huangjiajun 1 month ago
parent
commit
401a8b571e
1 changed files with 7 additions and 0 deletions
  1. +7
    -0
      app/svc/svc_printer_list.go

+ 7
- 0
app/svc/svc_printer_list.go View File

@@ -53,6 +53,8 @@ func PrinterIndexList(c *gin.Context) {
e.OutErr(c, e.ERR_MASTER_ID, nil)
return
}
user := GetUser(c)
search.StoreId = utils.IntToStr(user.Info.Uid)
list, err := db.GetPrinterIndexList(engine, &search)
fmt.Println(err)
fmt.Println(list)
@@ -98,6 +100,7 @@ func PrinterModuleList(c *gin.Context) {
e.OutErr(c, e.ERR_MASTER_ID, nil)
return
}

list, err := db.GetPrinterModuleList(engine, &search)
if err != nil {
e.OutErr(c, e.ERR_BAD_REQUEST, err)
@@ -305,6 +308,8 @@ func PrinterIndexRecordList(c *gin.Context) {
e.OutErr(c, e.ERR_MASTER_ID, nil)
return
}
user := GetUser(c)
search.StoreId = utils.IntToStr(user.Info.Uid)
list, err := db.GetPrinterRecordList(engine, &search)
if err != nil {
e.OutErr(c, e.ERR_BAD_REQUEST, err)
@@ -338,6 +343,8 @@ func PrinterIndexToSend(c *gin.Context) {
e.OutErr(c, e.ERR_INVALID_ARGS, err)
return
}
user := GetUser(c)
search.StoreId = utils.IntToStr(user.Info.Uid)
// 加锁 防止并发
mutexKey := fmt.Sprintf("%s:printer_send:p%ss%s", c.GetString("mid"), search.PrinterId, search.StoreId)
withdrawAvailable, err := cache.Do("SET", mutexKey, 1, "EX", 5, "NX")


Loading…
Cancel
Save