go_dreamfactory/modules/sociaty/api_cross_log.go
2022-10-31 18:27:07 +08:00

39 lines
873 B
Go

package sociaty
import (
"go_dreamfactory/comm"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
// 公会日志
func (this *apiComp) LogCheck(session comm.IUserSession, req *pb.SociatyLogReq) (code pb.ErrorCode) {
return
}
func (this *apiComp) Log(session comm.IUserSession, req *pb.SociatyLogReq) (code pb.ErrorCode, data proto.Message) {
uid := session.GetUserId()
sociaty := this.module.modelSociaty.getUserSociaty(uid)
if sociaty.Id == "" {
code = pb.ErrorCode_SociatyNoFound
this.module.Errorf("uid:%s not in sociaty", uid)
return
}
sl := this.module.modelSociatyLog.logList(sociaty.Id)
rsp := &pb.SociatyLogResp{
Log: &pb.DBSociatyLog{
SociatyId: sociaty.Id,
List: sl,
},
}
if err := session.SendMsg(string(this.module.GetType()), SociatySubTypeLog, rsp); err != nil {
code = pb.ErrorCode_SystemError
}
return
}