12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- package handler
- import (
- "github.com/gin-gonic/gin"
- "github.com/sirupsen/logrus"
- log "github.com/sirupsen/logrus"
- "youngee_b_api/consts"
- "youngee_b_api/model/http_model"
- "youngee_b_api/service"
- "youngee_b_api/util"
- )
- func WrapLocalLifeDetailHandler(ctx *gin.Context) {
- handler := newLocalLifeDetailHandler(ctx)
- baseRun(handler)
- }
- func newLocalLifeDetailHandler(ctx *gin.Context) *LocalLifeDetailHandler {
- return &LocalLifeDetailHandler{
- req: http_model.NewShowLocalRequest(),
- resp: http_model.NewShowLocalResponse(),
- ctx: ctx,
- }
- }
- type LocalLifeDetailHandler struct {
- req *http_model.ShowLocalRequest
- resp *http_model.CommonResponse
- ctx *gin.Context
- }
- func (h *LocalLifeDetailHandler) getRequest() interface{} {
- return h.req
- }
- func (h *LocalLifeDetailHandler) getContext() *gin.Context {
- return h.ctx
- }
- func (h *LocalLifeDetailHandler) getResponse() interface{} {
- return h.resp
- }
- func (h *LocalLifeDetailHandler) run() {
- // auth := middleware.GetSessionAuth(h.ctx)
- // enterpriseID := auth.EnterpriseID
- // fmt.Printf("projectID %+v", data.ProjectID)
- res, err := service.LocalLife.ShowLocalLife(h.ctx, h.req)
- if err != nil {
- logrus.Errorf("[ShowProjectHandler] call Show err:%+v\n", err)
- util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
- log.Info("ShowProject fail,req:%+v", h.req)
- return
- }
- h.resp.Message = "成功查询项目"
- h.resp.Data = res
- }
- func (h *LocalLifeDetailHandler) checkParam() error {
- return nil
- }
|