打印机
This commit is contained in:
38
controllers/app/print_setting.go
Normal file
38
controllers/app/print_setting.go
Normal file
@@ -0,0 +1,38 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"git.rosy.net.cn/jx-print/controllers"
|
||||
"git.rosy.net.cn/jx-print/model"
|
||||
tempModel "git.rosy.net.cn/jx-print/model/app_model"
|
||||
"git.rosy.net.cn/jx-print/services/print_server/app_server"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type PrintSetting struct{}
|
||||
|
||||
var PrintSettingController = new(PrintSetting)
|
||||
|
||||
// UpdatePrintSetting 修改打印机打印设置
|
||||
// @Title 修改打印机打印设置
|
||||
// @Description 修改打印机打印设置
|
||||
// @Param token cookie string true "用户登录token"
|
||||
// @Param data body app_model.UpdatePrintSetting true "请求参数"
|
||||
// @Success 200 {object} controllers.CallResult
|
||||
// @Failure 200 {object} controllers.CallResult
|
||||
// @router /updatePrintSetting [post]
|
||||
func (p *PrintSetting) UpdatePrintSetting(c *gin.Context) {
|
||||
var (
|
||||
err error
|
||||
tokenInfo *model.TokenInfo
|
||||
param = &tempModel.UpdatePrintSetting{}
|
||||
server = app_server.PrintSettingInfoServer
|
||||
)
|
||||
if err = c.ShouldBind(param); err != nil {
|
||||
controllers.BuildErrJson(c, err)
|
||||
return
|
||||
}
|
||||
controllers.CallFunc(c, func() (retVal interface{}, errCode string, err error) {
|
||||
err = server.UpdatePrintSetting(tokenInfo.User.UserID, param)
|
||||
return "", "", err
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user