Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@ -0,0 +1,59 @@
package http
import (
"go-common/app/admin/main/vip/model"
"go-common/library/ecode"
bm "go-common/library/net/http/blademaster"
)
func platformList(c *bm.Context) {
arg := new(struct {
Order string `form:"order" default:"desc"`
// PN int `form:"pn" default:"1"`
// PS int `form:"ps" default:"20"`
})
if err := c.Bind(arg); err != nil {
return
}
c.JSON(vipSvc.PlatformAll(c, arg.Order))
}
func platformInfo(c *bm.Context) {
arg := new(model.ArgID)
if err := c.Bind(arg); err != nil {
return
}
c.JSON(vipSvc.PlatformByID(c, arg))
}
func platformSave(c *bm.Context) {
arg := new(model.ConfPlatform)
if err := c.Bind(arg); err != nil {
return
}
username, ok := c.Get("username")
if !ok {
c.JSON(nil, ecode.AccessDenied)
return
}
// platform必填可选项为android、ios、web、public
if _, ok := model.PlatformMap[arg.Platform]; !ok {
c.JSON(nil, ecode.RequestErr)
return
}
arg.Operator = username.(string)
c.JSON(vipSvc.PlatformSave(c, arg))
}
func platformDel(c *bm.Context) {
arg := new(model.ArgID)
if err := c.Bind(arg); err != nil {
return
}
username, ok := c.Get("username")
if !ok {
c.JSON(nil, ecode.AccessDenied)
return
}
c.JSON(vipSvc.PlatformDel(c, arg, username.(string)))
}