huangjiajun 2 週之前
父節點
當前提交
401a8b571e
共有 1 個文件被更改,包括 7 次插入0 次删除
  1. +7
    -0
      app/svc/svc_printer_list.go

+ 7
- 0
app/svc/svc_printer_list.go 查看文件

@@ -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…
取消
儲存