35 lines
730 B
Go
35 lines
730 B
Go
package user
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
func (this *apiComp) InfoCheck(session comm.IUserSession, req *pb.UserInfoReq) (errdata *pb.ErrorData) {
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) Info(session comm.IUserSession, req *pb.UserInfoReq) (errdata *pb.ErrorData) {
|
|
if code = this.InfoCheck(session, req); errdata != nil {
|
|
return
|
|
}
|
|
|
|
dbUser := this.module.GetUser(session.GetUserId())
|
|
|
|
ue, err := this.module.GetUserExpand(session.GetUserId())
|
|
if err != nil {
|
|
code = pb.ErrorCode_DBError
|
|
return
|
|
}
|
|
|
|
rsp := &pb.UserInfoResp{
|
|
Data: dbUser,
|
|
Ex: ue,
|
|
}
|
|
|
|
if err := session.SendMsg(string(this.module.GetType()), UserSubTypeInfo, rsp); err != nil {
|
|
code = pb.ErrorCode_SystemError
|
|
}
|
|
return
|
|
}
|