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 WrapDeleteauthorizationHandler(ctx *gin.Context) { handler := newDeleteKsauthorizationHandler(ctx) BaseRun(handler) } type DeleteKsauthorizationHandler struct { ctx *gin.Context req *http_model.DeleteKsauthorizationRequest resp *http_model.CommonResponse } func (c DeleteKsauthorizationHandler) getContext() *gin.Context { return c.ctx } func (c DeleteKsauthorizationHandler) getResponse() interface{} { return c.resp } func (c DeleteKsauthorizationHandler) getRequest() interface{} { return c.req } func (c DeleteKsauthorizationHandler) run() { data := http_model.DeleteKsauthorizationRequest{} data = *c.req err := db.DeleteKsauthorization(c.ctx, &data) if err != nil { logrus.Errorf("[DeleteKsauthorizationHandler] call DeleteKsauthorization err:%+v\n", err) util.HandlerPackErrorResp(c.resp, consts.ErrorInternal, "") logrus.Info("DeleteKsauthorizationHandler fail,req:%+v", c.req) return } c.resp.Message = "成功删除授权" } func (c DeleteKsauthorizationHandler) checkParam() error { return nil } func newDeleteKsauthorizationHandler(ctx *gin.Context) *DeleteKsauthorizationHandler { return &DeleteKsauthorizationHandler{ ctx: ctx, req: http_model.NewDeleteKsauthorizationRequest(), resp: http_model.NewDeleteKsauthorizationResponse(), } }