123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- package handler
- import (
- "fmt"
- "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 WrapApproveProjectHandler(ctx *gin.Context) {
- handler := newApproveProjectHandler(ctx)
- baseRun(handler)
- }
- func newApproveProjectHandler(ctx *gin.Context) *ApproveProjectHandler {
- return &ApproveProjectHandler{
- req: http_model.NewApproveProjectRequest(),
- resp: http_model.NewApproveProjectResponse(),
- ctx: ctx,
- }
- }
- type ApproveProjectHandler struct {
- req *http_model.ApproveProjectRequest
- resp *http_model.CommonResponse
- ctx *gin.Context
- }
- func (h *ApproveProjectHandler) getRequest() interface{} {
- return h.req
- }
- func (h *ApproveProjectHandler) getContext() *gin.Context {
- return h.ctx
- }
- func (h *ApproveProjectHandler) getResponse() interface{} {
- return h.resp
- }
- func (h *ApproveProjectHandler) run() {
- data := http_model.ApproveProjectRequest{}
- data = *h.req
- fmt.Println(data.IsApprove,data.ProjectId)
- err,message := service.Project.ApproveProject(h.ctx, data)
- if err != nil {
- // 数据库查询失败,返回5001
- logrus.Errorf("[FindAllProductHandler] call FindAll err:%+v\n", err)
- util.HandlerPackErrorResp(h.resp, consts.ErrorInternal, "")
- logrus.Info("FindAllProduct fail,req:%+v", h.req)
- return
- }
- h.resp.Message = message
- }
- func (h *ApproveProjectHandler) checkParam() error {
- return nil
- }
|