...
|
...
|
@@ -430,22 +430,32 @@ func (c *CompanyController) InitCompany() { |
|
|
var (
|
|
|
err error
|
|
|
)
|
|
|
if len(param.CompanyName) == 0 {
|
|
|
log.Error("公司名称空")
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
if len(param.AdminAccount) == 0 {
|
|
|
log.Error("人员账号空")
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
if len(param.AdminName) == 0 {
|
|
|
log.Error("人员名称空")
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
param.CompanyName = strings.TrimSpace(param.CompanyName)
|
|
|
param.AdminAccount = strings.TrimSpace(param.AdminAccount)
|
|
|
param.AdminName = strings.TrimSpace(param.AdminName)
|
|
|
if ok := param.IsEnable(); ok {
|
|
|
if len(param.CompanyName) == 0 {
|
|
|
log.Error("公司名称空")
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
if len(param.AdminAccount) == 0 {
|
|
|
log.Error("人员账号空")
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
if len(param.AdminName) == 0 {
|
|
|
log.Error("人员名称空")
|
|
|
msg = protocol.BadRequestParam("1")
|
|
|
return
|
|
|
}
|
|
|
err = servecompany.InitCompanyInfo(param)
|
|
|
} else if ok := param.IsForbid(); ok {
|
|
|
err = servecompany.ForbidCompany(param.CompanyId)
|
|
|
} else {
|
|
|
err = protocol.NewErrWithMessage("1")
|
|
|
}
|
|
|
err = servecompany.InitCompanyInfo(param)
|
|
|
|
|
|
msg = protocol.NewReturnResponse(nil, err)
|
|
|
return
|
|
|
}
|
...
|
...
|
|