organization

pull/232/head
wangchuxiao 3 years ago
parent 6ea6a61e90
commit e2f8156a4d

@ -23,6 +23,13 @@
# ../cmd/open_im_demo/ # ../cmd/open_im_demo/
#) #)
# #
dockerfile_list=pwd dockerfile_list=$(ls ../dockerfiles/)
echo ${dockerfile_list}
for dockerfile in $dockerfile_list
do
echo "start to build images" $dockerfile
docker build -t $image . -f ${dockerfile}
echo "build ${dockerfile} ok"
done
echo ${#dockerfile_list[*]}
docker build -t $image . -f deploy.Dockerfile

@ -262,8 +262,8 @@ func GetTagSendLogs(c *gin.Context) {
client := pbOffice.NewOfficeServiceClient(etcdConn) client := pbOffice.NewOfficeServiceClient(etcdConn)
respPb, err := client.GetTagSendLogs(context.Background(), &reqPb) respPb, err := client.GetTagSendLogs(context.Background(), &reqPb)
if err != nil { if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTags failed", err.Error()) log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTagSendLogs failed", err.Error())
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()}) c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetTagSendLogs rpc server failed" + err.Error()})
return return
} }
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil { if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {

@ -56,7 +56,13 @@ func (s *officeServer) Run() {
log.NewInfo("0", "listen network success, ", address, listener) log.NewInfo("0", "listen network success, ", address, listener)
defer listener.Close() defer listener.Close()
//grpc server //grpc server
srv := grpc.NewServer() recvSize := 1024 * 1024 * 30
sendSize := 1024 * 1024 * 30
var options = []grpc.ServerOption{
grpc.MaxRecvMsgSize(recvSize),
grpc.MaxSendMsgSize(sendSize),
}
srv := grpc.NewServer(options...)
defer srv.GracefulStop() defer srv.GracefulStop()
//Service registers with etcd //Service registers with etcd
pbOffice.RegisterOfficeServiceServer(srv, s) pbOffice.RegisterOfficeServiceServer(srv, s)
@ -548,9 +554,18 @@ func (s *officeServer) GetWorkMomentByID(_ context.Context, req *pbOffice.GetWor
if !canSee { if !canSee {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "workMoments not access to user", canSee, workMoment, req.OpUserID) log.NewError(req.OperationID, utils.GetSelfFuncName(), "workMoments not access to user", canSee, workMoment, req.OpUserID)
} }
if err := utils.CopyStructFields(resp.WorkMoment, workMoment); err != nil { if err := utils.CopyStructFields(resp.WorkMoment, workMoment); err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error()) log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields", err.Error())
} }
user, err := imdb.GetUserByUserID(workMoment.UserID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserByUserID failed", err.Error())
}
if user != nil {
resp.WorkMoment.FaceURL = user.FaceURL
resp.WorkMoment.UserName = user.Nickname
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
return resp, nil return resp, nil
} }
@ -573,6 +588,16 @@ func (s *officeServer) GetUserWorkMoments(_ context.Context, req *pbOffice.GetUs
if err := utils.CopyStructFields(&resp.WorkMoments, workMoments); err != nil { if err := utils.CopyStructFields(&resp.WorkMoments, workMoments); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
} }
for _, v := range resp.WorkMoments {
user, err := imdb.GetUserByUserID(v.UserID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error())
}
if user != nil {
v.UserName = user.Nickname
v.FaceURL = user.FaceURL
}
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
return resp, nil return resp, nil
} }
@ -590,6 +615,16 @@ func (s *officeServer) GetUserFriendWorkMoments(_ context.Context, req *pbOffice
if err := utils.CopyStructFields(&resp.WorkMoments, workMoments); err != nil { if err := utils.CopyStructFields(&resp.WorkMoments, workMoments); err != nil {
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
} }
for _, v := range resp.WorkMoments {
user, err := imdb.GetUserByUserID(v.UserID)
if err != nil {
log.NewError(req.OperationID, utils.GetSelfFuncName(), err.Error())
}
if user != nil {
v.UserName = user.Nickname
v.FaceURL = user.FaceURL
}
}
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
return resp, nil return resp, nil
} }

Loading…
Cancel
Save