contact.api 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. )
  52. @server(
  53. jwt: Auth
  54. group: contact
  55. middleware: Authority
  56. )
  57. service Wechat {
  58. // Create contact information | 创建Contact
  59. @handler createContact
  60. post /contact/create (ContactInfo) returns (BaseMsgResp)
  61. // Update contact information | 更新Contact
  62. @handler updateContact
  63. post /contact/update (ContactInfo) returns (BaseMsgResp)
  64. // Delete contact information | 删除Contact信息
  65. @handler deleteContact
  66. post /contact/delete (IDsReq) returns (BaseMsgResp)
  67. // Get contact list | 获取Contact列表
  68. @handler getContactList
  69. post /contact/list (ContactListReq) returns (ContactListResp)
  70. // Get contact by ID | 通过ID获取Contact
  71. @handler getContactById
  72. post /contact (IDReq) returns (ContactInfoResp)
  73. @handler addNewFriend
  74. post /contact/addNewFriend (AddNewFriendReq) returns (BaseMsgResp)
  75. @handler changeBlockList
  76. post /contact/changeBlockList (changeBlockListReq) returns (BaseMsgResp)
  77. }