IAccountService.cs 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.ServiceModel;
  6. using Aitex.Core.Util;
  7. namespace Aitex.Core.Account
  8. {
  9. /// <summary>
  10. /// This interface defines operation contracts for user account management.
  11. /// </summary>
  12. [ServiceContract]
  13. public interface IAccountService
  14. {
  15. /// <summary>
  16. /// User calls this method to login the server.
  17. /// </summary>
  18. /// <param name="accountId"></param>
  19. /// <param name="password"></param>
  20. [OperationContract]
  21. LoginResult Login(string accountId, string password);
  22. /// <summary>
  23. /// User calls this method to logout from the server.
  24. /// </summary>
  25. /// <param name="accountId"></param>
  26. [OperationContract]
  27. void Logout(string accountId);
  28. /// <summary>
  29. /// Administrator user calls this method to create a new account.
  30. /// </summary>
  31. /// <param name="newAccount"></param>
  32. /// <returns></returns>
  33. [OperationContract]
  34. CreateAccountResult CreateAccount(Account newAccount);
  35. /// <summary>
  36. /// Administrator user calls this method to delete an account.
  37. /// </summary>
  38. /// <param name="accountId"></param>
  39. /// <returns></returns>
  40. [OperationContract]
  41. DeleteAccountResult DeleteAccount(string accountId);
  42. /// <summary>
  43. /// get current login user's account data
  44. /// </summary>
  45. /// <returns></returns>
  46. //[OperationContract]
  47. //Account GetCurrentUser();
  48. /// <summary>
  49. /// get user data by accountId
  50. /// </summary>
  51. /// <param name="accountId"></param>
  52. /// <returns></returns>
  53. [OperationContract]
  54. GetAccountInfoResult GetAccountInfo(string accountId);
  55. /// <summary>
  56. /// update account
  57. /// </summary>
  58. /// <param name="account"></param>
  59. /// <returns></returns>6
  60. [OperationContract]
  61. UpdateAccountResult UpdateAccount(Account account);
  62. /// <summary>
  63. /// get account list
  64. /// </summary>
  65. /// <returns></returns>
  66. [OperationContract]
  67. GetAccountListResult GetAccountList();
  68. /// <summary>
  69. /// change account password
  70. /// </summary>
  71. /// <param name="accountId"></param>
  72. /// <param name="newPassword"></param>
  73. [OperationContract]
  74. ChangePwdResult ChangePassword(string accountId, string newPassword);
  75. /// <summary>
  76. /// 获取当前登录的用户
  77. /// </summary>
  78. /// <returns></returns>
  79. [OperationContract]
  80. List<Account> GetLoginUsers();
  81. /// <summary>
  82. /// 强制注销用户
  83. /// </summary>
  84. /// <param name="accountId"></param>
  85. /// <param name="reason"></param>
  86. [OperationContract]
  87. void KickUserOut(string accountId, string reason);
  88. /// <summary>
  89. /// get all roles' permission
  90. /// </summary>
  91. /// <param name="accountid"></param>
  92. /// <param name="clientip"></param>
  93. [OperationContract]
  94. SerializableDictionary<string, SerializableDictionary<string, ViewPermission>> GetAllRolesPermission();
  95. /// <summary>
  96. /// save all roles' permission
  97. /// </summary>
  98. /// <param name="accountid"></param>
  99. /// <param name="clientip"></param>
  100. [OperationContract]
  101. bool SaveAllRolesPermission(Dictionary<string, Dictionary<string, ViewPermission>> data);
  102. /// <summary>
  103. /// get all view list
  104. /// </summary>
  105. /// <param name="accountid"></param>
  106. /// <param name="clientip"></param>
  107. [OperationContract]
  108. SerializableDictionary<string, string> GetAllViewList();
  109. /// <summary>
  110. /// Get all roles
  111. /// </summary>
  112. /// <returns></returns>
  113. [OperationContract]
  114. IEnumerable<string> GetAllRoles();
  115. /// <summary>
  116. /// UI 界面定期发送CheckAlive事件,用于通知AccountManager当前用户仍旧Alive
  117. /// 如果连续超过10秒钟没有发送Alive信息,系统自动将该用户注销
  118. /// </summary>
  119. /// <returns></returns>
  120. //[OperationContract]
  121. void CheckAlive(string accountId);
  122. /*
  123. [OperationContract]
  124. void RequestAuthorization(string accountId, string ip);
  125. [OperationContract]
  126. void AbortAuthorization();
  127. [OperationContract]
  128. void GrantAuthorization(bool isGranted);
  129. [OperationContract]
  130. List<int> LoadInterestedEvents(string accountEmail);
  131. [OperationContract]
  132. void SaveInterestedEvents(string accountEmail, List<int> events);
  133. [OperationContract]
  134. int GetMaxInterestedEvents();
  135. [OperationContract]
  136. void SaveWarningEvents(List<int> warningEvents);
  137. [OperationContract]
  138. List<int> LoadWarningEvents();
  139. */
  140. [OperationContract]
  141. string GetProcessViewPermission();
  142. [OperationContract]
  143. bool SaveProcessViewPermission(string viewXML);
  144. }
  145. }