35 lines
875 B
Go
35 lines
875 B
Go
package user
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/sys/log"
|
|
"go_dreamfactory/pb"
|
|
|
|
"google.golang.org/protobuf/proto"
|
|
)
|
|
|
|
// 参数校验
|
|
func (this *apiComp) SignCheck(session comm.IUserSession, req *pb.UserSignReq) (code pb.ErrorCode) {
|
|
|
|
return
|
|
}
|
|
|
|
// 登录
|
|
func (this *apiComp) Sign(session comm.IUserSession, req *pb.UserSignReq) (code pb.ErrorCode, data *pb.ErrorData) {
|
|
|
|
if sign, err := this.module.modelSign.GetUserSign(session.GetUserId()); err == nil {
|
|
session.SendMsg(string(this.module.GetType()), "sign", &pb.UserSignResp{
|
|
Data: sign,
|
|
})
|
|
}
|
|
|
|
return
|
|
}
|
|
|
|
func (this *apiComp) sendMsg(session comm.IUserSession, subType string, rsp proto.Message) {
|
|
if err := session.SendMsg(string(this.module.GetType()), subType, rsp); err != nil {
|
|
this.module.Error("UserModule sendMsg err", log.Field{Key: "err", Value: err.Error()})
|
|
return
|
|
}
|
|
}
|