edb_data_from_python.go 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. package data_manage
  2. import (
  3. "time"
  4. )
  5. // EdbDataPython python指标数据结构体
  6. type EdbDataPython struct {
  7. EdbDataId int `orm:"column(edb_data_id);pk" gorm:"primaryKey" `
  8. EdbInfoId int
  9. EdbCode string
  10. DataTime string
  11. Value float64
  12. CreateTime time.Time
  13. ModifyTime time.Time
  14. DataTimestamp int64
  15. }
  16. // EdbInfoPythonSaveReq 计算(运算)指标请求参数
  17. type EdbInfoPythonSaveReq struct {
  18. AdminId int `description:"添加人id"`
  19. AdminName string `description:"添加人名称"`
  20. EdbName string `description:"指标名称"`
  21. Frequency string `description:"频率"`
  22. Unit string `description:"单位"`
  23. ClassifyId int `description:"分类id"`
  24. CalculateFormula string `description:"计算公式"`
  25. EdbInfoIdArr []struct {
  26. EdbInfoId int `description:"指标id"`
  27. FromTag string `description:"指标对应标签"`
  28. }
  29. }
  30. // ExecPythonEdbReq 执行python代码运算指标的请求参数
  31. type ExecPythonEdbReq struct {
  32. PythonCode string `description:"python代码"`
  33. }
  34. // AddPythonEdbReq 添加python代码运算指标的请求参数
  35. type AddPythonEdbReq struct {
  36. EdbInfoId int `description:"指标id"`
  37. EdbName string `description:"指标名称"`
  38. Frequency string `description:"频度"`
  39. Unit string `description:"单位"`
  40. ClassifyId int `description:"分类id"`
  41. PythonCode string `description:"python代码"`
  42. }
  43. // PostAddPythonEdbReq 添加python代码运算指标的请求参数(请求指标服务)
  44. type PostAddPythonEdbReq struct {
  45. AdminId int `description:"添加人id"`
  46. AdminName string `description:"添加人名称"`
  47. EdbInfoId int `description:"指标id"`
  48. EdbName string `description:"指标名称"`
  49. Frequency string `description:"频度"`
  50. Unit string `description:"单位"`
  51. ClassifyId int `description:"分类id"`
  52. PythonCode string `description:"python代码"`
  53. }
  54. // PythonEdbDetailResp python指标详情接口
  55. type PythonEdbDetailResp struct {
  56. EdbInfoDetail *EdbInfo
  57. PythonCode string
  58. }
  59. // TableInfoResp 指标数据表结构
  60. type TableInfoResp struct {
  61. ColumnList []map[string]string
  62. TableName string
  63. TemplateStr string
  64. }