广告平台(站长使用)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hdl_division_strategy.go 2.8 KiB

2 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. package hdl
  2. import (
  3. "applet/app/e"
  4. "applet/app/lib/validate"
  5. "applet/app/md"
  6. "applet/app/svc"
  7. "github.com/gin-gonic/gin"
  8. )
  9. // DivisionStrategyList
  10. // @Summary 列表
  11. // @Tags 分成策略------嘉俊
  12. // @Description 分成策略-列表
  13. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  14. // @Accept json
  15. // @Produce json
  16. // @Param args body md.DivisionStrategyReq true "请求参数"
  17. // @Success 200 {object} md.DivisionStrategyRes "具体看返回内容 这是data里面的数据"
  18. // @Failure 400 {object} md.Response "具体错误"
  19. // @Router /api/divisionStrategy/list [POST]
  20. func DivisionStrategyList(c *gin.Context) {
  21. var req md.DivisionStrategyReq
  22. err := c.ShouldBindJSON(&req)
  23. if err != nil {
  24. err = validate.HandleValidateErr(err)
  25. err1 := err.(e.E)
  26. e.OutErr(c, err1.Code, err1.Error())
  27. return
  28. }
  29. res := svc.DivisionStrategyList(c, req)
  30. e.OutSuc(c, res, nil)
  31. return
  32. }
  33. // DivisionStrategyDetail
  34. // @Summary 详情
  35. // @Tags 分成策略------嘉俊
  36. // @Description 分成策略-详情
  37. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  38. // @Accept json
  39. // @Produce json
  40. // @Param args body md.DivisionStrategyDetailReq true "请求参数"
  41. // @Success 200 {object} md.DivisionStrategyDetailRes "具体看返回内容 这是data里面的数据"
  42. // @Failure 400 {object} md.Response "具体错误"
  43. // @Router /api/divisionStrategy/detail [POST]
  44. func DivisionStrategyDetail(c *gin.Context) {
  45. var req md.DivisionStrategyDetailReq
  46. err := c.ShouldBindJSON(&req)
  47. if err != nil {
  48. err = validate.HandleValidateErr(err)
  49. err1 := err.(e.E)
  50. e.OutErr(c, err1.Code, err1.Error())
  51. return
  52. }
  53. res := svc.DivisionStrategyDetail(c, req)
  54. e.OutSuc(c, res, nil)
  55. return
  56. }
  57. // DivisionStrategySave
  58. // @Summary 保存
  59. // @Tags 分成策略------嘉俊
  60. // @Description 分成策略-保存
  61. // @param Authorization header string true "验证参数Bearer和token空格拼接"
  62. // @Accept json
  63. // @Produce json
  64. // @Param args body md.DivisionStrategyDetailRes true "请求参数"
  65. // @Success 200 {string} "具体看返回内容 "
  66. // @Failure 400 {object} md.Response "具体错误"
  67. // @Router /api/divisionStrategy/save [POST]
  68. func DivisionStrategySave(c *gin.Context) {
  69. var req md.DivisionStrategyDetailRes
  70. err := c.ShouldBindJSON(&req)
  71. if err != nil {
  72. err = validate.HandleValidateErr(err)
  73. err1 := err.(e.E)
  74. e.OutErr(c, err1.Code, err1.Error())
  75. return
  76. }
  77. err = svc.DivisionStrategySave(c, req)
  78. if err != nil {
  79. err = validate.HandleValidateErr(err)
  80. err1 := err.(e.E)
  81. e.OutErr(c, err1.Code, err1.Error())
  82. return
  83. }
  84. e.OutSuc(c, "success", nil)
  85. return
  86. }