Community Server专题八:MemberRole之Membership深入篇

本文深入探讨了ASP.NET中的Membership机制,特别是SqlMembershipProvider类的实现细节。通过对关键代码的分析,揭示了如何创建用户、验证输入及与数据库交互的过程。
专题八的上篇大致讨论了MemberRole中的Membership实现,对于运用Membership进行web开发足够,但是对于想更深入了解Membership实现机理的朋友那是远远不够的,这个专题我们更深入一下了解Membership。
其实MemberRole是一个非常好的资源包,借住Reflector这个优秀的工具,你可以对其进行代码分析。它无论是在组建的构架、代码的设计、数据库表的建立、存储过程的使用等都是非常优秀的,你是程序员也好构架师也罢,其中可以学习的真的很多很多,我在整个分析的过程中也深深受益。
由于MemberRole中的Membership只实现了对SQL Server的操Provider类,即SqlMembershipProvider类。因此我们从SqlMembershipProvider开始分析。Provider模型在上篇已经做过介绍,SqlMembershipProvider类继承了MembershipProvider,并实现其所有的抽象方法。在分析之前先看两个类:MembershipUser与MembershipUserCollection。
MembershipUser,先看看代码:(代码中省略的具体实现,只有方法与属性名称)
Membership创建的User,该类中有这个User的一些基本状态,如该User的UserName、Email等,还有一些方法,如ChangePassword()、ResetPassword()等(如果你是初学者,还在为建立一个对象需要什么属性,包含什么方法发愁,那这就是你应该好好学的,这也是OOP最基本的要求)。
publicclassMembershipUser
{
//Methods
protectedMembershipUser();
publicMembershipUser(MembershipProviderprovider,stringname,objectproviderUserKey,stringemail,stringpasswordQuestion,stringcomment,boolisApproved,boolisLockedOut,DateTimecreationDate,DateTimelastLoginDate,DateTimelastActivityDate,DateTimelastPasswordChangedDate,DateTimelastLockoutDate);
publicvirtualboolChangePassword(stringoldPassword,stringnewPassword);
publicvirtualboolChangePasswordQuestionAndAnswer(stringpassword,stringnewPasswordQuestion,stringnewPasswordAnswer);
publicvirtualstringGetPassword();
publicvirtualstringGetPassword(stringpasswordAnswer);
publicvirtualstringResetPassword();
publicvirtualstringResetPassword(stringpasswordAnswer);
publicoverridestringToString();
publicvirtualboolUnlockUser();
internalvirtualvoidUpdate();
privatevoidUpdateSelf();
//Properties
publicvirtualstringComment{get;set;}
publicvirtualDateTimeCreationDate{get;}
publicvirtualstringEmail{get;set;}
publicvirtualboolIsApproved{get;set;}
publicvirtualboolIsLockedOut{get;}
publicboolIsOnline{get;}
publicvirtualDateTimeLastActivityDate{get;set;}
publicvirtualDateTimeLastLockoutDate{get;}
publicvirtualDateTimeLastLoginDate{get;set;}
publicvirtualDateTimeLastPasswordChangedDate{get;}
publicvirtualstringPasswordQuestion{get;}
publicvirtualMembershipProviderProvider{get;}
publicvirtualobjectProviderUserKey{get;}
publicvirtualstringUserName{get;}
//Fields
privatestring_Comment;
privateDateTime_CreationDate;
privatestring_Email;
privatebool_IsApproved;
privatebool_IsLockedOut;
privateDateTime_LastActivityDate;
privateDateTime_LastLockoutDate;
privateDateTime_LastLoginDate;
privateDateTime_LastPasswordChangedDate;
privatestring_PasswordQuestion;
privateMembershipProvider_Provider;
privateobject_ProviderUserKey;
privatestring_UserName;
}

这是一个实体类,表示一个由
MembershipUserCollection,这是一个MembershipUser类的容器,用来存放MembershipUser列表,记得上次广州.net俱乐部聚会时,我的演讲中有朋友在提出CS是否使用自定义类来存储用户列表,其实在这里可以看到CS中使用的就是自定义的类而不是DataSet(我想在asp.net 2.0正式发布后这也不会改变),这样做主要是因为考虑到性能与灵活性。
好了,回到SqlMembershipProvider类上来,我们具体分析一个有代表性质的方法:
MembershipUser对象,如果建立失败MembershipUser对象为null(其实我早期做过一些项目的时候喜欢在建立对象成功后返回一个ID)。可以看到在这个方法中有很多的if语句,它们是为了检验数据是否合法,这是必须的吗?其实不是,但对于构建一个强壮的底层代码这是必须的,不然一点点的错误都有可能导致系统的瘫痪。其实做项目与做开发有的时候不太一样,企业的有些项目开发很多时候只要能实现功能就可以了,而且开发过程也集中在一些现有的代码或者组建的基础上,个人的错误不会影响全局的运行,PM也不做过多要求。但如果是做产品,这个情况可能会有所改变,很多时候要求很严格,至少我是这样。在做完对输入参数的验证后,CreateUser建立与数据库的连接,这里是调用SqlConnectionHelper类下的GetConnection方法进行的,为了照顾初学者阅读,我这里这一下为什么需要把对数据库连接与操作写在SqlConnectionHelper类下,而不是直接采用SqlConnection提供的方法,其实这是一个设计模式的问题,Membership的实现需要很多的方法与数据库进行交换数据库,如果每次方法都调用一次SqlConnection的方法建立数据库连接,一来会造成大量的代码冗余,而且一旦数据库连接语句一旦改变,你就要去修改很多个方法,如果你把这个过程都包装在一个类下面,连接数据库就有统一的入口,一来容易维护,二来不会有太多的代码冗余,再者如果需要查找错误也非常容易。这里Membership采用的是存储过程,我们可以看到使用的是dbo.aspnet_Membership_CreateUser存储过程,好了,打开你的数据库,找到这个存储过程:
publicoverrideMembershipUserCreateUser(stringusername,stringpassword,stringemail,stringpasswordQuestion,stringpasswordAnswer,boolisApproved,objectproviderUserKey,outMembershipCreateStatusstatus)

{

stringtext3;

MembershipUseruser1;

if(!SecUtility.ValidateParameter(refpassword,true,true,false,0x80))

{

status
=MembershipCreateStatus.InvalidPassword;

returnnull;

}


stringtext1=base.GenerateSalt();

stringtext2=base.EncodePassword(password,(int)this._PasswordFormat,text1);

if(text2.Length>0x80)

{

status
=MembershipCreateStatus.InvalidPassword;

returnnull;

}


if(passwordAnswer!=null)

{

passwordAnswer
=passwordAnswer.Trim();

}


if((passwordAnswer!=null)&&(passwordAnswer.Length>0))

{

if(passwordAnswer.Length>0x80)

{

status
=MembershipCreateStatus.InvalidAnswer;

returnnull;

}


text3
=base.EncodePassword(passwordAnswer.ToLower(CultureInfo.InvariantCulture),(int)this._PasswordFormat,text1);

}


else

{

text3
=passwordAnswer;

}


if(!SecUtility.ValidateParameter(reftext3,this.RequiresQuestionAndAnswer,this.RequiresQuestionAndAnswer,false,0x80))

{

status
=MembershipCreateStatus.InvalidAnswer;

returnnull;

}


if(!SecUtility.ValidateParameter(refusername,true,true,true,0x100))

{

status
=MembershipCreateStatus.InvalidUserName;

returnnull;

}


if(!SecUtility.ValidateParameter(refemail,this.RequiresUniqueEmail,this.RequiresUniqueEmail,false,0x100))

{

status
=MembershipCreateStatus.InvalidEmail;

returnnull;

}


if(!SecUtility.ValidateParameter(refpasswordQuestion,this.RequiresQuestionAndAnswer,this.RequiresQuestionAndAnswer,false,0x100))

{

status
=MembershipCreateStatus.InvalidQuestion;

returnnull;

}


if((providerUserKey!=null)&&!(providerUserKeyisGuid))

{

status
=MembershipCreateStatus.InvalidProviderUserKey;

returnnull;

}


if(password.Length<this.MinRequiredPasswordLength)

{

status
=MembershipCreateStatus.InvalidPassword;

returnnull;

}


intnum1=0;

for(intnum2=0;num2<password.Length;num2++)

{

if(!char.IsLetterOrDigit(password,num2))

{

num1
++;

}


}


if(num1<this.MinRequiredNonAlphanumericCharacters)

{

status
=MembershipCreateStatus.InvalidPassword;

returnnull;

}


if((this.PasswordStrengthRegularExpression.Length>0)&&!Regex.IsMatch(password,this.PasswordStrengthRegularExpression))

# CRM项目控制器接口报告 ## 目录结构说明 本报告按照以下三个路径对控制器进行分类: 1. **/Controllers** - 主控制器目录(MVC控制器) 2. **/Areas/API/Controllers** - API控制器目录(Web API控制器) --- # 第一部分:/Controllers 目录下的控制器 ## 1. HomeController **路径**: `/Controllers/HomeController.cs` **命名空间**: `BEMS.Web.Controllers` **基类**: `Controller` ### 接口列表 #### 1. Login (GET) - **路径**: `/Home/Login` - **HTTP方法**: GET - **描述**: 显示登录页面 - **入参**: 无 - **返回值**: `ActionResult` (View) #### 2. LoginBlank (GET) - **路径**: `/Home/LoginBlank` - **HTTP方法**: GET - **描述**: 显示空白登录页面 - **入参**: 无 - **返回值**: `ActionResult` (View) #### 3. SSOLogin (GET) - **路径**: `/Home/SSOLogin` - **HTTP方法**: GET - **描述**: SSO登录重定向 - **入参**: 无 - **返回值**: `RedirectResult` #### 4. Login (POST) - **路径**: `/Home/Login` - **HTTP方法**: POST - **描述**: 处理用户登录 - **入参**: `LoginViewModel` ```csharp public class LoginViewModel { [Required] [Display(Name = "登录名")] public string LoginName { get; set; } [Required] [Display(Name = "密码")] public string Password { get; set; } } ``` - **返回值**: `ActionResult` (View或Redirect) #### 5. LoginBlank (POST) - **路径**: `/Home/LoginBlank` - **HTTP方法**: POST - **描述**: 处理空白登录页面登录 - **入参**: `LoginViewModel` (同上) - **返回值**: `ActionResult` (View或Redirect) #### 6. LogOut (POST) - **路径**: `/Home/LogOut` - **HTTP方法**: POST - **描述**: 退出登录 - **入参**: 无 - **返回值**: `ActionResult` (Redirect) --- ## 2. UserController **路径**: `/Controllers/Authorization/UserController.cs` **命名空间**: `BEMS.Web.Controllers.Authorization` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/User/Index` - **HTTP方法**: GET/POST - **描述**: 用户列表查询 - **入参**: `UserListViewModel` ```csharp public class UserListViewModel { public PageInfo PageInfo { get; set; } public IEnumerable<UserViewModel> UserViewModels { get; set; } public UserSearchParams SearchParams { get; set; } } public class UserSearchParams { public string Name { get; set; } } ``` - **返回值**: `ActionResult` (PartialView) #### 2. Create (GET) - **路径**: `/User/Create` - **HTTP方法**: GET - **描述**: 显示创建用户页面 - **入参**: 无 - **返回值**: `ActionResult` (PartialView) #### 3. Create (POST) - **路径**: `/User/Create` - **HTTP方法**: POST - **描述**: 创建新用户 - **入参**: `UserViewModel` ```csharp public class UserViewModel : ViewModelBase { [Required] [StringLength(50)] [Display(Name = "登录帐号")] public string UserName { get; set; } [StringLength(30, MinimumLength = 6)] [Display(Name = "登录密码")] public string Password { get; set; } [StringLength(20)] [Display(Name = "电话号码")] public string PhoneNo { get; set; } [Required] [Display(Name = "角色")] public List<string> RoleIds { get; set; } [Required] [Display(Name = "用户姓名")] public string TrueName { get; set; } public bool IsSystem { get; set; } public bool FromLoginCenter { get; set; } [Display(Name = "管理大区")] public List<string> Regions { get; set; } } ``` - **返回值**: `ActionResult` (Redirect) #### 4. Remove (GET) - **路径**: `/User/Remove` - **HTTP方法**: GET - **描述**: 删除用户 - **入参**: `string id` (用户ID) - **返回值**: `JsonResult<JsonBase<String>>` #### 5. Edit (GET) - **路径**: `/User/Edit` - **HTTP方法**: GET - **描述**: 显示编辑用户页面 - **入参**: `string id` (用户ID) - **返回值**: `ActionResult` (PartialView) #### 6. Edit (POST) - **路径**: `/User/Edit` - **HTTP方法**: POST - **描述**: 更新用户信息 - **入参**: `UserViewModel` (同上) - **返回值**: `ActionResult` (Redirect) #### 7. ChangePassword (GET) - **路径**: `/User/ChangePassword` - **HTTP方法**: GET - **描述**: 显示修改密码页面 - **入参**: 无 - **返回值**: `ActionResult` (View) #### 8. ChangePassword (POST) - **路径**: `/User/ChangePassword` - **HTTP方法**: POST - **描述**: 修改密码 - **入参**: `ChangePasswordViewModel` ```csharp public class ChangePasswordViewModel { [Required] [StringLength(30, MinimumLength = 6)] [Display(Name = "旧密码")] public string OldPassword { get; set; } [Required] [StringLength(30, MinimumLength = 6)] [Display(Name = "新的密码")] public string NewPassword { get; set; } [Required] [Compare("NewPassword")] [StringLength(30, MinimumLength = 6)] [Display(Name = "确认新密码")] public string ConfirmPassword { get; set; } } ``` - **返回值**: `JsonResult<JsonBase<String>>` #### 9. Welcome (GET) - **路径**: `/User/Welcome` - **HTTP方法**: GET - **描述**: 欢迎页面 - **入参**: 无 - **返回值**: `ActionResult` (View) #### 10. LogOut (GET) - **路径**: `/User/LogOut` - **HTTP方法**: GET - **描述**: 退出登录 - **入参**: 无 - **返回值**: `ActionResult` (Redirect) --- ## 3. RoleController **路径**: `/Controllers/Authorization/RoleController.cs` **命名空间**: `BEMS.Web.Controllers.Authorization` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/Role/Index` - **HTTP方法**: GET/POST - **描述**: 角色列表查询 - **入参**: `RoleListViewModel` ```csharp public class RoleListViewModel { public PageInfo PageInfo { get; set; } public IEnumerable<RoleViewModel> RoleViewModels { get; set; } public RoleSearchParams SearchParams { get; set; } } public class RoleSearchParams { public string Name { get; set; } } ``` - **返回值**: `ActionResult` (PartialView) #### 2. Create (GET) - **路径**: `/Role/Create` - **HTTP方法**: GET - **描述**: 显示创建角色页面 - **入参**: 无 - **返回值**: `ActionResult` (View) #### 3. Create (POST) - **路径**: `/Role/Create` - **HTTP方法**: POST - **描述**: 创建新角色 - **入参**: `RoleViewModel` ```csharp public class RoleViewModel : ViewModelBase { [Required] [StringLength(50)] [Display(Name = "角色名称")] public string RoleName { get; set; } [StringLength(500)] [Display(Name = "备注")] public string Comments { get; set; } [Display(Name = "角色类型")] public int RoleType { get; set; } public bool IsSystem { get; set; } } ``` - **返回值**: `ActionResult` (Redirect) #### 4. Remove (GET) - **路径**: `/Role/Remove` - **HTTP方法**: GET - **描述**: 删除角色 - **入参**: `string id` (角色ID) - **返回值**: `JsonResult<JsonBase<String>>` #### 5. Edit (GET) - **路径**: `/Role/Edit` - **HTTP方法**: GET - **描述**: 显示编辑角色页面 - **入参**: `string id` (角色ID) - **返回值**: `ActionResult` (PartialView) #### 6. Edit (POST) - **路径**: `/Role/Edit` - **HTTP方法**: POST - **描述**: 更新角色信息 - **入参**: `RoleViewModel` (同上) - **返回值**: `JsonResult<JsonBase<String>>` #### 7. Authority (GET) - **路径**: `/Role/Authority` - **HTTP方法**: GET - **描述**: 角色授权页面 - **入参**: `string roleId` (角色ID) - **返回值**: `ActionResult` (View) #### 8. Update (POST) - **路径**: `/Role/Update` - **HTTP方法**: POST - **描述**: 更新角色权限 - **入参**: `AuthorityEntityModel` ```csharp public class AuthorityEntityModel { public string Actions { get; set; } public string SiteMaps { get; set; } public string Category { set; get; } public string TargetId { set; get; } } ``` - **返回值**: `ActionResult` (Redirect) --- ## 4. APPDataController **路径**: `/Controllers/Base/APPDataController.cs` **命名空间**: `BEMS.Controllers` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/APPData/Index` - **HTTP方法**: GET/POST - **描述**: APP数据列表查询 - **入参**: `APPDataListViewModel` ```csharp public class APPDataListViewModel { public PageInfo PageInfo { get; set; } public IEnumerable<APPDataViewModel> ViewModels { get; set; } public APPDataSearchParams SearchParams { get; set; } } public class APPDataSearchParams { public string Name { get; set; } } ``` - **返回值**: `ActionResult` (PartialView) #### 2. Create (GET) - **路径**: `/APPData/Create` - **HTTP方法**: GET - **描述**: 显示创建APP数据页面 - **入参**: 无 - **返回值**: `ActionResult` (PartialView) #### 3. Create (POST) - **路径**: `/APPData/Create` - **HTTP方法**: POST - **描述**: 创建APP数据 - **入参**: `APPDataViewModel` ```csharp public class APPDataViewModel : ViewModelBase { [Required] [StringLength(100)] [Display(Name = "模块名称")] public string APP_Name { get; set; } [Required] [StringLength(50)] [Display(Name = "模块代码")] public string APP_Code { get; set; } [StringLength(300)] [Display(Name = "模块描述")] public string APP_Desc { get; set; } } ``` - **返回值**: `ActionResult` (Redirect) #### 4. Remove (GET) - **路径**: `/APPData/Remove` - **HTTP方法**: GET - **描述**: 删除APP数据 - **入参**: `string id` (APP数据ID) - **返回值**: `JsonResult<JsonBase<String>>` #### 5. Edit (GET) - **路径**: `/APPData/Edit` - **HTTP方法**: GET - **描述**: 显示编辑APP数据页面 - **入参**: `string id` (APP数据ID) - **返回值**: `ActionResult` (PartialView) #### 6. Edit (POST) - **路径**: `/APPData/Edit` - **HTTP方法**: POST - **描述**: 更新APP数据 - **入参**: `APPDataViewModel` (同上) - **返回值**: `JsonResult<JsonBase<String>>` --- ## 5. MemberRoleController **路径**: `/Controllers/Base/MemberRoleController.cs` **命名空间**: `BEMS.Controllers` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/MemberRole/Index` - **HTTP方法**: GET/POST - **描述**: 会员角色列表查询 - **入参**: `MemberRoleListViewModel` - **返回值**: `ActionResult` (PartialView) #### 2. Create (GET) - **路径**: `/MemberRole/Create` - **HTTP方法**: GET - **描述**: 显示创建会员角色页面 - **入参**: 无 - **返回值**: `ActionResult` (View) #### 3. Create (POST) - **路径**: `/MemberRole/Create` - **HTTP方法**: POST - **描述**: 创建会员角色 - **入参**: `MemberRoleViewModel` - **返回值**: `ActionResult` (Redirect) #### 4. Remove (GET) - **路径**: `/MemberRole/Remove` - **HTTP方法**: GET - **描述**: 删除会员角色 - **入参**: `string id` (角色ID) - **返回值**: `JsonResult<JsonBase<String>>` #### 5. Edit (GET) - **路径**: `/MemberRole/Edit` - **HTTP方法**: GET - **描述**: 显示编辑会员角色页面 - **入参**: `string id` (角色ID) - **返回值**: `ActionResult` (PartialView) #### 6. Edit (POST) - **路径**: `/MemberRole/Edit` - **HTTP方法**: POST - **描述**: 更新会员角色 - **入参**: `MemberRoleViewModel` - **返回值**: `JsonResult<JsonBase<String>>` #### 7. MemberRoleAuthority (GET) - **路径**: `/MemberRole/MemberRoleAuthority` - **HTTP方法**: GET - **描述**: 会员角色授权页面 - **入参**: `string memberRoleId` (会员角色ID) - **返回值**: `ActionResult` (View) #### 8. UpdateMemberRoleAuthority (POST) - **路径**: `/MemberRole/UpdateMemberRoleAuthority` - **HTTP方法**: POST - **描述**: 更新会员角色权限 - **入参**: `MemberAppAuthorityUpdateEntityModel` - **返回值**: `ActionResult` (Redirect) --- ## 6. MemberUserController **路径**: `/Controllers/Base/MemberUserController.cs` **命名空间**: `BEMS.Controllers` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/MemberUser/Index` - **HTTP方法**: GET/POST - **描述**: 会员用户列表查询 - **入参**: `MemberUserListViewModel` ```csharp public class MemberUserListViewModel { public PageInfo PageInfo { get; set; } public IEnumerable<MemberUserViewModel> ViewModels { get; set; } public MemberUserSearchParams SearchParams { get; set; } } public class MemberUserSearchParams { public string Name { get; set; } } ``` - **返回值**: `ActionResult` (PartialView) #### 2. Create (GET) - **路径**: `/MemberUser/Create` - **HTTP方法**: GET - **描述**: 显示创建会员用户页面 - **入参**: 无 - **返回值**: `ActionResult` (PartialView) #### 3. Create (POST) - **路径**: `/MemberUser/Create` - **HTTP方法**: POST - **描述**: 创建会员用户 - **入参**: `MemberUserViewModel` ```csharp public class MemberUserViewModel : ViewModelBase { [Required] [StringLength(50)] [Display(Name = "用户名")] public string UserName { get; set; } [Required] [StringLength(50)] [Display(Name = "姓名")] public string TrueName { get; set; } [Required] [StringLength(50, MinimumLength = 6)] [Display(Name = "密码")] public string Password { get; set; } [StringLength(20)] [Display(Name = "电话号码")] public string PhoneNo { get; set; } [StringLength(200)] [Display(Name = "Email")] public string Email { get; set; } [StringLength(40)] [Display(Name = "域账号")] public string SSOAccount { get; set; } [StringLength(200)] [Display(Name = "微信Id")] public string WXOpenId { get; set; } [StringLength(200)] [Display(Name = "微信Id")] public string WXUnionId { get; set; } [Display(Name = "UUID")] public string UUID { get; set; } [Display(Name = "角色")] public List<string> RoleIds { get; set; } public bool IsSSOAutoCreate { get; set; } [Display(Name = "国家地区")] public List<string> CompanyCodeList { get; set; } public string CompanyCodeListDesc { get; set; } } ``` - **返回值**: `ActionResult` (Redirect) #### 4. Remove (GET) - **路径**: `/MemberUser/Remove` - **HTTP方法**: GET - **描述**: 删除会员用户 - **入参**: `string id` (用户ID) - **返回值**: `JsonResult<JsonBase<String>>` #### 5. Edit (GET) - **路径**: `/MemberUser/Edit` - **HTTP方法**: GET - **描述**: 显示编辑会员用户页面 - **入参**: `string id` (用户ID) - **返回值**: `ActionResult` (PartialView) #### 6. Edit (POST) - **路径**: `/MemberUser/Edit` - **HTTP方法**: POST - **描述**: 更新会员用户信息 - **入参**: `MemberUserViewModel` (同上) - **返回值**: `ActionResult` (Redirect) --- ## 7. MemberUserLoginLogController **路径**: `/Controllers/Base/MemberUserLoginLogController.cs` **命名空间**: `BEMS.Controllers` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/MemberUserLoginLog/Index` - **HTTP方法**: GET/POST - **描述**: 会员用户登录日志列表查询 - **入参**: `MemberUserLoginLogListViewModel` - **返回值**: `ActionResult` (PartialView) --- ## 8. PersonController **路径**: `/Controllers/Demo/PersonController.cs` **命名空间**: `BEMS.Controllers` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/Person/Index` - **HTTP方法**: GET/POST - **描述**: 人员列表查询 - **入参**: `PersonListViewModel` ```csharp public class PersonListViewModel { public PageInfo PageInfo { get; set; } public IEnumerable<PersonViewModel> ViewModels { get; set; } public PersonSearchParams SearchParams { get; set; } } public class PersonSearchParams { public string Name { get; set; } } ``` - **返回值**: `ActionResult` (PartialView) #### 2. Create (GET) - **路径**: `/Person/Create` - **HTTP方法**: GET - **描述**: 显示创建人员页面 - **入参**: 无 - **返回值**: `ActionResult` (View) #### 3. Create (POST) - **路径**: `/Person/Create` - **HTTP方法**: POST - **描述**: 创建人员 - **入参**: `PersonViewModel` ```csharp public class PersonViewModel : ViewModelBase { [Required] [StringLength(50)] [Display(Name = "姓名")] public string UserName { get; set; } [Required] [Display(Name = "性别")] public int Sex { get; set; } [Required] [Display(Name = "身高")] public int Height { get; set; } [Required] [Display(Name = "体重")] public decimal Weight { get; set; } } ``` - **返回值**: `ActionResult` (Redirect) #### 4. Remove (GET) - **路径**: `/Person/Remove` - **HTTP方法**: GET - **描述**: 删除人员 - **入参**: `string id` (人员ID) - **返回值**: `JsonResult<JsonBase<String>>` #### 5. Edit (GET) - **路径**: `/Person/Edit` - **HTTP方法**: GET - **描述**: 显示编辑人员页面 - **入参**: `string id` (人员ID) - **返回值**: `ActionResult` (PartialView) #### 6. Edit (POST) - **路径**: `/Person/Edit` - **HTTP方法**: POST - **描述**: 更新人员信息 - **入参**: `PersonViewModel` (同上) - **返回值**: `ActionResult` (Redirect) --- ## 9. ImplantMainInfoController **路径**: `/Controllers/Implant/ImplantMainInfoController.cs` **命名空间**: `BEMS.Controllers` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/ImplantMainInfo/Index` - **HTTP方法**: GET/POST - **描述**: 植入主信息列表查询 - **入参**: `ImplantMainInfoListViewModel` - **返回值**: `ActionResult` (PartialView) #### 2. Remove (GET) - **路径**: `/ImplantMainInfo/Remove` - **HTTP方法**: GET - **描述**: 删除植入主信息 - **入参**: `string id` (主信息ID) - **返回值**: `JsonResult<JsonBase<String>>` #### 3. SetPrintStatus (GET) - **路径**: `/ImplantMainInfo/SetPrintStatus` - **HTTP方法**: GET - **描述**: 设置打印状态 - **入参**: - `string id` (主信息ID) - `string status` (状态) - `string from` (来源,默认"Index") - **返回值**: `JsonResult<JsonBase<String>>` #### 4. SetPrintStatus2 (GET) - **路径**: `/ImplantMainInfo/SetPrintStatus2` - **HTTP方法**: GET - **描述**: 批量设置打印状态 - **入参**: - `string ids` (主信息ID列表,逗号分隔) - `string status` (状态) - `string from` (来源,默认"Index") - **返回值**: `JsonResult<JsonBase<String>>` #### 5. DoCheck (POST) - **路径**: `/ImplantMainInfo/DoCheck` - **HTTP方法**: POST - **描述**: 审核植入信息 - **入参**: `DoCheckModel` ```csharp public class DoCheckModel { public string id { get; set; } public string status { get; set; } public string from { get; set; } public string adminRemarks { get; set; } } ``` - **返回值**: `JsonResult<JsonBase<String>>` #### 6. ViewDetails (GET) - **路径**: `/ImplantMainInfo/ViewDetails` - **HTTP方法**: GET - **描述**: 查看植入详情 - **入参**: `string id` (主信息ID) - **返回值**: `ActionResult` (PartialView) #### 7. Edit (GET) - **路径**: `/ImplantMainInfo/Edit` - **HTTP方法**: GET - **描述**: 显示编辑植入信息页面 - **入参**: `string id` (主信息ID) - **返回值**: `ActionResult` (PartialView) #### 8. PrintWarrentyCard (GET) - **路径**: `/ImplantMainInfo/PrintWarrentyCard` - **HTTP方法**: GET - **描述**: 打印保修卡 - **入参**: `string id` (主信息ID) - **返回值**: `ActionResult` (PartialView) #### 9. PrintWarrentyCard2 (GET) - **路径**: `/ImplantMainInfo/PrintWarrentyCard2` - **HTTP方法**: GET - **描述**: 批量打印保修卡 - **入参**: `string ids` (主信息ID列表) - **返回值**: `ActionResult` (PartialView) #### 10. PrintWarrentyCardQRCode (GET) - **路径**: `/ImplantMainInfo/PrintWarrentyCardQRCode` - **HTTP方法**: GET - **描述**: 打印带二维码的保修卡 - **入参**: `string id` (主信息ID) - **返回值**: `ActionResult` (PartialView) #### 11. PrintWarrentyCard2QRCode (GET) - **路径**: `/ImplantMainInfo/PrintWarrentyCard2QRCode` - **HTTP方法**: GET - **描述**: 批量打印带二维码的保修卡 - **入参**: `string ids` (主信息ID列表) - **返回值**: `ActionResult` (PartialView) #### 12. UpdateCardInfo (POST) - **路径**: `/ImplantMainInfo/UpdateCardInfo` - **HTTP方法**: POST - **描述**: 更新卡片信息 - **入参**: `ImplantMainInfoViewModel` - **返回值**: `JsonResult<JsonBase<String>>` #### 13. DeleteAttachment (GET) - **路径**: `/ImplantMainInfo/DeleteAttachment` - **HTTP方法**: GET - **描述**: 删除附件 - **入参**: - `string mainInfoId` (主信息ID) - `string attachmentId` (附件ID) - **返回值**: `JsonResult<JsonBase<String>>` #### 14. DelPacemakersDetails (GET) - **路径**: `/ImplantMainInfo/DelPacemakersDetails` - **HTTP方法**: GET - **描述**: 删除起搏器详情 - **入参**: - `string id` (详情ID) - `string mainInfoId` (主信息ID) - **返回值**: `JsonResult<JsonBase<string>>` #### 15. UploadAttachment (POST) - **路径**: `/ImplantMainInfo/UploadAttachment` - **HTTP方法**: POST - **描述**: 上传附件 - **入参**: 文件上传 (FormData) - **返回值**: `JsonResult<JsonBase<String>>` #### 16. Export (GET) - **路径**: `/ImplantMainInfo/Export` - **HTTP方法**: GET - **描述**: 导出数据 - **入参**: - `string RecordStatus` - `string WarrantyCardStatus` - `string CreatedTimeSpan` - `string ImplantDateTimeSpan` - `string Name` - `string PrintStatus` - `string Province` - `string Type` - `string RegistrationStatus` - `string SubModel` - `string SubSerial` - `string FollowUp` - **返回值**: `FileResult` (Excel文件) #### 17. GetModelInfo (GET) - **路径**: `/ImplantMainInfo/GetModelInfo` - **HTTP方法**: GET - **描述**: 获取型号信息 - **入参**: `string modelNo` (型号编号) - **返回值**: `JsonResult` (包含SelectMode和WarrantyYear) #### 18. SavePacemakersDetails (GET) - **路径**: `/ImplantMainInfo/SavePacemakersDetails` - **HTTP方法**: GET - **描述**: 保存起搏器详情 - **入参**: `PacemakersDetailsViewModel` - **返回值**: `JsonResult` #### 19. CheckMainSerialNumber (GET) - **路径**: `/ImplantMainInfo/CheckMainSerialNumber` - **HTTP方法**: GET - **描述**: 检查主序列号 - **入参**: - `string mainInfoId` (主信息ID) - `string modelNo` (型号) - `string serialNumber` (序列号) - **返回值**: `JsonResult` #### 20. AdminSave (GET) - **路径**: `/ImplantMainInfo/AdminSave` - **HTTP方法**: GET - **描述**: 管理员保存数据 - **入参**: `ImplantMainInfoViewModel` - **返回值**: `JsonResult` --- ## 10. ModelInfoController **路径**: `/Controllers/Implant/ModelInfoController.cs` **命名空间**: `BEMS.Controllers` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/ModelInfo/Index` - **HTTP方法**: GET/POST - **描述**: 型号信息列表查询 - **入参**: `ModelInfoListViewModel` - **返回值**: `ActionResult` (PartialView) #### 2. Create (GET) - **路径**: `/ModelInfo/Create` - **HTTP方法**: GET - **描述**: 显示创建型号信息页面 - **入参**: 无 - **返回值**: `ActionResult` (PartialView) #### 3. Create (POST) - **路径**: `/ModelInfo/Create` - **HTTP方法**: POST - **描述**: 创建型号信息 - **入参**: `ModelInfoViewModel` - **返回值**: `ActionResult` (Redirect) #### 4. Remove (GET) - **路径**: `/ModelInfo/Remove` - **HTTP方法**: GET - **描述**: 删除型号信息 - **入参**: `string id` (型号信息ID) - **返回值**: `JsonResult<JsonBase<String>>` #### 5. Edit (GET) - **路径**: `/ModelInfo/Edit` - **HTTP方法**: GET - **描述**: 显示编辑型号信息页面 - **入参**: `string id` (型号信息ID) - **返回值**: `ActionResult` (PartialView) #### 6. Edit (POST) - **路径**: `/ModelInfo/Edit` - **HTTP方法**: POST - **描述**: 更新型号信息 - **入参**: `ModelInfoViewModel` - **返回值**: `JsonResult<JsonBase<String>>` #### 7. MaterialList (GET) - **路径**: `/ModelInfo/MaterialList` - **HTTP方法**: GET - **描述**: 获取物料列表 - **入参**: `string KeyWord` (关键词) - **返回值**: `JsonResult` (物料列表) --- ## 11. PowerController **路径**: `/Controllers/Implant/PowerController.cs` **命名空间**: `BEMS.Controllers` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/Power/Index` - **HTTP方法**: GET/POST - **描述**: 电源主信息列表查询 - **入参**: `PowerMainListViewModel` - **返回值**: `ActionResult` (PartialView) #### 2. ViewDetail (GET) - **路径**: `/Power/ViewDetail` - **HTTP方法**: GET - **描述**: 查看电源详情 - **入参**: `string id` (主信息ID) - **返回值**: `ActionResult` (PartialView) #### 3. Remove (GET) - **路径**: `/Power/Remove` - **HTTP方法**: GET - **描述**: 删除电源信息 - **入参**: `string id` (主信息ID) - **返回值**: `JsonResult<JsonBase<String>>` #### 4. Export (GET) - **路径**: `/Power/Export` - **HTTP方法**: GET - **描述**: 导出电源数据 - **入参**: `PowerMainSearchParams` - **返回值**: `FileResult` (Excel文件) --- ## 12. SICDImplantController **路径**: `/Controllers/Implant/SICDImplantController.cs` **命名空间**: `BEMS.Controllers` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/SICDImplant/Index` - **HTTP方法**: GET/POST - **描述**: SICD植入信息列表查询 - **入参**: `SICDImplantMainInfoListViewModel` - **返回值**: `ActionResult` (PartialView) #### 2. ViewDetail (GET) - **路径**: `/SICDImplant/ViewDetail` - **HTTP方法**: GET - **描述**: 查看SICD植入详情 - **入参**: `string id` (主信息ID) - **返回值**: `ActionResult` (PartialView) #### 3. Remove (GET) - **路径**: `/SICDImplant/Remove` - **HTTP方法**: GET - **描述**: 删除SICD植入信息 - **入参**: `string id` (主信息ID) - **返回值**: `JsonResult<JsonBase<String>>` #### 4. SetPrintStatus (GET) - **路径**: `/SICDImplant/SetPrintStatus` - **HTTP方法**: GET - **描述**: 设置打印状态 - **入参**: - `string id` (主信息ID) - `string status` (状态) - `string from` (来源,默认"Index") - **返回值**: `JsonResult<JsonBase<String>>` #### 5. SetPrintStatus2 (GET) - **路径**: `/SICDImplant/SetPrintStatus2` - **HTTP方法**: GET - **描述**: 批量设置打印状态 - **入参**: - `string ids` (主信息ID列表) - `string status` (状态) - `string from` (来源,默认"Index") - **返回值**: `JsonResult<JsonBase<String>>` #### 6. DoCheck (POST) - **路径**: `/SICDImplant/DoCheck` - **HTTP方法**: POST - **描述**: 审核SICD植入信息 - **入参**: `DoCheckModel` (同上) - **返回值**: `JsonResult<JsonBase<String>>` #### 7. PrintWarrentyCard (GET) - **路径**: `/SICDImplant/PrintWarrentyCard` - **HTTP方法**: GET - **描述**: 打印保修卡 - **入参**: `string id` (主信息ID) - **返回值**: `ActionResult` (PartialView) #### 8. PrintWarrentyCard2 (GET) - **路径**: `/SICDImplant/PrintWarrentyCard2` - **HTTP方法**: GET - **描述**: 批量打印保修卡 - **入参**: `string ids` (主信息ID列表) - **返回值**: `ActionResult` (PartialView) #### 9. PrintWarrentyCardQRCode (GET) - **路径**: `/SICDImplant/PrintWarrentyCardQRCode` - **HTTP方法**: GET - **描述**: 打印带二维码的保修卡 - **入参**: `string id` (主信息ID) - **返回值**: `ActionResult` (PartialView) #### 10. PrintWarrentyCard2QRCode (GET) - **路径**: `/SICDImplant/PrintWarrentyCard2QRCode` - **HTTP方法**: GET - **描述**: 批量打印带二维码的保修卡 - **入参**: `string ids` (主信息ID列表) - **返回值**: `ActionResult` (PartialView) #### 11. Export (GET) - **路径**: `/SICDImplant/Export` - **HTTP方法**: GET - **描述**: 导出SICD数据 - **入参**: - `string RecordStatus` - `string WarrantyCardStatus` - `string CreatedTimeSpan` - `string ImplantDateTimeSpan` - `string Name` - `string PrintStatus` - `string Provincec` - `string Province` - `string RegistrationStatus` - `string SubModel` - `string SubSerial` - `string FollowUp` - **返回值**: `FileResult` (Excel文件) --- ## 13. SiteMapController **路径**: `/Controllers/Sys/SiteMapController.cs` **命名空间**: `BEMS.Controllers` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/SiteMap/Index` - **HTTP方法**: GET/POST - **描述**: 站点地图列表查询 - **入参**: `SiteMapListViewModel` - **返回值**: `ActionResult` (PartialView) #### 2. Create (GET) - **路径**: `/SiteMap/Create` - **HTTP方法**: GET - **描述**: 显示创建站点地图页面 - **入参**: 无 - **返回值**: `ActionResult` (View) #### 3. Create (POST) - **路径**: `/SiteMap/Create` - **HTTP方法**: POST - **描述**: 创建站点地图 - **入参**: `SiteMapViewModel` - **返回值**: `ActionResult` (Redirect) #### 4. Remove (GET) - **路径**: `/SiteMap/Remove` - **HTTP方法**: GET - **描述**: 删除站点地图 - **入参**: `string id` (站点地图ID) - **返回值**: `JsonResult<JsonBase<String>>` #### 5. Edit (GET) - **路径**: `/SiteMap/Edit` - **HTTP方法**: GET - **描述**: 显示编辑站点地图页面 - **入参**: `string id` (站点地图ID) - **返回值**: `ActionResult` (PartialView) #### 6. Edit (POST) - **路径**: `/SiteMap/Edit` - **HTTP方法**: POST - **描述**: 更新站点地图 - **入参**: `SiteMapViewModel` - **返回值**: `JsonResult<JsonBase<String>>` --- ## 14. UserLoginLogController **路径**: `/Controllers/Sys/UserLoginLogController.cs` **命名空间**: `BEMS.Controllers` **基类**: `BaseController` ### 接口列表 #### 1. Index (GET/POST) - **路径**: `/UserLoginLog/Index` - **HTTP方法**: GET/POST - **描述**: 用户登录日志列表查询 - **入参**: `UserLoginLogListViewModel` - **返回值**: `ActionResult` (PartialView) --- ## 15. LoginController **路径**: `/Controllers/WebApp/LoginController.cs` **命名空间**: `BEMS.Web.Controllers.WebApp` **基类**: `WebAppController` ### 接口列表 #### 1. Index (GET) - **路径**: `/Login/Index` - **HTTP方法**: GET - **描述**: 显示登录页面 - **入参**: 无 - **返回值**: `ActionResult` (View) #### 2. ChangeLan (POST) - **路径**: `/Login/ChangeLan` - **HTTP方法**: POST - **描述**: 更改语言 - **入参**: `string lan` (语言代码) - **返回值**: `JsonResult` --- ## 16. BEUserLoginController **路径**: `/Controllers/WebApp/BEUserLoginController.cs` **命名空间**: `BEMS.Web.Controllers.WebApp` **基类**: `WebAppController` ### 接口列表 #### 1. Login (GET) - **路径**: `/BEUserLogin/Login` - **HTTP方法**: GET - **描述**: 显示BE用户登录页面 - **入参**: 无 - **返回值**: `ActionResult` (View) #### 2. Login (POST) - **路径**: `/BEUserLogin/Login` - **HTTP方法**: POST - **描述**: 处理BE用户登录 - **入参**: `MemberLoginViewModel` ```csharp public class MemberLoginViewModel { [Required] [Display(Name = "登录名")] public string LoginName { get; set; } [Required] [Display(Name = "密码")] public string Password { get; set; } } ``` - **返回值**: `ActionResult` (View或Redirect) #### 3. LogOut (GET) - **路径**: `/BEUserLogin/LogOut` - **HTTP方法**: GET - **描述**: BE用户退出登录 - **入参**: 无 - **返回值**: `ActionResult` (Redirect) --- ## 17. ErrorController **路径**: `/Controllers/ErrorController.cs` **命名空间**: `BEMS.Web.Controllers` **基类**: `Controller` ### 接口列表 #### 1. Error_500 (GET) - **路径**: `/Error/Error_500` - **HTTP方法**: GET - **描述**: 显示500错误页面 - **入参**: 无 - **返回值**: `ActionResult` (PartialView) --- ## 18. WebAppController **路径**: `/Controllers/WebAppController.cs` **命名空间**: `BEMS.Web.Controllers` **基类**: `Controller` ### 接口列表 #### 1. SetLanguage (GET) - **路径**: `/WebApp/SetLanguage` - **HTTP方法**: GET - **描述**: 设置语言 - **入参**: `string language` (语言代码) - **返回值**: `ActionResult` (Redirect) --- # 第二部分:/Areas/API/Controllers 目录下的控制器 ## 1. PatientController **路径**: `/Areas/API/Controllers/PatientController.cs` **命名空间**: `BEMS.Web.Areas.API.Controllers` **基类**: `ApiController` **路由前缀**: `api/Patient` ### 接口列表 #### 1. ParamVerification (POST) - **路径**: `/api/Patient/ParamVerification` - **HTTP方法**: POST - **描述**: 参数验证 - **入参**: `Object bodyParam` (加密的JSON字符串) - **返回值**: `ResModel` ```csharp public class ResModel { public int code { get; set; } public string message { get; set; } public object data { get; set; } } ``` #### 2. ImplantInfo (POST) - **路径**: `/api/Patient/ImplantInfo` - **HTTP方法**: POST - **描述**: 获取患者植入信息 - **入参**: `string bodyParam` (加密的JSON字符串,包含patientName) - **返回值**: `ResModel` (包含患者植入信息列表) ```csharp public class PatientImplantInfo { public string PatientName { get; set; } public string PatientSex { get; set; } public string ModelNo { get; set; } public string SerialNumber { get; set; } public string SelectMode { get; set; } public DateTime? ImplantDate { get; set; } public string WarrantyYear { get; set; } public string HospitalName { get; set; } public string HospitalAddress { get; set; } public string DoctorName { get; set; } public string HospitalTel { get; set; } public string Type { get; set; } public string RecordStatus { get; set; } public List<PacemakersDetail> PacemakersDetail { get; set; } } ``` #### 3. SyncRegistrationInfo (POST) - **路径**: `/api/Patient/SyncRegistrationInfo` - **HTTP方法**: POST - **描述**: 同步注册信息(患者手机号和身份证号) - **入参**: `string bodyParam` (加密的JSON字符串,包含modelNo, serialNumber, patientPhone, patientIdCard) - **返回值**: `ResModel` --- ## 2. ImplantInfoController **路径**: `/Areas/API/Controllers/WebApp/ImplantInfoController.cs` **命名空间**: `BEMS.Web.Areas.API.Controllers` **基类**: `MemberApiController` **路由前缀**: `api/ImplantInfo` ### 接口列表 #### 1. GetHospitalList (GET) - **路径**: `/api/ImplantInfo/HospitalList` - **HTTP方法**: GET - **描述**: 获取医院列表 - **入参**: `string KeyWord` (关键词,可选) - **返回值**: `ResModel` (包含医院列表) ```csharp // 返回数据格式 { code: 200, message: "", data: [ { Text: "医院名称", Value: "医院代码", Tel: "" } ] } ``` #### 2. GetDoctorsList (GET) - **路径**: `/api/ImplantInfo/DoctorsList` - **HTTP方法**: GET - **描述**: 获取医生列表 - **入参**: - `string HospitalCode` (医院代码) - `string KeyWord` (关键词,可选) - **返回值**: `ResModel` (包含医生列表) #### 3. SetDoctorInfo (POST) - **路径**: `/api/ImplantInfo/Doctor` - **HTTP方法**: POST - **描述**: 设置医生信息 - **入参**: `dynamic data` ```csharp { HospitalCode: string, HospitalName: string, HCPName: string, HCPTel: string } ``` - **返回值**: `ResModel` #### 4. GetFollowUpUserList (GET) - **路径**: `/api/ImplantInfo/FollowUpUserList` - **HTTP方法**: GET - **描述**: 获取跟台人列表 - **入参**: `string KeyWord` (关键词,可选) - **返回值**: `ResModel` (包含跟台人列表) #### 5. GetSubBUList (GET) - **路径**: `/api/ImplantInfo/SubBUList` - **HTTP方法**: GET - **描述**: 获取类别列表(SubBU) - **入参**: 无 - **返回值**: `ResModel` (包含类别列表) #### 6. MaterialList (GET) - **路径**: `/api/ImplantInfo/MaterialList` - **HTTP方法**: GET - **描述**: 获取型号列表 - **入参**: - `string KeyWord` (关键词) - `string productLine` (产品线,默认"CRM") - **返回值**: `ResModel` (包含型号列表) #### 7. GetProviderList (GET) - **路径**: `/api/ImplantInfo/ProviderList` - **HTTP方法**: GET - **描述**: 获取制造商列表(植入电极导管信息) - **入参**: 无 - **返回值**: `ResModel` (包含制造商列表) #### 8. GetImplantPositionList (GET) - **路径**: `/api/ImplantInfo/ImplantPositionList` - **HTTP方法**: GET - **描述**: 获取植入位置列表 - **入参**: 无 - **返回值**: `ResModel` (包含植入位置列表) #### 9. GetMyImplantsList (GET) - **路径**: `/api/ImplantInfo/MyImplantsList` - **HTTP方法**: GET - **描述**: 我的植入单列表 - **入参**: - `string keyWords` (关键词) - `string recordStatus` (记录状态) - `string printStatus` (打印状态) - `string registrationStatus` (注册状态) - `int pageIndex` (页码,默认1) - `int pageSize` (每页大小,默认10) - **返回值**: `ResModel` (包含植入单列表和总数) #### 10. GetImplantsById (GET) - **路径**: `/api/ImplantInfo/ImplantsById` - **HTTP方法**: GET - **描述**: 获取植入单详情 - **入参**: `string Id` (植入单ID) - **返回值**: `ResModel` (包含植入单详情) #### 11. DeleteImplantsById (GET) - **路径**: `/api/ImplantInfo/DeleteMyImplant` - **HTTP方法**: GET - **描述**: 删除植入单 - **入参**: `string Id` (植入单ID) - **返回值**: `ResModel` #### 12. CancelImplantsById (GET) - **路径**: `/api/ImplantInfo/CancelMyImplant` - **HTTP方法**: GET - **描述**: 撤销植入单 - **入参**: - `string Id` (植入单ID) - `int VersionNumber` (版本号) - **返回值**: `ResModel` #### 13. SaveDraft (POST) - **路径**: `/api/ImplantInfo/SaveDraft` - **HTTP方法**: POST - **描述**: 保存草稿 - **入参**: `ImplantMainInfoModel` ```csharp public class ImplantMainInfoModel { public string Id { get; set; } public DateTime? ImplantDate { get; set; } public string HospitalCode { get; set; } public string HospitalName { get; set; } public string HospitalTel { get; set; } public string DoctorCode { get; set; } public string DoctorName { get; set; } public string DoctorTel { get; set; } public string FollowUpByEID { get; set; } public string FollowUpByName { get; set; } public string PatientNameCN { get; set; } public string PatientNameEN { get; set; } public string PatientPhoneNotCrypto { get; set; } public string PatientIdCardNotCrypto { get; set; } public string PatientSex { get; set; } public string ModelNo { get; set; } public string SerialNumber { get; set; } public string RecordStatus { get; set; } public List<PacemakersDetailsModel> PacemakersDetailsList { get; set; } public List<ScreenShotsModel> Attachments { get; set; } // ... 更多字段 } ``` - **返回值**: `ResModel` #### 14. Submit (POST) - **路径**: `/api/ImplantInfo/Submit` - **HTTP方法**: POST - **描述**: 提交植入单 - **入参**: `ImplantMainInfoModel` (同上) - **返回值**: `ResModel` #### 15. UploadAttachment (POST) - **路径**: `/api/ImplantInfo/UploadAttachment` - **HTTP方法**: POST - **描述**: 上传附件 - **入参**: 文件上传 (FormData) - **返回值**: `ResModel` (包含文件信息) ```csharp { FileId: string, PreSignedUrl: string, ThumbUrl: string, OriginalUrl: string, FileName: string, OriginFileName: string } ``` #### 16. UsualnessHospitalList (GET) - **路径**: `/api/ImplantInfo/UsualnessHospitalList` - **HTTP方法**: GET - **描述**: 获取常用医院列表 - **入参**: 无 - **返回值**: `ResModel` (包含常用医院列表,最多10条) --- ## 3. MemberUserController **路径**: `/Areas/API/Controllers/WebApp/MemberUserController.cs` **命名空间**: `BEMS.Web.Areas.API.Controllers` **基类**: `MemberApiController` ### 接口列表 #### 1. Login (GET) - **路径**: `/api/MemberUser/Login` - **HTTP方法**: GET - **描述**: 用户登录 - **入参**: - `string username` (用户名) - `string password` (密码,MD5加密) - `string sign` (签名) - `int tspan` (时间戳) - **返回值**: `ResModel` (包含用户信息和Token) ```csharp { Id: string, UserName: string, TrueName: string, Token: string, PhoneNo: string, Email: string, IsEmailBind: bool, SSOAccount: string, MFlowToken: string, AuthorizedAppModule: List<string> } ``` #### 2. BindingEmailPassword (POST) - **路径**: `/api/MemberUser/BindingEmailPassword` - **HTTP方法**: POST - **描述**: 绑定邮箱密码 - **入参**: `BindingEmailPasswordReq` ```csharp public class BindingEmailPasswordReq { public string pwdhash { get; set; } } ``` - **返回值**: `ResModel` #### 3. CheckEmailPwd (POST) - **路径**: `/api/MemberUser/CheckEmailPwd` - **HTTP方法**: POST - **描述**: 检查邮箱密码 - **入参**: `string hash` (密码哈希) - **返回值**: `ResModel` --- ## 4. PowerController **路径**: `/Areas/API/Controllers/WebApp/PowerController.cs` **命名空间**: `BEMS.Web.Areas.API.Controllers` **基类**: `MemberApiController` **路由前缀**: `api/Power` ### 接口列表 #### 1. SearchImplant (GET) - **路径**: `/api/Power/SearchImplant` - **HTTP方法**: GET - **描述**: 搜索植入单 - **入参**: - `string keyWords` (关键词,可选) - `int pageIndex` (页码,默认1) - `int pageSize` (每页大小,默认10) - **返回值**: `ResModel` (包含植入单列表和总数) #### 2. PacemakersDetails (GET) - **路径**: `/api/Power/PacemakersDetails` - **HTTP方法**: GET - **描述**: 获取起搏器详情(最多3条) - **入参**: `string id` (植入单ID) - **返回值**: `ResModel` (包含起搏器详情列表) #### 3. GetList (GET) - **路径**: `/api/Power/GetList` - **HTTP方法**: GET - **描述**: 获取设备电池列表 - **入参**: - `string keyword` (关键词,可选) - `int pageIndex` (页码,默认1) - `int pageSize` (每页大小,默认10) - **返回值**: `ResModel` (包含设备电池列表和总数) #### 4. GetDetail (GET) - **路径**: `/api/Power/GetDetail` - **HTTP方法**: GET - **描述**: 获取设备电池详情 - **入参**: `string id` (设备电池ID) - **返回值**: `ResModel` (包含主信息、详情和附件) #### 5. Submit (POST) - **路径**: `/api/Power/Submit` - **HTTP方法**: POST - **描述**: 提交设备电池信息 - **入参**: `SubmitModel` - **返回值**: `ResModel` #### 6. UploadAttachment (POST) - **路径**: `/api/Power/UploadAttachment` - **HTTP方法**: POST - **描述**: 上传附件 - **入参**: 文件上传 (FormData) - **返回值**: `ResModel` (包含文件信息) --- ## 5. SICDImplantInfoController **路径**: `/Areas/API/Controllers/WebApp/SICDImplantInfoController.cs` **命名空间**: `BEMS.Web.Areas.API.Controllers` **基类**: `MemberApiController` **路由前缀**: `api/SICDImplant` ### 接口列表 #### 1. GetMyImplantsList (GET) - **路径**: `/api/SICDImplant/MyImplantsSCID` - **HTTP方法**: GET - **描述**: 我的S-ICD植入单列表 - **入参**: - `string ipttype` (植入类型) - `string recordStatus` (记录状态) - `string registrationStatus` (注册状态) - `string subModel` (子型号) - `string subSerial` (子序列号) - `string keyWords` (关键词) - `int pageIndex` (页码,默认1) - `int pageSize` (每页大小,默认10) - **返回值**: `ResModel` (包含植入单列表和总数) #### 2. GetImplantsById (GET) - **路径**: `/api/SICDImplant/ImplantsById` - **HTTP方法**: GET - **描述**: 获取S-ICD植入单详情 - **入参**: `string Id` (植入单ID) - **返回值**: `ResModel` (包含植入单详情) #### 3. DeleteImplantsById (GET) - **路径**: `/api/SICDImplant/DeleteMyImplant` - **HTTP方法**: GET - **描述**: 删除S-ICD植入单 - **入参**: `string Id` (植入单ID) - **返回值**: `ResModel` #### 4. CancelImplantsById (GET) - **路径**: `/api/SICDImplant/CancelMyImplant` - **HTTP方法**: GET - **描述**: 撤销S-ICD植入单 - **入参**: - `string Id` (植入单ID) - `int VersionNumber` (版本号) - **返回值**: `ResModel` #### 5. SaveDraft (POST) - **路径**: `/api/SICDImplant/SaveDraft` - **HTTP方法**: POST - **描述**: 保存筛选单草稿 - **入参**: `SICDImplantMainInfoModel` ```csharp public class SICDImplantMainInfoModel { public string Id { get; set; } public string PatientName { get; set; } public string PatientEnName { get; set; } public string PatientPhoneNotCrypto { get; set; } public string PatientIdCardNotCrypto { get; set; } public string PatientGender { get; set; } public int? PatientHeight { get; set; } public int? PatientWeight { get; set; } public decimal? BMI { get; set; } public string NYHA { get; set; } public string Indication { get; set; } public string Prd_Model { get; set; } public string Prd_SN { get; set; } public DateTime? ImplantDate { get; set; } public string HospitalCode { get; set; } public string HospitalName { get; set; } public string DoctorCode { get; set; } public string DoctorName { get; set; } public string RecordStatus { get; set; } public List<SICDImplant_Detail_ModelSub> ModelList { get; set; } public List<SICDImplant_Attachment_ModelSub> Attachments { get; set; } // ... 更多字段 } ``` - **返回值**: `ResModel` #### 6. Submit (POST) - **路径**: `/api/SICDImplant/Submit` - **HTTP方法**: POST - **描述**: 提交筛选单 - **入参**: `SICDImplantMainInfoModel` (同上) - **返回值**: `ResModel` #### 7. SaveImplateDraft (POST) - **路径**: `/api/SICDImplant/ImplateDraft` - **HTTP方法**: POST - **描述**: 保存植入单草稿 - **入参**: `SICDImplantMainInfoModel` (同上) - **返回值**: `ResModel` #### 8. SaveImplateSubmit (POST) - **路径**: `/api/SICDImplant/ImplateSubmit` - **HTTP方法**: POST - **描述**: 提交植入单 - **入参**: `SICDImplantMainInfoModel` (同上) - **返回值**: `ResModel` #### 9. AdminSubmit (POST) - **路径**: `/api/SICDImplant/AdminSubmit` - **HTTP方法**: POST - **描述**: 管理员修改筛选单 - **入参**: `SICDImplantMainInfoModel` (同上) - **返回值**: `ResModel` #### 10. SaveAdminImplateSubmit (POST) - **路径**: `/api/SICDImplant/AdminImplateSubmit` - **HTTP方法**: POST - **描述**: 管理员修改植入单 - **入参**: `SICDImplantMainInfoModel` (同上) - **返回值**: `ResModel` --- ## 6. WxCommonController **路径**: `/Areas/API/Controllers/WebApp/WxCommonController.cs` **命名空间**: `BEMS.Web.Areas.API.Controllers` **基类**: `ApiController` **路由前缀**: `api/WxCommon` ### 接口列表 #### 1. GetWXAuthorizationToken (GET) - **路径**: `/api/WxCommon/WXAuthorizationToken` - **HTTP方法**: GET - **描述**: 获取微信授权Token - **入参**: - `string code` (微信授权码) - `string account` (账号,可选,用于模拟登录) - **返回值**: `ResModel` (包含Token和用户信息) ```csharp { Token: string, Avatar: string, TrueName: string } ``` #### 2. GetWXConfig (GET) - **路径**: `/api/WxCommon/WXConfig` - **HTTP方法**: GET - **描述**: 获取微信配置信息 - **入参**: `string shareurl` (分享URL) - **返回值**: `ResModel` (包含微信JS-SDK配置信息) -
12-05
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值