123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- package handler
- import (
- "github.com/gin-gonic/gin"
- "github.com/sirupsen/logrus"
- "youngee_m_api/consts"
- "youngee_m_api/model/http_model"
- "youngee_m_api/service"
- "youngee_m_api/util"
- )
- func WrapLocalPreDataListHandler(ctx *gin.Context) {
- handler := newLocalPreDataListHandler(ctx)
- BaseRun(handler)
- }
- func newLocalPreDataListHandler(ctx *gin.Context) *LocalPreDataListHandler {
- return &LocalPreDataListHandler{
- req: http_model.NewLocalPreDataListRequest(),
- resp: http_model.NewLocalPreDataListResponse(),
- ctx: ctx,
- }
- }
- type LocalPreDataListHandler struct {
- req *http_model.LocalPreDataListRequest
- resp *http_model.CommonResponse
- ctx *gin.Context
- }
- func (h LocalPreDataListHandler) getRequest() interface{} {
- return h.req
- }
- func (h LocalPreDataListHandler) getContext() *gin.Context {
- return h.ctx
- }
- func (h LocalPreDataListHandler) getResponse() interface{} {
- return h.resp
- }
- func (h LocalPreDataListHandler) run() {
- data := http_model.LocalPreDataListRequest{}
- data = *h.req
- res, err := service.LocalTask.GetLocalPreDataList(h.ctx, data)
- if err != nil {
- logrus.Errorf("[GetLocalPreDataList] call GetLocalPreDataList err:%+v\n", err)
- util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
- logrus.Info("GetLocalPreDataList fail,req:%+v", h.req)
- return
- }
- h.resp.Message = "成功查询数据待传列表"
- h.resp.Data = res
- h.resp.Status = consts.ErrorSuccess
- }
- func (h LocalPreDataListHandler) checkParam() error {
- return nil
- }
|