label_relationship.api 6.7 KB

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