label_relationship.api 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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. Ctype *uint64 `json:"ctype,optional"`
  54. Cname *string `json:"cname,optional"`
  55. Cage *int `json:"cage,optional"`
  56. Carea *string `json:"carea,optional"`
  57. Cbirthday *string `json:"cbirthday,optional"`
  58. Cbirtharea *string `json:"cbirtharea,optional"`
  59. CidcardNo *string `json:"cidcardNo,optional"`
  60. Ctitle *string `json:"ctitle,optional"`
  61. Cc *string `json:"cc,optional"`
  62. Phone *string `json:"phone,optional"`
  63. }
  64. // The response data of label information | Label信息
  65. LabelInfo {
  66. BaseIDInfo
  67. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  68. Status *uint8 `json:"status,optional"`
  69. // 标签类型:1好友,2群组,3公众号,4企业微信联系人
  70. Type *int `json:"type,optional"`
  71. // 标签名称
  72. Name *string `json:"name,optional"`
  73. // 标签来源:1后台创建 2个微同步
  74. From *int `json:"from,optional"`
  75. // 标签模式:1动态 2静态
  76. Mode *int `json:"mode,optional"`
  77. // 标签的触达条件
  78. Conditions *string `json:"conditions,optional"`
  79. // 组织ID
  80. OrganizationId *uint64 `json:"organizationId,optional"`
  81. // Label Relationships | 标签关系
  82. LabelRelationships []LabelRelationshipInfo `json:"labelRelationships,optional"`
  83. }
  84. // The response data of label relationship information | LabelRelationship信息
  85. LabelRelationshipInfo {
  86. BaseIDInfo
  87. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  88. Status *uint8 `json:"status,optional"`
  89. // 标签 ID
  90. LabelId *uint64 `json:"labelId,optional"`
  91. // 联系人 ID
  92. ContactId *uint64 `json:"contactId,optional"`
  93. // Contact information | 联系人信息
  94. Contact ContactInfo `json:"contact,optional"`
  95. // Label information | 标签信息
  96. Label LabelInfo `json:"label,optional"`
  97. // 组织ID
  98. OrganizationId *uint64 `json:"organizationId,optional"`
  99. }
  100. // The response data of label relationship information | LabelRelationship信息
  101. LabelRelationshipsInfo {
  102. BaseIDInfo
  103. // 更新类型:为空或“all”时表示全量更新,为 “add” 时表示仅追加
  104. UpdateType *string `json:"updateType,optional"`
  105. // 标签 ID
  106. LabelIds []uint64 `json:"labelIds,optional"`
  107. // 联系人 ID
  108. ContactId *uint64 `json:"contactId,optional"`
  109. }
  110. BatchLabelRelationshipsInfo {
  111. // 更新类型:为1 时表示增加标签,为 -1 时表示移除标签
  112. UpdateType int `json:"updateType,optional"`
  113. // 标签 ID
  114. LabelIds []uint64 `json:"labelIds,optional"`
  115. // 联系人 ID
  116. ContactIds []uint64 `json:"contactIds,optional"`
  117. }
  118. // The response data of label relationship list | LabelRelationship列表数据
  119. LabelRelationshipListResp {
  120. BaseDataInfo
  121. // LabelRelationship list data | LabelRelationship列表数据
  122. Data LabelRelationshipListInfo `json:"data"`
  123. }
  124. // LabelRelationship list data | LabelRelationship列表数据
  125. LabelRelationshipListInfo {
  126. BaseListInfo
  127. // The API list data | LabelRelationship列表数据
  128. Data []LabelRelationshipInfo `json:"data"`
  129. }
  130. // Get label relationship list request params | LabelRelationship列表请求参数
  131. LabelRelationshipListReq {
  132. PageInfo
  133. }
  134. // LabelRelationship information response | LabelRelationship信息返回体
  135. LabelRelationshipInfoResp {
  136. BaseDataInfo
  137. // LabelRelationship information | LabelRelationship数据
  138. Data LabelRelationshipInfo `json:"data"`
  139. }
  140. )
  141. @server(
  142. jwt: Auth
  143. group: label_relationship
  144. middleware: Authority
  145. )
  146. service Wechat {
  147. // Create label relationship information | 创建LabelRelationship
  148. @handler createLabelRelationship
  149. post /label_relationship/create (LabelRelationshipInfo) returns (BaseMsgResp)
  150. // Update label relationship information | 更新LabelRelationship
  151. @handler updateLabelRelationship
  152. post /label_relationship/update (LabelRelationshipInfo) returns (BaseMsgResp)
  153. // Update label relationships information | 更新联系人所有 LabelRelationship
  154. @handler updateLabelRelationships
  155. post /label_relationship/update_contact_labels (LabelRelationshipsInfo) returns (BaseMsgResp)
  156. // Batch Update label relationships information | 批量更新联系人所有 LabelRelationship
  157. @handler batchUpdateLabelRelationships
  158. post /label_relationship/batch_update_contact_labels (BatchLabelRelationshipsInfo) returns (BaseMsgResp)
  159. // Delete label relationship information | 删除LabelRelationship信息
  160. @handler deleteLabelRelationship
  161. post /label_relationship/delete (IDsReq) returns (BaseMsgResp)
  162. // Get label relationship list | 获取LabelRelationship列表
  163. @handler getLabelRelationshipList
  164. post /label_relationship/list (LabelRelationshipListReq) returns (LabelRelationshipListResp)
  165. // Get label relationship by ID | 通过ID获取LabelRelationship
  166. @handler getLabelRelationshipById
  167. post /label_relationship (IDReq) returns (LabelRelationshipInfoResp)
  168. // 更新WhatsappContact的Label信息
  169. @handler setWhatsappContactLabel
  170. post /label_relationship/setWhatsappContactLabel (LabelRelationshipsInfo) returns (BaseMsgResp)
  171. // 批量更新WhatsappContact的Label信息
  172. @handler setWhatsappContactBatchLabel
  173. post /label_relationship/setWhatsappContactBatchLabel (BatchLabelRelationshipsInfo) returns (BaseMsgResp)
  174. }