1
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
package app
|
package app
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.rosy.net.cn/baseapi/utils"
|
|
||||||
"git.rosy.net.cn/jx-print/controllers"
|
"git.rosy.net.cn/jx-print/controllers"
|
||||||
"git.rosy.net.cn/jx-print/globals"
|
|
||||||
"git.rosy.net.cn/jx-print/model"
|
"git.rosy.net.cn/jx-print/model"
|
||||||
"git.rosy.net.cn/jx-print/model/app_model"
|
"git.rosy.net.cn/jx-print/model/app_model"
|
||||||
"git.rosy.net.cn/jx-print/services/print_server/app_server"
|
"git.rosy.net.cn/jx-print/services/print_server/app_server"
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ func (p *Print) UpdatePrinter(c *gin.Context) {
|
|||||||
// TestPrint 测试打印 POST
|
// TestPrint 测试打印 POST
|
||||||
// @Title 测试打印
|
// @Title 测试打印
|
||||||
// @Description 测试打印
|
// @Description 测试打印
|
||||||
// @Param token cookie string true "用户登录token"
|
// @Param token cookie string false "用户登录token"
|
||||||
// @Param data body app_model.TestPrintReq true "请求参数"
|
// @Param data body app_model.TestPrintReq true "请求参数"
|
||||||
// @Success 200 {object} controllers.CallResult
|
// @Success 200 {object} controllers.CallResult
|
||||||
// @Failure 200 {object} controllers.CallResult
|
// @Failure 200 {object} controllers.CallResult
|
||||||
@@ -258,9 +258,9 @@ func (p *Print) TestPrint(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if tokenInfo = controllers.CheckToken(c); tokenInfo == nil {
|
//if tokenInfo = controllers.CheckToken(c); tokenInfo == nil {
|
||||||
return
|
// return
|
||||||
}
|
//}
|
||||||
controllers.CallFunc(c, func() (retVal interface{}, errCode string, err error) {
|
controllers.CallFunc(c, func() (retVal interface{}, errCode string, err error) {
|
||||||
retVal, err = printServer.TestPrint(param.AppID, tokenInfo, param.PrintNo, param.OrderNo, param.Content)
|
retVal, err = printServer.TestPrint(param.AppID, tokenInfo, param.PrintNo, param.OrderNo, param.Content)
|
||||||
return retVal, "", err
|
return retVal, "", err
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
package controllers
|
package controllers
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.rosy.net.cn/jx-print/globals"
|
|
||||||
"git.rosy.net.cn/jx-print/model"
|
"git.rosy.net.cn/jx-print/model"
|
||||||
"git.rosy.net.cn/jx-print/services/print_server"
|
"git.rosy.net.cn/jx-print/services/print_server"
|
||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
|
|||||||
@@ -205,10 +205,10 @@ func TestPrint(appID int, tokenInfo *model.TokenInfo, printNo string, orderNo in
|
|||||||
// return "", fmt.Errorf("未查询到此应用!app_id:%d", appID)
|
// return "", fmt.Errorf("未查询到此应用!app_id:%d", appID)
|
||||||
//}
|
//}
|
||||||
|
|
||||||
printers, _ := dao.GetPrinters(db, appID, printNo, 0, 0, 0)
|
//printers, _ := dao.GetPrinters(db, appID, printNo, 0, 0, 0)
|
||||||
if len(printers) == 0 {
|
//if len(printers) == 0 {
|
||||||
return "", fmt.Errorf("未在该应用下查到此打印机!app_id: %d, print_no: %s", appID, printNo)
|
// return "", fmt.Errorf("未在该应用下查到此打印机!app_id: %d, print_no: %s", appID, printNo)
|
||||||
}
|
//}
|
||||||
|
|
||||||
printMsg := &model.PrintMsg{
|
printMsg := &model.PrintMsg{
|
||||||
CreatedAt: &now,
|
CreatedAt: &now,
|
||||||
|
|||||||
Reference in New Issue
Block a user