contact.api 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. )
  37. @server(
  38. jwt: Auth
  39. group: contact
  40. middleware: Authority
  41. )
  42. service Wechat {
  43. // Create contact information | 创建Contact
  44. @handler createContact
  45. post /contact/create (ContactInfo) returns (BaseMsgResp)
  46. // Update contact information | 更新Contact
  47. @handler updateContact
  48. post /contact/update (ContactInfo) returns (BaseMsgResp)
  49. // Delete contact information | 删除Contact信息
  50. @handler deleteContact
  51. post /contact/delete (IDsReq) returns (BaseMsgResp)
  52. // Get contact list | 获取Contact列表
  53. @handler getContactList
  54. post /contact/list (ContactListReq) returns (ContactListResp)
  55. // Get contact by ID | 通过ID获取Contact
  56. @handler getContactById
  57. post /contact (IDReq) returns (ContactInfoResp)
  58. }