huangjiajun 2 semanas atrás
pai
commit
401a8b571e
1 arquivos alterados com 7 adições e 0 exclusões
  1. +7
    -0
      app/svc/svc_printer_list.go

+ 7
- 0
app/svc/svc_printer_list.go Ver arquivo

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


Carregando…
Cancelar
Salvar