zhangqian
2023-09-28 e7d5e1be855743ee472269607c549d0c2f56533f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package v1
 
import (
    "apsClient/model/request"
    "apsClient/pkg/contextx"
    "apsClient/pkg/ecode"
    "apsClient/service"
    "github.com/gin-gonic/gin"
)
 
type ProcessModelApi struct{}
 
// List
// @Tags      工艺模型
// @Summary   获取工艺模型列表
// @Produce   application/json
// @Param     object  query    request.ProcessModelList true  "查询参数"
// @Success   200   {object}  contextx.Response{data=response.TaskCountdown}  "成功"
// @Router    /v1/processModel/list [get]
func (slf *ProcessModelApi) List(c *gin.Context) {
    var params request.ProcessModelList
    ctx, ok := contextx.NewContext(c, &params)
    if !ok {
        return
    }
    list, total, err := service.GetProcessModelList(params.Page, params.PageSize)
    if err != nil {
        ctx.Fail(ecode.DBErr)
        return
    }
    ctx.ResultList(list, total)
}