contact.api 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. import "../base.api"
  2. type (
  3. // The response data of contact information | Contact信息
  4. ContactInfo {
  5. BaseIDInfo
  6. // Status 1: normal 2: ban | 状态 1 正常 2 禁用
  7. Status *uint8 `json:"status,optional"`
  8. // 属主微信id
  9. WxWxid *string `json:"wxWxid,optional"`
  10. // 联系人类型:1好友,2群组,3公众号,4企业微信联系人
  11. Type *int `json:"type,optional"`
  12. // 微信id 公众号微信ID
  13. Wxid *string `json:"wxid,optional"`
  14. // 微信账号
  15. Account *string `json:"account,optional"`
  16. // 微信昵称 群备注名称
  17. Nickname *string `json:"nickname,optional"`
  18. // 备注名
  19. Markname *string `json:"markname,optional"`
  20. // 头像
  21. Headimg *string `json:"headimg,optional"`
  22. // 性别 0未知 1男 2女
  23. Sex *int `json:"sex,optional"`
  24. // 星标 65/67=星标 1/3=未星标
  25. Starrole *string `json:"starrole,optional"`
  26. // 不让他看我的朋友圈 0可以看 1不让看
  27. Dontseeit *int `json:"dontseeit,optional"`
  28. // 不看他的朋友圈 0可以看 1不看 1=开启了不看他 128/129=仅聊天
  29. Dontseeme *int `json:"dontseeme,optional"`
  30. // 所属标签id清单,多开会用逗号隔开
  31. Lag *string `json:"lag,optional"`
  32. // 群组id
  33. Gid *string `json:"gid,optional"`
  34. // 群组名称
  35. Gname *string `json:"gname,optional"`
  36. // v3数据
  37. V3 *string `json:"v3,optional"`
  38. }
  39. // The response data of contact list | Contact列表数据
  40. ContactListResp {
  41. BaseDataInfo
  42. // Contact list data | Contact列表数据
  43. Data ContactListInfo `json:"data"`
  44. }
  45. // Contact list data | Contact列表数据
  46. ContactListInfo {
  47. BaseListInfo
  48. // The API list data | Contact列表数据
  49. Data []ContactInfo `json:"data"`
  50. }
  51. // Get contact list request params | Contact列表请求参数
  52. ContactListReq {
  53. PageInfo
  54. // 属主微信id
  55. WxWxid *string `json:"wxWxid,optional"`
  56. // 微信id 公众号微信ID
  57. Wxid *string `json:"wxid,optional"`
  58. // 微信账号
  59. Account *string `json:"account,optional"`
  60. }
  61. // Contact information response | Contact信息返回体
  62. ContactInfoResp {
  63. BaseDataInfo
  64. // Contact information | Contact数据
  65. Data ContactInfo `json:"data"`
  66. }
  67. )
  68. @server(
  69. jwt: Auth
  70. group: Contact
  71. middleware: Authority
  72. )
  73. service Wechat {
  74. // Create contact information | 创建Contact
  75. @handler createContact
  76. post /contact/create (ContactInfo) returns (BaseMsgResp)
  77. // Update contact information | 更新Contact
  78. @handler updateContact
  79. post /contact/update (ContactInfo) returns (BaseMsgResp)
  80. // Delete contact information | 删除Contact信息
  81. @handler deleteContact
  82. post /contact/delete (IDsReq) returns (BaseMsgResp)
  83. // Get contact list | 获取Contact列表
  84. @handler getContactList
  85. post /contact/list (ContactListReq) returns (ContactListResp)
  86. // Get contact by ID | 通过ID获取Contact
  87. @handler getContactById
  88. post /contact (IDReq) returns (ContactInfoResp)
  89. }