|
- package hdl
-
- import (
- "applet/app/e"
- "applet/app/lib/validate"
- "applet/app/md"
- "applet/app/svc"
- "github.com/gin-gonic/gin"
- )
-
- // DivisionStrategyList
- // @Summary 列表
- // @Tags 分成策略------嘉俊
- // @Description 分成策略-列表
- // @param Authorization header string true "验证参数Bearer和token空格拼接"
- // @Accept json
- // @Produce json
- // @Param args body md.DivisionStrategyReq true "请求参数"
- // @Success 200 {object} md.DivisionStrategyRes "具体看返回内容 这是data里面的数据"
- // @Failure 400 {object} md.Response "具体错误"
- // @Router /api/divisionStrategy/list [POST]
- func DivisionStrategyList(c *gin.Context) {
- var req md.DivisionStrategyReq
- err := c.ShouldBindJSON(&req)
- if err != nil {
- err = validate.HandleValidateErr(err)
- err1 := err.(e.E)
- e.OutErr(c, err1.Code, err1.Error())
- return
- }
- res := svc.DivisionStrategyList(c, req)
- e.OutSuc(c, res, nil)
- return
- }
-
- // DivisionStrategyDetail
- // @Summary 详情
- // @Tags 分成策略------嘉俊
- // @Description 分成策略-详情
- // @param Authorization header string true "验证参数Bearer和token空格拼接"
- // @Accept json
- // @Produce json
- // @Param args body md.DivisionStrategyDetailReq true "请求参数"
- // @Success 200 {object} md.DivisionStrategyDetailRes "具体看返回内容 这是data里面的数据"
- // @Failure 400 {object} md.Response "具体错误"
- // @Router /api/divisionStrategy/detail [POST]
- func DivisionStrategyDetail(c *gin.Context) {
- var req md.DivisionStrategyDetailReq
- err := c.ShouldBindJSON(&req)
- if err != nil {
- err = validate.HandleValidateErr(err)
- err1 := err.(e.E)
- e.OutErr(c, err1.Code, err1.Error())
- return
- }
- res := svc.DivisionStrategyDetail(c, req)
- e.OutSuc(c, res, nil)
- return
- }
-
- // DivisionStrategySave
- // @Summary 保存
- // @Tags 分成策略------嘉俊
- // @Description 分成策略-保存
- // @param Authorization header string true "验证参数Bearer和token空格拼接"
- // @Accept json
- // @Produce json
- // @Param args body md.DivisionStrategyDetailRes true "请求参数"
- // @Success 200 {string} "具体看返回内容 "
- // @Failure 400 {object} md.Response "具体错误"
- // @Router /api/divisionStrategy/save [POST]
- func DivisionStrategySave(c *gin.Context) {
- var req md.DivisionStrategyDetailRes
- err := c.ShouldBindJSON(&req)
- if err != nil {
- err = validate.HandleValidateErr(err)
- err1 := err.(e.E)
- e.OutErr(c, err1.Code, err1.Error())
- return
- }
- err = svc.DivisionStrategySave(c, req)
- if err != nil {
- err = validate.HandleValidateErr(err)
- err1 := err.(e.E)
- e.OutErr(c, err1.Code, err1.Error())
- return
- }
- e.OutSuc(c, "success", nil)
- return
- }
|