This commit is contained in:
邹宗楠
2022-10-18 10:30:37 +08:00
parent c0d92f612e
commit 03069ce0fe
19 changed files with 187 additions and 19 deletions

View File

@@ -45,6 +45,37 @@ func (p *PrinterBindStore) AddPrinterBindStore(c *gin.Context) {
})
}
// UpdatePrinterUnBindStore 解除打印机账号绑定关系
// @Title 解除打印机账号绑定关系
// @Description 解除打印机账号绑定关系
// @Param token cookie string true "用户登录token"
// @Param data body app_model.RelieveBind true "请求参数"
// @Success 200 {object} controllers.CallResult
// @Failure 200 {object} controllers.CallResult
// @router /bindingStore [post]
func (p *PrinterBindStore) UpdatePrinterUnBindStore(c *gin.Context) {
var (
err error
tokenInfo *model.TokenInfo
param = &tempModel.RelieveBind{}
bindServer = printServer.PrintBindStore{}
)
if err = c.ShouldBind(&param); err != nil {
controllers.BuildErrJson(c, err)
return
}
if tokenInfo = controllers.CheckToken(c); tokenInfo == nil {
return
}
// 解除用户和打印机绑定关系,
controllers.CallFunc(c, func() (retVal interface{}, errCode string, err error) {
err = bindServer.RelievePrintBindStore(tokenInfo.User.UserID, param.PrintNo)
return retVal, "", err
})
}
// CheckStoreBindStatus 检查用户是否可以取消门店打印机绑定
// @Title 检查用户是否可以取消门店打印机绑定
// @Description 检查用户是否可以取消门店打印机绑定