temp
This commit is contained in:
@@ -123,7 +123,7 @@ func (c *ApiController) CallOpenAPI() {
|
|||||||
}
|
}
|
||||||
goto end
|
goto end
|
||||||
} else {
|
} else {
|
||||||
if app.Status != model.UserStatusNormal {
|
if app.Status != model.UserStatusNormal || app.DeletedAt != utils.DefaultTimeValue {
|
||||||
errCode = model.ErrCodeGeneralFailed
|
errCode = model.ErrCodeGeneralFailed
|
||||||
err = fmt.Errorf("很抱歉您的应用已失效!")
|
err = fmt.Errorf("很抱歉您的应用已失效!")
|
||||||
goto end
|
goto end
|
||||||
@@ -183,32 +183,29 @@ end:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//添加打印机,暂不支持批量
|
//添加打印机,一次最多50条
|
||||||
func (c *ApiController) AddPrinter(dataMap map[string]interface{}) (data, errCode string, err error) {
|
func (c *ApiController) AddPrinter(dataMap map[string]interface{}) (data, errCode string, err error) {
|
||||||
var (
|
var (
|
||||||
printNo, printKey, name string
|
printers []*model.Printer
|
||||||
appID int
|
//printNo, printKey, name string
|
||||||
|
printersStr string
|
||||||
|
//appID int
|
||||||
)
|
)
|
||||||
globals.SugarLogger.Debugf("Begin API AddPrinter data: [%v]", utils.Format4Output(dataMap, false))
|
globals.SugarLogger.Debugf("Begin API AddPrinter data: [%v]", utils.Format4Output(dataMap, false))
|
||||||
if _, ok := dataMap[keyPrintNo].(string); !ok {
|
if _, ok := dataMap["prints"].(string); !ok {
|
||||||
return buildParamErrCodeAndErr(keyPrintNo)
|
return buildParamErrCodeAndErr("prints")
|
||||||
} else {
|
} else {
|
||||||
if printNo = dataMap[keyPrintNo].(string); printNo == "" {
|
if printersStr = dataMap["prints"].(string); printersStr == "" {
|
||||||
return buildParamErrCodeAndErr(keyPrintNo)
|
return buildParamErrCodeAndErr("prints")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if _, ok := dataMap[keyPrintKey].(string); !ok {
|
if err = utils.UnmarshalUseNumber([]byte(printersStr), &printers); err != nil {
|
||||||
return buildParamErrCodeAndErr(keyPrintKey)
|
return buildParamErrCodeAndErr("prints")
|
||||||
} else {
|
|
||||||
if printKey = dataMap[keyPrintKey].(string); printKey == "" {
|
|
||||||
return buildParamErrCodeAndErr(keyPrintKey)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
appID = utils.Str2Int(dataMap[keyAppID].(string))
|
|
||||||
name = dataMap[keyName].(string)
|
|
||||||
if err = cms.AddPrinter(appID, printNo, printKey, name); err != nil {
|
|
||||||
return "", model.ErrCodeGeneralFailed, err
|
|
||||||
}
|
}
|
||||||
|
//appID = utils.Str2Int(dataMap[keyAppID].(string))
|
||||||
|
//if err = cms.AddPrinter(appID, printers); err != nil {
|
||||||
|
// return "", model.ErrCodeGeneralFailed, err
|
||||||
|
//}
|
||||||
return "", errCode, err
|
return "", errCode, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user