...
|
...
|
@@ -95,3 +95,45 @@ func (this *UserController) ChangePassword() { |
|
|
header := controllers.GetRequestHeader(this.Ctx)
|
|
|
msg = protocol.NewReturnResponse(user.ChangePassword(header, request))
|
|
|
}
|
|
|
|
|
|
//UserCompanys
|
|
|
//@router /userCompanys [post]
|
|
|
func (this *UserController) UserCompanys() {
|
|
|
var msg *protocol.ResponseMessage
|
|
|
defer func() {
|
|
|
this.Resp(msg)
|
|
|
}()
|
|
|
var request *protocol.UserCompanysRequest
|
|
|
if err := json.Unmarshal(this.ByteBody, &request); err != nil {
|
|
|
log.Error(err)
|
|
|
msg = protocol.BadRequestParam(1)
|
|
|
return
|
|
|
}
|
|
|
if b, m := this.Valid(request); !b {
|
|
|
msg = m
|
|
|
return
|
|
|
}
|
|
|
header := controllers.GetRequestHeader(this.Ctx)
|
|
|
msg = protocol.NewReturnResponse(user.UserCompanys(header, request))
|
|
|
}
|
|
|
|
|
|
//SwitchCompany
|
|
|
//@router /switchCompany [post]
|
|
|
func (this *UserController) SwitchCompany() {
|
|
|
var msg *protocol.ResponseMessage
|
|
|
defer func() {
|
|
|
this.Resp(msg)
|
|
|
}()
|
|
|
var request *protocol.SwitchCompanyRequest
|
|
|
if err := json.Unmarshal(this.ByteBody, &request); err != nil {
|
|
|
log.Error(err)
|
|
|
msg = protocol.BadRequestParam(1)
|
|
|
return
|
|
|
}
|
|
|
if b, m := this.Valid(request); !b {
|
|
|
msg = m
|
|
|
return
|
|
|
}
|
|
|
header := controllers.GetRequestHeader(this.Ctx)
|
|
|
msg = protocol.NewReturnResponse(user.SwitchCompany(header, request))
|
|
|
} |
...
|
...
|
|