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.
46 lines
872 B
46 lines
872 B
package jyy
|
|
|
|
import (
|
|
"recook/internal/back"
|
|
"recook/internal/v2/logic/app/jyy"
|
|
"recook/tools"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type Proxy struct {
|
|
}
|
|
|
|
func (o Proxy) Banners(c *gin.Context) {
|
|
res, _ := jyy.Logic.Banners()
|
|
back.Suc(c, "ok", res)
|
|
}
|
|
|
|
func (o Proxy) Activities(c *gin.Context) {
|
|
res, _ := jyy.Logic.Activities()
|
|
back.Suc(c, "ok", res)
|
|
}
|
|
|
|
func (o Proxy) ShopCartEntries(c *gin.Context) {
|
|
var args jyy.ArgsEntryReq
|
|
if err := tools.ParseParams(&args, c); err != nil {
|
|
back.Err(c, err.Error())
|
|
return
|
|
}
|
|
res := jyy.Logic.ShopCartEntries(args)
|
|
back.Suc(c, "ok", res)
|
|
}
|
|
|
|
func (o Proxy) AddSku(c *gin.Context) {
|
|
var args jyy.ArgsAddSku
|
|
if err := tools.ParseParams(&args, c); err != nil {
|
|
back.Err(c, err.Error())
|
|
return
|
|
}
|
|
if err := jyy.Logic.ShopCartAddSku(args); err != nil {
|
|
back.Fail(c, err.Error())
|
|
} else {
|
|
back.Suc(c, "ok", "")
|
|
}
|
|
}
|