test_data/api/test.data/report.chart.selection.go
2024-09-13 15:30:53 +08:00

57 lines
1.6 KiB
Go

package test_data
import (
"github.com/gin-gonic/gin"
"testData/model/response"
test_data "testData/repository/test.data"
"testData/request"
"testData/utils"
)
type IReportChartSelectionService interface {
}
type ReportChartSelectionService struct{}
func InitReportChartSelectionService() *ReportChartSelectionService {
return &ReportChartSelectionService{}
}
// @Tags 数据分析平台-生产
// @Summary 测试良率项目选项
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.ProbabilitySelection true "查询参数"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"操作成功"}"
// @Router /testData/report/probabilitySelection/product [post]
func (S *ReportChartSelectionService) GetProductSelection(c *gin.Context) {
r := request.ProbabilitySelection{}
_ = c.ShouldBind(&r)
if msg, ok := utils.ValidateInfo2CN(r); !ok {
response.FailWithMessage(msg, c)
return
}
response.OkWithData(test_data.GetProductSelection(&r), c)
}
// @Tags 数据分析平台-生产
// @Summary 测试良率批次选项
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.ProbabilitySelection true "查询参数"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"操作成功"}"
// @Router /testData/report/probabilitySelection/lot [post]
func (S *ReportChartSelectionService) GetLotSelection(c *gin.Context) {
r := request.ProbabilitySelection{}
_ = c.ShouldBind(&r)
if msg, ok := utils.ValidateInfo2CN(r); !ok {
response.FailWithMessage(msg, c)
return
}
response.OkWithData(test_data.GetLotSelection(&r), c)
}