syntax = "v1" import ( "base.api" ) type ( ProductionReportReq { StartTime string `form:"startTime,optional"` // YYYY-MM EndTime string `form:"endTime,optional"` // YYYY-MM Granularity string `form:"granularity,optional"` // month 或 day,默认 month } ProductionReportSummary { TotalCompleted int `json:"totalCompleted"` TotalScrapped int `json:"totalScrapped"` QualificationRate float64 `json:"qualificationRate"` PlanAchievementRate float64 `json:"planAchievementRate"` } CategoryStat { Category string `json:"category"` Completed int `json:"completed"` Scrapped int `json:"scrapped"` QualificationRate float64 `json:"qualificationRate"` } ProductionTrendItem { Period string `json:"period"` Categories []CategoryStat `json:"categories"` } ProductionReportReply { Summary ProductionReportSummary `json:"summary"` Trend []ProductionTrendItem `json:"trend"` } ) @server ( jwt: Auth group: reports prefix: /api/v1 ) service hougai-api { @doc "产量报表(按月/日+大类统计)" @handler productionReport get /reports/production (ProductionReportReq) returns (ProductionReportReply) }