label_relationship.api 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  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. Cbirtyday *string `json:"cbirtyday,optional"`
  58. Cbirtharea *string `json:"cbirtharea,optional"`
  59. CidcardNo *string `json:"cidcardNo,optional"`
  60. Ctitle *string `json:"ctitle,optional"`
  61. Cc *string `json:"c,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. // 内容类型:1-微信 2-whatsapp
  84. Ctype *uint64 `json:"ctype,optional"`
  85. }
  86. // The response data of label relationship information | LabelRelationship信息
  87. LabelRelationshipInfo {
  88. BaseIDInfo
  89. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  90. Status *uint8 `json:"status,optional"`
  91. // 标签 ID
  92. LabelId *uint64 `json:"labelId,optional"`
  93. // 联系人 ID
  94. ContactId *uint64 `json:"contactId,optional"`
  95. // Contact information | 联系人信息
  96. Contact ContactInfo `json:"contact,optional"`
  97. // Label information | 标签信息
  98. Label LabelInfo `json:"label,optional"`
  99. // 组织ID
  100. OrganizationId *uint64 `json:"organizationId,optional"`
  101. }
  102. // The response data of label relationship information | LabelRelationship信息
  103. LabelRelationshipsInfo {
  104. BaseIDInfo
  105. // 更新类型:为空或“all”时表示全量更新,为 “add” 时表示仅追加
  106. UpdateType *string `json:"updateType,optional"`
  107. // 标签 ID
  108. LabelIds []uint64 `json:"labelIds,optional"`
  109. // 联系人 ID
  110. ContactId *uint64 `json:"contactId,optional"`
  111. }
  112. BatchLabelRelationshipsInfo {
  113. // 更新类型:为1 时表示增加标签,为 -1 时表示移除标签
  114. UpdateType int `json:"updateType,optional"`
  115. // 标签 ID
  116. LabelIds []uint64 `json:"labelIds,optional"`
  117. // 联系人 ID
  118. ContactIds []uint64 `json:"contactIds,optional"`
  119. }
  120. // The response data of label relationship list | LabelRelationship列表数据
  121. LabelRelationshipListResp {
  122. BaseDataInfo
  123. // LabelRelationship list data | LabelRelationship列表数据
  124. Data LabelRelationshipListInfo `json:"data"`
  125. }
  126. // LabelRelationship list data | LabelRelationship列表数据
  127. LabelRelationshipListInfo {
  128. BaseListInfo
  129. // The API list data | LabelRelationship列表数据
  130. Data []LabelRelationshipInfo `json:"data"`
  131. }
  132. // Get label relationship list request params | LabelRelationship列表请求参数
  133. LabelRelationshipListReq {
  134. PageInfo
  135. }
  136. // LabelRelationship information response | LabelRelationship信息返回体
  137. LabelRelationshipInfoResp {
  138. BaseDataInfo
  139. // LabelRelationship information | LabelRelationship数据
  140. Data LabelRelationshipInfo `json:"data"`
  141. }
  142. )
  143. @server(
  144. jwt: Auth
  145. group: label_relationship
  146. middleware: Authority
  147. )
  148. service Wechat {
  149. // Create label relationship information | 创建LabelRelationship
  150. @handler createLabelRelationship
  151. post /label_relationship/create (LabelRelationshipInfo) returns (BaseMsgResp)
  152. // Update label relationship information | 更新LabelRelationship
  153. @handler updateLabelRelationship
  154. post /label_relationship/update (LabelRelationshipInfo) returns (BaseMsgResp)
  155. // Update label relationships information | 更新联系人所有 LabelRelationship
  156. @handler updateLabelRelationships
  157. post /label_relationship/update_contact_labels (LabelRelationshipsInfo) returns (BaseMsgResp)
  158. // Batch Update label relationships information | 批量更新联系人所有 LabelRelationship
  159. @handler batchUpdateLabelRelationships
  160. post /label_relationship/batch_update_contact_labels (BatchLabelRelationshipsInfo) returns (BaseMsgResp)
  161. // Delete label relationship information | 删除LabelRelationship信息
  162. @handler deleteLabelRelationship
  163. post /label_relationship/delete (IDsReq) returns (BaseMsgResp)
  164. // Get label relationship list | 获取LabelRelationship列表
  165. @handler getLabelRelationshipList
  166. post /label_relationship/list (LabelRelationshipListReq) returns (LabelRelationshipListResp)
  167. // Get label relationship by ID | 通过ID获取LabelRelationship
  168. @handler getLabelRelationshipById
  169. post /label_relationship (IDReq) returns (LabelRelationshipInfoResp)
  170. // 更新WhatsappContact的Label信息
  171. @handler setWhatsappContactLabel
  172. post /label_relationship/setWhatsappContactLabel (LabelRelationshipsInfo) returns (BaseMsgResp)
  173. // 批量更新WhatsappContact的Label信息
  174. @handler setWhatsappContactBatchLabel
  175. post /label_relationship/setWhatsappContactBatchLabel (BatchLabelRelationshipsInfo) returns (BaseMsgResp)
  176. }