Browse Source

feat(wechat): Optimize the Enterprise wechat module

- 新增通讯录应用集成模块,通讯录相关接口事件移动到通讯录模块
- 新增办公应用集成模块,办公应用相关接口事件移动到办公模块
- 新增部分单元测试模块
pull/1393/head
colin 2 months ago
parent
commit
ebfa510c78
  1. 32
      aspnet-core/LINGYUN.MicroService.WechatManagement.sln
  2. 3
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN.Abp.WeChat.SettingManagement.csproj
  3. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/AbpWeChatSettingManagementModule.cs
  4. 13
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingAppService.cs
  5. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN.Abp.WeChat.Work.Common.csproj
  6. 24
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/AbpWeChatWorkCommonModule.cs
  7. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalAttribute.cs
  8. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalAttributeDeserializeFactory.cs
  9. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalAttributeType.cs
  10. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalMiniProgramAttribute.cs
  11. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalProfile.cs
  12. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalTextAttribute.cs
  13. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalWebAttribute.cs
  14. 25
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/Gender.cs
  15. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/MemberExtendAttribute.cs
  16. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/WechatChannel.cs
  17. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/WechatChannelStatus.cs
  18. 62
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/EnumToNumberStringConverter.cs
  19. 7
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/ExternalProfileNewtonsoftJsonConverter.cs
  20. 31
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/IntToBoolConverter.cs
  21. 45
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/System/Text/Json/Serialization/EnumToNumberStringConverter.cs
  22. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/System/Text/Json/Serialization/ExternalProfileSystemTextJsonConverter.cs
  23. 26
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/System/Text/Json/Serialization/IntToBoolJsonConverter.cs
  24. 3
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/FodyWeavers.xml
  25. 30
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/FodyWeavers.xsd
  26. 27
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN.Abp.WeChat.Work.Contacts.csproj
  27. 45
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/AbpWeChatWorkContactModule.cs
  28. 87
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/IWeChatWorkDepartmentProvider.cs
  29. 25
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/Department.cs
  30. 39
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/DepartmentInfo.cs
  31. 32
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/SubDepartment.cs
  32. 68
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Request/WeChatWorkCreateDepartmentRequest.cs
  33. 25
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Request/WeChatWorkDeleteDepartmentRequest.cs
  34. 25
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Request/WeChatWorkGetDepartmentListRequest.cs
  35. 25
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Request/WeChatWorkGetDepartmentRequest.cs
  36. 25
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Request/WeChatWorkGetSubDepartmentListRequest.cs
  37. 60
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Request/WeChatWorkUpdateDepartmentRequest.cs
  38. 21
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkCreateDepartmentResponse.cs
  39. 22
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetDepartmentListResponse.cs
  40. 22
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetDepartmentResponse.cs
  41. 22
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetSubDepartmentListResponse.cs
  42. 108
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/WeChatWorkDepartmentProvider.cs
  43. 31
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Features/WeChatWorkContactsFeatureDefinitionProvider.cs
  44. 14
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Features/WeChatWorkContactsFeatureNames.cs
  45. 9
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Localization/Resources/en.json
  46. 9
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Localization/Resources/zh-Hans.json
  47. 199
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/IWeChatWorkMemberProvider.cs
  48. 20
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/AttributeType.cs
  49. 39
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/DepartmentMember.cs
  50. 25
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/DepartmentUser.cs
  51. 20
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/EmailType.cs
  52. 25
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberAttribute.cs
  53. 33
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberAttributeDeserializeFactory.cs
  54. 18
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberExternalAttribute.cs
  55. 173
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberInfo.cs
  56. 30
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberStatus.cs
  57. 29
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberTextAttribute.cs
  58. 36
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberWebAttribute.cs
  59. 30
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/QrCodeSizeType.cs
  60. 39
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkBulkDeleteMemberRequest.cs
  61. 63
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkBulkInviteMemberRequest.cs
  62. 26
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkConvertToOpenIdRequest.cs
  63. 27
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkConvertToUserIdRequest.cs
  64. 230
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkCreateMemberRequest.cs
  65. 35
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkGetUserIdByEmailRequest.cs
  66. 26
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkGetUserIdByMobileRequest.cs
  67. 42
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkGetUserIdListRequest.cs
  68. 236
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkUpdateMemberRequest.cs
  69. 35
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkBulkInviteMemberResponse.cs
  70. 21
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkConvertToOpenIdResponse.cs
  71. 21
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkConvertToUserIdResponse.cs
  72. 22
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkCreateMemberResponse.cs
  73. 21
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetJoinQrCodeResponse.cs
  74. 22
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetMemberListResponse.cs
  75. 170
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetMemberResponse.cs
  76. 22
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetSimpleMemberListResponse.cs
  77. 29
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetUserIdListResponse.cs
  78. 18
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetUserIdResponse.cs
  79. 209
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/WeChatWorkMemberProvider.cs
  80. 24
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/BatchJobResultEvent.cs
  81. 3
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/CreateDepartmentEvent.cs
  82. 3
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/CreateUserEvent.cs
  83. 3
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DeleteDepartmentEvent.cs
  84. 3
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DeleteUserEvent.cs
  85. 5
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DepartmentUpdateEvent.cs
  86. 3
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UpdateDepartmentEvent.cs
  87. 3
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UpdateUserEvent.cs
  88. 6
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UserChangeEvent.cs
  89. 3
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UserTagChangeEvent.cs
  90. 30
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Settings/WeChatWorkContactSettingDefinitionProvider.cs
  91. 12
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Settings/WeChatWorkContactSettingNames.cs
  92. 20
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/IWeChatWorkTagProvider.cs
  93. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Models/TagInfo.cs
  94. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Models/TagUserInfo.cs
  95. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Request/WeChatWorkGetTagRequest.cs
  96. 4
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Request/WeChatWorkTagChangeMemberRequest.cs
  97. 4
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Request/WeChatWorkTagCreateRequest.cs
  98. 4
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Request/WeChatWorkTagUpdateRequest.cs
  99. 5
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagChangeMemberResponse.cs
  100. 2
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagCreateResponse.cs

32
aspnet-core/LINGYUN.MicroService.WechatManagement.sln

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
# Visual Studio Version 18
VisualStudioVersion = 18.0.11205.157 d18.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "framework", "framework", "{BD5616DF-D493-4170-8E78-46486BE77FC2}"
EndProject
@ -127,6 +127,14 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WeChat.Work.Ext
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WeChat.Work.Handlers", "framework\wechat\LINGYUN.Abp.WeChat.Work.Handlers\LINGYUN.Abp.WeChat.Work.Handlers.csproj", "{E0DFCAD9-8AFE-A816-10F7-B4CA6691E910}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WeChat.Work.Contacts", "framework\wechat\LINGYUN.Abp.WeChat.Work.Contacts\LINGYUN.Abp.WeChat.Work.Contacts.csproj", "{69419D6B-9DA5-D9BD-1D6C-61BBAE331057}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WeChat.Work.Contacts.Tests", "tests\LINGYUN.Abp.WeChat.Work.Contacts.Tests\LINGYUN.Abp.WeChat.Work.Contacts.Tests.csproj", "{C3BEBB5D-EF3A-4387-8357-0C3829756E41}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WeChat.Work.OA", "framework\wechat\LINGYUN.Abp.WeChat.Work.OA\LINGYUN.Abp.WeChat.Work.OA.csproj", "{BA80572F-49BD-41E3-89D8-AE5BF15B00F9}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.WeChat.Work.OA.Tests", "tests\LINGYUN.Abp.WeChat.Work.OA.Tests\LINGYUN.Abp.WeChat.Work.OA.Tests.csproj", "{0209DBBA-CF63-4538-AB8D-452E9A591336}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -325,6 +333,22 @@ Global
{E0DFCAD9-8AFE-A816-10F7-B4CA6691E910}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E0DFCAD9-8AFE-A816-10F7-B4CA6691E910}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E0DFCAD9-8AFE-A816-10F7-B4CA6691E910}.Release|Any CPU.Build.0 = Release|Any CPU
{69419D6B-9DA5-D9BD-1D6C-61BBAE331057}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{69419D6B-9DA5-D9BD-1D6C-61BBAE331057}.Debug|Any CPU.Build.0 = Debug|Any CPU
{69419D6B-9DA5-D9BD-1D6C-61BBAE331057}.Release|Any CPU.ActiveCfg = Release|Any CPU
{69419D6B-9DA5-D9BD-1D6C-61BBAE331057}.Release|Any CPU.Build.0 = Release|Any CPU
{C3BEBB5D-EF3A-4387-8357-0C3829756E41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C3BEBB5D-EF3A-4387-8357-0C3829756E41}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C3BEBB5D-EF3A-4387-8357-0C3829756E41}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C3BEBB5D-EF3A-4387-8357-0C3829756E41}.Release|Any CPU.Build.0 = Release|Any CPU
{BA80572F-49BD-41E3-89D8-AE5BF15B00F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA80572F-49BD-41E3-89D8-AE5BF15B00F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA80572F-49BD-41E3-89D8-AE5BF15B00F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA80572F-49BD-41E3-89D8-AE5BF15B00F9}.Release|Any CPU.Build.0 = Release|Any CPU
{0209DBBA-CF63-4538-AB8D-452E9A591336}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0209DBBA-CF63-4538-AB8D-452E9A591336}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0209DBBA-CF63-4538-AB8D-452E9A591336}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0209DBBA-CF63-4538-AB8D-452E9A591336}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -388,6 +412,10 @@ Global
{9DC2A982-8FA2-93BE-5FE1-3D7F7C105C39} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{6628FB84-66C0-4023-9AA0-AAC4C0CC5917} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{E0DFCAD9-8AFE-A816-10F7-B4CA6691E910} = {EDBB7BC1-46F0-4803-A572-7F8FEF433BE2}
{69419D6B-9DA5-D9BD-1D6C-61BBAE331057} = {EDBB7BC1-46F0-4803-A572-7F8FEF433BE2}
{C3BEBB5D-EF3A-4387-8357-0C3829756E41} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{BA80572F-49BD-41E3-89D8-AE5BF15B00F9} = {EDBB7BC1-46F0-4803-A572-7F8FEF433BE2}
{0209DBBA-CF63-4538-AB8D-452E9A591336} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EC9D01C1-EA3C-48C7-A279-4D35C8AD312E}

3
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN.Abp.WeChat.SettingManagement.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
@ -30,6 +30,7 @@
<ProjectReference Include="..\..\settings\LINGYUN.Abp.SettingManagement.Application.Contracts\LINGYUN.Abp.SettingManagement.Application.Contracts.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.WeChat.MiniProgram\LINGYUN.Abp.WeChat.MiniProgram.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.WeChat.Official\LINGYUN.Abp.WeChat.Official.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.WeChat.Work.Contacts\LINGYUN.Abp.WeChat.Work.Contacts.csproj" />
<ProjectReference Include="..\LINGYUN.Abp.WeChat.Work\LINGYUN.Abp.WeChat.Work.csproj" />
</ItemGroup>

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/AbpWeChatSettingManagementModule.cs

@ -2,6 +2,7 @@
using LINGYUN.Abp.WeChat.MiniProgram;
using LINGYUN.Abp.WeChat.Official;
using LINGYUN.Abp.WeChat.Work;
using LINGYUN.Abp.WeChat.Work.Contacts;
using LINGYUN.Abp.WeChat.Work.Localization;
using Localization.Resources.AbpUi;
using Microsoft.Extensions.DependencyInjection;
@ -16,6 +17,7 @@ namespace LINGYUN.Abp.WeChat.SettingManagement;
typeof(AbpWeChatOfficialModule),
typeof(AbpWeChatMiniProgramModule),
typeof(AbpWeChatWorkModule),
typeof(AbpWeChatWorkContactModule),
typeof(AbpAspNetCoreMvcModule))]
public class AbpWeChatSettingManagementModule : AbpModule
{

13
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.SettingManagement/LINGYUN/Abp/WeChat/SettingManagement/WeChatSettingAppService.cs

@ -5,6 +5,8 @@ using LINGYUN.Abp.WeChat.MiniProgram.Settings;
using LINGYUN.Abp.WeChat.Official.Features;
using LINGYUN.Abp.WeChat.Official.Settings;
using LINGYUN.Abp.WeChat.Settings;
using LINGYUN.Abp.WeChat.Work.Contacts.Features;
using LINGYUN.Abp.WeChat.Work.Contacts.Settings;
using LINGYUN.Abp.WeChat.Work.Features;
using LINGYUN.Abp.WeChat.Work.Settings;
using System.Threading.Tasks;
@ -173,6 +175,17 @@ public class WeChatSettingAppService : ApplicationService, IWeChatSettingAppServ
await SettingManager.GetOrNullAsync(WeChatWorkSettingNames.Connection.Secret, providerName, providerKey),
ValueType.String,
providerName);
if (await FeatureChecker.IsEnabledAsync(WeChatWorkContactsFeatureNames.Enable))
{
workConnectionSetting.AddDetail(
await SettingDefinitionManager.GetAsync(WeChatWorkContactSettingNames.Secret),
StringLocalizerFactory,
await SettingManager.GetOrNullAsync(WeChatWorkContactSettingNames.Secret, providerName, providerKey),
ValueType.String,
providerName);
}
workConnectionSetting.AddDetail(
await SettingDefinitionManager.GetAsync(WeChatWorkSettingNames.Connection.Token),
StringLocalizerFactory,

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN.Abp.WeChat.Work.Common.csproj

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />

24
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/AbpWeChatWorkCommonModule.cs

@ -27,7 +27,6 @@ public class AbpWeChatWorkCommonModule : AbpModule
options.MapEvent("enter_agent", context => context.GetWeChatMessage<EnterAgentEvent>());
options.MapEvent("LOCATION", context => context.GetWeChatMessage<ReportingGeoLocationEvent>());
options.MapEvent("location_select", context => context.GetWeChatMessage<GeoLocationSelectPushEevent>());
options.MapEvent("batch_job_result", context => context.GetWeChatMessage<BatchJobResultEvent>());
options.MapEvent("open_approval_change", context => context.GetWeChatMessage<ApprovalStatusChangeEvent>());
options.MapEvent("sys_approval_change", context => context.GetWeChatMessage<SysApprovalStatusChangeEvent>());
options.MapEvent("share_agent_change", context => context.GetWeChatMessage<ShareAgentChangeEvent>());
@ -36,29 +35,6 @@ public class AbpWeChatWorkCommonModule : AbpModule
options.MapEvent("template_card_menu_event", context => context.GetWeChatMessage<TemplateCardMenuPushEvent>());
options.MapEvent("close_inactive_agent", context => context.GetWeChatMessage<CloseInActiveAgentEvent>());
options.MapEvent("reopen_inactive_agent", context => context.GetWeChatMessage<ReOpenInActiveAgentEevent>());
options.MapEvent("change_contact", context =>
{
//static UserChangeEvent CreateUserChangeEvent<TEvent>(string originXml) where TEvent : UserChangeEvent
//{
// var events = new XmlDeserializationEvents();
// return originXml.DeserializeWeChatMessage<TEvent>(events);
//}
var changeType = context.GetMessageData("ChangeType");
return changeType switch
{
"create_user" => context.GetWeChatMessage<CreateUserEvent>(),
"update_user" => context.GetWeChatMessage<UpdateUserEvent>(),
"delete_user" => context.GetWeChatMessage<DeleteUserEvent>(),
"create_party" => context.GetWeChatMessage<CreateDepartmentEvent>(),
"update_party" => context.GetWeChatMessage<UpdateDepartmentEvent>(),
"delete_party" => context.GetWeChatMessage<DeleteDepartmentEvent>(),
"update_tag" => context.GetWeChatMessage<UserTagChangeEvent>(),
_ => throw new AbpWeChatException($"Contact change event {changeType} is not mounted!"),
};
});
options.MapEvent("book_meeting_room", context => context.GetWeChatMessage<BookMeetingRoomEvent>());
options.MapEvent("cancel_meeting_room", context => context.GetWeChatMessage<CancelMeetingRoomEvent>());
options.MapMessage("text", context => context.GetWeChatMessage<TextMessage>());
options.MapMessage("image", context => context.GetWeChatMessage<PictureMessage>());

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Models/ExternalAttribute.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalAttribute.cs

@ -2,7 +2,7 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.ExternalContact.Models;
namespace LINGYUN.Abp.WeChat.Work.Common.Members.Models;
/// <summary>
/// 成员对外属性
/// </summary>

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Models/ExternalAttributeDeserializeFactory.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalAttributeDeserializeFactory.cs

@ -2,7 +2,7 @@
using System;
using System.Text.Json;
namespace LINGYUN.Abp.WeChat.Work.ExternalContact.Models;
namespace LINGYUN.Abp.WeChat.Work.Common.Members.Models;
internal static class ExternalAttributeDeserializeFactory
{
/// <summary>

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Models/ExternalAttributeType.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalAttributeType.cs

@ -1,6 +1,6 @@
using System.ComponentModel;
namespace LINGYUN.Abp.WeChat.Work.ExternalContact.Models;
namespace LINGYUN.Abp.WeChat.Work.Common.Members.Models;
/// <summary>
/// 属性类型
/// </summary>

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Models/ExternalMiniProgramAttribute.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalMiniProgramAttribute.cs

@ -2,7 +2,7 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.ExternalContact.Models;
namespace LINGYUN.Abp.WeChat.Work.Common.Members.Models;
/// <summary>
/// 小程序类型属性
/// </summary>

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Models/ExternalProfile.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalProfile.cs

@ -3,7 +3,7 @@ using Newtonsoft.Json;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.ExternalContact.Models;
namespace LINGYUN.Abp.WeChat.Work.Common.Members.Models;
/// <summary>
/// 成员对外信息
/// </summary>

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Models/ExternalTextAttribute.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalTextAttribute.cs

@ -2,7 +2,7 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.ExternalContact.Models;
namespace LINGYUN.Abp.WeChat.Work.Common.Members.Models;
/// <summary>
/// 文本类型属性
/// </summary>

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Models/ExternalWebAttribute.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/ExternalWebAttribute.cs

@ -2,7 +2,7 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.ExternalContact.Models;
namespace LINGYUN.Abp.WeChat.Work.Common.Members.Models;
/// <summary>
/// 网页类型属性
/// </summary>

25
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/Gender.cs

@ -0,0 +1,25 @@
using System.ComponentModel;
namespace LINGYUN.Abp.WeChat.Work.Common.Members.Models;
/// <summary>
/// 性别
/// </summary>
[Description("性别")]
public enum Gender
{
/// <summary>
/// 未知
/// </summary>
[Description("未知")]
None = 0,
/// <summary>
/// 男性
/// </summary>
[Description("男性")]
Male = 1,
/// <summary>
/// 女性
/// </summary>
[Description("女性")]
FeMale = 2,
}

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/MemberExtendAttribute.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/MemberExtendAttribute.cs

@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Xml.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Common.Messages.Models;
namespace LINGYUN.Abp.WeChat.Work.Common.Members.Models;
[XmlRoot("Item")]
public class MemberExtendAttribute

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Models/WechatChannel.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/WechatChannel.cs

@ -2,7 +2,7 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.ExternalContact.Models;
namespace LINGYUN.Abp.WeChat.Work.Common.Members.Models;
/// <summary>
/// 视频号属性
/// </summary>

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/LINGYUN/Abp/WeChat/Work/ExternalContact/Models/WechatChannelStatus.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Members/Models/WechatChannelStatus.cs

@ -1,6 +1,6 @@
using System.ComponentModel;
namespace LINGYUN.Abp.WeChat.Work.ExternalContact.Models;
namespace LINGYUN.Abp.WeChat.Work.Common.Members.Models;
/// <summary>
/// 视频号状态
/// </summary>

62
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/EnumToNumberStringConverter.cs

@ -0,0 +1,62 @@
using System;
namespace Newtonsoft.Json;
#nullable enable
public class EnumToNumberStringConverter<T> : JsonConverter where T : struct, Enum
{
public override bool CanConvert(Type objectType)
{
return objectType == typeof(T?);
}
public override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
{
if (reader.TokenType == JsonToken.Null)
{
return null;
}
try
{
if (reader.TokenType == JsonToken.String)
{
var stringValue = reader.Value?.ToString();
if (string.IsNullOrEmpty(stringValue))
{
return null;
}
if (int.TryParse(stringValue, out var intValue))
{
return (T?)Enum.ToObject(typeof(T), intValue);
}
}
else if (reader.TokenType == JsonToken.Integer)
{
return (T?)Enum.ToObject(typeof(T), Convert.ToInt32(reader.Value));
}
}
catch (Exception ex)
{
throw new JsonSerializationException($"Error converting value {reader.Value} to type '{objectType}'.", ex);
}
throw new JsonSerializationException($"Unexpected token {reader.TokenType} when parsing enum.");
}
public override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
{
if (value == null)
{
writer.WriteNull();
}
else
{
var enumValue = (T)value;
writer.WriteValue(Convert.ToInt32(enumValue).ToString());
}
}
}
#nullable disable

7
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/Newtonsoft/Json/ExternalProfileNewtonsoftJsonConverter.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/ExternalProfileNewtonsoftJsonConverter.cs

@ -1,4 +1,5 @@
using LINGYUN.Abp.WeChat.Work.ExternalContact.Models;

using LINGYUN.Abp.WeChat.Work.Common.Members.Models;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@ -8,7 +9,7 @@ internal class ExternalProfileNewtonsoftJsonConverter : JsonConverter<ExternalPr
{
public override bool CanWrite => true;
public override void WriteJson(JsonWriter writer, ExternalProfile? value, JsonSerializer serializer)
public override void WriteJson(JsonWriter writer, ExternalProfile value, JsonSerializer serializer)
{
writer.WriteStartObject();
@ -33,7 +34,7 @@ internal class ExternalProfileNewtonsoftJsonConverter : JsonConverter<ExternalPr
writer.WriteEndObject();
}
public override ExternalProfile? ReadJson(JsonReader reader, Type objectType, ExternalProfile? existingValue, bool hasExistingValue, JsonSerializer serializer)
public override ExternalProfile ReadJson(JsonReader reader, Type objectType, ExternalProfile existingValue, bool hasExistingValue, JsonSerializer serializer)
{
var jObject = JObject.Load(reader);

31
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/Newtonsoft/Json/IntToBoolConverter.cs

@ -0,0 +1,31 @@
using System;
namespace Newtonsoft.Json;
public class IntToBoolConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
return objectType == typeof(bool);
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
switch (reader.TokenType)
{
case JsonToken.Integer:
var value = (long)reader.Value;
return value == 1;
case JsonToken.Boolean:
return (bool)reader.Value;
default:
throw new JsonSerializationException($"Unexpected token {reader.TokenType} when parsing bool.");
}
}
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
var boolValue = (bool)value;
writer.WriteValue(boolValue ? 1 : 0);
}
}

45
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/System/Text/Json/Serialization/EnumToNumberStringConverter.cs

@ -0,0 +1,45 @@
namespace System.Text.Json.Serialization;
#nullable enable
public class EnumToNumberStringConverter<T> : JsonConverter<T?> where T : struct, Enum
{
public override T? Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
if (reader.TokenType == JsonTokenType.Null)
{
return null;
}
if (reader.TokenType == JsonTokenType.String)
{
var stringValue = reader.GetString();
if (string.IsNullOrEmpty(stringValue))
{
return null;
}
if (int.TryParse(stringValue, out var intValue))
{
return (T)Enum.ToObject(typeof(T), intValue);
}
}
else if (reader.TokenType == JsonTokenType.Number)
{
return (T)Enum.ToObject(typeof(T), reader.GetInt32());
}
throw new JsonException($"Unable to convert value to enum {typeof(T).Name}");
}
public override void Write(Utf8JsonWriter writer, T? value, JsonSerializerOptions options)
{
if (value == null)
{
writer.WriteNullValue();
}
else
{
writer.WriteStringValue(Convert.ToInt32(value).ToString());
}
}
}
#nullable disable

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.ExternalContact/System/Text/Json/Serialization/ExternalProfileSystemTextJsonConverter.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/System/Text/Json/Serialization/ExternalProfileSystemTextJsonConverter.cs

@ -1,4 +1,4 @@
using LINGYUN.Abp.WeChat.Work.ExternalContact.Models;
using LINGYUN.Abp.WeChat.Work.Common.Members.Models;
using System.Collections.Generic;
namespace System.Text.Json.Serialization;

26
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/System/Text/Json/Serialization/IntToBoolJsonConverter.cs

@ -0,0 +1,26 @@
namespace System.Text.Json.Serialization;
public class IntToBoolJsonConverter : JsonConverter<bool>
{
public override bool Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
{
switch (reader.TokenType)
{
case JsonTokenType.Number:
var intValue = reader.GetInt64();
return intValue == 1;
case JsonTokenType.True:
return true;
case JsonTokenType.False:
return false;
}
throw new JsonException($"Cannot convert {reader.TokenType} to bool.");
}
public override void Write(Utf8JsonWriter writer, bool value, JsonSerializerOptions options)
{
writer.WriteNumberValue(value ? 1 : 0);
}
}

3
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/FodyWeavers.xml

@ -0,0 +1,3 @@
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd">
<ConfigureAwait ContinueOnCapturedContext="false" />
</Weavers>

30
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/FodyWeavers.xsd

@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. -->
<xs:element name="Weavers">
<xs:complexType>
<xs:all>
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1">
<xs:complexType>
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" />
</xs:complexType>
</xs:element>
</xs:all>
<xs:attribute name="VerifyAssembly" type="xs:boolean">
<xs:annotation>
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VerifyIgnoreCodes" type="xs:string">
<xs:annotation>
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="GenerateXsd" type="xs:boolean">
<xs:annotation>
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
</xs:schema>

27
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN.Abp.WeChat.Work.Contacts.csproj

@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\..\..\configureawait.props" />
<Import Project="..\..\..\..\common.props" />
<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1;net8.0;net9.0</TargetFrameworks>
<AssemblyName>LINGYUN.Abp.WeChat.Work.Contacts</AssemblyName>
<PackageId>LINGYUN.Abp.WeChat.Work.Contacts</PackageId>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<Nullable>enable</Nullable>
<RootNamespace />
</PropertyGroup>
<ItemGroup>
<None Remove="LINGYUN\Abp\WeChat\Work\Contacts\Localization\Resources\*.json" />
<EmbeddedResource Include="LINGYUN\Abp\WeChat\Work\Contacts\Localization\Resources\*.json" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LINGYUN.Abp.WeChat.Work\LINGYUN.Abp.WeChat.Work.csproj" />
</ItemGroup>
</Project>

45
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/AbpWeChatWorkContactModule.cs

@ -0,0 +1,45 @@
using LINGYUN.Abp.WeChat.Common;
using LINGYUN.Abp.WeChat.Common.Messages;
using LINGYUN.Abp.WeChat.Work.Common.Messages;
using LINGYUN.Abp.WeChat.Work.Contacts.Messages.Models;
using LINGYUN.Abp.WeChat.Work.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Modularity;
namespace LINGYUN.Abp.WeChat.Work.Contacts;
/// <summary>
/// 企业微信通讯录模块
/// </summary>
[DependsOn(typeof(AbpWeChatWorkModule))]
public class AbpWeChatWorkContactModule : AbpModule
{
public override void ConfigureServices(ServiceConfigurationContext context)
{
Configure<AbpWeChatWorkMessageResolveOptions>(options =>
{
options.MapEvent("change_contact", context =>
{
var changeType = context.GetMessageData("ChangeType");
return changeType switch
{
"create_user" => context.GetWeChatMessage<CreateUserEvent>(),
"update_user" => context.GetWeChatMessage<UpdateUserEvent>(),
"delete_user" => context.GetWeChatMessage<DeleteUserEvent>(),
"create_party" => context.GetWeChatMessage<CreateDepartmentEvent>(),
"update_party" => context.GetWeChatMessage<UpdateDepartmentEvent>(),
"delete_party" => context.GetWeChatMessage<DeleteDepartmentEvent>(),
"update_tag" => context.GetWeChatMessage<UserTagChangeEvent>(),
_ => throw new AbpWeChatException($"Contact change event {changeType} is not mounted!"),
};
});
options.MapEvent("batch_job_result", context => context.GetWeChatMessage<BatchJobResultEvent>());
});
Configure<AbpLocalizationOptions>(options =>
{
options.Resources
.Get<WeChatWorkResource>()
.AddVirtualJson("/LINGYUN/Abp/WeChat/Work/Contacts/Localization/Resources");
});
}
}

87
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/IWeChatWorkDepartmentProvider.cs

@ -0,0 +1,87 @@
using LINGYUN.Abp.WeChat.Work.Contacts.Departments.Request;
using LINGYUN.Abp.WeChat.Work.Contacts.Departments.Response;
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments;
/// <summary>
/// 企业微信部门管理接口
/// </summary>
public interface IWeChatWorkDepartmentProvider
{
/// <summary>
/// 获取部门列表
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90208" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkGetDepartmentListResponse> GetDepartmentListAsync(
WeChatWorkGetDepartmentListRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// 获取子部门ID列表
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/95350" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkGetSubDepartmentListResponse> GetSubDepartmentListAsync(
WeChatWorkGetSubDepartmentListRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// 获取单个部门详情
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/95351" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkGetDepartmentResponse> GetDepartmentAsync(
WeChatWorkGetDepartmentRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// 创建部门
/// </summary>
/// <remarks>
/// 此接口使用通讯录应用Token<br />
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90205" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkCreateDepartmentResponse> CreateDepartmentAsync(
WeChatWorkCreateDepartmentRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// 更新部门
/// </summary>
/// <remarks>
/// 此接口使用通讯录应用Token<br />
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90206" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkResponse> UpdateDepartmentAsync(
WeChatWorkUpdateDepartmentRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// 删除部门
/// </summary>
/// <remarks>
/// 此接口使用通讯录应用Token<br />
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90207" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkResponse> DeleteDepartmentAsync(
WeChatWorkDeleteDepartmentRequest request,
CancellationToken cancellationToken = default);
}

25
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/Department.cs

@ -0,0 +1,25 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Models;
/// <summary>
/// 部门
/// </summary>
public class Department
{
/// <summary>
/// 部门名称
/// </summary>
[NotNull]
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; }
/// <summary>
/// 部门id
/// </summary>
[NotNull]
[JsonProperty("id")]
[JsonPropertyName("id")]
public string Id { get; set; }
}

39
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/DepartmentInfo.cs

@ -0,0 +1,39 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Models;
/// <summary>
/// 部门详情
/// </summary>
public class DepartmentInfo : Department
{
/// <summary>
/// 部门英文名称
/// </summary>
[CanBeNull]
[JsonProperty("name_en")]
[JsonPropertyName("name_en")]
public string? NameEn { get; set; }
/// <summary>
/// 部门负责人的UserID,返回在应用可见范围内的部门负责人列表
/// </summary>
[NotNull]
[JsonProperty("department_leader")]
[JsonPropertyName("department_leader")]
public string[] DepartmentLeader { get; set; }
/// <summary>
/// 父部门id。根部门为1
/// </summary>
[NotNull]
[JsonProperty("parentid")]
[JsonPropertyName("parentid")]
public int ParentId { get; set; }
/// <summary>
/// 在父部门中的次序值。order值大的排序靠前。值范围是[0, 2^32)
/// </summary>
[NotNull]
[JsonProperty("order")]
[JsonPropertyName("order")]
public int Order { get; set; }
}

32
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Models/SubDepartment.cs

@ -0,0 +1,32 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Models;
/// <summary>
/// 子部门
/// </summary>
public class SubDepartment
{
/// <summary>
/// 部门id
/// </summary>
[NotNull]
[JsonProperty("id")]
[JsonPropertyName("id")]
public string Id { get; set; }
/// <summary>
/// 父部门id。根部门为1。
/// </summary>
[NotNull]
[JsonProperty("parentid")]
[JsonPropertyName("parentid")]
public int ParentId { get; set; }
/// <summary>
/// 在父部门中的次序值。order值大的排序靠前。值范围是[0, 2^32)。
/// </summary>
[NotNull]
[JsonProperty("order")]
[JsonPropertyName("order")]
public int Order { get; set; }
}

68
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Request/WeChatWorkCreateDepartmentRequest.cs

@ -0,0 +1,68 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using System.Xml.Linq;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Request;
/// <summary>
/// 创建部门请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90205" />
/// </remarks>
public class WeChatWorkCreateDepartmentRequest : WeChatWorkRequest
{
/// <summary>
/// 部门名称。同一个层级的部门名称不能重复。长度限制为1~64个UTF-8字符
/// </summary>
[NotNull]
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; }
/// <summary>
/// 英文名称。同一个层级的部门名称不能重复。需要在管理后台开启多语言支持才能生效。长度限制为1~64个字符
/// </summary>
[CanBeNull]
[JsonProperty("name_en")]
[JsonPropertyName("name_en")]
public string? NameEn { get; set; }
/// <summary>
/// 父部门id,32位整型
/// </summary>
[NotNull]
[JsonProperty("parentid")]
[JsonPropertyName("parentid")]
public int ParentId { get; }
/// <summary>
/// 在父部门中的次序值。order值大的排序靠前。有效的值范围是[0, 2^32)
/// </summary>
[CanBeNull]
[JsonProperty("order")]
[JsonPropertyName("order")]
public int? Order { get; set; }
/// <summary>
/// 部门id,32位整型,指定时必须大于1。若不填该参数,将自动生成id
/// </summary>
[CanBeNull]
[JsonProperty("id")]
[JsonPropertyName("id")]
public int? Id { get; set; }
public WeChatWorkCreateDepartmentRequest(string name, int parentId = 0, string? nameEn = null, int? order = null, int? id = null)
{
Check.NotNullOrWhiteSpace(name, nameof(name), 64, 1);
Check.Length(nameEn, nameof(nameEn), 64, 1);
Name = name;
NameEn = nameEn;
ParentId = parentId;
Order = order;
Id = id;
}
protected override void Validate()
{
Check.NotNullOrWhiteSpace(Name, nameof(Name), 64, 1);
Check.Length(NameEn, nameof(NameEn), 64, 1);
}
}

25
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Request/WeChatWorkDeleteDepartmentRequest.cs

@ -0,0 +1,25 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Request;
/// <summary>
/// 删除部门请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90207" />
/// </remarks>
public class WeChatWorkDeleteDepartmentRequest : WeChatWorkRequest
{
/// <summary>
/// 部门id
/// </summary>
[NotNull]
[JsonProperty("id")]
[JsonPropertyName("id")]
public int Id { get; }
public WeChatWorkDeleteDepartmentRequest(int id)
{
Id = id;
}
}

25
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Request/WeChatWorkGetDepartmentListRequest.cs

@ -0,0 +1,25 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Request;
/// <summary>
/// 获取部门列表请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90208" />
/// </remarks>
public class WeChatWorkGetDepartmentListRequest : WeChatWorkRequest
{
/// <summary>
/// 部门id。获取指定部门及其下的子部门(以及子部门的子部门等等,递归)。 如果不填,默认获取全量组织架构
/// </summary>
[CanBeNull]
[JsonProperty("id")]
[JsonPropertyName("id")]
public int? Id { get; }
public WeChatWorkGetDepartmentListRequest(int? id = null)
{
Id = id;
}
}

25
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Request/WeChatWorkGetDepartmentRequest.cs

@ -0,0 +1,25 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Request;
/// <summary>
/// 获取单个部门详情请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90207" />
/// </remarks>
public class WeChatWorkGetDepartmentRequest : WeChatWorkRequest
{
/// <summary>
/// 部门id
/// </summary>
[NotNull]
[JsonProperty("id")]
[JsonPropertyName("id")]
public int Id { get; }
public WeChatWorkGetDepartmentRequest(int id)
{
Id = id;
}
}

25
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Request/WeChatWorkGetSubDepartmentListRequest.cs

@ -0,0 +1,25 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Request;
/// <summary>
/// 获取子部门ID列表请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/95350" />
/// </remarks>
public class WeChatWorkGetSubDepartmentListRequest : WeChatWorkRequest
{
/// <summary>
/// 部门id。获取指定部门及其下的子部门(以及子部门的子部门等等,递归)。 如果不填,默认获取全量组织架构
/// </summary>
[CanBeNull]
[JsonProperty("id")]
[JsonPropertyName("id")]
public int? Id { get; }
public WeChatWorkGetSubDepartmentListRequest(int? id = null)
{
Id = id;
}
}

60
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Request/WeChatWorkUpdateDepartmentRequest.cs

@ -0,0 +1,60 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Request;
/// <summary>
/// 更新部门请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90205" />
/// </remarks>
public class WeChatWorkUpdateDepartmentRequest : WeChatWorkRequest
{
/// <summary>
/// 部门id
/// </summary>
[NotNull]
[JsonProperty("id")]
[JsonPropertyName("id")]
public int Id { get; }
/// <summary>
/// 部门名称。长度限制为1~64个UTF-8字符
/// </summary>
[CanBeNull]
[JsonProperty("name")]
[JsonPropertyName("name")]
public string? Name { get; set; }
/// <summary>
/// 英文名称,需要在管理后台开启多语言支持才能生效。长度限制为1~64个字符
/// </summary>
[CanBeNull]
[JsonProperty("name_en")]
[JsonPropertyName("name_en")]
public string? NameEn { get; set; }
/// <summary>
/// 父部门id
/// </summary>
[CanBeNull]
[JsonProperty("parentid")]
[JsonPropertyName("parentid")]
public int? ParentId { get; set; }
/// <summary>
/// 在父部门中的次序值。order值大的排序靠前。有效的值范围是[0, 2^32)
/// </summary>
[CanBeNull]
[JsonProperty("order")]
[JsonPropertyName("order")]
public int? Order { get; set; }
public WeChatWorkUpdateDepartmentRequest(int id)
{
Id = id;
}
protected override void Validate()
{
Check.NotNullOrWhiteSpace(Name, nameof(Name), 64, 1);
Check.Length(NameEn, nameof(NameEn), 64, 1);
}
}

21
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkCreateDepartmentResponse.cs

@ -0,0 +1,21 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Response;
/// <summary>
/// 创建部门响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90205" />
/// </remarks>
public class WeChatWorkCreateDepartmentResponse : WeChatWorkResponse
{
/// <summary>
/// 创建的部门id
/// </summary>
[NotNull]
[JsonProperty("id")]
[JsonPropertyName("id")]
public int Id { get; set; }
}

22
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetDepartmentListResponse.cs

@ -0,0 +1,22 @@
using JetBrains.Annotations;
using LINGYUN.Abp.WeChat.Work.Contacts.Departments.Models;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Response;
/// <summary>
/// 获取部门列表响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90208" />
/// </remarks>
public class WeChatWorkGetDepartmentListResponse : WeChatWorkResponse
{
/// <summary>
/// 部门列表数据
/// </summary>
[NotNull]
[JsonProperty("department")]
[JsonPropertyName("department")]
public DepartmentInfo[] Department { get; set; }
}

22
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetDepartmentResponse.cs

@ -0,0 +1,22 @@
using JetBrains.Annotations;
using LINGYUN.Abp.WeChat.Work.Contacts.Departments.Models;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Response;
/// <summary>
/// 获取单个部门详情响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/95351" />
/// </remarks>
public class WeChatWorkGetDepartmentResponse : WeChatWorkResponse
{
/// <summary>
/// 部门详情
/// </summary>
[NotNull]
[JsonProperty("department")]
[JsonPropertyName("department")]
public DepartmentInfo Department { get; set; }
}

22
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/Response/WeChatWorkGetSubDepartmentListResponse.cs

@ -0,0 +1,22 @@
using JetBrains.Annotations;
using LINGYUN.Abp.WeChat.Work.Contacts.Departments.Models;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments.Response;
/// <summary>
/// 获取子部门ID列表响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/95350" />
/// </remarks>
public class WeChatWorkGetSubDepartmentListResponse : WeChatWorkResponse
{
/// <summary>
/// 部门列表数据。
/// </summary>
[NotNull]
[JsonProperty("department_id")]
[JsonPropertyName("department_id")]
public SubDepartment[] Department { get; set; }
}

108
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Departments/WeChatWorkDepartmentProvider.cs

@ -0,0 +1,108 @@
using LINGYUN.Abp.WeChat.Work.Contacts.Departments.Request;
using LINGYUN.Abp.WeChat.Work.Contacts.Departments.Response;
using LINGYUN.Abp.WeChat.Work.Contacts.Features;
using LINGYUN.Abp.WeChat.Work.Contacts.Token;
using LINGYUN.Abp.WeChat.Work.Token;
using Microsoft.Extensions.DependencyInjection;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Features;
using Volo.Abp.Json;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Departments;
[RequiresFeature(WeChatWorkContactsFeatureNames.Enable)]
public class WeChatWorkDepartmentProvider : IWeChatWorkDepartmentProvider, ISingletonDependency
{
protected IJsonSerializer JsonSerializer { get; }
protected IHttpClientFactory HttpClientFactory { get; }
protected IWeChatWorkTokenProvider WeChatWorkTokenProvider { get; }
protected IWeChatWorkContactTokenProvider WeChatWorkContactTokenProvider { get; }
public WeChatWorkDepartmentProvider(
IJsonSerializer jsonSerializer,
IHttpClientFactory httpClientFactory,
IWeChatWorkTokenProvider weChatWorkTokenProvider,
IWeChatWorkContactTokenProvider weChatWorkContactTokenProvider)
{
JsonSerializer = jsonSerializer;
HttpClientFactory = httpClientFactory;
WeChatWorkTokenProvider = weChatWorkTokenProvider;
WeChatWorkContactTokenProvider = weChatWorkContactTokenProvider;
}
public async virtual Task<WeChatWorkGetDepartmentListResponse> GetDepartmentListAsync(
WeChatWorkGetDepartmentListRequest request,
CancellationToken cancellationToken = default)
{
Check.NotNull(request, nameof(request));
var token = await WeChatWorkTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.GetDepartmentListAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkGetSubDepartmentListResponse> GetSubDepartmentListAsync(
WeChatWorkGetSubDepartmentListRequest request,
CancellationToken cancellationToken = default)
{
Check.NotNull(request, nameof(request));
var token = await WeChatWorkTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.GetSubDepartmentListAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkGetDepartmentResponse> GetDepartmentAsync(
WeChatWorkGetDepartmentRequest request,
CancellationToken cancellationToken = default)
{
Check.NotNull(request, nameof(request));
var token = await WeChatWorkTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.GetDepartmentAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkCreateDepartmentResponse> CreateDepartmentAsync(
WeChatWorkCreateDepartmentRequest request,
CancellationToken cancellationToken = default)
{
Check.NotNull(request, nameof(request));
var token = await WeChatWorkContactTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.CreateDepartmentAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkResponse> UpdateDepartmentAsync(
WeChatWorkUpdateDepartmentRequest request,
CancellationToken cancellationToken = default)
{
Check.NotNull(request, nameof(request));
var token = await WeChatWorkContactTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.UpdateDepartmentAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkResponse> DeleteDepartmentAsync(
WeChatWorkDeleteDepartmentRequest request,
CancellationToken cancellationToken = default)
{
Check.NotNull(request, nameof(request));
var token = await WeChatWorkContactTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.DeleteDepartmentAsync(token.AccessToken, request, cancellationToken);
}
}

31
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Features/WeChatWorkContactsFeatureDefinitionProvider.cs

@ -0,0 +1,31 @@
using LINGYUN.Abp.WeChat.Work.Features;
using LINGYUN.Abp.WeChat.Work.Localization;
using Volo.Abp.Features;
using Volo.Abp.Localization;
using Volo.Abp.Validation.StringValues;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Features;
public class WeChatWorkContactsFeatureDefinitionProvider : FeatureDefinitionProvider
{
public override void Define(IFeatureDefinitionContext context)
{
var weChatFeature = context.GetGroupOrNull(WeChatWorkFeatureNames.GroupName);
if (weChatFeature == null)
{
return;
}
var group = weChatFeature.AddFeature(WeChatWorkContactsFeatureNames.GroupName);
group.CreateChild(
WeChatWorkContactsFeatureNames.Enable,
defaultValue: "false",
displayName: L("Features:ContactsEnable"),
description: L("Features:ContactsEnableDesc"),
valueType: new ToggleStringValueType(new BooleanValueValidator()));
}
private static LocalizableString L(string name)
{
return LocalizableString.Create<WeChatWorkResource>(name);
}
}

14
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Features/WeChatWorkContactsFeatureNames.cs

@ -0,0 +1,14 @@
using LINGYUN.Abp.WeChat.Work.Features;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Features;
/// <summary>
/// 企业微信通讯录模块功能
/// </summary>
public static class WeChatWorkContactsFeatureNames
{
public const string GroupName = WeChatWorkFeatureNames.GroupName + ".Contacts";
/// <summary>
/// 启用企业微信通讯录
/// </summary>
public const string Enable = GroupName + ".Enable";
}

9
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Localization/Resources/en.json

@ -0,0 +1,9 @@
{
"culture": "en",
"texts": {
"Features:ContactsEnable": "Enable Contacts",
"Features:ContactsEnableDesc": "Enable the ability to provide the application with an Enterprise wechat contacts interface.",
"DisplayName:WeChatWorkContact.Secret": "Contact Secret",
"Description:WeChatWorkContact.Secret": "Secretfor the address contact application. Some contact interfaces require a contact synchronization secret."
}
}

9
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Localization/Resources/zh-Hans.json

@ -0,0 +1,9 @@
{
"culture": "zh-Hans",
"texts": {
"Features:ContactsEnable": "启用通讯录",
"Features:ContactsEnableDesc": "启用以使应用拥有企业微信通讯录接口的能力.",
"DisplayName:WeChatWorkContact.Secret": "通讯录访问密钥",
"Description:WeChatWorkContact.Secret": "通讯录应用访问密钥,部分通讯录接口需要通讯录同步secret."
}
}

199
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/IWeChatWorkMemberProvider.cs

@ -0,0 +1,199 @@
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Request;
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Response;
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members;
/// <summary>
/// 企业微信成员管理接口
/// </summary>
public interface IWeChatWorkMemberProvider
{
/// <summary>
/// 读取成员
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90196" />
/// </remarks>
/// <param name="userId">成员UserID。对应管理端的账号,企业内必须唯一。不区分大小写,长度为1~64个字节</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkGetMemberResponse> GetMemberAsync(
string userId,
CancellationToken cancellationToken = default);
/// <summary>
/// 创建成员
/// </summary>
/// <remarks>
/// 此接口使用通讯录应用Token<br />
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90195" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkCreateMemberResponse> CreateMemberAsync(
WeChatWorkCreateMemberRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// 更新成员
/// </summary>
/// <remarks>
/// 此接口使用通讯录应用Token<br />
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90197" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkResponse> UpdateMemberAsync(
WeChatWorkUpdateMemberRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// 删除成员
/// </summary>
/// <remarks>
/// 此接口使用通讯录应用Token<br />
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90198" />
/// </remarks>
/// <param name="userId">成员UserID。对应管理端的账号</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkResponse> DeleteMemberAsync(
string userId,
CancellationToken cancellationToken = default);
/// <summary>
/// 批量删除成员
/// </summary>
/// <remarks>
/// 此接口使用通讯录应用Token<br />
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90199" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkResponse> BulkDeleteMemberAsync(
WeChatWorkBulkDeleteMemberRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// 获取部门成员
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90200" />
/// </remarks>
/// <param name="departmentId">获取的部门id</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkGetSimpleMemberListResponse> GetSimpleMemberListAsync(
int departmentId,
CancellationToken cancellationToken = default);
/// <summary>
/// 获取部门成员详情
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90201" />
/// </remarks>
/// <param name="departmentId">获取的部门id</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkGetMemberListResponse> GetMemberListAsync(
int departmentId,
CancellationToken cancellationToken = default);
/// <summary>
/// userid转openid
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90202" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkConvertToOpenIdResponse> ConvertToOpenIdAsync(
WeChatWorkConvertToOpenIdRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// openid转userid
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90202" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkConvertToUserIdResponse> ConvertToUserIdAsync(
WeChatWorkConvertToUserIdRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// 登录二次验证
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90203" />
/// </remarks>
/// <param name="userId">成员UserID。对应管理端的账号</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkResponse> AuthSuccessAsync(
string userId,
CancellationToken cancellationToken = default);
/// <summary>
/// 邀请成员
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90975" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkBulkInviteMemberResponse> BulkInviteMemberAsync(
WeChatWorkBulkInviteMemberRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// 获取加入企业二维码
/// </summary>
/// <remarks>
/// 此接口使用通讯录应用Token<br />
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/91714" />
/// </remarks>
/// <param name="sizeType">二维码尺寸类型</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkGetJoinQrCodeResponse> GetJoinQrCodeAsync(
QrCodeSizeType sizeType,
CancellationToken cancellationToken = default);
/// <summary>
/// 手机号获取userid
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/95402" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkGetUserIdResponse> GetUserIdByMobileAsync(
WeChatWorkGetUserIdByMobileRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// 邮箱获取userid
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/95895" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkGetUserIdResponse> GetUserIdByEmailAsync(
WeChatWorkGetUserIdByEmailRequest request,
CancellationToken cancellationToken = default);
/// <summary>
/// 获取成员ID列表
/// </summary>
/// <remarks>
/// 此接口使用通讯录应用Token<br />
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/96067" />
/// </remarks>
/// <param name="request">请求参数</param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
Task<WeChatWorkGetUserIdListResponse> GetUserIdListAsync(
WeChatWorkGetUserIdListRequest request,
CancellationToken cancellationToken = default);
}

20
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/AttributeType.cs

@ -0,0 +1,20 @@
using System.ComponentModel;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
/// <summary>
/// 属性类型
/// </summary>
[Description("属性类型")]
public enum AttributeType
{
/// <summary>
/// 文本
/// </summary>
[Description("文本")]
Text = 0,
/// <summary>
/// 网页
/// </summary>
[Description("网页")]
Web = 1
}

39
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/DepartmentMember.cs

@ -0,0 +1,39 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
/// <summary>
/// 部门成员
/// </summary>
public class DepartmentMember
{
/// <summary>
/// 成员UserID。对应管理端的账号
/// </summary>
[NotNull]
[JsonProperty("userid")]
[JsonPropertyName("userid")]
public string UserId { get; set; }
/// <summary>
/// 成员名称,代开发自建应用需要管理员授权才返回
/// </summary>
[NotNull]
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; }
/// <summary>
/// 成员所属部门列表。列表项为部门ID,32位整型
/// </summary>
[CanBeNull]
[JsonProperty("department")]
[JsonPropertyName("department")]
public int[]? Department { get; set; }
/// <summary>
/// 全局唯一
/// </summary>
[NotNull]
[JsonProperty("open_userid")]
[JsonPropertyName("open_userid")]
public string OpenUserId { get; set; }
}

25
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/DepartmentUser.cs

@ -0,0 +1,25 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
/// <summary>
/// 用户-部门关系
/// </summary>
public class DepartmentUser
{
/// <summary>
/// 用户userid,当用户在多个部门下时会有多条记录
/// </summary>
[NotNull]
[JsonProperty("userid")]
[JsonPropertyName("userid")]
public string UserId { get; set; }
/// <summary>
/// 用户所属部门
/// </summary>
[NotNull]
[JsonProperty("department")]
[JsonPropertyName("department")]
public int Department { get; set; }
}

20
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/EmailType.cs

@ -0,0 +1,20 @@
using System.ComponentModel;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
/// <summary>
/// 邮箱类型
/// </summary>
[Description("邮箱类型")]
public enum EmailType
{
/// <summary>
/// 企业邮箱
/// </summary>
[Description("企业邮箱")]
BizEmail = 1,
/// <summary>
/// 个人邮箱
/// </summary>
[Description("个人邮箱")]
PersonEmail = 2,
}

25
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberAttribute.cs

@ -0,0 +1,25 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
/// <summary>
/// 成员扩展属性
/// </summary>
public abstract class MemberAttribute
{
/// <summary>
/// 属性名称: 在新增或者更新操作时,需要先确保在管理端有创建该属性,否则会忽略
/// </summary>
[NotNull]
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; }
/// <summary>
/// 属性类型
/// </summary>
[NotNull]
[JsonProperty("type")]
[JsonPropertyName("type")]
public AttributeType Type { get; set; }
}

33
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberAttributeDeserializeFactory.cs

@ -0,0 +1,33 @@
using Newtonsoft.Json.Linq;
using System;
using System.Text.Json;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
internal static class MemberAttributeDeserializeFactory
{
/// <summary>
/// 根据属性类型创建属性(System.Text.Json)
/// </summary>
public static MemberAttribute CreateExternalAttribute(AttributeType type, JsonElement configElement)
{
return type switch
{
AttributeType.Text => JsonSerializer.Deserialize<MemberTextAttribute>(configElement.GetRawText())!,
AttributeType.Web => JsonSerializer.Deserialize<MemberWebAttribute>(configElement.GetRawText())!,
_ => throw new NotSupportedException($"Attribute type {type} is not supported for the time being"),
};
}
/// <summary>
/// 根据属性类型创建属性(Newtonsoft.Json)
/// </summary>
public static MemberAttribute CreateExternalAttribute(AttributeType type, JToken configToken)
{
return type switch
{
AttributeType.Text => configToken.ToObject<MemberTextAttribute>()!,
AttributeType.Web => configToken.ToObject<MemberWebAttribute>()!,
_ => throw new NotSupportedException($"Attribute type {type} is not supported for the time being"),
};
}
}

18
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberExternalAttribute.cs

@ -0,0 +1,18 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
/// <summary>
/// 成员扩展属性
/// </summary>
public class MemberExternalAttribute
{
/// <summary>
/// 扩展属性列表
/// </summary>
[NotNull]
[JsonProperty("attrs")]
[JsonPropertyName("attrs")]
public MemberAttribute[] Attributes { get; set; }
}

173
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberInfo.cs

@ -0,0 +1,173 @@
using JetBrains.Annotations;
using LINGYUN.Abp.WeChat.Work.Common.Members.Models;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
/// <summary>
/// 成员详情
/// </summary>
public class MemberInfo
{
/// <summary>
/// 全局唯一
/// </summary>
[NotNull]
[JsonProperty("open_userid")]
[JsonPropertyName("open_userid")]
public string OpenUserId { get; set; }
/// <summary>
/// 成员UserID
/// </summary>
[NotNull]
[JsonProperty("userid")]
[JsonPropertyName("userid")]
public string UserId { get; set; }
/// <summary>
/// 成员名称
/// </summary>
[NotNull]
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; }
/// <summary>
/// 手机号码
/// </summary>
[CanBeNull]
[JsonProperty("mobile")]
[JsonPropertyName("mobile")]
public string? Mobile { get; set; }
/// <summary>
/// 成员所属部门id列表
/// </summary>
[NotNull]
[JsonProperty("department")]
[JsonPropertyName("department")]
public int[] Department { get; set; }
/// <summary>
/// 主部门
/// </summary>
[CanBeNull]
[JsonProperty("main_department")]
[JsonPropertyName("main_department")]
public int? MainDepartment { get; set; }
/// <summary>
/// 部门内的排序值,默认为0。数量必须和department一致,数值越大排序越前面。值范围是[0, 2^32)
/// </summary>
[NotNull]
[JsonProperty("order")]
[JsonPropertyName("order")]
public int[]? Order { get; set; }
/// <summary>
/// 员工个人二维码
/// </summary>
[CanBeNull]
[JsonProperty("qr_code")]
[JsonPropertyName("qr_code")]
public string? QrCode { get; set; }
/// <summary>
/// 职务信息
/// </summary>
[CanBeNull]
[JsonProperty("position")]
[JsonPropertyName("position")]
public string? Position { get; set; }
/// <summary>
/// 性别
/// </summary>
[CanBeNull]
[JsonProperty("gender")]
[JsonPropertyName("gender")]
public Gender? Gender { get; set; }
/// <summary>
/// 邮箱
/// </summary>
[CanBeNull]
[JsonProperty("email")]
[JsonPropertyName("email")]
public string? Email { get; set; }
/// <summary>
/// 企业邮箱
/// </summary>
[CanBeNull]
[JsonProperty("biz_mail")]
[JsonPropertyName("biz_mail")]
public string? BizEmail { get; set; }
/// <summary>
/// 表示在所在的部门内是否为部门负责人,数量与department一致
/// </summary>
[CanBeNull]
[JsonProperty("is_leader_in_dept")]
[JsonPropertyName("is_leader_in_dept")]
public int[]? IsLeaderInDept { get; set; }
/// <summary>
/// 直属上级UserID,返回在应用可见范围内的直属上级列表,最多有1个直属上级
/// </summary>
[CanBeNull]
[JsonProperty("direct_leader")]
[JsonPropertyName("direct_leader")]
public string[]? DirectLeader { get; set; }
/// <summary>
/// 头像url
/// </summary>
[CanBeNull]
[JsonProperty("avatar")]
[JsonPropertyName("avatar")]
public string? Avatar { get; set; }
/// <summary>
/// 头像缩略图url
/// </summary>
[CanBeNull]
[JsonProperty("thumb_avatar")]
[JsonPropertyName("thumb_avatar")]
public string? ThumbAvatar { get; set; }
/// <summary>
/// 座机
/// </summary>
[CanBeNull]
[JsonProperty("telephone")]
[JsonPropertyName("telephone")]
public string? TelePhone { get; set; }
/// <summary>
/// 别名
/// </summary>
[CanBeNull]
[JsonProperty("alias")]
[JsonPropertyName("alias")]
public string? Alias { get; set; }
/// <summary>
/// 地址
/// </summary>
[CanBeNull]
[JsonProperty("address")]
[JsonPropertyName("address")]
public string? Address { get; set; }
/// <summary>
/// 激活状态
/// </summary>
[NotNull]
[JsonProperty("status")]
[JsonPropertyName("status")]
public MemberStatus Status { get; set; }
/// <summary>
/// 扩展属性
/// </summary>
[CanBeNull]
[JsonProperty("extattr")]
[JsonPropertyName("extattr")]
public MemberExternalAttribute? ExternalAttribute { get; set; }
/// <summary>
/// 对外职务,如果设置了该值,则以此作为对外展示的职务,否则以position来展示。
/// </summary>
[CanBeNull]
[JsonProperty("external_position")]
[JsonPropertyName("external_position")]
public string? ExternalPosition { get; set; }
/// <summary>
/// 外部联系人的自定义展示信息
/// </summary>
[CanBeNull]
[JsonProperty("external_profile")]
[JsonPropertyName("external_profile")]
public ExternalProfile? ExternalProfile { get; set; }
}

30
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberStatus.cs

@ -0,0 +1,30 @@
using System.ComponentModel;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
/// <summary>
/// 激活状态
/// </summary>
[Description("激活状态")]
public enum MemberStatus
{
/// <summary>
/// 已激活
/// </summary>
[Description("已激活")]
Activated = 1,
/// <summary>
/// 已禁用
/// </summary>
[Description("已禁用")]
Disabled = 2,
/// <summary>
/// 未激活
/// </summary>
[Description("未激活")]
NotActivated = 4,
/// <summary>
/// 退出企业
/// </summary>
[Description("退出企业")]
Exited = 5,
}

29
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberTextAttribute.cs

@ -0,0 +1,29 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
/// <summary>
/// 文本类型的成员属性
/// </summary>
public class MemberTextAttribute : MemberAttribute
{
/// <summary>
/// 文本
/// </summary>
[NotNull]
[JsonProperty("text")]
[JsonPropertyName("text")]
public MemberTextModel Text { get; set; }
}
public class MemberTextModel
{
/// <summary>
/// 文本
/// </summary>
[NotNull]
[JsonProperty("value")]
[JsonPropertyName("value")]
public string Value { get; set; }
}

36
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/MemberWebAttribute.cs

@ -0,0 +1,36 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
/// <summary>
/// 网页类型的成员属性
/// </summary>
public class MemberWebAttribute : MemberAttribute
{
/// <summary>
/// 网页
/// </summary>
[NotNull]
[JsonProperty("web")]
[JsonPropertyName("web")]
public MemberWebModel Web { get; set; }
}
public class MemberWebModel
{
/// <summary>
/// 网页的url,必须包含http或者https头
/// </summary>
[NotNull]
[JsonProperty("url")]
[JsonPropertyName("url")]
public string Url { get; set; }
/// <summary>
/// 网页的展示标题,长度限制12个UTF8字符
/// </summary>
[NotNull]
[JsonProperty("title")]
[JsonPropertyName("title")]
public string Title { get; set; }
}

30
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Models/QrCodeSizeType.cs

@ -0,0 +1,30 @@
using System.ComponentModel;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
/// <summary>
/// 二维码尺寸类型
/// </summary>
[Description("二维码尺寸类型")]
public enum QrCodeSizeType
{
/// <summary>
/// 171 x 171
/// </summary>
[Description("171 x 171")]
Size171 = 1,
/// <summary>
/// 399 x 399
/// </summary>
[Description("399 x 399")]
Size399 = 2,
/// <summary>
/// 741 x 741
/// </summary>
[Description("741 x 741")]
Size741 = 3,
/// <summary>
/// 2052 x 2052
/// </summary>
[Description("2052 x 2052")]
Size2052 = 4,
}

39
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkBulkDeleteMemberRequest.cs

@ -0,0 +1,39 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Request;
/// <summary>
/// 批量删除成员请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90199" />
/// </remarks>
public class WeChatWorkBulkDeleteMemberRequest : WeChatWorkRequest
{
/// <summary>
/// 成员UserID列表。对应管理端的账号。最多支持200个。若存在无效UserID,直接返回错误
/// </summary>
[NotNull]
[JsonProperty("useridlist")]
[JsonPropertyName("useridlist")]
public List<string> UserIdList { get; }
public WeChatWorkBulkDeleteMemberRequest() :this([])
{
}
public WeChatWorkBulkDeleteMemberRequest(List<string> userIdList)
{
UserIdList = userIdList;
}
protected override void Validate()
{
if (UserIdList.Count > 100)
{
throw new ArgumentException("The maximum number of member ids that can be deleted simultaneously is only 200!");
}
}
}

63
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkBulkInviteMemberRequest.cs

@ -0,0 +1,63 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Request;
/// <summary>
/// 邀请成员请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90975" />
/// </remarks>
public class WeChatWorkBulkInviteMemberRequest : WeChatWorkRequest
{
/// <summary>
/// 成员ID列表, 最多支持1000个。
/// </summary>
[NotNull]
[JsonProperty("user")]
[JsonPropertyName("user")]
public List<string> User { get; }
/// <summary>
/// 部门ID列表,最多支持100个。
/// </summary>
[NotNull]
[JsonProperty("party")]
[JsonPropertyName("party")]
public List<int> Party { get; }
/// <summary>
/// 标签ID列表,最多支持100个。
/// </summary>
[NotNull]
[JsonProperty("tag")]
[JsonPropertyName("tag")]
public List<int> Tag { get; }
public WeChatWorkBulkInviteMemberRequest()
{
User = new List<string>();
Party = new List<int>();
Tag = new List<int>();
}
protected override void Validate()
{
if (User.IsNullOrEmpty() && Party.IsNullOrEmpty() && Tag.IsNullOrEmpty())
{
throw new ArgumentException("User, Party, and Tag cannot all be empty at the same time!");
}
if (User.Count > 1000)
{
throw new ArgumentException("User list, up to 1000 supported!");
}
if (Party.Count > 100)
{
throw new ArgumentException("Party list, up to 100 supported!");
}
if (Tag.Count > 100)
{
throw new ArgumentException("Tag list, up to 100 supported!");
}
}
}

26
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkConvertToOpenIdRequest.cs

@ -0,0 +1,26 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Request;
/// <summary>
/// userid转openid请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90202" />
/// </remarks>
public class WeChatWorkConvertToOpenIdRequest : WeChatWorkRequest
{
/// <summary>
/// 企业内的成员id
/// </summary>
[NotNull]
[JsonProperty("userid")]
[JsonPropertyName("userid")]
public string UserId { get; }
public WeChatWorkConvertToOpenIdRequest(string userId)
{
UserId = Check.NotNullOrWhiteSpace(userId, nameof(userId));
}
}

27
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkConvertToUserIdRequest.cs

@ -0,0 +1,27 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Request;
/// <summary>
/// openid转userid请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90202" />
/// </remarks>
public class WeChatWorkConvertToUserIdRequest : WeChatWorkRequest
{
/// <summary>
/// 在使用企业支付之后,返回结果的openid
/// </summary>
[NotNull]
[JsonProperty("openid")]
[JsonPropertyName("openid")]
public string OpenId { get; }
public WeChatWorkConvertToUserIdRequest(string openId)
{
OpenId = Check.NotNullOrWhiteSpace(openId, nameof(openId));
}
}

230
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkCreateMemberRequest.cs

@ -0,0 +1,230 @@
using JetBrains.Annotations;
using LINGYUN.Abp.WeChat.Work.Common.Members.Models;
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
using Newtonsoft.Json;
using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Request;
/// <summary>
/// 创建成员请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90195" />
/// </remarks>
public class WeChatWorkCreateMemberRequest : WeChatWorkRequest
{
/// <summary>
/// 成员UserID。对应管理端的账号,企业内必须唯一。长度为1~64个字节。只能由数字、字母和“_-@.”四种字符组成,且第一个字符必须是数字或字母。系统进行唯一性检查时会忽略大小写。
/// </summary>
[NotNull]
[JsonProperty("userid")]
[JsonPropertyName("userid")]
[StringLength(64, MinimumLength = 1)]
public string UserId { get; set; }
/// <summary>
/// 成员名称。长度为1~64个utf8字符
/// </summary>
[NotNull]
[JsonProperty("name")]
[JsonPropertyName("name")]
[StringLength(64, MinimumLength = 1)]
public string Name { get; set; }
/// <summary>
/// 成员别名。长度1~64个utf8字符
/// </summary>
[CanBeNull]
[JsonProperty("alias")]
[JsonPropertyName("alias")]
[StringLength(64, MinimumLength = 1)]
public string? Alias { get; set; }
/// <summary>
/// 手机号码。企业内必须唯一,mobile/email二者不能同时为空 ,中国大陆手机号码可省略“+86”,其他国家或地区必须要带上国际码。
/// </summary>
[CanBeNull]
[JsonProperty("mobile")]
[JsonPropertyName("mobile")]
public string? Mobile { get; set; }
/// <summary>
/// 成员所属部门id列表,不超过100个。当不填写department或id为0时,成员会放在其他(待设置部门)下,当填写的部门不存在时,会在在其他(待设置部门)下新建对应部门
/// </summary>
[CanBeNull]
[JsonProperty("department")]
[JsonPropertyName("department")]
public int[]? Department { get; set; }
/// <summary>
/// 部门内的排序值,默认为0,成员次序以创建时间从小到大排列。个数必须和参数department的个数一致,数值越大排序越前面。有效的值范围是[0, 2^32)
/// </summary>
[CanBeNull]
[JsonProperty("order")]
[JsonPropertyName("order")]
public int[]? Order { get; set; }
/// <summary>
/// 职务信息。长度为0~128个字符
/// </summary>
[CanBeNull]
[StringLength(128)]
[JsonProperty("position")]
[JsonPropertyName("position")]
public string? Position { get; set; }
/// <summary>
/// 性别
/// </summary>
[CanBeNull]
[JsonProperty("gender")]
[JsonPropertyName("gender")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.EnumToNumberStringConverter<Gender>))]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.EnumToNumberStringConverter<Gender>))]
public Gender? Gender { get; set; }
/// <summary>
/// 邮箱。可填写企业已有的邮箱账号,方便同事获取成员的邮箱账号以发邮件。长度6~64个字节,且为有效的email格式。企业内必须唯一,mobile/email二者不能同时为空。境外成员可用此邮箱登录企业微信。
/// </summary>
[CanBeNull]
[StringLength(64)]
[JsonProperty("email")]
[JsonPropertyName("email")]
public string? Email { get; set; }
/// <summary>
/// 如果企业已开通腾讯企业邮(企业微信邮箱),设置该值可创建企业邮箱账号。长度6~64个字节,且为有效的企业邮箱格式。企业内必须唯一。未填写则系统会为用户生成默认企业邮箱(由系统生成的邮箱可修改一次)
/// </summary>
[CanBeNull]
[StringLength(64)]
[JsonProperty("biz_mail")]
[JsonPropertyName("biz_mail")]
public string? BizEmail { get; set; }
/// <summary>
/// 座机。32字节以内,由纯数字、“-”、“+”或“,”组成。
/// </summary>
[CanBeNull]
[StringLength(32)]
[JsonProperty("telephone")]
[JsonPropertyName("telephone")]
public string? TelePhone { get; set; }
/// <summary>
/// 个数必须和参数department的个数一致,表示在所在的部门内是否为部门负责人。1表示为部门负责人,0表示非部门负责人。在审批(自建、第三方)等应用里可以用来标识上级审批人
/// </summary>
[CanBeNull]
[JsonProperty("is_leader_in_dept")]
[JsonPropertyName("is_leader_in_dept")]
public int[]? IsLeaderInDept { get; set; }
/// <summary>
/// 直属上级UserID,设置范围为企业内成员,可以设置最多1个上级
/// </summary>
[CanBeNull]
[JsonProperty("direct_leader")]
[JsonPropertyName("direct_leader")]
public string[]? DirectLeader { get; set; }
/// <summary>
/// 成员头像的mediaid,通过素材管理接口上传图片获得的mediaid
/// </summary>
[CanBeNull]
[JsonProperty("avatar_mediaid")]
[JsonPropertyName("avatar_mediaid")]
public string? AvatarMediaId { get; set; }
/// <summary>
/// 启用/禁用成员。1表示启用成员,0表示禁用成员
/// </summary>
[CanBeNull]
[JsonProperty("enable")]
[JsonPropertyName("enable")]
public int? Enable { get; set; }
/// <summary>
/// 扩展属性。扩展属性字段需要先在WEB管理端添加,见扩展属性添加方法,否则忽略未知属性的赋值。字段详情见成员扩展属性
/// </summary>
[CanBeNull]
[JsonProperty("extattr")]
[JsonPropertyName("extattr")]
public MemberExternalAttribute? ExternalAttribute { get; set; }
/// <summary>
/// 是否邀请该成员使用企业微信(将通过微信服务通知或短信或邮件下发邀请,每天自动下发一次,最多持续3个工作日),默认值为true。
/// </summary>
[CanBeNull]
[JsonProperty("to_invite")]
[JsonPropertyName("to_invite")]
public bool? ToInvite { get; set; }
/// <summary>
/// 成员对外属性,字段详情见对外属性
/// </summary>
[CanBeNull]
[JsonProperty("external_profile")]
[JsonPropertyName("external_profile")]
public ExternalProfile? ExternalProfile { get; set; }
/// <summary>
/// 对外职务,如果设置了该值,则以此作为对外展示的职务,否则以position来展示。长度12个汉字内
/// </summary>
[CanBeNull]
[StringLength(12)]
[JsonProperty("external_position")]
[JsonPropertyName("external_position")]
public string? ExternalPosition { get; set; }
/// <summary>
/// 视频号名字(设置后,成员将对外展示该视频号)。须从企业绑定到企业微信的视频号中选择,可在“我的企业”页中查看绑定的视频号
/// </summary>
[CanBeNull]
[JsonProperty("nickname")]
[JsonPropertyName("nickname")]
public string? NickName { get; set; }
/// <summary>
/// 地址。长度最大128个字符
/// </summary>
[CanBeNull]
[StringLength(128)]
[JsonProperty("address")]
[JsonPropertyName("address")]
public string? Address { get; set; }
/// <summary>
/// 主部门
/// </summary>
[CanBeNull]
[JsonProperty("main_department")]
[JsonPropertyName("main_department")]
public int? MainDepartment { get; set; }
protected override void Validate()
{
Check.NotNullOrWhiteSpace(UserId, nameof(UserId), 64, 1);
Check.NotNullOrWhiteSpace(Name, nameof(Name), 64, 1);
Check.Length(Alias, nameof(Alias), 64, 1);
Check.Length(Position, nameof(Position), 128);
Check.Length(Email, nameof(Email), 64, 6);
Check.Length(BizEmail, nameof(BizEmail), 64, 6);
Check.Length(TelePhone, nameof(TelePhone), 32);
Check.Length(ExternalPosition, nameof(ExternalPosition), 12);
Check.Length(Address, nameof(Address), 128);
// mobile/email二者不能同时为空
if (Mobile.IsNullOrWhiteSpace() && Email.IsNullOrWhiteSpace())
{
throw new ArgumentException("mobile and email cannot be empty at the same time!");
}
// 成员所属部门id列表,不超过100个
if (Department?.Length > 0)
{
// 成员所属部门id列表,不超过100个
if (Department?.Length > 100)
{
throw new ArgumentException("The list of department ids to which members belong shall not exceed 100!");
}
// 部门排序列表个数必须和参数department的个数一致
if (Order?.Length != Department?.Length)
{
throw new ArgumentException("The number of Order must be consistent with the number of the parameter \"department\"!");
}
// 部门负责人列表个数必须和参数department的个数一致
if (IsLeaderInDept?.Length != Department?.Length)
{
throw new ArgumentException("The number of IsLeaderInDept must be consistent with the number of the parameter \"Department\"!");
}
}
// 最多只可设置一个直属上级
if (DirectLeader?.Length > 1)
{
throw new ArgumentException("At most, only one direct superior can be set up!");
}
// 只可存在两种值
if (Enable.HasValue && Enable != 0)
{
Enable = 1;
}
}
}

35
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkGetUserIdByEmailRequest.cs

@ -0,0 +1,35 @@
using JetBrains.Annotations;
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Request;
/// <summary>
/// 邮箱获取userid请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/95402" />
/// </remarks>
public class WeChatWorkGetUserIdByEmailRequest : WeChatWorkRequest
{
/// <summary>
/// 邮箱
/// </summary>
[NotNull]
[JsonProperty("email")]
[JsonPropertyName("email")]
public string Email { get; }
/// <summary>
/// 邮箱类型
/// </summary>
[CanBeNull]
[JsonProperty("email_type")]
[JsonPropertyName("email_type")]
public EmailType? EmailType { get; }
public WeChatWorkGetUserIdByEmailRequest(string email, EmailType? emailType = null)
{
Email = Check.NotNullOrWhiteSpace(email, nameof(email));
EmailType = emailType;
}
}

26
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkGetUserIdByMobileRequest.cs

@ -0,0 +1,26 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Request;
/// <summary>
/// 手机号获取userid请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/95402" />
/// </remarks>
public class WeChatWorkGetUserIdByMobileRequest : WeChatWorkRequest
{
/// <summary>
/// 用户在企业微信通讯录中的手机号码。长度为5~32个字节
/// </summary>
[NotNull]
[JsonProperty("mobile")]
[JsonPropertyName("mobile")]
public string Mobile { get; }
public WeChatWorkGetUserIdByMobileRequest(string mobile)
{
Mobile = Check.NotNullOrWhiteSpace(mobile, nameof(mobile), 32, 5);
}
}

42
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkGetUserIdListRequest.cs

@ -0,0 +1,42 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Request;
/// <summary>
/// 获取成员ID列表请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/96067" />
/// </remarks>
public class WeChatWorkGetUserIdListRequest : WeChatWorkRequest
{
/// <summary>
/// 用于分页查询的游标,字符串类型,由上一次调用返回,首次调用不填
/// </summary>
[CanBeNull]
[JsonProperty("cursor")]
[JsonPropertyName("cursor")]
public string? Cursor { get; set; }
/// <summary>
/// 分页,预期请求的数据量,取值范围 1 ~ 10000
/// </summary>
[CanBeNull]
[JsonProperty("limit")]
[JsonPropertyName("limit")]
public int? Limit { get; set; }
public WeChatWorkGetUserIdListRequest(string? cursor = null, int? limit = 100)
{
Cursor = cursor;
Limit = limit;
}
protected override void Validate()
{
if (Limit.HasValue)
{
Check.Range(Limit.Value, nameof(Limit), 1, 10000);
}
}
}

236
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Request/WeChatWorkUpdateMemberRequest.cs

@ -0,0 +1,236 @@
using JetBrains.Annotations;
using LINGYUN.Abp.WeChat.Work.Common.Members.Models;
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
using Newtonsoft.Json;
using System;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Request;
/// <summary>
/// 更新成员请求参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90197" />
/// </remarks>
public class WeChatWorkUpdateMemberRequest : WeChatWorkRequest
{
/// <summary>
/// 成员UserID。对应管理端的账号,企业内必须唯一。不区分大小写,长度为1~64个字节
/// </summary>
[NotNull]
[JsonProperty("userid")]
[JsonPropertyName("userid")]
[StringLength(64, MinimumLength = 1)]
public string UserId { get; set; }
/// <summary>
/// 如果userid由系统自动生成,则仅允许修改一次。新值可由new_userid字段指定。
/// </summary>
[CanBeNull]
[JsonProperty("new_userid")]
[JsonPropertyName("new_userid")]
[StringLength(64, MinimumLength = 1)]
public string? NewUserId { get; set; }
/// <summary>
/// 成员名称。长度为1~64个utf8字符
/// </summary>
[NotNull]
[JsonProperty("name")]
[JsonPropertyName("name")]
[StringLength(64, MinimumLength = 1)]
public string Name { get; set; }
/// <summary>
/// 成员别名。长度1~64个utf8字符
/// </summary>
[CanBeNull]
[JsonProperty("alias")]
[JsonPropertyName("alias")]
[StringLength(64, MinimumLength = 1)]
public string? Alias { get; set; }
/// <summary>
/// 手机号码。企业内必须唯一。若成员已激活企业微信,则需成员自行修改(此情况下该参数被忽略,但不会报错) ,中国大陆手机号码可省略“+86”,其他国家或地区必须要带上国际码。
/// </summary>
[CanBeNull]
[JsonProperty("mobile")]
[JsonPropertyName("mobile")]
public string? Mobile { get; set; }
/// <summary>
/// 成员所属部门id列表,不超过100个
/// </summary>
[CanBeNull]
[JsonProperty("department")]
[JsonPropertyName("department")]
public int[]? Department { get; set; }
/// <summary>
/// 部门内的排序值,默认为0。当有传入department时有效。数量必须和department一致,数值越大排序越前面。有效的值范围是[0, 2^32)
/// </summary>
[CanBeNull]
[JsonProperty("order")]
[JsonPropertyName("order")]
public int[]? Order { get; set; }
/// <summary>
/// 职务信息。长度为0~128个utf8字符
/// </summary>
[CanBeNull]
[StringLength(128)]
[JsonProperty("position")]
[JsonPropertyName("position")]
public string? Position { get; set; }
/// <summary>
/// 性别
/// </summary>
[CanBeNull]
[JsonProperty("gender")]
[JsonPropertyName("gender")]
[Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.EnumToNumberStringConverter<Gender>))]
[System.Text.Json.Serialization.JsonConverter(typeof(System.Text.Json.Serialization.EnumToNumberStringConverter<Gender>))]
public Gender? Gender { get; set; }
/// <summary>
/// 邮箱。可填写企业已有的邮箱账号,方便同事获取成员的邮箱账号以发邮件。长度6~64个字节,且为有效的email格式。企业内必须唯一。境外成员可用此邮箱登录企业微信。
/// </summary>
[CanBeNull]
[StringLength(64)]
[JsonProperty("email")]
[JsonPropertyName("email")]
public string? Email { get; set; }
/// <summary>
/// 如果企业已开通腾讯企业邮(企业微信邮箱),设置该值可创建企业邮箱账号。长度6~63个字节,且为有效的企业邮箱格式。企业内必须唯一。未填写则系统会为用户生成默认企业邮箱(由系统生成的邮箱可修改一次)。
/// </summary>
[CanBeNull]
[StringLength(64)]
[JsonProperty("biz_mail")]
[JsonPropertyName("biz_mail")]
public string? BizEmail { get; set; }
/// <summary>
/// 企业邮箱别名。长度6~63个字节,且为有效的企业邮箱格式。企业内必须唯一,最多可设置5个别名。更新时为覆盖式更新。传空结构或传空数组会清空当前企业邮箱别名。
/// </summary>
[CanBeNull]
[StringLength(63, MinimumLength = 6)]
[JsonProperty("biz_mail_alias")]
[JsonPropertyName("biz_mail_alias")]
public string? BizEmailAlias { get; set; }
/// <summary>
/// 座机。32字节以内,由纯数字、“-”、“+”或“,”组成。
/// </summary>
[CanBeNull]
[StringLength(32)]
[JsonProperty("telephone")]
[JsonPropertyName("telephone")]
public string? TelePhone { get; set; }
/// <summary>
/// 部门负责人字段,个数必须和department一致,表示在所在的部门内是否为负责人。0-否,1-是
/// </summary>
[CanBeNull]
[JsonProperty("is_leader_in_dept")]
[JsonPropertyName("is_leader_in_dept")]
public int[]? IsLeaderInDept { get; set; }
/// <summary>
/// 直属上级UserID,设置范围为企业内成员,可以设置最多1个上级
/// </summary>
[CanBeNull]
[JsonProperty("direct_leader")]
[JsonPropertyName("direct_leader")]
public string[]? DirectLeader { get; set; }
/// <summary>
/// 成员头像的mediaid,通过素材管理接口上传图片获得的mediaid
/// </summary>
[CanBeNull]
[JsonProperty("avatar_mediaid")]
[JsonPropertyName("avatar_mediaid")]
public string? AvatarMediaId { get; set; }
/// <summary>
/// 启用/禁用成员。1表示启用成员,0表示禁用成员
/// </summary>
[CanBeNull]
[JsonProperty("enable")]
[JsonPropertyName("enable")]
public int? Enable { get; set; }
/// <summary>
/// 扩展属性。扩展属性字段需要先在WEB管理端添加,见扩展属性添加方法,否则忽略未知属性的赋值。字段详情见成员扩展属性
/// </summary>
[CanBeNull]
[JsonProperty("extattr")]
[JsonPropertyName("extattr")]
public MemberExternalAttribute? ExternalAttribute { get; set; }
/// <summary>
/// 成员对外属性,字段详情见对外属性
/// </summary>
[CanBeNull]
[JsonProperty("external_profile")]
[JsonPropertyName("external_profile")]
public ExternalProfile? ExternalProfile { get; set; }
/// <summary>
/// 对外职务,如果设置了该值,则以此作为对外展示的职务,否则以position来展示。不超过12个汉字
/// </summary>
[CanBeNull]
[StringLength(12)]
[JsonProperty("external_position")]
[JsonPropertyName("external_position")]
public string? ExternalPosition { get; set; }
/// <summary>
/// 视频号名字(设置后,成员将对外展示该视频号)。须从企业绑定到企业微信的视频号中选择,可在“我的企业”页中查看绑定的视频号
/// </summary>
[CanBeNull]
[JsonProperty("nickname")]
[JsonPropertyName("nickname")]
public string? NickName { get; set; }
/// <summary>
/// 地址。长度最大128个字符
/// </summary>
[CanBeNull]
[StringLength(128)]
[JsonProperty("address")]
[JsonPropertyName("address")]
public string? Address { get; set; }
/// <summary>
/// 主部门
/// </summary>
[CanBeNull]
[JsonProperty("main_department")]
[JsonPropertyName("main_department")]
public int? MainDepartment { get; set; }
protected override void Validate()
{
Check.NotNullOrWhiteSpace(UserId, nameof(UserId), 64, 1);
Check.NotNullOrWhiteSpace(Name, nameof(Name), 64, 1);
Check.Length(Alias, nameof(Alias), 64, 1);
Check.Length(Position, nameof(Position), 128);
Check.Length(Email, nameof(Email), 64, 6);
Check.Length(BizEmail, nameof(BizEmail), 64, 6);
Check.Length(TelePhone, nameof(TelePhone), 32);
Check.Length(ExternalPosition, nameof(ExternalPosition), 12);
Check.Length(Address, nameof(Address), 128);
Check.Length(NewUserId, nameof(NewUserId), 64, 1);
// 成员所属部门id列表,不超过100个
if (Department?.Length > 0)
{
// 成员所属部门id列表,不超过100个
if (Department?.Length > 100)
{
throw new ArgumentException("The list of department ids to which members belong shall not exceed 100!");
}
// 部门排序列表个数必须和参数department的个数一致
if (Order?.Length != Department?.Length)
{
throw new ArgumentException("The number of Order must be consistent with the number of the parameter \"department\"!");
}
// 部门负责人列表个数必须和参数department的个数一致
if (IsLeaderInDept?.Length != Department?.Length)
{
throw new ArgumentException("The number of IsLeaderInDept must be consistent with the number of the parameter \"Department\"!");
}
}
// 最多只可设置一个直属上级
if (DirectLeader?.Length > 1)
{
throw new ArgumentException("At most, only one direct superior can be set up!");
}
// 只可存在两种值
if (Enable.HasValue && Enable != 0)
{
Enable = 1;
}
}
}

35
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkBulkInviteMemberResponse.cs

@ -0,0 +1,35 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Response;
/// <summary>
/// 邀请成员响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90975" />
/// </remarks>
public class WeChatWorkBulkInviteMemberResponse : WeChatWorkResponse
{
/// <summary>
/// 非法成员列表
/// </summary>
[NotNull]
[JsonProperty("invaliduser")]
[JsonPropertyName("invaliduser")]
public string[] InvalidUser { get; set; }
/// <summary>
/// 非法部门列表
/// </summary>
[NotNull]
[JsonProperty("invalidparty")]
[JsonPropertyName("invalidparty")]
public int[] InvalidParty { get; set; }
/// <summary>
/// 非法标签列表
/// </summary>
[NotNull]
[JsonProperty("invalidtag")]
[JsonPropertyName("invalidtag")]
public int[] InvalidTag { get; set; }
}

21
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkConvertToOpenIdResponse.cs

@ -0,0 +1,21 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Response;
/// <summary>
/// userid转openid响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90202" />
/// </remarks>
public class WeChatWorkConvertToOpenIdResponse : WeChatWorkResponse
{
/// <summary>
/// 企业微信成员userid对应的openid
/// </summary>
[NotNull]
[JsonProperty("openid")]
[JsonPropertyName("openid")]
public string OpenId { get; set; }
}

21
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkConvertToUserIdResponse.cs

@ -0,0 +1,21 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Response;
/// <summary>
/// openid转userid响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90202" />
/// </remarks>
public class WeChatWorkConvertToUserIdResponse : WeChatWorkResponse
{
/// <summary>
/// 该openid在企业微信对应的成员userid
/// </summary>
[NotNull]
[JsonProperty("userid")]
[JsonPropertyName("userid")]
public string UserId { get; set; }
}

22
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkCreateMemberResponse.cs

@ -0,0 +1,22 @@
using JetBrains.Annotations;
using LINGYUN.Abp.WeChat.Work.Contacts.Departments.Models;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Response;
/// <summary>
/// 创建成员响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90195" />
/// </remarks>
public class WeChatWorkCreateMemberResponse : WeChatWorkResponse
{
/// <summary>
/// 因填写不存在的部门,新增的部门列表
/// </summary>
[CanBeNull]
[JsonProperty("created_department_list")]
[JsonPropertyName("created_department_list")]
public Department[]? CreatedDepartmentList { get; set; }
}

21
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetJoinQrCodeResponse.cs

@ -0,0 +1,21 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Response;
/// <summary>
/// 获取加入企业二维码响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/91714" />
/// </remarks>
public class WeChatWorkGetJoinQrCodeResponse : WeChatWorkResponse
{
/// <summary>
/// 二维码链接,有效期7天
/// </summary>
[NotNull]
[JsonProperty("join_qrcode")]
[JsonPropertyName("join_qrcode")]
public string JoinQrcCode { get; set; }
}

22
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetMemberListResponse.cs

@ -0,0 +1,22 @@
using JetBrains.Annotations;
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Response;
/// <summary>
/// 获取部门成员详情响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90201" />
/// </remarks>
public class WeChatWorkGetMemberListResponse : WeChatWorkResponse
{
/// <summary>
/// 成员列表
/// </summary>
[NotNull]
[JsonProperty("userlist")]
[JsonPropertyName("userlist")]
public MemberInfo[] UserList { get; set; }
}

170
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetMemberResponse.cs

@ -0,0 +1,170 @@
using JetBrains.Annotations;
using LINGYUN.Abp.WeChat.Work.Common.Members.Models;
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Response;
/// <summary>
/// 读取成员响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90196" />
/// </remarks>
public class WeChatWorkGetMemberResponse : WeChatWorkResponse
{
/// <summary>
/// 全局唯一
/// </summary>
[NotNull]
[JsonProperty("open_userid")]
[JsonPropertyName("open_userid")]
public string OpenUserId { get; set; }
/// <summary>
/// 成员UserID
/// </summary>
[NotNull]
[JsonProperty("userid")]
[JsonPropertyName("userid")]
public string UserId { get; set; }
/// <summary>
/// 成员名称
/// </summary>
[NotNull]
[JsonProperty("name")]
[JsonPropertyName("name")]
public string Name { get; set; }
/// <summary>
/// 手机号码
/// </summary>
[CanBeNull]
[JsonProperty("mobile")]
[JsonPropertyName("mobile")]
public string? Mobile { get; set; }
/// <summary>
/// 成员所属部门id列表
/// </summary>
[NotNull]
[JsonProperty("department")]
[JsonPropertyName("department")]
public int[] Department { get; set; }
/// <summary>
/// 主部门
/// </summary>
[CanBeNull]
[JsonProperty("main_department")]
[JsonPropertyName("main_department")]
public int? MainDepartment { get; set; }
/// <summary>
/// 部门内的排序值,默认为0。数量必须和department一致,数值越大排序越前面。值范围是[0, 2^32)
/// </summary>
[NotNull]
[JsonProperty("order")]
[JsonPropertyName("order")]
public int[]? Order { get; set; }
/// <summary>
/// 员工个人二维码
/// </summary>
[CanBeNull]
[JsonProperty("qr_code")]
[JsonPropertyName("qr_code")]
public string? QrCode { get; set; }
/// <summary>
/// 职务信息
/// </summary>
[CanBeNull]
[JsonProperty("position")]
[JsonPropertyName("position")]
public string? Position { get; set; }
/// <summary>
/// 性别
/// </summary>
[CanBeNull]
[JsonProperty("gender")]
[JsonPropertyName("gender")]
public Gender? Gender { get; set; }
/// <summary>
/// 邮箱
/// </summary>
[CanBeNull]
[JsonProperty("email")]
[JsonPropertyName("email")]
public string? Email { get; set; }
/// <summary>
/// 企业邮箱
/// </summary>
[CanBeNull]
[JsonProperty("biz_mail")]
[JsonPropertyName("biz_mail")]
public string? BizEmail { get; set; }
/// <summary>
/// 表示在所在的部门内是否为部门负责人,数量与department一致
/// </summary>
[CanBeNull]
[JsonProperty("is_leader_in_dept")]
[JsonPropertyName("is_leader_in_dept")]
public int[]? IsLeaderInDept { get; set; }
/// <summary>
/// 直属上级UserID,返回在应用可见范围内的直属上级列表,最多有1个直属上级
/// </summary>
[CanBeNull]
[JsonProperty("direct_leader")]
[JsonPropertyName("direct_leader")]
public string[]? DirectLeader { get; set; }
/// <summary>
/// 头像url
/// </summary>
[CanBeNull]
[JsonProperty("avatar")]
[JsonPropertyName("avatar")]
public string? Avatar { get; set; }
/// <summary>
/// 头像缩略图url
/// </summary>
[CanBeNull]
[JsonProperty("thumb_avatar")]
[JsonPropertyName("thumb_avatar")]
public string? ThumbAvatar { get; set; }
/// <summary>
/// 座机
/// </summary>
[CanBeNull]
[JsonProperty("telephone")]
[JsonPropertyName("telephone")]
public string? TelePhone { get; set; }
/// <summary>
/// 别名
/// </summary>
[CanBeNull]
[JsonProperty("alias")]
[JsonPropertyName("alias")]
public string? Alias { get; set; }
/// <summary>
/// 地址
/// </summary>
[CanBeNull]
[JsonProperty("address")]
[JsonPropertyName("address")]
public string? Address { get; set; }
/// <summary>
/// 激活状态
/// </summary>
[NotNull]
[JsonProperty("status")]
[JsonPropertyName("status")]
public MemberStatus Status { get; set; }
/// <summary>
/// 扩展属性
/// </summary>
[CanBeNull]
[JsonProperty("extattr")]
[JsonPropertyName("extattr")]
public MemberExternalAttribute? ExternalAttribute { get; set; }
/// <summary>
/// 对外职务,如果设置了该值,则以此作为对外展示的职务,否则以position来展示。
/// </summary>
[CanBeNull]
[JsonProperty("external_position")]
[JsonPropertyName("external_position")]
public string? ExternalPosition { get; set; }
}

22
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetSimpleMemberListResponse.cs

@ -0,0 +1,22 @@
using JetBrains.Annotations;
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Response;
/// <summary>
/// 获取部门成员响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/90200" />
/// </remarks>
public class WeChatWorkGetSimpleMemberListResponse : WeChatWorkResponse
{
/// <summary>
/// 成员列表
/// </summary>
[NotNull]
[JsonProperty("userlist")]
[JsonPropertyName("userlist")]
public DepartmentMember[] UserList { get; set; }
}

29
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetUserIdListResponse.cs

@ -0,0 +1,29 @@
using JetBrains.Annotations;
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Response;
/// <summary>
/// 获取成员ID列表响应参数
/// </summary>
/// <remarks>
/// 详情见: <see href="https://developer.work.weixin.qq.com/document/path/96067" />
/// </remarks>
public class WeChatWorkGetUserIdListResponse : WeChatWorkResponse
{
/// <summary>
/// 用户-部门关系列表
/// </summary>
[CanBeNull]
[JsonProperty("next_cursor")]
[JsonPropertyName("next_cursor")]
public string? NextCursor { get; set; }
/// <summary>
/// 分页游标,下次请求时填写以获取之后分页的记录。如果该字段返回空则表示已没有更多数据
/// </summary>
[NotNull]
[JsonProperty("dept_user")]
[JsonPropertyName("dept_user")]
public DepartmentUser[] DepartmentUser { get; set; }
}

18
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/Response/WeChatWorkGetUserIdResponse.cs

@ -0,0 +1,18 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members.Response;
/// <summary>
/// 获取userid响应参数
/// </summary>
public class WeChatWorkGetUserIdResponse : WeChatWorkResponse
{
/// <summary>
/// 成员UserID。对应管理端的账号,企业内必须唯一。不区分大小写,长度为1~64个字节。注意:第三方应用获取的值是密文的userid
/// </summary>
[NotNull]
[JsonProperty("userid")]
[JsonPropertyName("userid")]
public string UserId { get; set; }
}

209
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Members/WeChatWorkMemberProvider.cs

@ -0,0 +1,209 @@
using LINGYUN.Abp.WeChat.Work.Contacts.Features;
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Models;
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Request;
using LINGYUN.Abp.WeChat.Work.Contacts.Members.Response;
using LINGYUN.Abp.WeChat.Work.Contacts.Token;
using LINGYUN.Abp.WeChat.Work.Token;
using Microsoft.Extensions.DependencyInjection;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Features;
using Volo.Abp.Json;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Members;
[RequiresFeature(WeChatWorkContactsFeatureNames.Enable)]
public class WeChatWorkMemberProvider : IWeChatWorkMemberProvider, ISingletonDependency
{
protected IJsonSerializer JsonSerializer { get; }
protected IHttpClientFactory HttpClientFactory { get; }
protected IWeChatWorkTokenProvider WeChatWorkTokenProvider { get; }
protected IWeChatWorkContactTokenProvider WeChatWorkContactTokenProvider { get; }
public WeChatWorkMemberProvider(
IJsonSerializer jsonSerializer,
IHttpClientFactory httpClientFactory,
IWeChatWorkTokenProvider weChatWorkTokenProvider,
IWeChatWorkContactTokenProvider weChatWorkContactTokenProvider)
{
JsonSerializer = jsonSerializer;
HttpClientFactory = httpClientFactory;
WeChatWorkTokenProvider = weChatWorkTokenProvider;
WeChatWorkContactTokenProvider = weChatWorkContactTokenProvider;
}
public async virtual Task<WeChatWorkGetMemberResponse> GetMemberAsync(
string userId,
CancellationToken cancellationToken = default)
{
Check.NotNullOrWhiteSpace(userId, nameof(userId), 64, 1);
var token = await WeChatWorkTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.GetMemberAsync(token.AccessToken, userId, cancellationToken);
}
public async virtual Task<WeChatWorkCreateMemberResponse> CreateMemberAsync(
WeChatWorkCreateMemberRequest request,
CancellationToken cancellationToken = default)
{
Check.NotNull(request, nameof(request));
var token = await WeChatWorkContactTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.CreateMemberAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkResponse> UpdateMemberAsync(
WeChatWorkUpdateMemberRequest request,
CancellationToken cancellationToken = default)
{
Check.NotNull(request, nameof(request));
var token = await WeChatWorkContactTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.UpdateMemberAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkResponse> DeleteMemberAsync(
string userId,
CancellationToken cancellationToken = default)
{
Check.NotNullOrWhiteSpace(userId, nameof(userId), 64, 1);
var token = await WeChatWorkContactTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.DeleteMemberAsync(token.AccessToken, userId, cancellationToken);
}
public async virtual Task<WeChatWorkResponse> BulkDeleteMemberAsync(
WeChatWorkBulkDeleteMemberRequest request,
CancellationToken cancellationToken = default)
{
Check.NotNull(request, nameof(request));
var token = await WeChatWorkContactTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.BulkDeleteMemberAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkGetSimpleMemberListResponse> GetSimpleMemberListAsync(
int departmentId,
CancellationToken cancellationToken = default)
{
Check.NotDefaultOrNull<int>(departmentId, nameof(departmentId));
var token = await WeChatWorkTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.GetSimpleMemberListAsync(token.AccessToken, departmentId, cancellationToken);
}
public async virtual Task<WeChatWorkGetMemberListResponse> GetMemberListAsync(
int departmentId,
CancellationToken cancellationToken = default)
{
Check.NotDefaultOrNull<int>(departmentId, nameof(departmentId));
var token = await WeChatWorkTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.GetMemberListAsync(token.AccessToken, departmentId, cancellationToken);
}
public async virtual Task<WeChatWorkConvertToOpenIdResponse> ConvertToOpenIdAsync(
WeChatWorkConvertToOpenIdRequest request,
CancellationToken cancellationToken = default)
{
Check.NotNull(request, nameof(request));
var token = await WeChatWorkTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.ConvertToOpenIdAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkConvertToUserIdResponse> ConvertToUserIdAsync(
WeChatWorkConvertToUserIdRequest request,
CancellationToken cancellationToken = default)
{
Check.NotNull(request, nameof(request));
var token = await WeChatWorkTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.ConvertToUserIdAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkResponse> AuthSuccessAsync(
string userId,
CancellationToken cancellationToken = default)
{
Check.NotNull(userId, nameof(userId));
var token = await WeChatWorkTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.AuthSuccessAsync(token.AccessToken, userId, cancellationToken);
}
public async virtual Task<WeChatWorkBulkInviteMemberResponse> BulkInviteMemberAsync(
WeChatWorkBulkInviteMemberRequest request,
CancellationToken cancellationToken = default)
{
Check.NotNull(request, nameof(request));
var token = await WeChatWorkTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.BulkInviteMemberAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkGetJoinQrCodeResponse> GetJoinQrCodeAsync(
QrCodeSizeType sizeType,
CancellationToken cancellationToken = default)
{
var token = await WeChatWorkContactTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.GetJoinQrCodeAsync(token.AccessToken, sizeType, cancellationToken);
}
public async virtual Task<WeChatWorkGetUserIdResponse> GetUserIdByMobileAsync(
WeChatWorkGetUserIdByMobileRequest request,
CancellationToken cancellationToken = default)
{
var token = await WeChatWorkTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.GetUserIdByMobileAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkGetUserIdResponse> GetUserIdByEmailAsync(
WeChatWorkGetUserIdByEmailRequest request,
CancellationToken cancellationToken = default)
{
var token = await WeChatWorkTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.GetUserIdByEmailAsync(token.AccessToken, request, cancellationToken);
}
public async virtual Task<WeChatWorkGetUserIdListResponse> GetUserIdListAsync(
WeChatWorkGetUserIdListRequest request,
CancellationToken cancellationToken = default)
{
var token = await WeChatWorkContactTokenProvider.GetTokenAsync(cancellationToken);
var client = HttpClientFactory.CreateWeChatWorkApiClient();
return await client.GetUserIdListAsync(token.AccessToken, request, cancellationToken);
}
}

24
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/BatchJobResultEvent.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/BatchJobResultEvent.cs

@ -1,11 +1,15 @@
using LINGYUN.Abp.WeChat.Common.Messages;
using LINGYUN.Abp.WeChat.Work.Common.Messages;
using System.Xml.Serialization;
using Volo.Abp.EventBus;
namespace LINGYUN.Abp.WeChat.Work.Common.Messages.Models;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Messages.Models;
/// <summary>
/// 异步任务完成事件
/// 异步任务完成通知
/// </summary>
/// <remarks>
/// 本事件是成员在使用异步任务接口时,用于接收任务执行完毕的结果通知。
/// </remarks>
[EventName("batch_job_result")]
public class BatchJobResultEvent : WeChatWorkEventMessage
{
@ -13,14 +17,15 @@ public class BatchJobResultEvent : WeChatWorkEventMessage
/// 异步任务信息
/// </summary>
[XmlElement("BatchJob")]
public BatchJobResult BatchJob { get; set; }
public BatchJob BatchJob { get; set; }
public override WeChatMessageEto ToEto()
{
return new WeChatWorkEventMessageEto<BatchJobResultEvent>(this);
}
}
public class BatchJobResult
public class BatchJob
{
/// <summary>
/// 异步任务id,最大长度为64字符
@ -28,12 +33,7 @@ public class BatchJobResult
[XmlElement("JobId")]
public string JobId { get; set; }
/// <summary>
/// 操作类型,字符串,
/// 目前分别有:
/// sync_user(增量更新成员)、
/// replace_user(全量覆盖成员)、
/// invite_user(邀请成员关注)、
/// replace_party(全量覆盖部门)
/// 操作类型,字符串,目前分别有:sync_user(增量更新成员)、 replace_user(全量覆盖成员)、invite_user(邀请成员关注)、replace_party(全量覆盖部门)
/// </summary>
[XmlElement("JobType")]
public string JobType { get; set; }
@ -43,8 +43,8 @@ public class BatchJobResult
[XmlElement("ErrCode")]
public int ErrCode { get; set; }
/// <summary>
/// 返回码
/// 返回码的文本描述内容
/// </summary>
[XmlElement("ErrMsg")]
public string ErrMsg { get; set; }
}
}

3
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/CreateDepartmentEvent.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/CreateDepartmentEvent.cs

@ -1,8 +1,9 @@
using LINGYUN.Abp.WeChat.Common.Messages;
using LINGYUN.Abp.WeChat.Work.Common.Messages;
using System.Xml.Serialization;
using Volo.Abp.EventBus;
namespace LINGYUN.Abp.WeChat.Work.Common.Messages.Models;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Messages.Models;
/// <summary>
/// 新增部门事件
/// </summary>

3
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/CreateUserEvent.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/CreateUserEvent.cs

@ -1,7 +1,8 @@
using LINGYUN.Abp.WeChat.Common.Messages;
using LINGYUN.Abp.WeChat.Work.Common.Messages;
using Volo.Abp.EventBus;
namespace LINGYUN.Abp.WeChat.Work.Common.Messages.Models;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Messages.Models;
/// <summary>
/// 新增成员事件
/// </summary>

3
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/DeleteDepartmentEvent.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DeleteDepartmentEvent.cs

@ -1,8 +1,9 @@
using LINGYUN.Abp.WeChat.Common.Messages;
using LINGYUN.Abp.WeChat.Work.Common.Messages;
using System.Xml.Serialization;
using Volo.Abp.EventBus;
namespace LINGYUN.Abp.WeChat.Work.Common.Messages.Models;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Messages.Models;
/// <summary>
/// 删除部门事件
/// </summary>

3
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/DeleteUserEvent.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DeleteUserEvent.cs

@ -1,8 +1,9 @@
using LINGYUN.Abp.WeChat.Common.Messages;
using LINGYUN.Abp.WeChat.Work.Common.Messages;
using System.Xml.Serialization;
using Volo.Abp.EventBus;
namespace LINGYUN.Abp.WeChat.Work.Common.Messages.Models;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Messages.Models;
/// <summary>
/// 删除成员事件
/// </summary>

5
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/DepartmentUpdateEvent.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/DepartmentUpdateEvent.cs

@ -1,6 +1,7 @@
using System.Xml.Serialization;
using LINGYUN.Abp.WeChat.Work.Common.Messages;
using System.Xml.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Common.Messages.Models;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Messages.Models;
/// <summary>
/// 部门变更事件
/// </summary>

3
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/UpdateDepartmentEvent.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UpdateDepartmentEvent.cs

@ -1,7 +1,8 @@
using LINGYUN.Abp.WeChat.Common.Messages;
using LINGYUN.Abp.WeChat.Work.Common.Messages;
using Volo.Abp.EventBus;
namespace LINGYUN.Abp.WeChat.Work.Common.Messages.Models;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Messages.Models;
/// <summary>
/// 更新部门事件
/// </summary>

3
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/UpdateUserEvent.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UpdateUserEvent.cs

@ -1,8 +1,9 @@
using LINGYUN.Abp.WeChat.Common.Messages;
using LINGYUN.Abp.WeChat.Work.Common.Messages;
using System.Xml.Serialization;
using Volo.Abp.EventBus;
namespace LINGYUN.Abp.WeChat.Work.Common.Messages.Models;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Messages.Models;
/// <summary>
/// 更新成员事件
/// </summary>

6
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/UserChangeEvent.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UserChangeEvent.cs

@ -1,6 +1,8 @@
using System.Xml.Serialization;
using LINGYUN.Abp.WeChat.Work.Common.Members.Models;
using LINGYUN.Abp.WeChat.Work.Common.Messages;
using System.Xml.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Common.Messages.Models;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Messages.Models;
/// <summary>
/// 成员变更事件
/// </summary>

3
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Common/LINGYUN/Abp/WeChat/Work/Common/Messages/Models/UserTagChangeEvent.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Messages/Models/UserTagChangeEvent.cs

@ -1,8 +1,9 @@
using LINGYUN.Abp.WeChat.Common.Messages;
using LINGYUN.Abp.WeChat.Work.Common.Messages;
using System.Xml.Serialization;
using Volo.Abp.EventBus;
namespace LINGYUN.Abp.WeChat.Work.Common.Messages.Models;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Messages.Models;
/// <summary>
/// 标签成员变更事件
/// </summary>

30
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Settings/WeChatWorkContactSettingDefinitionProvider.cs

@ -0,0 +1,30 @@
using LINGYUN.Abp.WeChat.Work.Localization;
using Volo.Abp.Localization;
using Volo.Abp.Settings;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Settings;
public class WeChatWorkContactSettingDefinitionProvider : SettingDefinitionProvider
{
public override void Define(ISettingDefinitionContext context)
{
context.Add(
new SettingDefinition(
WeChatWorkContactSettingNames.Secret,
displayName: L("DisplayName:WeChatWorkContact.Secret"),
description: L("Description:WeChatWorkContact.Secret"),
isVisibleToClients: false,
isEncrypted: true)
.WithProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName)
);
}
private static ILocalizableString L(string name)
{
return LocalizableString.Create<WeChatWorkResource>(name);
}
}

12
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Settings/WeChatWorkContactSettingNames.cs

@ -0,0 +1,12 @@
using LINGYUN.Abp.WeChat.Work.Settings;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Settings;
public static class WeChatWorkContactSettingNames
{
public const string Prefix = WeChatWorkSettingNames.Prefix + ".Contacts";
/// <summary>
/// 通讯录应用Srcret
/// </summary>
public const string Secret = Prefix + ".Secret";
}

20
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Tags/IWeChatWorkTagProvider.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/IWeChatWorkTagProvider.cs

@ -1,9 +1,9 @@
using LINGYUN.Abp.WeChat.Work.Tags.Request;
using LINGYUN.Abp.WeChat.Work.Tags.Response;
using LINGYUN.Abp.WeChat.Work.Contacts.Tags.Request;
using LINGYUN.Abp.WeChat.Work.Contacts.Tags.Response;
using System.Threading;
using System.Threading.Tasks;
namespace LINGYUN.Abp.WeChat.Work.Tags;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Tags;
/// <summary>
/// 标签管理接口
/// </summary>
@ -13,7 +13,7 @@ public interface IWeChatWorkTagProvider
/// 创建标签
/// </summary>
/// <remarks>
/// 详情见:https://developer.work.weixin.qq.com/document/path/90210
/// 详情见:<see href="https://developer.work.weixin.qq.com/document/path/90210"/>
/// </remarks>
/// <param name="request">创建标签请求参数</param>
/// <param name="cancellationToken"></param>
@ -25,7 +25,7 @@ public interface IWeChatWorkTagProvider
/// 更新标签名字
/// </summary>
/// <remarks>
/// 详情见:https://developer.work.weixin.qq.com/document/path/90211
/// 详情见:<see href="https://developer.work.weixin.qq.com/document/path/90211"/>
/// </remarks>
/// <param name="request">更新标签名字请求参数</param>
/// <param name="cancellationToken"></param>
@ -37,7 +37,7 @@ public interface IWeChatWorkTagProvider
/// 删除标签
/// </summary>
/// <remarks>
/// 详情见:https://developer.work.weixin.qq.com/document/path/90212
/// 详情见:<see href="https://developer.work.weixin.qq.com/document/path/90212"/>
/// </remarks>
/// <param name="request">删除标签请求参数</param>
/// <param name="cancellationToken"></param>
@ -49,7 +49,7 @@ public interface IWeChatWorkTagProvider
/// 获取标签成员
/// </summary>
/// <remarks>
/// 详情见:https://developer.work.weixin.qq.com/document/path/90213
/// 详情见:<see href="https://developer.work.weixin.qq.com/document/path/90213"/>
/// </remarks>
/// <param name="request">获取标签成员请求参数</param>
/// <param name="cancellationToken"></param>
@ -61,7 +61,7 @@ public interface IWeChatWorkTagProvider
/// 增加标签成员
/// </summary>
/// <remarks>
/// 详情见:https://developer.work.weixin.qq.com/document/path/90214
/// 详情见:<see href="https://developer.work.weixin.qq.com/document/path/90214"/>
/// </remarks>
/// <param name="request">增加标签成员请求参数</param>
/// <param name="cancellationToken"></param>
@ -73,7 +73,7 @@ public interface IWeChatWorkTagProvider
/// 删除标签成员
/// </summary>
/// <remarks>
/// 详情见:https://developer.work.weixin.qq.com/document/path/90214
/// 详情见:<see href="https://developer.work.weixin.qq.com/document/path/90215"/>
/// </remarks>
/// <param name="request">增加标签成员请求参数</param>
/// <param name="cancellationToken"></param>
@ -85,7 +85,7 @@ public interface IWeChatWorkTagProvider
/// 获取标签列表
/// </summary>
/// <remarks>
/// 详情见:https://developer.work.weixin.qq.com/document/path/90214
/// 详情见:<see href="https://developer.work.weixin.qq.com/document/path/90216"/>
/// </remarks>
/// <param name="cancellationToken"></param>
/// <returns>获取标签列表响应参数</returns>

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Tags/Models/TagInfo.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Models/TagInfo.cs

@ -2,7 +2,7 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Tags.Models;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Tags.Models;
/// <summary>
/// 标签
/// </summary>

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Tags/Models/TagUserInfo.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Models/TagUserInfo.cs

@ -2,7 +2,7 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Tags.Models;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Tags.Models;
/// <summary>
/// 标签中包含的成员
/// </summary>

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Tags/Request/WeChatWorkGetTagRequest.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Request/WeChatWorkGetTagRequest.cs

@ -3,7 +3,7 @@ using Newtonsoft.Json;
using System.Text.Json.Serialization;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Tags.Request;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Tags.Request;
/// <summary>
/// 获取标签请求参数
/// </summary>

4
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Tags/Request/WeChatWorkTagChangeMemberRequest.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Request/WeChatWorkTagChangeMemberRequest.cs

@ -5,11 +5,11 @@ using System.Collections.Generic;
using System.Text.Json.Serialization;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Tags.Request;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Tags.Request;
/// <summary>
/// 标签成员变更请求参数
/// </summary>
public class WeChatWorkTagChangeMemberRequest
public class WeChatWorkTagChangeMemberRequest : WeChatWorkRequest
{
/// <summary>
/// 标签id,非负整型,指定此参数时新增的标签会生成对应的标签id,不指定时则以目前最大的id自增。

4
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Tags/Request/WeChatWorkTagCreateRequest.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Request/WeChatWorkTagCreateRequest.cs

@ -4,11 +4,11 @@ using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Tags.Request;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Tags.Request;
/// <summary>
/// 创建标签请求参数
/// </summary>
public class WeChatWorkTagCreateRequest
public class WeChatWorkTagCreateRequest : WeChatWorkRequest
{
/// <summary>
/// 标签id,非负整型,指定此参数时新增的标签会生成对应的标签id,不指定时则以目前最大的id自增。

4
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Tags/Request/WeChatWorkTagUpdateRequest.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Request/WeChatWorkTagUpdateRequest.cs

@ -4,11 +4,11 @@ using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;
using Volo.Abp;
namespace LINGYUN.Abp.WeChat.Work.Tags.Request;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Tags.Request;
/// <summary>
/// 更新标签请求参数
/// </summary>
public class WeChatWorkTagUpdateRequest
public class WeChatWorkTagUpdateRequest : WeChatWorkRequest
{
/// <summary>
/// 标签id,非负整型,指定此参数时新增的标签会生成对应的标签id,不指定时则以目前最大的id自增。

5
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Tags/Response/WeChatWorkTagChangeMemberResponse.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagChangeMemberResponse.cs

@ -1,9 +1,8 @@
using JetBrains.Annotations;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Tags.Response;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Tags.Response;
/// <summary>
/// 标签成员变更响应参数
/// </summary>
@ -22,5 +21,5 @@ public class WeChatWorkTagChangeMemberResponse : WeChatWorkResponse
[CanBeNull]
[JsonProperty("invalidparty")]
[JsonPropertyName("invalidparty")]
public List<int> InvalidPart { get; set; }
public int[]? InvalidPart { get; set; }
}

2
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work/LINGYUN/Abp/WeChat/Work/Tags/Response/WeChatWorkTagCreateResponse.cs → aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Work.Contacts/LINGYUN/Abp/WeChat/Work/Contacts/Tags/Response/WeChatWorkTagCreateResponse.cs

@ -2,7 +2,7 @@
using Newtonsoft.Json;
using System.Text.Json.Serialization;
namespace LINGYUN.Abp.WeChat.Work.Tags.Response;
namespace LINGYUN.Abp.WeChat.Work.Contacts.Tags.Response;
/// <summary>
/// 创建标签响应参数
/// </summary>

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save