wx_card.api 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. import "../base.api"
  2. type (
  3. // The data of wx card information | WxCard信息
  4. WxCardInfo {
  5. BaseIDInfo
  6. // user表ID
  7. UserId *uint64 `json:"userId,optional"`
  8. // wx表ID
  9. WxUserId *uint64 `json:"wxUserId,optional"`
  10. // 头像
  11. Avatar *string `json:"avatar,optional"`
  12. // logo
  13. Logo *string `json:"logo,optional"`
  14. // 名称
  15. Name *string `json:"name,optional"`
  16. // 公司
  17. Company *string `json:"company,optional"`
  18. // 地址
  19. Address *string `json:"address,optional"`
  20. // 手机号
  21. Phone *string `json:"phone,optional"`
  22. // 公众号
  23. OfficialAccount *string `json:"officialAccount,optional"`
  24. // 微信号
  25. WechatAccount *string `json:"wechatAccount,optional"`
  26. // 邮箱
  27. Email *string `json:"email,optional"`
  28. // 聊天信息
  29. ApiBase *string `json:"apiBase,optional"`
  30. ApiKey *string `json:"apiKey,optional"`
  31. // AI信息
  32. AiInfo *string `json:"aiInfo,optional"`
  33. // 个人介绍
  34. Intro *string `json:"intro,optional"`
  35. ShowChat *bool `json:"showChat,optional"`
  36. ShowAi *bool `json:"showAi,optional"`
  37. IsVip *bool `json:"isVip,optional"`
  38. }
  39. WxCardSimpleInfo {
  40. ID *uint64 `json:"id,optional"`
  41. // 头像
  42. Avatar *string `json:"avatar,optional"`
  43. // 名称
  44. Name *string `json:"name,optional"`
  45. Type *string `json:"type,optional"`
  46. }
  47. // The response data of wx card list | WxCard列表数据
  48. WxCardListResp {
  49. BaseDataInfo
  50. // WxCard list data | WxCard列表数据
  51. Data WxCardListInfo `json:"data"`
  52. }
  53. // WxCard list data | WxCard列表数据
  54. WxCardListInfo {
  55. BaseListInfo
  56. // The API list data | WxCard列表数据
  57. Data []WxCardInfo `json:"data"`
  58. }
  59. // Get wx card list request params | WxCard列表请求参数
  60. WxCardListReq {
  61. PageInfo
  62. // 头像
  63. Avatar *string `json:"avatar,optional"`
  64. // logo
  65. Logo *string `json:"logo,optional"`
  66. // 名称
  67. Name *string `json:"name,optional"`
  68. }
  69. // WxCard information response | WxCard信息返回体
  70. WxCardInfoResp {
  71. BaseDataInfo
  72. // WxCard information | WxCard数据
  73. Data WxCardInfo `json:"data"`
  74. }
  75. QrcodeReq {
  76. Path string `form:"path"`
  77. Width int64 `form:"width"`
  78. EnvVersion string `form:"envVersion"`
  79. }
  80. )
  81. @server(
  82. jwt: Auth
  83. group: wxcard
  84. middleware: Miniprogram
  85. )
  86. service Wechat {
  87. // Get wx card by ID | 通过ID获取WxCard
  88. @handler getApiWxCardDetail
  89. post /api/card/detail (IDReq) returns (WxCardInfoResp)
  90. }
  91. @server(
  92. group: wxcard
  93. )
  94. service Wechat {
  95. // Get wx card share qrcode | 通过小程序分享二维码
  96. @handler getApiWxCardQrcode
  97. get /api/card/qrcode (QrcodeReq)
  98. }
  99. @server(
  100. jwt: Auth
  101. group: wxcard
  102. middleware: Authority
  103. )
  104. service Wechat {
  105. // Create wx card information | 创建WxCard
  106. @handler createWxCard
  107. post /wx_card/create (WxCardInfo) returns (BaseMsgResp)
  108. // Update wx card information | 更新WxCard
  109. @handler updateWxCard
  110. post /wx_card/update (WxCardInfo) returns (BaseMsgResp)
  111. // Delete wx card information | 删除WxCard信息
  112. @handler deleteWxCard
  113. post /wx_card/delete (IDsReq) returns (BaseMsgResp)
  114. // Get wx card list | 获取WxCard列表
  115. @handler getWxCardList
  116. post /wx_card/list (WxCardListReq) returns (WxCardListResp)
  117. // Get wx card by ID | 通过ID获取WxCard
  118. @handler getWxCardById
  119. post /wx_card (IDReq) returns (WxCardInfoResp)
  120. }