wx_card.api 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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"`
  36. ShowAi *bool `json:"showAi"`
  37. }
  38. WxCardSimpleInfo {
  39. ID *uint64 `json:"id,optional"`
  40. // 头像
  41. Avatar *string `json:"avatar,optional"`
  42. // 名称
  43. Name *string `json:"name,optional"`
  44. }
  45. // The response data of wx card list | WxCard列表数据
  46. WxCardListResp {
  47. BaseDataInfo
  48. // WxCard list data | WxCard列表数据
  49. Data WxCardListInfo `json:"data"`
  50. }
  51. // WxCard list data | WxCard列表数据
  52. WxCardListInfo {
  53. BaseListInfo
  54. // The API list data | WxCard列表数据
  55. Data []WxCardInfo `json:"data"`
  56. }
  57. // Get wx card list request params | WxCard列表请求参数
  58. WxCardListReq {
  59. PageInfo
  60. // 头像
  61. Avatar *string `json:"avatar,optional"`
  62. // logo
  63. Logo *string `json:"logo,optional"`
  64. // 名称
  65. Name *string `json:"name,optional"`
  66. }
  67. // WxCard information response | WxCard信息返回体
  68. WxCardInfoResp {
  69. BaseDataInfo
  70. // WxCard information | WxCard数据
  71. Data WxCardInfo `json:"data"`
  72. }
  73. QrcodeReq {
  74. Path string `form:"path"`
  75. Width int64 `form:"width"`
  76. EnvVersion string `form:"envVersion"`
  77. }
  78. )
  79. @server(
  80. jwt: Auth
  81. group: wxcard
  82. middleware: Miniprogram
  83. )
  84. service Wechat {
  85. // Get wx card by ID | 通过ID获取WxCard
  86. @handler getApiWxCardDetail
  87. post /api/card/detail (IDReq) returns (WxCardInfoResp)
  88. }
  89. @server(
  90. group: wxcard
  91. )
  92. service Wechat {
  93. // Get wx card share qrcode | 通过小程序分享二维码
  94. @handler getApiWxCardQrcode
  95. get /api/card/qrcode (QrcodeReq)
  96. }
  97. @server(
  98. jwt: Auth
  99. group: wxcard
  100. middleware: Authority
  101. )
  102. service Wechat {
  103. // Create wx card information | 创建WxCard
  104. @handler createWxCard
  105. post /wx_card/create (WxCardInfo) returns (BaseMsgResp)
  106. // Update wx card information | 更新WxCard
  107. @handler updateWxCard
  108. post /wx_card/update (WxCardInfo) returns (BaseMsgResp)
  109. // Delete wx card information | 删除WxCard信息
  110. @handler deleteWxCard
  111. post /wx_card/delete (IDsReq) returns (BaseMsgResp)
  112. // Get wx card list | 获取WxCard列表
  113. @handler getWxCardList
  114. post /wx_card/list (WxCardListReq) returns (WxCardListResp)
  115. // Get wx card by ID | 通过ID获取WxCard
  116. @handler getWxCardById
  117. post /wx_card (IDReq) returns (WxCardInfoResp)
  118. }