label_relationship.api 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. // The response data of label relationship list | LabelRelationship列表数据
  97. LabelRelationshipListResp {
  98. BaseDataInfo
  99. // LabelRelationship list data | LabelRelationship列表数据
  100. Data LabelRelationshipListInfo `json:"data"`
  101. }
  102. // LabelRelationship list data | LabelRelationship列表数据
  103. LabelRelationshipListInfo {
  104. BaseListInfo
  105. // The API list data | LabelRelationship列表数据
  106. Data []LabelRelationshipInfo `json:"data"`
  107. }
  108. // Get label relationship list request params | LabelRelationship列表请求参数
  109. LabelRelationshipListReq {
  110. PageInfo
  111. }
  112. // LabelRelationship information response | LabelRelationship信息返回体
  113. LabelRelationshipInfoResp {
  114. BaseDataInfo
  115. // LabelRelationship information | LabelRelationship数据
  116. Data LabelRelationshipInfo `json:"data"`
  117. }
  118. )
  119. @server(
  120. jwt: Auth
  121. group: label_relationship
  122. middleware: Authority
  123. )
  124. service Wechat {
  125. // Create label relationship information | 创建LabelRelationship
  126. @handler createLabelRelationship
  127. post /label_relationship/create (LabelRelationshipInfo) returns (BaseMsgResp)
  128. // Update label relationship information | 更新LabelRelationship
  129. @handler updateLabelRelationship
  130. post /label_relationship/update (LabelRelationshipInfo) returns (BaseMsgResp)
  131. // Update label relationships information | 更新联系人所有 LabelRelationship
  132. @handler updateLabelRelationships
  133. post /label_relationship/update_contact_labels (LabelRelationshipsInfo) returns (BaseMsgResp)
  134. // Delete label relationship information | 删除LabelRelationship信息
  135. @handler deleteLabelRelationship
  136. post /label_relationship/delete (IDsReq) returns (BaseMsgResp)
  137. // Get label relationship list | 获取LabelRelationship列表
  138. @handler getLabelRelationshipList
  139. post /label_relationship/list (LabelRelationshipListReq) returns (LabelRelationshipListResp)
  140. // Get label relationship by ID | 通过ID获取LabelRelationship
  141. @handler getLabelRelationshipById
  142. post /label_relationship (IDReq) returns (LabelRelationshipInfoResp)
  143. }