@@ -3,7 +3,9 @@ package hdl | |||||
import ( | import ( | ||||
"applet/app/db" | "applet/app/db" | ||||
"applet/app/e" | "applet/app/e" | ||||
"fmt" | |||||
"github.com/gin-gonic/gin" | "github.com/gin-gonic/gin" | ||||
"time" | |||||
) | ) | ||||
// Demo 测试 | // Demo 测试 | ||||
@@ -16,4 +18,13 @@ func Demo(c *gin.Context) { | |||||
return | return | ||||
} | } | ||||
e.OutSuc(c, data, nil) | e.OutSuc(c, data, nil) | ||||
go GoOnExecuting() | |||||
return | |||||
} | |||||
func GoOnExecuting() { | |||||
for i := 0; i < 20; i++ { | |||||
time.Sleep(1 * time.Second) | |||||
fmt.Println(i) | |||||
} | |||||
} | } |
@@ -226,6 +226,7 @@ type CentralKitchenForSchoolReserveListReq struct { | |||||
} | } | ||||
type CentralKitchenForSchoolReserveListResp struct { | type CentralKitchenForSchoolReserveListResp struct { | ||||
Id int `json:"id" ` | |||||
EnterpriseId int `json:"enterprise_id" ` | EnterpriseId int `json:"enterprise_id" ` | ||||
EnterpriseName string `json:"enterprise_name" ` | EnterpriseName string `json:"enterprise_name" ` | ||||
Uid int `json:"uid" ` | Uid int `json:"uid" ` | ||||
@@ -561,6 +561,7 @@ func CentralKitchenForSchoolReserveList(req md.CentralKitchenForSchoolReserveLis | |||||
for _, v := range m { | for _, v := range m { | ||||
resp = append(resp, md.CentralKitchenForSchoolReserveListResp{ | resp = append(resp, md.CentralKitchenForSchoolReserveListResp{ | ||||
Id: v.CentralKitchenForSchoolPackageOrdForReserve.Id, | |||||
EnterpriseId: v.UserIdentity.EnterpriseId, | EnterpriseId: v.UserIdentity.EnterpriseId, | ||||
EnterpriseName: v.Enterprise.Name, | EnterpriseName: v.Enterprise.Name, | ||||
Uid: v.UserIdentity.Uid, | Uid: v.UserIdentity.Uid, | ||||
@@ -3,12 +3,15 @@ package mw | |||||
import ( | import ( | ||||
"applet/app/customer/svc" | "applet/app/customer/svc" | ||||
"applet/app/e" | "applet/app/e" | ||||
"fmt" | |||||
"github.com/gin-gonic/gin" | "github.com/gin-gonic/gin" | ||||
) | ) | ||||
// 检查权限, 签名等等 | // 检查权限, 签名等等 | ||||
func Auth(c *gin.Context) { | func Auth(c *gin.Context) { | ||||
user, err := svc.CheckUser(c) | user, err := svc.CheckUser(c) | ||||
fmt.Println("user>>>>>>>>>", user) | |||||
fmt.Println("err>>>>>>>>>", err) | |||||
if err != nil { | if err != nil { | ||||
switch err.(type) { | switch err.(type) { | ||||
case e.E: | case e.E: | ||||
@@ -186,11 +186,11 @@ func rRole(r *gin.RouterGroup) { | |||||
} | } | ||||
func AdminRoute(r *gin.RouterGroup) { | func AdminRoute(r *gin.RouterGroup) { | ||||
r.GET("/demo", hdl2.Demo) | |||||
r.POST("/login", hdl2.Login) | r.POST("/login", hdl2.Login) | ||||
r.Use(mw.Auth) //检测登录状态 | |||||
r.GET("/demo", hdl2.Demo) | |||||
r.Use(mw.Auth) //检测登录状态 | |||||
r.GET("/userInfo", hdl2.UserInfo) //用户信息 | r.GET("/userInfo", hdl2.UserInfo) //用户信息 | ||||
r.Any("/changePwd", hdl2.Demo) //修改密码 | r.Any("/changePwd", hdl2.Demo) //修改密码 | ||||
r.GET("/sysCfg", hdl2.GetSysCfg) //基础配置-获取 | r.GET("/sysCfg", hdl2.GetSysCfg) //基础配置-获取 | ||||