Community Server专题八:MemberRole之Membership

本文详细解析了MemberRole组件中的Membership部分,介绍了其配置及工作原理,并探讨了MembershipProvider的抽象类设计及其在多数据库环境下的应用。
Community Server专题八:MemberRole之Membership
 
MemberRole是一个在asp.net 1.1下实现用户管理、角色管理、用户特性信息存储(profile)等的一个组件,该组件被ASP.NET 2.0 Beta 2所采用,也就是ASP.NET 2.0 Beta 2中所说的Membership and Roles。如果你在asp.net 1.1下采用了MemberRole,那么你的web程序将会很容易的过渡到asp.net 2.0,另外多个采取MemberRole进行用户管理的web程序需要整合时也非常容易。我将分4个专题来分析MemberRole,探索一下MemberRole到底是如何工作的,无论对CS的构架还是对了解asp.net 2.0都是非常有帮助的。
CS中,运用该组件的4个部分:membership、roleManager、profile、anonymousIdentification的运用(整个MemberRole也这四部分功能)。
在分析前,准备需要一个工具:Reflector.exe,没有的朋友google一下,下载它。
本次专题分析membership,先看一下CS中Membership的配置文件(Web.Config中):

:这是一个数值,用来计算在线用户的数量,例如:15,就表示如果用户在15分钟后不活动(发出Http请求)CS系统将视该用户不在线。

<membership userIsOnlineTimeWindow="15" >

              
<providers>

                   
<add 

                       
name="CommunityServerSqlProvider"              

                       type
="Openlab.AutoRegister.CSAutoBlogGalleryMembershipProvider, Openlab.CSAddOns"

                       connectionStringName
="SiteSqlServer"

                       enablePasswordRetrieval
="false"

                       enablePasswordReset
="true"

                       requiresQuestionAndAnswer
="false"

                       requiresUniqueEmail
="true"

                       passwordFormat
="Hashed"

                       applicationName
="dev"

                       description
="Stores and retrieves membership data from the local Microsoft SQL Server database"

                       autoCreateBlog
="false"

                       defaultBlogGroupID
="3"

                       autoCreateGallery
="false"

                       defaultGalleryGroupID
="2"

                       maxInvalidPasswordAttempts 
= "999"

                       passwordAttemptWindow 
= "999"

                       minRequiredPasswordLength 
= "4"

                       minRequiredNonalphanumericCharacters 
= "0"

                   
/>

              
</providers>

</membership>
userIsOnlineTimeWindow
Name:名称
type:类的名字空间与所在的程序集合
connectionStringName:数据库连接字符串节点的key。通过这个key就可以找到连接数据库的用户名与密码
enablePasswordRetrieval:是否打开取回秘密功能
enablePasswordReset:是否打开秘密重新设功能
requiresQuestionAndAnswer:注册时是否需要填写Question与Answer
requiresUniqueEmail:注册时是否Email唯一
passwordFormat:密码的加密格式
applicationName:使用该membership应用程序的名称
description:描述信息
 
以下4个参数是CCS中添加的,目的是给注册用户自动开通相册和博客
autoCreateBlog:是否当用户注册时自动为该用户建立一个Blog
defaultBlogGroupID:默认的建立blog的分组ID
autoCreateGallery:是否当用户注册时自动为该用户建立一个相册
defaultGalleryGroupID:默认的建立相册的分组ID
 
用Reflector.exe打开MemberRole.dll,你可以看到以下的内容:
再打开Microsoft.ScalableHosting.Configuration节点
这次我们只关注两个类MembershipConfig、MembershipConfigHandler。MembershipConfigHandler实现了IConfigurationSectionHandler接口。也就是说,CS启动后如果调用ConfigurationSettings.GetConfig("memberrolesprototype/membership"),系统将会自动的调用MembershipConfigHandler中的Create方法把web.config中memberrolesprototype/membership的配置内容读入进行处理。先看以下Create做了些什么:
public virtual object Create(object parent, object configContextObj, XmlNode section)
{
      MembershipConfig config1 
= new MembershipConfig(parent as MembershipConfig);
      
int num1 = -1;
      ConfigUtils.GetAndRemovePositiveIntegerAttribute(section, 
"userIsOnlineTimeWindow"ref num1);
      
if (num1 > 0)
      
{
            config1.UserIsOnlineTimeWindow 
= num1;
      }

      
string text1 = null;
      ConfigUtils.GetAndRemoveStringAttribute(section, 
"hashAlgorithm"ref text1);
      
if ((text1 != null&& (text1.Length > 0))
      
{
            config1.HashAlgorithmType 
= text1;
      }

      ConfigUtils.CheckForUnrecognizedAttributes(section);
      MembershipProvider provider1 
= null;
      
foreach (XmlNode node1 in section.ChildNodes)
      
{
            
if (node1.NodeType != XmlNodeType.Element)
            
{
                  
continue;
            }

            
if (node1.Name != "providers")
            
{
                  
throw new ConfigurationException("Unrecognized tag: " + node1.Name, node1);
            }

            
foreach (XmlNode node2 in node1.ChildNodes)
            
{
                  
if (node2.NodeType == XmlNodeType.Element)
                  
{
                        
if (node2.Name != "add")
                        
{
                              
throw new ConfigurationException("Unrecognized tag: " + node2.Name, node2);
                        }

                        
if (provider1 != null)
                        
{
                              
throw new ConfigurationException("Only one provider can be configured", node2);
                        }

                        
string text2 = null;
                        
string text3 = null;
                        ConfigUtils.GetAndRemoveRequiredNonEmptyStringAttribute(node2, 
"name"ref text2);
                        ConfigUtils.GetAndRemoveRequiredNonEmptyStringAttribute(node2, 
"type"ref text3);
                        NameValueCollection collection1 
= new NameValueCollection();
                        
foreach (XmlAttribute attribute1 in node2.Attributes)
                        
{
                              
if ((attribute1.Name != null&& (attribute1.Name.Length > 0))
                              
{
                                    collection1.Add(attribute1.Name, attribute1.Value);
                              }

                        }

                        provider1 
= (MembershipProvider) Activator.CreateInstance(Type.GetType(text3, true));
                        provider1.Initialize(text2, collection1);
                        config1.Provider 
= provider1;
                  }

            }

      }

      
return config1;
}


 
代码有点长,其实这里就是把web.config下面membership节点的配置信息读入,进行初始化,然后通过GetType与Activator.CreateInstance方法反射后实例化一个MembershipProvider。
MembershipProvider又是什么,继续看看:
MembershipProvider是实现继承了ProviderBase的一个类,其实ProviderBase并没有什么,看看代码
public abstract class MembershipProvider : ProviderBase
{
      
// Events
      public event MembershipValidatePasswordEventHandler ValidatingPassword;
 
      
// Methods
      protected MembershipProvider();
      
public abstract bool ChangePassword(string username, string oldPassword, string newPassword);
      
public abstract bool ChangePasswordQuestionAndAnswer(string username, string password, string newPasswordQuestion, string newPasswordAnswer);
      
public abstract MembershipUser CreateUser(string username, string password, string email, string passwordQuestion, string passwordAnswer, bool isApproved, object providerUserKey, out MembershipCreateStatus status);
      
protected virtual byte[] DecryptPassword(byte[] encodedPassword);
      
public abstract bool DeleteUser(string username, bool deleteAllRelatedData);
      
internal string EncodePassword(string pass, int passwordFormat, string salt);
      
protected virtual byte[] EncryptPassword(byte[] password);
      
public abstract MembershipUserCollection FindUsersByEmail(string emailToMatch, int pageIndex, int pageSize, out int totalRecords);
      
public abstract MembershipUserCollection FindUsersByName(string usernameToMatch, int pageIndex, int pageSize, out int totalRecords);
      
internal string GenerateSalt();
      
public abstract MembershipUserCollection GetAllUsers(int pageIndex, int pageSize, out int totalRecords);
      
public abstract int GetNumberOfUsersOnline();
      
public abstract string GetPassword(string username, string answer);
      
public abstract MembershipUser GetUser(object providerUserKey, bool userIsOnline);
      
public abstract MembershipUser GetUser(string username, bool userIsOnline);
      
public abstract string GetUserNameByEmail(string email);
      
protected virtual void OnValidatingPassword(ValidatePasswordEventArgs e);
      
public abstract string ResetPassword(string username, string answer);
      
internal string UnEncodePassword(string pass, int passwordFormat);
      
public abstract bool UnlockUser(string userName);
      
public abstract void UpdateUser(MembershipUser user);
      
public abstract bool ValidateUser(string username, string password);
 
      
// Properties
      public abstract string ApplicationName getset; }
      
public abstract bool EnablePasswordReset get; }
      
public abstract bool EnablePasswordRetrieval get; }
      
public abstract int MaxInvalidPasswordAttempts get; }
      
public abstract int MinRequiredNonAlphanumericCharacters get; }
      
public abstract int MinRequiredPasswordLength get; }
      
public abstract int PasswordAttemptWindow get; }
      
public abstract MembershipPasswordFormat PasswordFormat get; }
      
public abstract string PasswordStrengthRegularExpression get; }
      
public abstract bool RequiresQuestionAndAnswer get; }
      
public abstract bool RequiresUniqueEmail get; }
 
      
// Fields
      private MembershipValidatePasswordEventHandler _EventHandler;
      
private const int SALT_SIZE_IN_BYTES = 0x10;
}

原来
仅仅只是保护了两个虚属性的类,设置这个类只是一种设计模式,没有特别的用途。我们把重点集中到MembershipProvider上,MembershipProvider类是Provider构架的一种体现形式,Provider构架常常用到对数据库的访问上,实现多数据库,同时也可以很好的隔离数据层与业务层的代码有利于协作开发。具体实现是这样的,先把要操作数据库的方法抽象出来,单独的放入一个abstract类,例如:MembershipProvider,然后通过继承,把这些抽象的方法全部的实现出来,例如:SqlMembershipProvider。这样有什么好处呢?对于三层构架的web应用程序来说,中间的业务逻辑层调用操作数据库的方法是从MembershipProvider,对于该层来说它并不关心该抽象层是如何被继承后实现抽象方法的。它只关心抽象层中是否有它想要的方法。如果能理解到这里,嘿嘿,我们的机会就来了,因为这隔离了具体的数据库操作实现,更进一步说就是隔离了使用何种数据库。再从团队协作考虑,假设你的MembershipProvider定义的完善后,继承MembershipProvider实现SQL Server操作的SqlMembershipProvider类中的方法无论怎么改变,都不会影响其它人员在业务逻辑层的开发。听起来这种方式好像很美,但是要实现这样的功能还需要一个关键的技术,那就是反射,所以我们看到在配置的字段里有这样的字节:。
public abstract class ProviderBase
{
      
// Methods
      protected ProviderBase();
      
public virtual void Initialize(string name, NameValueCollection config);
 
      
// Properties
      public virtual string Description get; }
      
public virtual string Name get; }
 
      
// Fields
      private string _Description;
      
private bool _Initialized;
      
private string _name;
}


ProviderBase
type="Openlab.AutoRegister.CSAutoBlogGalleryMembershipProvider, Openlab.CSAddOns"
这就是为了通过反射找到MembershipProvider具体方法实现的类而做的准备。
注:由于分析的代码来源于宝玉的CCS,在CCS中为了实现注册后能自动开通博客与相册又继承了SqlMembershipProvider类,重写了几个方法(关键是其中的InitializeCreateUser方法)
只要你继承MembershipProvider类,对其中的抽象方法进行实现,无论你是实现对Access的操作,还是其它数据库,都是没有问题的。在asp.net 2.0 beta2中的Membership已经提供access与sql server两种数据库操作实现。不过MemberRole.dll程序集中只实现了SqlMembershipProvider,也就是对SQL Server的操作。
Membership是一个没有表示层的运用组件,它包含了逻辑层与数据操作层,数据层我在这个专题中就不多做解释,他的实现是在SqlMembershipProvider类中,你可以通过Reflector.exe慢慢研究。上面的文字说过,实现Provider模式后业务逻辑层对数据层具体实现就不关心了,在MemberRole.dll中的Membership,它把所有的这些逻辑用一个类包装起来,那就是Membership类:
对于引用MemberRole.dll实现Membership功能的web app(DNN,CS就是典型)来说,只要做合适的配置之后就可以直接使用了。
例如,要建立一个用户只要调用Membership.CreateUser的静态方法,就可以完成(Membership会根据内部的方法和具体的数据库操作,把用户信息写入数据库)。
对于使用Membership来开发web app的程序员来说,完全可以不必要了解这些细节,asp 2.0 beta2就没有提供这样的机会,MS只要求你会用就可以了,不过很庆幸的是CS给我们提供了这样的一个机会,了解这些操作的实质(包括URL Rewrite等功能也是一样,这些功能都可以在asp 2.0 beta2中直接使用,而不要构架如何代码)。
这个专题只是大致的讲解了Membership,下一个专题,我们将更深入的去看看Membership的数据层的操作实现以及数据库表的设计(包括存储过程)。
 

Trackback: http://tb.blog.youkuaiyun.com/TrackBack.aspx?PostId=1538975


 
# 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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值