contact.api 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. // 联系人类型:1好友,2群组,3公众号,4企业微信联系人
  28. Type *int `json:"type,optional"`
  29. }
  30. // Contact information response | Contact信息返回体
  31. ContactInfoResp {
  32. BaseDataInfo
  33. // Contact information | Contact数据
  34. Data ContactInfo `json:"data"`
  35. }
  36. AddNewFriendReq {
  37. OwnerWxid string `json:"ownerWxid"`
  38. Wxid string `json:"wxid"`
  39. Gid string `json:"gid"`
  40. Desc string `json:"desc"`
  41. AddType string `json:"addType"`
  42. }
  43. )
  44. @server(
  45. jwt: Auth
  46. group: contact
  47. middleware: Authority
  48. )
  49. service Wechat {
  50. // Create contact information | 创建Contact
  51. @handler createContact
  52. post /contact/create (ContactInfo) returns (BaseMsgResp)
  53. // Update contact information | 更新Contact
  54. @handler updateContact
  55. post /contact/update (ContactInfo) returns (BaseMsgResp)
  56. // Delete contact information | 删除Contact信息
  57. @handler deleteContact
  58. post /contact/delete (IDsReq) returns (BaseMsgResp)
  59. // Get contact list | 获取Contact列表
  60. @handler getContactList
  61. post /contact/list (ContactListReq) returns (ContactListResp)
  62. // Get contact by ID | 通过ID获取Contact
  63. @handler getContactById
  64. post /contact (IDReq) returns (ContactInfoResp)
  65. @handler addNewFriend
  66. post /contact/addNewFriend (AddNewFriendReq) returns (BaseMsgResp)
  67. }