123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- package handler
- import (
- "github.com/gin-gonic/gin"
- "youngee_b_api/model/http_model"
- "youngee_b_api/service"
- )
- func WrapSpecialLocalAddToListHandler(ctx *gin.Context) {
- handler := newLocalLifeAddToListHandler(ctx)
- baseRun(handler)
- }
- func newSpecialLocalAddToListHandler(ctx *gin.Context) *SpecialLocalAddToListHandler {
- return &SpecialLocalAddToListHandler{
- req: http_model.NewSpecialLocalAddToListRequest(),
- resp: http_model.NewSpecialLocalAddToListResponse(),
- ctx: ctx,
- }
- }
- type SpecialLocalAddToListHandler struct {
- req *http_model.SpecialLocalAddToListRequest
- resp *http_model.CommonResponse
- ctx *gin.Context
- }
- func (h *SpecialLocalAddToListHandler) getRequest() interface{} {
- return h.req
- }
- func (h *SpecialLocalAddToListHandler) getContext() *gin.Context {
- return h.ctx
- }
- func (h *SpecialLocalAddToListHandler) getResponse() interface{} {
- return h.resp
- }
- func (h *SpecialLocalAddToListHandler) run() {
- // 1. 加入商单
- createErr := service.SLocalLife.ChangeSupplierStatus(h.ctx, h.req)
- if createErr != nil {
- h.resp.Status = 50000
- h.resp.Message = "加入商单失败"
- return
- }
- h.resp.Status = 20000
- h.resp.Message = "加入商单成功"
- }
- func (h *SpecialLocalAddToListHandler) checkParam() error {
- return nil
- }
|