Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,51 @@
package http
import (
"encoding/json"
"go-common/app/service/bbq/recsys/api/grpc/v1"
bm "go-common/library/net/http/blademaster"
"io/ioutil"
)
// start this just a example
func start(c *bm.Context) {
arg := new(v1.RecsysRequest)
if err := c.Bind(arg); err != nil {
return
}
c.JSON(srv.Start(c, arg))
}
func reqRecsys(c *bm.Context) {
res, _ := ioutil.ReadAll(c.Request.Body)
arg := new(v1.RecsysRequest)
json.Unmarshal(res, &arg)
if err := c.Bind(arg); err != nil {
return
}
c.JSON(srv.Start(c, arg))
}
func relatedRecsys(c *bm.Context) {
res, _ := ioutil.ReadAll(c.Request.Body)
arg := new(v1.RecsysRequest)
json.Unmarshal(res, &arg)
if err := c.Bind(arg); err != nil {
return
}
c.JSON(srv.RelatedRecService(c, arg))
}
func upsRecsys(c *bm.Context) {
res, _ := ioutil.ReadAll(c.Request.Body)
arg := new(v1.RecsysRequest)
json.Unmarshal(res, &arg)
if err := c.Bind(arg); err != nil {
return
}
c.JSON(srv.UpsRecService(c, arg))
}