123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- package handler
- import (
- "github.com/gin-gonic/gin"
- "github.com/sirupsen/logrus"
- "youngee_b_api/consts"
- "youngee_b_api/model/http_model"
- "youngee_b_api/pack"
- "youngee_b_api/service"
- "youngee_b_api/util"
- )
- func WrapFullSLocalListHandler(ctx *gin.Context) {
- handler := newFullSLocalListHandler(ctx)
- baseRun(handler)
- }
- func newFullSLocalListHandler(ctx *gin.Context) *FullListHandler {
- return &FullListHandler{
- req: http_model.NewFullListRequest(),
- resp: http_model.NewFullListResponse(),
- ctx: ctx,
- }
- }
- type FullSLocalListHandler struct {
- req *http_model.FullListRequest
- resp *http_model.CommonResponse
- ctx *gin.Context
- }
- func (h *FullSLocalListHandler) getRequest() interface{} {
- return h.req
- }
- func (h *FullSLocalListHandler) getContext() *gin.Context {
- return h.ctx
- }
- func (h *FullSLocalListHandler) getResponse() interface{} {
- return h.resp
- }
- func (h *FullSLocalListHandler) run() {
- // enterpriseID := middleware.GetSessionAuth(h.ctx).EnterpriseID
- condition := pack.HttpFullLocalLifeListRequestToCondition(h.req)
- data, err := service.LocalLife.GetFullLocalLifeList(h.ctx, h.req.PageSize, h.req.PageNum, h.req.SupplierId, condition)
- if err != nil {
- logrus.WithContext(h.ctx).Errorf("[FullListHandler] error GetFullProjectList, err:%+v", err)
- util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, consts.DefaultToast)
- return
- }
- h.resp.Data = data
- }
- func (h *FullSLocalListHandler) checkParam() error {
- return nil
- }
|