dashboard.api 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. import "../base.api"
  2. type (
  3. ChartsReq {
  4. StartDate *string `json:"start_date"`
  5. EndDate *string `json:"end_date"`
  6. // 租户id
  7. OrganizationId *uint64 `json:"organizationId,optional"`
  8. }
  9. ChartsResp {
  10. BaseDataInfo
  11. Data *ChartsData `json:"data"`
  12. }
  13. ChartsData {
  14. AiResponse *ChartsUint `json:"ai_response"`
  15. SopRun *ChartsUint `json:"sop_run"`
  16. TotalFriend *ChartsUint `json:"total_friend"`
  17. TotalGroup *ChartsUint `json:"total_group"`
  18. AccountBalance *ChartsUint `json:"account_balance"`
  19. ConsumeToken *ChartsUint `json:"consume_token"`
  20. ActiveUser *ChartsUint `json:"active_user"`
  21. NewUser *ChartsInt `json:"new_user"`
  22. }
  23. ChartsUint {
  24. Count uint64 `json:"count"`
  25. Rate float32 `json:"rate"`
  26. Label []string `json:"label"`
  27. Val []uint64 `json:"val"`
  28. }
  29. ChartsInt {
  30. Count int64 `json:"count"`
  31. Rate float32 `json:"rate"`
  32. Label []string `json:"label"`
  33. Val []int64 `json:"val"`
  34. }
  35. )
  36. @server(
  37. jwt: Auth
  38. group: dashboard
  39. middleware: Authority
  40. )
  41. service Wechat {
  42. // get charts | 获取图表数据
  43. @handler getCharts
  44. post /dashboard/charts (ChartsReq) returns (ChartsResp)
  45. }