@@ -0,0 +1,65 @@
|
||||
package activityctrl
|
||||
|
||||
import (
|
||||
"91porn-server/common"
|
||||
"91porn-server/common/stderr"
|
||||
"91porn-server/models/v/prizemod"
|
||||
"91porn-server/web/service/activityser"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// 新增
|
||||
func AddPrize(c *gin.Context) {
|
||||
var in prizemod.AddPrizeCond
|
||||
if err := c.ShouldBind(&in); err != nil {
|
||||
common.ServeJSON(c, stderr.ErrParamError, "web activity Add arg error "+err.Error())
|
||||
return
|
||||
}
|
||||
code := activityser.AddPrize(in)
|
||||
if code != stderr.Success {
|
||||
common.ServeJSON(c, code, nil)
|
||||
return
|
||||
}
|
||||
common.ServeJSON(c, code, "success")
|
||||
}
|
||||
|
||||
// 修改
|
||||
func ModifyPrize(c *gin.Context) {
|
||||
var in *prizemod.ModifyPrizeCond
|
||||
if err := c.ShouldBind(&in); err != nil {
|
||||
common.ServeJSON(c, stderr.ErrParamError, "web activity Modify arg error "+err.Error())
|
||||
return
|
||||
}
|
||||
code := activityser.ModifyPrize(in)
|
||||
if code != stderr.Success {
|
||||
common.ServeJSON(c, code, nil)
|
||||
return
|
||||
}
|
||||
common.ServeJSON(c, code, "success")
|
||||
}
|
||||
|
||||
// 查询
|
||||
func QueryAllPrize(c *gin.Context) {
|
||||
var in *prizemod.QueryAllPrizeCond
|
||||
if err := c.ShouldBindQuery(&in); err != nil {
|
||||
common.ServeJSON(c, stderr.ErrParamError, "web activity QueryAll arg error "+err.Error())
|
||||
return
|
||||
}
|
||||
data, code := activityser.QueryAllPrize(in)
|
||||
if code != stderr.Success {
|
||||
common.ServeJSON(c, code, nil)
|
||||
return
|
||||
}
|
||||
common.ServeJSON(c, code, data)
|
||||
}
|
||||
|
||||
func QueryVipDropDownBox(c *gin.Context) {
|
||||
data, code := activityser.QueryVipDropDownBox()
|
||||
common.ServeJSON(c, code, data)
|
||||
}
|
||||
|
||||
func QueryPrizeDropDownBox(c *gin.Context) {
|
||||
data, code := activityser.QueryPrizeDropDownBox()
|
||||
common.ServeJSON(c, code, data)
|
||||
}
|
||||
Reference in New Issue
Block a user