1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- package handler
- import (
- "github.com/gin-gonic/gin"
- "github.com/sirupsen/logrus"
- "youngee_m_api/consts"
- "youngee_m_api/db"
- "youngee_m_api/model/http_model"
- "youngee_m_api/util"
- )
- func WrapJobDetailHandler(ctx *gin.Context) {
- handler := newJobDetail(ctx)
- BaseRun(handler)
- }
- type JobDetailHandler struct {
- ctx *gin.Context
- req *http_model.JobDetailRequest
- resp *http_model.CommonResponse
- }
- func (s JobDetailHandler) getContext() *gin.Context {
- return s.ctx
- }
- func (s JobDetailHandler) getResponse() interface{} {
- return s.resp
- }
- func (s JobDetailHandler) getRequest() interface{} {
- return s.req
- }
- func (s JobDetailHandler) run() {
- //enterpriseID := middleware.GetSessionAuth(s.ctx).EnterpriseID
- res, err := db.GetJobDetail(s.ctx, s.req)
- if err != nil {
- logrus.Errorf("[GetJobDetail] call Show err:%+v\n", err)
- util.HandlerPackErrorResp(s.resp, consts.ErrorInternal, "")
- logrus.Info("GetJobDetail fail,req:%+v", s.req)
- return
- }
- s.resp.Message = "成功查询岗位"
- s.resp.Data = res
- }
- func (s JobDetailHandler) checkParam() error {
- return nil
- }
- func newJobDetail(ctx *gin.Context) *JobDetailHandler {
- return &JobDetailHandler{
- ctx: ctx,
- req: http_model.NewJobDetailRequest(),
- resp: http_model.NewJobDetailResponse(),
- }
- }
|