Browse Source

update

add_mode
DengBiao 1 year ago
parent
commit
c66b1ef20a
5 changed files with 18 additions and 2 deletions
  1. +11
    -0
      app/admin/hdl/hdl_demo.go
  2. +1
    -0
      app/admin/md/md_enterprise_manage.go
  3. +1
    -0
      app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go
  4. +3
    -0
      app/customer/mw/mw_customer_auth.go
  5. +2
    -2
      app/router/admin_router.go

+ 11
- 0
app/admin/hdl/hdl_demo.go View File

@@ -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)
}
} }

+ 1
- 0
app/admin/md/md_enterprise_manage.go View File

@@ -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" `


+ 1
- 0
app/admin/svc/enterprise_manage/svc_central_kitchen_for_school.go View File

@@ -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
- 0
app/customer/mw/mw_customer_auth.go View File

@@ -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:


+ 2
- 2
app/router/admin_router.go View File

@@ -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) //基础配置-获取


Loading…
Cancel
Save