contact.api 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. import "../base.api"
  2. import "./label_relationship.api"
  3. type (
  4. // The response data of contact list | Contact列表数据
  5. ContactListResp {
  6. BaseDataInfo
  7. // Contact list data | Contact列表数据
  8. Data ContactListInfo `json:"data"`
  9. }
  10. // Contact list data | Contact列表数据
  11. ContactListInfo {
  12. BaseListInfo
  13. // The API list data | Contact列表数据
  14. Data []ContactInfo `json:"data"`
  15. }
  16. // Get contact list request params | Contact列表请求参数
  17. ContactListReq {
  18. PageInfo
  19. // Label ID list | 标签ID列表
  20. LabelIDs []uint64 `json:"labelIDs,optional"`
  21. // 属主微信id
  22. WxWxid *string `json:"wxWxid,optional"`
  23. // 微信id 公众号微信ID
  24. Wxid *string `json:"wxid,optional"`
  25. // 微信账号
  26. Account *string `json:"account,optional"`
  27. // 昵称
  28. Nickname *string `json:"nickname,optional"`
  29. // 联系人类型:1好友,2群组,3公众号,4企业微信联系人
  30. Type *int `json:"type,optional"`
  31. }
  32. // Contact information response | Contact信息返回体
  33. ContactInfoResp {
  34. BaseDataInfo
  35. // Contact information | Contact数据
  36. Data ContactInfo `json:"data"`
  37. }
  38. AddNewFriendReq {
  39. OwnerWxid string `json:"ownerWxid"`
  40. Wxid string `json:"wxid"`
  41. Gid string `json:"gid"`
  42. Desc string `json:"desc"`
  43. AddType string `json:"addType"`
  44. }
  45. changeBlockListReq {
  46. OwnerWxid string `json:"ownerWxid"`
  47. Wxid string `json:"wxid"`
  48. Type *int `json:"type,optional"`
  49. Ai *bool `json:"ai,optional"`
  50. }
  51. ImportWhatsappContactReq {
  52. File *string `form:"file,optional"`
  53. }
  54. WhatsappContactListReq {
  55. PageInfo
  56. // 标签ID列表
  57. LabelIDs []uint64 `json:"labelIDs,optional"`
  58. // 电话
  59. Phone *string `json:"phone,optional"`
  60. // 名称
  61. Name *string `json:"name,optional"`
  62. }
  63. CreateWhatsappContactReq {
  64. BaseIDInfo
  65. // 国家区号
  66. Cc *string `json:"cc"`
  67. Phone *string `json:"phone"`
  68. // 备注名
  69. Markname *string `json:"markname,optional"`
  70. Ctype *uint64 `json:"ctype,optional"`
  71. Cname *string `json:"cname,optional"`
  72. Csex *int `json:"csex,optional"`
  73. Cage *int `json:"cage,optional"`
  74. Carea *string `json:"carea,optional"`
  75. Cmobile *string `json:"cmobile,optional"`
  76. Cbirtyday *string `json:"cbirtyday,optional"`
  77. Cbirtharea *string `json:"cbirtharea,optional"`
  78. CidcardNo *string `json:"cidcardNo,optional"`
  79. Ctitle *string `json:"ctitle,optional"`
  80. }
  81. )
  82. @server(
  83. jwt: Auth
  84. group: contact
  85. middleware: Authority
  86. )
  87. service Wechat {
  88. // Create contact information | 创建Contact
  89. @handler createContact
  90. post /contact/create (ContactInfo) returns (BaseMsgResp)
  91. // Update contact information | 更新Contact
  92. @handler updateContact
  93. post /contact/update (ContactInfo) returns (BaseMsgResp)
  94. // Delete contact information | 删除Contact信息
  95. @handler deleteContact
  96. post /contact/delete (IDsReq) returns (BaseMsgResp)
  97. // Get contact list | 获取Contact列表
  98. @handler getContactList
  99. post /contact/list (ContactListReq) returns (ContactListResp)
  100. // Get contact by ID | 通过ID获取Contact
  101. @handler getContactById
  102. post /contact (IDReq) returns (ContactInfoResp)
  103. @handler addNewFriend
  104. post /contact/addNewFriend (AddNewFriendReq) returns (BaseMsgResp)
  105. @handler changeBlockList
  106. post /contact/changeBlockList (changeBlockListReq) returns (BaseMsgResp)
  107. // 导入Whatsapp联系人
  108. @handler importWhatsappContact
  109. post /contact/importWhatsappContact (ImportWhatsappContactReq) returns (BaseDataInfo)
  110. // Whatsapp联系人列表
  111. @handler getWhatsappContactList
  112. post /contact/getWhatsappContactList (WhatsappContactListReq) returns (ContactListResp)
  113. // Whatsapp联系人创建
  114. @handler createWhatsappContact
  115. post /contact/createWhatsappContact (CreateWhatsappContactReq) returns (BaseMsgResp)
  116. // Whatsapp联系人编辑
  117. @handler updateWhatsappContact
  118. post /contact/updateWhatsappContact (CreateWhatsappContactReq) returns (BaseMsgResp)
  119. // Whatsapp联系人删除
  120. @handler deleteWhatsappContact
  121. post /contact/deleteWhatsappContact (IDsReq) returns (BaseMsgResp)
  122. // Whatsapp联系人详情
  123. @handler getWhatsappContact
  124. post /contact/getWhatsappContact (IDReq) returns (ContactInfoResp)
  125. }