label_relationship.api 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. import "../base.api"
  2. type (
  3. // ContactLabelList | Contact标签列表
  4. ContactLabelList {
  5. // label
  6. Label *string `json:"label,optional"`
  7. // value
  8. Value *uint64 `json:"value,optional"`
  9. }
  10. // The response data of contact information | Contact信息
  11. ContactInfo {
  12. BaseIDInfo
  13. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  14. Status *uint8 `json:"status,optional"`
  15. // 属主微信id
  16. WxWxid *string `json:"wxWxid,optional"`
  17. // 属主微信昵称
  18. WxWxidNickname *string `json:"wxWxidNickname,optional"`
  19. // 联系人类型:1好友,2群组,3公众号,4企业微信联系人
  20. Type *int `json:"type,optional"`
  21. // 微信id 公众号微信ID
  22. Wxid *string `json:"wxid,optional"`
  23. // 微信账号
  24. Account *string `json:"account,optional"`
  25. // 微信昵称 群备注名称
  26. Nickname *string `json:"nickname,optional"`
  27. // 备注名
  28. Markname *string `json:"markname,optional"`
  29. // 头像
  30. Headimg *string `json:"headimg,optional"`
  31. // 性别 0未知 1男 2女
  32. Sex *int `json:"sex,optional"`
  33. // 星标 65/67=星标 1/3=未星标
  34. Starrole *string `json:"starrole,optional"`
  35. // 不让他看我的朋友圈 0可以看 1不让看
  36. Dontseeit *int `json:"dontseeit,optional"`
  37. // 不看他的朋友圈 0可以看 1不看 1=开启了不看他 128/129=仅聊天
  38. Dontseeme *int `json:"dontseeme,optional"`
  39. // 所属标签id清单,多开会用逗号隔开
  40. Lag *string `json:"lag,optional"`
  41. // 群组id
  42. Gid *string `json:"gid,optional"`
  43. // 群组名称
  44. Gname *string `json:"gname,optional"`
  45. // v3数据
  46. V3 *string `json:"v3,optional"`
  47. // Label Relationships | 标签关系
  48. LabelRelationships []ContactLabelList `json:"labelRelationships,optional"`
  49. // 组织ID
  50. OrganizationId *uint64 `json:"organizationId,optional"`
  51. // 是否在黑名单中
  52. IsInBlockList *bool `json:"isInBlockList,optional"`
  53. }
  54. // The response data of label information | Label信息
  55. LabelInfo {
  56. BaseIDInfo
  57. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  58. Status *uint8 `json:"status,optional"`
  59. // 标签类型:1好友,2群组,3公众号,4企业微信联系人
  60. Type *int `json:"type,optional"`
  61. // 标签名称
  62. Name *string `json:"name,optional"`
  63. // 标签来源:1后台创建 2个微同步
  64. From *int `json:"from,optional"`
  65. // 标签模式:1动态 2静态
  66. Mode *int `json:"mode,optional"`
  67. // 标签的触达条件
  68. Conditions *string `json:"conditions,optional"`
  69. // 组织ID
  70. OrganizationId *uint64 `json:"organizationId,optional"`
  71. // Label Relationships | 标签关系
  72. LabelRelationships []LabelRelationshipInfo `json:"labelRelationships,optional"`
  73. }
  74. // The response data of label relationship information | LabelRelationship信息
  75. LabelRelationshipInfo {
  76. BaseIDInfo
  77. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  78. Status *uint8 `json:"status,optional"`
  79. // 标签 ID
  80. LabelId *uint64 `json:"labelId,optional"`
  81. // 联系人 ID
  82. ContactId *uint64 `json:"contactId,optional"`
  83. // Contact information | 联系人信息
  84. Contact ContactInfo `json:"contact,optional"`
  85. // Label information | 标签信息
  86. Label LabelInfo `json:"label,optional"`
  87. // 组织ID
  88. OrganizationId *uint64 `json:"organizationId,optional"`
  89. }
  90. // The response data of label relationship information | LabelRelationship信息
  91. LabelRelationshipsInfo {
  92. BaseIDInfo
  93. // 更新类型:为空或“all”时表示全量更新,为 “add” 时表示仅追加
  94. UpdateType *string `json:"updateType,optional"`
  95. // 标签 ID
  96. LabelIds []uint64 `json:"labelIds,optional"`
  97. // 联系人 ID
  98. ContactId *uint64 `json:"contactId,optional"`
  99. }
  100. BatchLabelRelationshipsInfo {
  101. // 更新类型:为1 时表示增加标签,为 -1 时表示移除标签
  102. UpdateType int `json:"updateType,optional"`
  103. // 标签 ID
  104. LabelIds []uint64 `json:"labelIds,optional"`
  105. // 联系人 ID
  106. ContactIds []uint64 `json:"contactIds,optional"`
  107. }
  108. // The response data of label relationship list | LabelRelationship列表数据
  109. LabelRelationshipListResp {
  110. BaseDataInfo
  111. // LabelRelationship list data | LabelRelationship列表数据
  112. Data LabelRelationshipListInfo `json:"data"`
  113. }
  114. // LabelRelationship list data | LabelRelationship列表数据
  115. LabelRelationshipListInfo {
  116. BaseListInfo
  117. // The API list data | LabelRelationship列表数据
  118. Data []LabelRelationshipInfo `json:"data"`
  119. }
  120. // Get label relationship list request params | LabelRelationship列表请求参数
  121. LabelRelationshipListReq {
  122. PageInfo
  123. }
  124. // LabelRelationship information response | LabelRelationship信息返回体
  125. LabelRelationshipInfoResp {
  126. BaseDataInfo
  127. // LabelRelationship information | LabelRelationship数据
  128. Data LabelRelationshipInfo `json:"data"`
  129. }
  130. )
  131. @server(
  132. jwt: Auth
  133. group: label_relationship
  134. middleware: Authority
  135. )
  136. service Wechat {
  137. // Create label relationship information | 创建LabelRelationship
  138. @handler createLabelRelationship
  139. post /label_relationship/create (LabelRelationshipInfo) returns (BaseMsgResp)
  140. // Update label relationship information | 更新LabelRelationship
  141. @handler updateLabelRelationship
  142. post /label_relationship/update (LabelRelationshipInfo) returns (BaseMsgResp)
  143. // Update label relationships information | 更新联系人所有 LabelRelationship
  144. @handler updateLabelRelationships
  145. post /label_relationship/update_contact_labels (LabelRelationshipsInfo) returns (BaseMsgResp)
  146. // Batch Update label relationships information | 批量更新联系人所有 LabelRelationship
  147. @handler batchUpdateLabelRelationships
  148. post /label_relationship/batch_update_contact_labels (BatchLabelRelationshipsInfo) returns (BaseMsgResp)
  149. // Delete label relationship information | 删除LabelRelationship信息
  150. @handler deleteLabelRelationship
  151. post /label_relationship/delete (IDsReq) returns (BaseMsgResp)
  152. // Get label relationship list | 获取LabelRelationship列表
  153. @handler getLabelRelationshipList
  154. post /label_relationship/list (LabelRelationshipListReq) returns (LabelRelationshipListResp)
  155. // Get label relationship by ID | 通过ID获取LabelRelationship
  156. @handler getLabelRelationshipById
  157. post /label_relationship (IDReq) returns (LabelRelationshipInfoResp)
  158. }