dashboard.api 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import "../base.api"
  2. type (
  3. DashboardInfo {
  4. BaseIDInfo
  5. }
  6. ChartsReq {
  7. StartDate *string `json:"start_date"`
  8. EndDate *string `json:"end_date"`
  9. // 租户id
  10. OrganizationId *uint64 `json:"organizationId,optional"`
  11. }
  12. ChartsResp {
  13. BaseDataInfo
  14. Data *ChartsData `json:"data"`
  15. }
  16. ChartsData {
  17. AiResponse *ChartsUint `json:"ai_response"`
  18. SopRun *ChartsUint `json:"sop_run"`
  19. TotalFriend *ChartsUint `json:"total_friend"`
  20. TotalGroup *ChartsUint `json:"total_group"`
  21. AccountBalance *ChartsUint `json:"account_balance"`
  22. ConsumeToken *ChartsUint `json:"consume_token"`
  23. ActiveUser *ChartsUint `json:"active_user"`
  24. NewUser *ChartsInt `json:"new_user"`
  25. LabelDist []LabelsData `json:"label_dist"`
  26. }
  27. ChartsUint {
  28. Count uint64 `json:"count"`
  29. Rate float32 `json:"rate"`
  30. Label []string `json:"label"`
  31. Val []uint64 `json:"val"`
  32. }
  33. ChartsInt {
  34. Count int64 `json:"count"`
  35. Rate float32 `json:"rate"`
  36. Label []string `json:"label"`
  37. Val []int64 `json:"val"`
  38. }
  39. LabelsData {
  40. Value uint64 `json:"value"`
  41. Name string `json:"name"`
  42. }
  43. WxReq {
  44. PageInfo
  45. EndDate *string `json:"end_date"`
  46. // 租户id
  47. OrganizationId *uint64 `json:"organizationId,optional"`
  48. }
  49. WxResp {
  50. BaseDataInfo
  51. Data WxList `json:"data"`
  52. }
  53. WxList {
  54. BaseListInfo
  55. Data []WxData `json:"data"`
  56. }
  57. WxData {
  58. Nickname string `json:"nickname"`
  59. TotalFriend uint64 `json:"total_friend"`
  60. TotalGroup uint64 `json:"total_group"`
  61. InteractionRate float32 `json:"interaction_rate"`
  62. }
  63. )
  64. @server(
  65. jwt: Auth
  66. group: dashboard
  67. middleware: Authority
  68. )
  69. service Wechat {
  70. // get charts | 获取图表数据
  71. @handler getCharts
  72. post /dashboard/charts (ChartsReq) returns (ChartsResp)
  73. // get wxs | 获取图表数据
  74. @handler getWxs
  75. post /dashboard/wx (WxReq) returns (WxResp)
  76. }