diff --git a/cmd/open_im_api/main.go b/cmd/open_im_api/main.go index f9f8103f4..1a6a51808 100644 --- a/cmd/open_im_api/main.go +++ b/cmd/open_im_api/main.go @@ -136,6 +136,16 @@ func main() { officeGroup.POST("/set_tag", office.SetTag) officeGroup.POST("/send_msg_to_tag", office.SendMsg2Tag) officeGroup.POST("/get_send_tag_log", office.GetTagSendLogs) + + officeGroup.POST("/create_one_work_moment", office.CreateOneWorkMoment) + officeGroup.POST("/delete_one_work_moment", office.DeleteOneWorkMoment) + officeGroup.POST("/like_one_work_moment", office.LikeOneWorkMoment) + officeGroup.POST("/comment_one_work_moment", office.CommentOneWorkMoment) + officeGroup.POST("/get_user_work_moments", office.GetUserWorkMoments) + officeGroup.POST("/get_user_friend_work_moments", office.GetUserFriendWorkMoments) + officeGroup.POST("/get_user_work_moments_comments_msg", office.GetUserWorkMomentsCommentsMsg) + officeGroup.POST("/clear_user_work_moments_comments_msg", office.ClearUserWorkMomentsCommentsMsg) + officeGroup.POST("/set_user_work_moments_level", office.SetUserWorkMomentsLevel) } organizationGroup := r.Group("/organization") diff --git a/config/config.yaml b/config/config.yaml index c78611634..b2393c2a5 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -167,7 +167,7 @@ longconnsvr: websocketMaxMsgLen: 4096 websocketTimeOut: 10 -## 推送只能开启一个 +## 推送只能开启一个 enable代表开启 push: tpns: #腾讯推送,暂未测试 暂不要使用 ios: diff --git a/internal/api/office/work_moments.go b/internal/api/office/work_moments.go new file mode 100644 index 000000000..ac7619dda --- /dev/null +++ b/internal/api/office/work_moments.go @@ -0,0 +1,371 @@ +package office + +import ( + apiStruct "Open_IM/pkg/base_info" + "Open_IM/pkg/common/config" + "Open_IM/pkg/common/log" + "Open_IM/pkg/common/token_verify" + "Open_IM/pkg/grpc-etcdv3/getcdv3" + pbOffice "Open_IM/pkg/proto/office" + pbCommon "Open_IM/pkg/proto/sdk_ws" + "Open_IM/pkg/utils" + "context" + "github.com/gin-gonic/gin" + "net/http" + "strings" +) + +func CreateOneWorkMoment(c *gin.Context) { + var ( + req apiStruct.CreateOneWorkMomentReq + resp apiStruct.CreateOneWorkMomentResp + reqPb pbOffice.CreateOneWorkMomentReq + respPb *pbOffice.CreateOneWorkMomentResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.CreateOneWorkMoment(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CreateOneWorkMoment rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateOneWorkMoment rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func DeleteOneWorkMoment(c *gin.Context) { + var ( + req apiStruct.DeleteOneWorkMomentReq + resp apiStruct.DeleteOneWorkMomentResp + reqPb pbOffice.DeleteOneWorkMomentReq + respPb *pbOffice.DeleteOneWorkMomentResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.DeleteOneWorkMoment(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DeleteOneWorkMoment rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "DeleteOneWorkMoment rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func LikeOneWorkMoment(c *gin.Context) { + var ( + req apiStruct.LikeOneWorkMomentReq + resp apiStruct.LikeOneWorkMomentResp + reqPb pbOffice.LikeOneWorkMomentReq + respPb *pbOffice.LikeOneWorkMomentResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.LikeOneWorkMoment(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "LikeOneWorkMoment rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "LikeOneWorkMoment rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func CommentOneWorkMoment(c *gin.Context) { + var ( + req apiStruct.CommentOneWorkMomentReq + resp apiStruct.CommentOneWorkMomentResp + reqPb pbOffice.CommentOneWorkMomentReq + respPb *pbOffice.CommentOneWorkMomentResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.CommentOneWorkMoment(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CommentOneWorkMoment rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CommentOneWorkMoment rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetUserWorkMoments(c *gin.Context) { + var ( + req apiStruct.GetUserWorkMomentsReq + resp apiStruct.GetUserWorkMomentsResp + reqPb pbOffice.GetUserWorkMomentsReq + respPb *pbOffice.GetUserWorkMomentsResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.OperationID = req.OperationID + reqPb.Pagination = &pbCommon.RequestPagination{ + PageNumber: req.PageNumber, + ShowNumber: req.ShowNumber, + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.GetUserWorkMoments(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserWorkMoments rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserWorkMoments rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + resp.Data.WorkMoments = respPb.WorkMoments + resp.Data.ShowNumber = respPb.Pagination.ShowNumber + resp.Data.CurrentPage = respPb.Pagination.CurrentPage + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetUserFriendWorkMoments(c *gin.Context) { + var ( + req apiStruct.GetUserFriendWorkMomentsReq + resp apiStruct.GetUserFriendWorkMomentsResp + reqPb pbOffice.GetUserFriendWorkMomentsReq + respPb *pbOffice.GetUserFriendWorkMomentsResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.OperationID = req.OperationID + reqPb.Pagination = &pbCommon.RequestPagination{ + PageNumber: req.PageNumber, + ShowNumber: req.ShowNumber, + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.GetUserFriendWorkMoments(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserFriendWorkMoments rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserFriendWorkMoments rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + resp.Data.WorkMoments = respPb.WorkMoments + resp.Data.ShowNumber = respPb.Pagination.ShowNumber + resp.Data.CurrentPage = respPb.Pagination.CurrentPage + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func GetUserWorkMomentsCommentsMsg(c *gin.Context) { + var ( + req apiStruct.GetUserWorkMomentsCommentsMsgReq + resp apiStruct.GetUserWorkMomentsCommentsMsgResp + reqPb pbOffice.GetUserWorkMomentsCommentsMsgReq + respPb *pbOffice.GetUserWorkMomentsCommentsMsgResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.OperationID = req.OperationID + reqPb.Pagination = &pbCommon.RequestPagination{ + PageNumber: req.PageNumber, + ShowNumber: req.ShowNumber, + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.GetUserWorkMomentsCommentsMsg(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserWorkMomentsCommentsMsg rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserWorkMomentsCommentsMsg rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + resp.Data.CurrentPage = respPb.Pagination.CurrentPage + resp.Data.ShowNumber = respPb.Pagination.ShowNumber + resp.Data.CommentMsgs = respPb.CommentsMsgs + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func SetUserWorkMomentsLevel(c *gin.Context) { + var ( + req apiStruct.SetUserWorkMomentsLevelReq + resp apiStruct.SetUserWorkMomentsLevelResp + reqPb pbOffice.SetUserWorkMomentsLevelReq + respPb *pbOffice.SetUserWorkMomentsLevelResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + if err := utils.CopyStructFields(&reqPb, req); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + reqPb.UserID = userID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.SetUserWorkMomentsLevel(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetUserWorkMomentsLevel rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "SetUserWorkMomentsLevel rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} + +func ClearUserWorkMomentsCommentsMsg(c *gin.Context) { + var ( + req apiStruct.ClearUserWorkMomentsCommentsMsgReq + resp apiStruct.ClearUserWorkMomentsCommentsMsgResp + reqPb pbOffice.ClearUserWorkMomentsCommentsMsgReq + respPb *pbOffice.ClearUserWorkMomentsCommentsMsgResp + ) + if err := c.BindJSON(&req); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "bind json failed", err.Error()) + c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "bind json failed " + err.Error()}) + return + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req) + ok, userID := token_verify.GetUserIDFromToken(c.Request.Header.Get("token"), req.OperationID) + if !ok { + log.NewError(req.OperationID, "GetUserIDFromToken false ", c.Request.Header.Get("token")) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "GetUserIDFromToken failed"}) + return + } + reqPb.UserID = userID + reqPb.OperationID = req.OperationID + etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName) + client := pbOffice.NewOfficeServiceClient(etcdConn) + respPb, err := client.ClearUserWorkMomentsCommentsMsg(context.Background(), &reqPb) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "ClearUserWorkMomentsCommentsMsg rpc failed", err.Error()) + c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "ClearUserWorkMomentsCommentsMsg rpc server failed" + err.Error()}) + return + } + if err := utils.CopyStructFields(&resp, respPb.CommonResp); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp) + c.JSON(http.StatusOK, resp) +} diff --git a/internal/push/getui/push.go b/internal/push/getui/push.go index 18197558a..b91b51fc2 100644 --- a/internal/push/getui/push.go +++ b/internal/push/getui/push.go @@ -61,14 +61,34 @@ type PushReq struct { Notification Notification `json:"notification,omitempty"` Transmission string `json:"transmission,omitempty"` } `json:"push_message"` + PushChannel struct { + Ios Ios `json:"ios"` + Android Android `json:"android"` + } `json:"push_channel"` +} + +type Ios struct { + Aps struct { + Sound string `json:"sound"` + Alert Alert `json:"alert"` + } `json:"aps"` +} + +type Alert struct { + Title string `json:"title"` + Body string `json:"body"` +} + +type Android struct { + Ups struct { + Notification Notification `json:"notification"` + } `json:"ups"` } type Notification struct { Title string `json:"title"` Body string `json:"body"` ClickType string `json:"click_type"` - //Intent string `json:"intent,omitempty"` - //Url string `json:"url,omitempty"` } type PushResp struct { @@ -78,7 +98,7 @@ func newGetuiClient() *Getui { return &Getui{} } -func (g *Getui) Push(userIDList []string, alert, detailContent, platform, operationID string) (resp string, err error) { +func (g *Getui) Push(userIDList []string, alert, detailContent, operationID string) (resp string, err error) { token, err := db.DB.GetGetuiToken() log.NewDebug(operationID, utils.GetSelfFuncName(), "token:", token) if err != nil { @@ -102,13 +122,25 @@ func (g *Getui) Push(userIDList []string, alert, detailContent, platform, operat Body: alert, ClickType: "startapp", } + pushReq.PushChannel.Ios.Aps.Sound = "default" + pushReq.PushChannel.Ios.Aps.Alert = Alert{ + Title: alert, + Body: alert, + } + pushReq.PushChannel.Android.Ups.Notification = Notification{ + Title: alert, + Body: alert, + ClickType: "startapp", + } pushResp := PushResp{} err = g.request(PushURL, pushReq, token, &pushResp, operationID) switch err { case TokenExpireError: - _, err = g.getTokenAndSave2Redis(operationID) + token, err = g.getTokenAndSave2Redis(operationID) if err != nil { log.NewError(operationID, utils.GetSelfFuncName(), "getTokenAndSave2Redis failed, ", err.Error()) + } else { + log.NewInfo(operationID, utils.GetSelfFuncName(), "getTokenAndSave2Redis: ", token) } } if err != nil { diff --git a/internal/push/jpush/push.go b/internal/push/jpush/push.go index 439ee845f..aaaee306d 100644 --- a/internal/push/jpush/push.go +++ b/internal/push/jpush/push.go @@ -32,13 +32,13 @@ func (j *JPush) SetAlias(cid, alias string) (resp string, err error) { return resp, nil } -func (j *JPush) Push(accounts []string, alert, detailContent, platform, operationID string) (string, error) { +func (j *JPush) Push(accounts []string, alert, detailContent, operationID string) (string, error) { var pf requestBody.Platform - _ = pf.SetPlatform(platform) + pf.SetAll() var au requestBody.Audience au.SetAlias(accounts) var no requestBody.Notification - no.SetAlert(alert, platform) + no.SetAlert(alert) var me requestBody.Message me.SetMsgContent(detailContent) var o requestBody.Options diff --git a/internal/push/jpush/requestBody/notification.go b/internal/push/jpush/requestBody/notification.go index 3f2876612..9ff49a439 100644 --- a/internal/push/jpush/requestBody/notification.go +++ b/internal/push/jpush/requestBody/notification.go @@ -2,7 +2,6 @@ package requestBody import ( "Open_IM/pkg/common/config" - "Open_IM/pkg/common/constant" ) type Notification struct { @@ -23,18 +22,14 @@ type Ios struct { Badge string `json:"badge,omitempty"` } -func (n *Notification) SetAlert(alert, platform string) { +func (n *Notification) SetAlert(alert string) { n.Alert = alert - switch platform { - case constant.AndroidPlatformStr: - n.Android.Alert = alert - n.SetAndroidIntent() - case constant.IOSPlatformStr: - n.IOS.Alert = alert - n.IOS.Sound = "default" - n.IOS.Badge = "+1" - default: - } + n.Android.Alert = alert + n.SetAndroidIntent() + n.IOS.Alert = alert + n.IOS.Sound = "default" + n.IOS.Badge = "+1" + } func (n *Notification) SetAndroidIntent() { n.Android.Intent.URL = config.Config.Push.Jpns.PushIntent diff --git a/internal/push/logic/push_to_client.go b/internal/push/logic/push_to_client.go index c6e512ccb..607d36db0 100644 --- a/internal/push/logic/push_to_client.go +++ b/internal/push/logic/push_to_client.go @@ -59,68 +59,66 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) { if v.ResultCode == 0 { continue } - //supported terminal - for _, t := range pushTerminal { - if v.RecvPlatFormID == t { - //Use offline push messaging - var UIDList []string - UIDList = append(UIDList, v.RecvID) - customContent := OpenIMContent{ - SessionType: int(pushMsg.MsgData.SessionType), - From: pushMsg.MsgData.SendID, - To: pushMsg.MsgData.RecvID, - Seq: pushMsg.MsgData.Seq, - } - bCustomContent, _ := json.Marshal(customContent) - jsonCustomContent := string(bCustomContent) - var content string - if pushMsg.MsgData.OfflinePushInfo != nil { - content = pushMsg.MsgData.OfflinePushInfo.Title - - } else { - switch pushMsg.MsgData.ContentType { - case constant.Text: - content = constant.ContentType2PushContent[constant.Text] - case constant.Picture: - content = constant.ContentType2PushContent[constant.Picture] - case constant.Voice: - content = constant.ContentType2PushContent[constant.Voice] - case constant.Video: - content = constant.ContentType2PushContent[constant.Video] - case constant.File: - content = constant.ContentType2PushContent[constant.File] - case constant.AtText: - a := AtContent{} - _ = utils.JsonStringToStruct(string(pushMsg.MsgData.Content), &a) - if utils.IsContain(v.RecvID, a.AtUserList) { - content = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common] - } else { - content = constant.ContentType2PushContent[constant.GroupMsg] - } - default: - content = constant.ContentType2PushContent[constant.Common] - } - } - var offlinePusher pusher.OfflinePusher - if config.Config.Push.Getui.Enable { - log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), config.Config.Push.Getui) - offlinePusher = getui.GetuiClient - } - if config.Config.Push.Jpns.Enable { - offlinePusher = jpush.JPushClient - } - if offlinePusher == nil { - offlinePusher = jpush.JPushClient - } - pushResult, err := offlinePusher.Push(UIDList, content, jsonCustomContent, constant.PlatformIDToName(t), pushMsg.OperationID) - if err != nil { - log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error(), constant.PlatformIDToName(t)) - } else { - log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData, constant.PlatformIDToName(t)) - } - + if utils.IsContainInt32(v.RecvPlatFormID, pushTerminal) { + //Use offline push messaging + var UIDList []string + UIDList = append(UIDList, v.RecvID) + customContent := OpenIMContent{ + SessionType: int(pushMsg.MsgData.SessionType), + From: pushMsg.MsgData.SendID, + To: pushMsg.MsgData.RecvID, + Seq: pushMsg.MsgData.Seq, } + bCustomContent, _ := json.Marshal(customContent) + jsonCustomContent := string(bCustomContent) + var content string + if pushMsg.MsgData.OfflinePushInfo != nil { + content = pushMsg.MsgData.OfflinePushInfo.Title + + } else { + switch pushMsg.MsgData.ContentType { + case constant.Text: + content = constant.ContentType2PushContent[constant.Text] + case constant.Picture: + content = constant.ContentType2PushContent[constant.Picture] + case constant.Voice: + content = constant.ContentType2PushContent[constant.Voice] + case constant.Video: + content = constant.ContentType2PushContent[constant.Video] + case constant.File: + content = constant.ContentType2PushContent[constant.File] + case constant.AtText: + a := AtContent{} + _ = utils.JsonStringToStruct(string(pushMsg.MsgData.Content), &a) + if utils.IsContain(v.RecvID, a.AtUserList) { + content = constant.ContentType2PushContent[constant.AtText] + constant.ContentType2PushContent[constant.Common] + } else { + content = constant.ContentType2PushContent[constant.GroupMsg] + } + default: + content = constant.ContentType2PushContent[constant.Common] + } + } + var offlinePusher pusher.OfflinePusher + if config.Config.Push.Getui.Enable { + log.NewInfo(pushMsg.OperationID, utils.GetSelfFuncName(), config.Config.Push.Getui) + offlinePusher = getui.GetuiClient + } + if config.Config.Push.Jpns.Enable { + offlinePusher = jpush.JPushClient + } + if offlinePusher == nil { + offlinePusher = jpush.JPushClient + } + pushResult, err := offlinePusher.Push(UIDList, content, jsonCustomContent, pushMsg.OperationID) + if err != nil { + log.NewError(pushMsg.OperationID, "offline push error", pushMsg.String(), err.Error()) + } else { + log.NewDebug(pushMsg.OperationID, "offline push return result is ", pushResult, pushMsg.MsgData) + } + break } + } } diff --git a/internal/push/push_interface.go b/internal/push/push_interface.go index f89fcf664..59b4764b4 100644 --- a/internal/push/push_interface.go +++ b/internal/push/push_interface.go @@ -1,5 +1,5 @@ package push type OfflinePusher interface { - Push(userIDList []string, alert, detailContent, platform, operationID string) (resp string, err error) + Push(userIDList []string, alert, detailContent, operationID string) (resp string, err error) } diff --git a/internal/rpc/office/office.go b/internal/rpc/office/office.go index 43e757497..53e58f223 100644 --- a/internal/rpc/office/office.go +++ b/internal/rpc/office/office.go @@ -266,3 +266,180 @@ func (s *officeServer) GetUserTagByID(_ context.Context, req *pbOffice.GetUserTa log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) return resp, nil } + +func (s *officeServer) CreateOneWorkMoment(_ context.Context, req *pbOffice.CreateOneWorkMomentReq) (resp *pbOffice.CreateOneWorkMomentResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.CreateOneWorkMomentResp{} + workMoment := db.WorkMoment{} + if err := utils.CopyStructFields(&workMoment, req.WorkMoment); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + err = db.DB.CreateOneWorkMoment(&workMoment) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CreateOneWorkMoment", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) DeleteOneWorkMoment(_ context.Context, req *pbOffice.DeleteOneWorkMomentReq) (resp *pbOffice.DeleteOneWorkMomentResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.DeleteOneWorkMomentResp{} + err = db.DB.DeleteOneWorkMoment(req.WorkMomentID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "DeleteOneWorkMoment", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) LikeOneWorkMoment(_ context.Context, req *pbOffice.LikeOneWorkMomentReq) (resp *pbOffice.LikeOneWorkMomentResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.LikeOneWorkMomentResp{} + workMoment, err := db.DB.GetWorkMomentByID(req.WorkMomentID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetWorkMomentByID failed", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + if workMoment.UserID != req.WorkMomentID { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "workMoment.UserID != req.WorkMomentID ", workMoment, req.WorkMomentID) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg} + return resp, nil + } + if err = db.DB.LikeOneWorkMoment(req.UserID, req.WorkMomentID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "LikeOneWorkMoment failed ", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) CommentOneWorkMoment(_ context.Context, req *pbOffice.CommentOneWorkMomentReq) (resp *pbOffice.CommentOneWorkMomentResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.CommentOneWorkMomentResp{} + commentUserName, err := imdb.GetUserNameByUserID(req.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID commentUserName failed", req.UserID, err.Error()) + } + var replyUserName string + if req.ReplyUserID != "" { + replyUserName, err = imdb.GetUserNameByUserID(req.ReplyUserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID get replyUserName failed", req.ReplyUserID, err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + } + comment := db.Comment{ + UserID: req.UserID, + UserName: commentUserName, + ReplyUserID: req.ReplyUserID, + ReplyUserName: replyUserName, + ContentID: "", + Content: req.Content, + CreateTime: int32(time.Now().Unix()), + } + if err = db.DB.CommentOneWorkMoment(comment, req.WorkMomentID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "CommentOneWorkMoment failed", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) GetUserWorkMoments(_ context.Context, req *pbOffice.GetUserWorkMomentsReq) (resp *pbOffice.GetUserWorkMomentsResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.GetUserWorkMomentsResp{} + workMoments, err := db.DB.GetUserWorkMoments(req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), err) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + if err := utils.CopyStructFields(resp.WorkMoments, workMoments); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + resp.Pagination = &pbCommon.ResponsePagination{CurrentPage: req.Pagination.PageNumber, ShowNumber: req.Pagination.ShowNumber} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) GetUserFriendWorkMoments(_ context.Context, req *pbOffice.GetUserFriendWorkMomentsReq) (resp *pbOffice.GetUserFriendWorkMomentsResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.GetUserFriendWorkMomentsResp{} + friendIDList, err := imdb.GetFriendIDListByUserID(req.UserID) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetFriendIDListByUserID", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "friendIDList: ", friendIDList) + workMoments, err := db.DB.GetUserFriendWorkMoments(friendIDList, req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserFriendWorkMoments", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + if err := utils.CopyStructFields(resp.WorkMoments, workMoments); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error()) + } + resp.Pagination = &pbCommon.ResponsePagination{CurrentPage: req.Pagination.PageNumber, ShowNumber: req.Pagination.ShowNumber} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) GetUserWorkMomentsCommentsMsg(_ context.Context, req *pbOffice.GetUserWorkMomentsCommentsMsgReq) (resp *pbOffice.GetUserWorkMomentsCommentsMsgResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.GetUserWorkMomentsCommentsMsgResp{CommentsMsgs: []*pbOffice.CommentsMsg{}} + workMomentsCommentMsgs, err := db.DB.GetUserWorkMomentsCommentsMsg(req.UserID, req.Pagination.ShowNumber, req.Pagination.PageNumber) + if err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserWorkMomentsCommentsMsg", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + for _, commentMsg := range workMomentsCommentMsgs { + comment := pbOffice.Comment{} + if err := utils.CopyStructFields(&comment, commentMsg); err != nil { + log.NewDebug(req.OperationID, utils.GetSelfFuncName(), err.Error()) + } + resp.CommentsMsgs = append(resp.CommentsMsgs, &pbOffice.CommentsMsg{ + Comment: &comment, + WorkMomentID: commentMsg.WorkMomentID, + Content: commentMsg.Content, + }) + } + resp.Pagination = &pbCommon.ResponsePagination{CurrentPage: req.Pagination.PageNumber, ShowNumber: req.Pagination.ShowNumber} + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) SetUserWorkMomentsLevel(_ context.Context, req *pbOffice.SetUserWorkMomentsLevelReq) (resp *pbOffice.SetUserWorkMomentsLevelResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.SetUserWorkMomentsLevelResp{} + if err := db.DB.SetUserWorkMomentsLevel(req.UserID, req.Level); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetUserWorkMomentsLevel failed", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} + +func (s *officeServer) ClearUserWorkMomentsCommentsMsg(_ context.Context, req *pbOffice.ClearUserWorkMomentsCommentsMsgReq) (resp *pbOffice.ClearUserWorkMomentsCommentsMsgResp, err error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String()) + resp = &pbOffice.ClearUserWorkMomentsCommentsMsgResp{} + if err := db.DB.ClearUserWorkMomentsCommentsMsg(req.UserID); err != nil { + log.NewError(req.OperationID, utils.GetSelfFuncName(), "ClearUserWorkMomentsCommentsMsg", err.Error()) + resp.CommonResp = &pbOffice.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg} + return resp, nil + } + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String()) + return resp, nil +} diff --git a/pkg/base_info/work_moments_struct.go b/pkg/base_info/work_moments_struct.go new file mode 100644 index 000000000..22d38df37 --- /dev/null +++ b/pkg/base_info/work_moments_struct.go @@ -0,0 +1,97 @@ +package base_info + +import "Open_IM/pkg/proto/office" + +type CreateOneWorkMomentReq struct { + office.CreateOneWorkMomentReq +} + +type CreateOneWorkMomentResp struct { + CommResp +} + +type DeleteOneWorkMomentReq struct { + office.DeleteOneWorkMomentReq +} + +type DeleteOneWorkMomentResp struct { + CommResp +} + +type LikeOneWorkMomentReq struct { + office.LikeOneWorkMomentReq +} + +type LikeOneWorkMomentResp struct { + CommResp +} + +type CommentOneWorkMomentReq struct { + office.CommentOneWorkMomentReq +} + +type CommentOneWorkMomentResp struct { + CommResp +} + +type WorkMomentsUserCommonReq struct { + PageNumber int32 `json:"pageNumber" binding:"required"` + ShowNumber int32 `json:"showNumber" binding:"required"` + OperationID string `json:"operationID" binding:"required"` + UserID string `json:"UserID" binding:"required"` +} + +type GetUserWorkMomentsReq struct { + WorkMomentsUserCommonReq +} + +type GetUserWorkMomentsResp struct { + CommResp + Data struct { + WorkMoments []*office.WorkMoment `json:"workMoments"` + CurrentPage int32 `json:"currentPage"` + ShowNumber int32 `json:"showNumber"` + } `json:"data"` +} + +type GetUserFriendWorkMomentsReq struct { + WorkMomentsUserCommonReq +} + +type GetUserFriendWorkMomentsResp struct { + CommResp + Data struct { + WorkMoments []*office.WorkMoment `json:"workMoments"` + CurrentPage int32 `json:"currentPage"` + ShowNumber int32 `json:"showNumber"` + } `json:"data"` +} + +type GetUserWorkMomentsCommentsMsgReq struct { + WorkMomentsUserCommonReq +} + +type GetUserWorkMomentsCommentsMsgResp struct { + CommResp + Data struct { + CommentMsgs []*office.CommentsMsg `json:"comments"` + CurrentPage int32 `json:"currentPage"` + ShowNumber int32 `json:"showNumber"` + } `json:"data"` +} + +type SetUserWorkMomentsLevelReq struct { + office.SetUserWorkMomentsLevelReq +} + +type SetUserWorkMomentsLevelResp struct { + CommResp +} + +type ClearUserWorkMomentsCommentsMsgReq struct { + office.ClearUserWorkMomentsCommentsMsgReq +} + +type ClearUserWorkMomentsCommentsMsgResp struct { + CommResp +} diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go index f9550e7b3..bd465d6ff 100644 --- a/pkg/common/db/model.go +++ b/pkg/common/db/model.go @@ -46,11 +46,15 @@ func init() { // example: mongodb://$user:$password@mongo1.mongo:27017,mongo2.mongo:27017,mongo3.mongo:27017/$DBDatabase/?replicaSet=rs0&readPreference=secondary&authSource=admin&maxPoolSize=$DBMaxPoolSize uri = config.Config.Mongo.DBUri } else { - uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d", - config.Config.Mongo.DBAddress[0], config.Config.Mongo.DBDatabase, - config.Config.Mongo.DBMaxPoolSize) + if config.Config.Mongo.DBPassword != "" && config.Config.Mongo.DBUserName != "" { + uri = fmt.Sprintf("mongodb://%s:%s@%s/%s?maxPoolSize=%d", config.Config.Mongo.DBUserName, config.Config.Mongo.DBPassword, config.Config.Mongo.DBAddress[0], + config.Config.Mongo.DBDatabase, config.Config.Mongo.DBMaxPoolSize) + } else { + uri = fmt.Sprintf("mongodb://%s/%s/?maxPoolSize=%d", + config.Config.Mongo.DBAddress[0], config.Config.Mongo.DBDatabase, + config.Config.Mongo.DBMaxPoolSize) + } } - mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri)) if err != nil { fmt.Println(" mongo.Connect failed, try ", utils.GetSelfFuncName(), err.Error(), uri) @@ -61,7 +65,7 @@ func init() { panic(err1.Error()) } } - fmt.Println("0", utils.GetSelfFuncName(), "mongo driver client init success") + fmt.Println("0", utils.GetSelfFuncName(), "mongo driver client init success: ", uri) DB.mongoClient = mongoClient diff --git a/pkg/common/db/mongoModel.go b/pkg/common/db/mongoModel.go index 59ec1a0f2..6d7ff3f7c 100644 --- a/pkg/common/db/mongoModel.go +++ b/pkg/common/db/mongoModel.go @@ -563,10 +563,88 @@ func (d *DataBases) GetTagSendLogs(userID string, showNumber, pageNumber int32) return tagSendLogs, nil } +type WorkMoment struct { + WorkMomentID string `bson:"work_moment_id"` + UserID string `bson:"user_id"` + Content string `bson:"content"` + LikeUsers []*LikeUser `bson:"like_users"` + Comments []*Comment `bson:"comments"` + WhoCanSeeUserIDList []string `bson:"who_can_see_user_id_list"` + WhoCantSeeUserIDList []string `bson:"who_cant_see_user_id_list"` + IsPrivate bool + IsPublic bool + CreateTime int32 +} + +type LikeUser struct { + UserID string + UserName string +} + +type Comment struct { + UserID string + UserName string + ReplyUserID string + ReplyUserName string + ContentID string + Content string + CreateTime int32 +} + +func (d *DataBases) CreateOneWorkMoment(workMoment *WorkMoment) error { + return nil +} + +func (d *DataBases) DeleteOneWorkMoment(workMomentID string) error { + return nil +} + +func (d *DataBases) GetWorkMomentByID(workMomentID string) (*WorkMoment, error) { + return nil, nil +} + +func (d *DataBases) LikeOneWorkMoment(likeUserID, workMomentID string) error { + return nil +} + +func (d *DataBases) SetUserWorkMomentsLevel(userID string, level int32) error { + return nil +} + +func (d *DataBases) ClearUserWorkMomentsCommentsMsg(userID string) error { + return nil +} + +type CommentMsg struct { + WorkMomentID string `bson:"workMoment"` + CommentContent string `bson:"content"` + Comment +} + +func (d *DataBases) GetUserWorkMomentsCommentsMsg(userID string, showNumber, pageNumber int32) ([]CommentMsg, error) { + return nil, nil +} + +func (d *DataBases) CommentOneWorkMoment(comment Comment, workMomentID string) error { + return nil +} + +func (d *DataBases) GetUserWorkMoments(userID string, showNumber, pageNumber int32) ([]WorkMoment, error) { + return nil, nil +} + +func (d *DataBases) GetUserFriendWorkMoments(friendIDList []string, showNumber, pageNumber int32) ([]WorkMoment, error) { + return nil, nil +} + func generateTagID(tagName, userID string) string { return utils.Md5(tagName + userID + strconv.Itoa(rand.Int()) + time.Now().String()) } +func generateWorkMomentID(userID string) string { + return utils.Md5(userID + strconv.Itoa(rand.Int()) + time.Now().String()) +} + func getCurrentTimestampByMill() int64 { return time.Now().UnixNano() / 1e6 } diff --git a/pkg/common/db/mysql_model/im_mysql_model/friend_model.go b/pkg/common/db/mysql_model/im_mysql_model/friend_model.go index 700082353..a7b14f198 100644 --- a/pkg/common/db/mysql_model/im_mysql_model/friend_model.go +++ b/pkg/common/db/mysql_model/im_mysql_model/friend_model.go @@ -49,6 +49,19 @@ func GetFriendListByUserID(OwnerUserID string) ([]db.Friend, error) { return friends, nil } +func GetFriendIDListByUserID(OwnerUserID string) ([]string, error) { + dbConn, err := db.DB.MysqlDB.DefaultGormDB() + if err != nil { + return nil, err + } + var friendIDList []string + err = dbConn.Table("friends").Select("friend_user_id").Where("owner_user_id=?", OwnerUserID).Find(&friendIDList).Error + if err != nil { + return nil, err + } + return friendIDList, nil +} + func UpdateFriendComment(OwnerUserID, FriendUserID, Remark string) error { dbConn, err := db.DB.MysqlDB.DefaultGormDB() if err != nil { diff --git a/pkg/common/token_verify/jwt_token.go b/pkg/common/token_verify/jwt_token.go index 0687fa564..f362ef42c 100644 --- a/pkg/common/token_verify/jwt_token.go +++ b/pkg/common/token_verify/jwt_token.go @@ -93,7 +93,7 @@ func GetClaimFromToken(tokensString string) (*Claims, error) { } } else { if claims, ok := token.Claims.(*Claims); ok && token.Valid { - log.NewDebug("", claims.UID, claims.Platform) + //log.NewDebug("", claims.UID, claims.Platform) return claims, nil } return nil, &constant.ErrTokenNotValidYet diff --git a/pkg/proto/office/office.pb.go b/pkg/proto/office/office.pb.go index bbff9427e..32a6a004d 100644 --- a/pkg/proto/office/office.pb.go +++ b/pkg/proto/office/office.pb.go @@ -36,7 +36,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} } func (m *CommonResp) String() string { return proto.CompactTextString(m) } func (*CommonResp) ProtoMessage() {} func (*CommonResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{0} + return fileDescriptor_office_8a5f7d4f1783db20, []int{0} } func (m *CommonResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CommonResp.Unmarshal(m, b) @@ -82,7 +82,7 @@ func (m *TagUser) Reset() { *m = TagUser{} } func (m *TagUser) String() string { return proto.CompactTextString(m) } func (*TagUser) ProtoMessage() {} func (*TagUser) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{1} + return fileDescriptor_office_8a5f7d4f1783db20, []int{1} } func (m *TagUser) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TagUser.Unmarshal(m, b) @@ -129,7 +129,7 @@ func (m *Tag) Reset() { *m = Tag{} } func (m *Tag) String() string { return proto.CompactTextString(m) } func (*Tag) ProtoMessage() {} func (*Tag) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{2} + return fileDescriptor_office_8a5f7d4f1783db20, []int{2} } func (m *Tag) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_Tag.Unmarshal(m, b) @@ -182,7 +182,7 @@ func (m *GetUserTagsReq) Reset() { *m = GetUserTagsReq{} } func (m *GetUserTagsReq) String() string { return proto.CompactTextString(m) } func (*GetUserTagsReq) ProtoMessage() {} func (*GetUserTagsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{3} + return fileDescriptor_office_8a5f7d4f1783db20, []int{3} } func (m *GetUserTagsReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserTagsReq.Unmarshal(m, b) @@ -228,7 +228,7 @@ func (m *GetUserTagsResp) Reset() { *m = GetUserTagsResp{} } func (m *GetUserTagsResp) String() string { return proto.CompactTextString(m) } func (*GetUserTagsResp) ProtoMessage() {} func (*GetUserTagsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{4} + return fileDescriptor_office_8a5f7d4f1783db20, []int{4} } func (m *GetUserTagsResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserTagsResp.Unmarshal(m, b) @@ -276,7 +276,7 @@ func (m *CreateTagReq) Reset() { *m = CreateTagReq{} } func (m *CreateTagReq) String() string { return proto.CompactTextString(m) } func (*CreateTagReq) ProtoMessage() {} func (*CreateTagReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{5} + return fileDescriptor_office_8a5f7d4f1783db20, []int{5} } func (m *CreateTagReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateTagReq.Unmarshal(m, b) @@ -335,7 +335,7 @@ func (m *CreateTagResp) Reset() { *m = CreateTagResp{} } func (m *CreateTagResp) String() string { return proto.CompactTextString(m) } func (*CreateTagResp) ProtoMessage() {} func (*CreateTagResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{6} + return fileDescriptor_office_8a5f7d4f1783db20, []int{6} } func (m *CreateTagResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_CreateTagResp.Unmarshal(m, b) @@ -375,7 +375,7 @@ func (m *DeleteTagReq) Reset() { *m = DeleteTagReq{} } func (m *DeleteTagReq) String() string { return proto.CompactTextString(m) } func (*DeleteTagReq) ProtoMessage() {} func (*DeleteTagReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{7} + return fileDescriptor_office_8a5f7d4f1783db20, []int{7} } func (m *DeleteTagReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteTagReq.Unmarshal(m, b) @@ -427,7 +427,7 @@ func (m *DeleteTagResp) Reset() { *m = DeleteTagResp{} } func (m *DeleteTagResp) String() string { return proto.CompactTextString(m) } func (*DeleteTagResp) ProtoMessage() {} func (*DeleteTagResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{8} + return fileDescriptor_office_8a5f7d4f1783db20, []int{8} } func (m *DeleteTagResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_DeleteTagResp.Unmarshal(m, b) @@ -470,7 +470,7 @@ func (m *SetTagReq) Reset() { *m = SetTagReq{} } func (m *SetTagReq) String() string { return proto.CompactTextString(m) } func (*SetTagReq) ProtoMessage() {} func (*SetTagReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{9} + return fileDescriptor_office_8a5f7d4f1783db20, []int{9} } func (m *SetTagReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetTagReq.Unmarshal(m, b) @@ -543,7 +543,7 @@ func (m *SetTagResp) Reset() { *m = SetTagResp{} } func (m *SetTagResp) String() string { return proto.CompactTextString(m) } func (*SetTagResp) ProtoMessage() {} func (*SetTagResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{10} + return fileDescriptor_office_8a5f7d4f1783db20, []int{10} } func (m *SetTagResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SetTagResp.Unmarshal(m, b) @@ -587,7 +587,7 @@ func (m *SendMsg2TagReq) Reset() { *m = SendMsg2TagReq{} } func (m *SendMsg2TagReq) String() string { return proto.CompactTextString(m) } func (*SendMsg2TagReq) ProtoMessage() {} func (*SendMsg2TagReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{11} + return fileDescriptor_office_8a5f7d4f1783db20, []int{11} } func (m *SendMsg2TagReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SendMsg2TagReq.Unmarshal(m, b) @@ -667,7 +667,7 @@ func (m *SendMsg2TagResp) Reset() { *m = SendMsg2TagResp{} } func (m *SendMsg2TagResp) String() string { return proto.CompactTextString(m) } func (*SendMsg2TagResp) ProtoMessage() {} func (*SendMsg2TagResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{12} + return fileDescriptor_office_8a5f7d4f1783db20, []int{12} } func (m *SendMsg2TagResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_SendMsg2TagResp.Unmarshal(m, b) @@ -707,7 +707,7 @@ func (m *GetTagSendLogsReq) Reset() { *m = GetTagSendLogsReq{} } func (m *GetTagSendLogsReq) String() string { return proto.CompactTextString(m) } func (*GetTagSendLogsReq) ProtoMessage() {} func (*GetTagSendLogsReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{13} + return fileDescriptor_office_8a5f7d4f1783db20, []int{13} } func (m *GetTagSendLogsReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetTagSendLogsReq.Unmarshal(m, b) @@ -761,7 +761,7 @@ func (m *TagSendLog) Reset() { *m = TagSendLog{} } func (m *TagSendLog) String() string { return proto.CompactTextString(m) } func (*TagSendLog) ProtoMessage() {} func (*TagSendLog) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{14} + return fileDescriptor_office_8a5f7d4f1783db20, []int{14} } func (m *TagSendLog) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_TagSendLog.Unmarshal(m, b) @@ -815,7 +815,7 @@ func (m *GetTagSendLogsResp) Reset() { *m = GetTagSendLogsResp{} } func (m *GetTagSendLogsResp) String() string { return proto.CompactTextString(m) } func (*GetTagSendLogsResp) ProtoMessage() {} func (*GetTagSendLogsResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{15} + return fileDescriptor_office_8a5f7d4f1783db20, []int{15} } func (m *GetTagSendLogsResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetTagSendLogsResp.Unmarshal(m, b) @@ -869,7 +869,7 @@ func (m *GetUserTagByIDReq) Reset() { *m = GetUserTagByIDReq{} } func (m *GetUserTagByIDReq) String() string { return proto.CompactTextString(m) } func (*GetUserTagByIDReq) ProtoMessage() {} func (*GetUserTagByIDReq) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{16} + return fileDescriptor_office_8a5f7d4f1783db20, []int{16} } func (m *GetUserTagByIDReq) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserTagByIDReq.Unmarshal(m, b) @@ -922,7 +922,7 @@ func (m *GetUserTagByIDResp) Reset() { *m = GetUserTagByIDResp{} } func (m *GetUserTagByIDResp) String() string { return proto.CompactTextString(m) } func (*GetUserTagByIDResp) ProtoMessage() {} func (*GetUserTagByIDResp) Descriptor() ([]byte, []int) { - return fileDescriptor_office_7f5adce6bc494f97, []int{17} + return fileDescriptor_office_8a5f7d4f1783db20, []int{17} } func (m *GetUserTagByIDResp) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetUserTagByIDResp.Unmarshal(m, b) @@ -956,6 +956,1186 @@ func (m *GetUserTagByIDResp) GetTag() *Tag { return nil } +type LikeUser struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LikeUser) Reset() { *m = LikeUser{} } +func (m *LikeUser) String() string { return proto.CompactTextString(m) } +func (*LikeUser) ProtoMessage() {} +func (*LikeUser) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{18} +} +func (m *LikeUser) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LikeUser.Unmarshal(m, b) +} +func (m *LikeUser) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LikeUser.Marshal(b, m, deterministic) +} +func (dst *LikeUser) XXX_Merge(src proto.Message) { + xxx_messageInfo_LikeUser.Merge(dst, src) +} +func (m *LikeUser) XXX_Size() int { + return xxx_messageInfo_LikeUser.Size(m) +} +func (m *LikeUser) XXX_DiscardUnknown() { + xxx_messageInfo_LikeUser.DiscardUnknown(m) +} + +var xxx_messageInfo_LikeUser proto.InternalMessageInfo + +func (m *LikeUser) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *LikeUser) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +type Comment struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + UserName string `protobuf:"bytes,2,opt,name=userName" json:"userName,omitempty"` + ReplyUserID string `protobuf:"bytes,3,opt,name=replyUserID" json:"replyUserID,omitempty"` + ReplyUserName string `protobuf:"bytes,4,opt,name=replyUserName" json:"replyUserName,omitempty"` + ContentID string `protobuf:"bytes,5,opt,name=contentID" json:"contentID,omitempty"` + Content string `protobuf:"bytes,6,opt,name=content" json:"content,omitempty"` + CreateTime int32 `protobuf:"varint,7,opt,name=createTime" json:"createTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Comment) Reset() { *m = Comment{} } +func (m *Comment) String() string { return proto.CompactTextString(m) } +func (*Comment) ProtoMessage() {} +func (*Comment) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{19} +} +func (m *Comment) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Comment.Unmarshal(m, b) +} +func (m *Comment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Comment.Marshal(b, m, deterministic) +} +func (dst *Comment) XXX_Merge(src proto.Message) { + xxx_messageInfo_Comment.Merge(dst, src) +} +func (m *Comment) XXX_Size() int { + return xxx_messageInfo_Comment.Size(m) +} +func (m *Comment) XXX_DiscardUnknown() { + xxx_messageInfo_Comment.DiscardUnknown(m) +} + +var xxx_messageInfo_Comment proto.InternalMessageInfo + +func (m *Comment) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *Comment) GetUserName() string { + if m != nil { + return m.UserName + } + return "" +} + +func (m *Comment) GetReplyUserID() string { + if m != nil { + return m.ReplyUserID + } + return "" +} + +func (m *Comment) GetReplyUserName() string { + if m != nil { + return m.ReplyUserName + } + return "" +} + +func (m *Comment) GetContentID() string { + if m != nil { + return m.ContentID + } + return "" +} + +func (m *Comment) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *Comment) GetCreateTime() int32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +type WorkMoment struct { + WorkMomentID string `protobuf:"bytes,1,opt,name=workMomentID" json:"workMomentID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content" json:"content,omitempty"` + LikeUsers []*LikeUser `protobuf:"bytes,4,rep,name=likeUsers" json:"likeUsers,omitempty"` + Comments []*Comment `protobuf:"bytes,5,rep,name=comments" json:"comments,omitempty"` + WhoCanSeeUserIDList []string `protobuf:"bytes,6,rep,name=whoCanSeeUserIDList" json:"whoCanSeeUserIDList,omitempty"` + WhoCantSeeUserIDList []string `protobuf:"bytes,7,rep,name=whoCantSeeUserIDList" json:"whoCantSeeUserIDList,omitempty"` + IsPrivate bool `protobuf:"varint,8,opt,name=isPrivate" json:"isPrivate,omitempty"` + IsPublic bool `protobuf:"varint,9,opt,name=isPublic" json:"isPublic,omitempty"` + CreateTime int32 `protobuf:"varint,10,opt,name=CreateTime" json:"CreateTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *WorkMoment) Reset() { *m = WorkMoment{} } +func (m *WorkMoment) String() string { return proto.CompactTextString(m) } +func (*WorkMoment) ProtoMessage() {} +func (*WorkMoment) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{20} +} +func (m *WorkMoment) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_WorkMoment.Unmarshal(m, b) +} +func (m *WorkMoment) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_WorkMoment.Marshal(b, m, deterministic) +} +func (dst *WorkMoment) XXX_Merge(src proto.Message) { + xxx_messageInfo_WorkMoment.Merge(dst, src) +} +func (m *WorkMoment) XXX_Size() int { + return xxx_messageInfo_WorkMoment.Size(m) +} +func (m *WorkMoment) XXX_DiscardUnknown() { + xxx_messageInfo_WorkMoment.DiscardUnknown(m) +} + +var xxx_messageInfo_WorkMoment proto.InternalMessageInfo + +func (m *WorkMoment) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *WorkMoment) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *WorkMoment) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *WorkMoment) GetLikeUsers() []*LikeUser { + if m != nil { + return m.LikeUsers + } + return nil +} + +func (m *WorkMoment) GetComments() []*Comment { + if m != nil { + return m.Comments + } + return nil +} + +func (m *WorkMoment) GetWhoCanSeeUserIDList() []string { + if m != nil { + return m.WhoCanSeeUserIDList + } + return nil +} + +func (m *WorkMoment) GetWhoCantSeeUserIDList() []string { + if m != nil { + return m.WhoCantSeeUserIDList + } + return nil +} + +func (m *WorkMoment) GetIsPrivate() bool { + if m != nil { + return m.IsPrivate + } + return false +} + +func (m *WorkMoment) GetIsPublic() bool { + if m != nil { + return m.IsPublic + } + return false +} + +func (m *WorkMoment) GetCreateTime() int32 { + if m != nil { + return m.CreateTime + } + return 0 +} + +type CreateOneWorkMomentReq struct { + WorkMoment *WorkMoment `protobuf:"bytes,1,opt,name=workMoment" json:"workMoment,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateOneWorkMomentReq) Reset() { *m = CreateOneWorkMomentReq{} } +func (m *CreateOneWorkMomentReq) String() string { return proto.CompactTextString(m) } +func (*CreateOneWorkMomentReq) ProtoMessage() {} +func (*CreateOneWorkMomentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{21} +} +func (m *CreateOneWorkMomentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateOneWorkMomentReq.Unmarshal(m, b) +} +func (m *CreateOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateOneWorkMomentReq.Marshal(b, m, deterministic) +} +func (dst *CreateOneWorkMomentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateOneWorkMomentReq.Merge(dst, src) +} +func (m *CreateOneWorkMomentReq) XXX_Size() int { + return xxx_messageInfo_CreateOneWorkMomentReq.Size(m) +} +func (m *CreateOneWorkMomentReq) XXX_DiscardUnknown() { + xxx_messageInfo_CreateOneWorkMomentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateOneWorkMomentReq proto.InternalMessageInfo + +func (m *CreateOneWorkMomentReq) GetWorkMoment() *WorkMoment { + if m != nil { + return m.WorkMoment + } + return nil +} + +func (m *CreateOneWorkMomentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *CreateOneWorkMomentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type CreateOneWorkMomentResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CreateOneWorkMomentResp) Reset() { *m = CreateOneWorkMomentResp{} } +func (m *CreateOneWorkMomentResp) String() string { return proto.CompactTextString(m) } +func (*CreateOneWorkMomentResp) ProtoMessage() {} +func (*CreateOneWorkMomentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{22} +} +func (m *CreateOneWorkMomentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CreateOneWorkMomentResp.Unmarshal(m, b) +} +func (m *CreateOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CreateOneWorkMomentResp.Marshal(b, m, deterministic) +} +func (dst *CreateOneWorkMomentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CreateOneWorkMomentResp.Merge(dst, src) +} +func (m *CreateOneWorkMomentResp) XXX_Size() int { + return xxx_messageInfo_CreateOneWorkMomentResp.Size(m) +} +func (m *CreateOneWorkMomentResp) XXX_DiscardUnknown() { + xxx_messageInfo_CreateOneWorkMomentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CreateOneWorkMomentResp proto.InternalMessageInfo + +func (m *CreateOneWorkMomentResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type DeleteOneWorkMomentReq struct { + WorkMomentID string `protobuf:"bytes,1,opt,name=workMomentID" json:"workMomentID,omitempty"` + UserID string `protobuf:"bytes,2,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteOneWorkMomentReq) Reset() { *m = DeleteOneWorkMomentReq{} } +func (m *DeleteOneWorkMomentReq) String() string { return proto.CompactTextString(m) } +func (*DeleteOneWorkMomentReq) ProtoMessage() {} +func (*DeleteOneWorkMomentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{23} +} +func (m *DeleteOneWorkMomentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteOneWorkMomentReq.Unmarshal(m, b) +} +func (m *DeleteOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteOneWorkMomentReq.Marshal(b, m, deterministic) +} +func (dst *DeleteOneWorkMomentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteOneWorkMomentReq.Merge(dst, src) +} +func (m *DeleteOneWorkMomentReq) XXX_Size() int { + return xxx_messageInfo_DeleteOneWorkMomentReq.Size(m) +} +func (m *DeleteOneWorkMomentReq) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteOneWorkMomentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteOneWorkMomentReq proto.InternalMessageInfo + +func (m *DeleteOneWorkMomentReq) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *DeleteOneWorkMomentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *DeleteOneWorkMomentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type DeleteOneWorkMomentResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *DeleteOneWorkMomentResp) Reset() { *m = DeleteOneWorkMomentResp{} } +func (m *DeleteOneWorkMomentResp) String() string { return proto.CompactTextString(m) } +func (*DeleteOneWorkMomentResp) ProtoMessage() {} +func (*DeleteOneWorkMomentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{24} +} +func (m *DeleteOneWorkMomentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_DeleteOneWorkMomentResp.Unmarshal(m, b) +} +func (m *DeleteOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_DeleteOneWorkMomentResp.Marshal(b, m, deterministic) +} +func (dst *DeleteOneWorkMomentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_DeleteOneWorkMomentResp.Merge(dst, src) +} +func (m *DeleteOneWorkMomentResp) XXX_Size() int { + return xxx_messageInfo_DeleteOneWorkMomentResp.Size(m) +} +func (m *DeleteOneWorkMomentResp) XXX_DiscardUnknown() { + xxx_messageInfo_DeleteOneWorkMomentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_DeleteOneWorkMomentResp proto.InternalMessageInfo + +func (m *DeleteOneWorkMomentResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type LikeOneWorkMomentReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + WorkMomentID string `protobuf:"bytes,2,opt,name=WorkMomentID" json:"WorkMomentID,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LikeOneWorkMomentReq) Reset() { *m = LikeOneWorkMomentReq{} } +func (m *LikeOneWorkMomentReq) String() string { return proto.CompactTextString(m) } +func (*LikeOneWorkMomentReq) ProtoMessage() {} +func (*LikeOneWorkMomentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{25} +} +func (m *LikeOneWorkMomentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LikeOneWorkMomentReq.Unmarshal(m, b) +} +func (m *LikeOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LikeOneWorkMomentReq.Marshal(b, m, deterministic) +} +func (dst *LikeOneWorkMomentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_LikeOneWorkMomentReq.Merge(dst, src) +} +func (m *LikeOneWorkMomentReq) XXX_Size() int { + return xxx_messageInfo_LikeOneWorkMomentReq.Size(m) +} +func (m *LikeOneWorkMomentReq) XXX_DiscardUnknown() { + xxx_messageInfo_LikeOneWorkMomentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_LikeOneWorkMomentReq proto.InternalMessageInfo + +func (m *LikeOneWorkMomentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *LikeOneWorkMomentReq) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *LikeOneWorkMomentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type LikeOneWorkMomentResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *LikeOneWorkMomentResp) Reset() { *m = LikeOneWorkMomentResp{} } +func (m *LikeOneWorkMomentResp) String() string { return proto.CompactTextString(m) } +func (*LikeOneWorkMomentResp) ProtoMessage() {} +func (*LikeOneWorkMomentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{26} +} +func (m *LikeOneWorkMomentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_LikeOneWorkMomentResp.Unmarshal(m, b) +} +func (m *LikeOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_LikeOneWorkMomentResp.Marshal(b, m, deterministic) +} +func (dst *LikeOneWorkMomentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_LikeOneWorkMomentResp.Merge(dst, src) +} +func (m *LikeOneWorkMomentResp) XXX_Size() int { + return xxx_messageInfo_LikeOneWorkMomentResp.Size(m) +} +func (m *LikeOneWorkMomentResp) XXX_DiscardUnknown() { + xxx_messageInfo_LikeOneWorkMomentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_LikeOneWorkMomentResp proto.InternalMessageInfo + +func (m *LikeOneWorkMomentResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type CommentOneWorkMomentReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + WorkMomentID string `protobuf:"bytes,2,opt,name=workMomentID" json:"workMomentID,omitempty"` + ReplyUserID string `protobuf:"bytes,3,opt,name=replyUserID" json:"replyUserID,omitempty"` + Content string `protobuf:"bytes,4,opt,name=content" json:"content,omitempty"` + OperationID string `protobuf:"bytes,5,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommentOneWorkMomentReq) Reset() { *m = CommentOneWorkMomentReq{} } +func (m *CommentOneWorkMomentReq) String() string { return proto.CompactTextString(m) } +func (*CommentOneWorkMomentReq) ProtoMessage() {} +func (*CommentOneWorkMomentReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{27} +} +func (m *CommentOneWorkMomentReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommentOneWorkMomentReq.Unmarshal(m, b) +} +func (m *CommentOneWorkMomentReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommentOneWorkMomentReq.Marshal(b, m, deterministic) +} +func (dst *CommentOneWorkMomentReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommentOneWorkMomentReq.Merge(dst, src) +} +func (m *CommentOneWorkMomentReq) XXX_Size() int { + return xxx_messageInfo_CommentOneWorkMomentReq.Size(m) +} +func (m *CommentOneWorkMomentReq) XXX_DiscardUnknown() { + xxx_messageInfo_CommentOneWorkMomentReq.DiscardUnknown(m) +} + +var xxx_messageInfo_CommentOneWorkMomentReq proto.InternalMessageInfo + +func (m *CommentOneWorkMomentReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *CommentOneWorkMomentReq) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *CommentOneWorkMomentReq) GetReplyUserID() string { + if m != nil { + return m.ReplyUserID + } + return "" +} + +func (m *CommentOneWorkMomentReq) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +func (m *CommentOneWorkMomentReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type CommentOneWorkMomentResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommentOneWorkMomentResp) Reset() { *m = CommentOneWorkMomentResp{} } +func (m *CommentOneWorkMomentResp) String() string { return proto.CompactTextString(m) } +func (*CommentOneWorkMomentResp) ProtoMessage() {} +func (*CommentOneWorkMomentResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{28} +} +func (m *CommentOneWorkMomentResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommentOneWorkMomentResp.Unmarshal(m, b) +} +func (m *CommentOneWorkMomentResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommentOneWorkMomentResp.Marshal(b, m, deterministic) +} +func (dst *CommentOneWorkMomentResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommentOneWorkMomentResp.Merge(dst, src) +} +func (m *CommentOneWorkMomentResp) XXX_Size() int { + return xxx_messageInfo_CommentOneWorkMomentResp.Size(m) +} +func (m *CommentOneWorkMomentResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommentOneWorkMomentResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommentOneWorkMomentResp proto.InternalMessageInfo + +func (m *CommentOneWorkMomentResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type GetUserWorkMomentsReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserWorkMomentsReq) Reset() { *m = GetUserWorkMomentsReq{} } +func (m *GetUserWorkMomentsReq) String() string { return proto.CompactTextString(m) } +func (*GetUserWorkMomentsReq) ProtoMessage() {} +func (*GetUserWorkMomentsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{29} +} +func (m *GetUserWorkMomentsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserWorkMomentsReq.Unmarshal(m, b) +} +func (m *GetUserWorkMomentsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserWorkMomentsReq.Marshal(b, m, deterministic) +} +func (dst *GetUserWorkMomentsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserWorkMomentsReq.Merge(dst, src) +} +func (m *GetUserWorkMomentsReq) XXX_Size() int { + return xxx_messageInfo_GetUserWorkMomentsReq.Size(m) +} +func (m *GetUserWorkMomentsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserWorkMomentsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserWorkMomentsReq proto.InternalMessageInfo + +func (m *GetUserWorkMomentsReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserWorkMomentsReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetUserWorkMomentsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserWorkMomentsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + WorkMoments []*WorkMoment `protobuf:"bytes,2,rep,name=workMoments" json:"workMoments,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserWorkMomentsResp) Reset() { *m = GetUserWorkMomentsResp{} } +func (m *GetUserWorkMomentsResp) String() string { return proto.CompactTextString(m) } +func (*GetUserWorkMomentsResp) ProtoMessage() {} +func (*GetUserWorkMomentsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{30} +} +func (m *GetUserWorkMomentsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserWorkMomentsResp.Unmarshal(m, b) +} +func (m *GetUserWorkMomentsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserWorkMomentsResp.Marshal(b, m, deterministic) +} +func (dst *GetUserWorkMomentsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserWorkMomentsResp.Merge(dst, src) +} +func (m *GetUserWorkMomentsResp) XXX_Size() int { + return xxx_messageInfo_GetUserWorkMomentsResp.Size(m) +} +func (m *GetUserWorkMomentsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserWorkMomentsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserWorkMomentsResp proto.InternalMessageInfo + +func (m *GetUserWorkMomentsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserWorkMomentsResp) GetWorkMoments() []*WorkMoment { + if m != nil { + return m.WorkMoments + } + return nil +} + +func (m *GetUserWorkMomentsResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +type GetUserFriendWorkMomentsReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,2,opt,name=Pagination" json:"Pagination,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserFriendWorkMomentsReq) Reset() { *m = GetUserFriendWorkMomentsReq{} } +func (m *GetUserFriendWorkMomentsReq) String() string { return proto.CompactTextString(m) } +func (*GetUserFriendWorkMomentsReq) ProtoMessage() {} +func (*GetUserFriendWorkMomentsReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{31} +} +func (m *GetUserFriendWorkMomentsReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserFriendWorkMomentsReq.Unmarshal(m, b) +} +func (m *GetUserFriendWorkMomentsReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserFriendWorkMomentsReq.Marshal(b, m, deterministic) +} +func (dst *GetUserFriendWorkMomentsReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserFriendWorkMomentsReq.Merge(dst, src) +} +func (m *GetUserFriendWorkMomentsReq) XXX_Size() int { + return xxx_messageInfo_GetUserFriendWorkMomentsReq.Size(m) +} +func (m *GetUserFriendWorkMomentsReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserFriendWorkMomentsReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserFriendWorkMomentsReq proto.InternalMessageInfo + +func (m *GetUserFriendWorkMomentsReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserFriendWorkMomentsReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +func (m *GetUserFriendWorkMomentsReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type GetUserFriendWorkMomentsResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + WorkMoments []*WorkMoment `protobuf:"bytes,2,rep,name=workMoments" json:"workMoments,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserFriendWorkMomentsResp) Reset() { *m = GetUserFriendWorkMomentsResp{} } +func (m *GetUserFriendWorkMomentsResp) String() string { return proto.CompactTextString(m) } +func (*GetUserFriendWorkMomentsResp) ProtoMessage() {} +func (*GetUserFriendWorkMomentsResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{32} +} +func (m *GetUserFriendWorkMomentsResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserFriendWorkMomentsResp.Unmarshal(m, b) +} +func (m *GetUserFriendWorkMomentsResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserFriendWorkMomentsResp.Marshal(b, m, deterministic) +} +func (dst *GetUserFriendWorkMomentsResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserFriendWorkMomentsResp.Merge(dst, src) +} +func (m *GetUserFriendWorkMomentsResp) XXX_Size() int { + return xxx_messageInfo_GetUserFriendWorkMomentsResp.Size(m) +} +func (m *GetUserFriendWorkMomentsResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserFriendWorkMomentsResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserFriendWorkMomentsResp proto.InternalMessageInfo + +func (m *GetUserFriendWorkMomentsResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserFriendWorkMomentsResp) GetWorkMoments() []*WorkMoment { + if m != nil { + return m.WorkMoments + } + return nil +} + +func (m *GetUserFriendWorkMomentsResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +type CommentsMsg struct { + Comment *Comment `protobuf:"bytes,1,opt,name=comment" json:"comment,omitempty"` + WorkMomentID string `protobuf:"bytes,2,opt,name=workMomentID" json:"workMomentID,omitempty"` + Content string `protobuf:"bytes,3,opt,name=content" json:"content,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *CommentsMsg) Reset() { *m = CommentsMsg{} } +func (m *CommentsMsg) String() string { return proto.CompactTextString(m) } +func (*CommentsMsg) ProtoMessage() {} +func (*CommentsMsg) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{33} +} +func (m *CommentsMsg) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommentsMsg.Unmarshal(m, b) +} +func (m *CommentsMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommentsMsg.Marshal(b, m, deterministic) +} +func (dst *CommentsMsg) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommentsMsg.Merge(dst, src) +} +func (m *CommentsMsg) XXX_Size() int { + return xxx_messageInfo_CommentsMsg.Size(m) +} +func (m *CommentsMsg) XXX_DiscardUnknown() { + xxx_messageInfo_CommentsMsg.DiscardUnknown(m) +} + +var xxx_messageInfo_CommentsMsg proto.InternalMessageInfo + +func (m *CommentsMsg) GetComment() *Comment { + if m != nil { + return m.Comment + } + return nil +} + +func (m *CommentsMsg) GetWorkMomentID() string { + if m != nil { + return m.WorkMomentID + } + return "" +} + +func (m *CommentsMsg) GetContent() string { + if m != nil { + return m.Content + } + return "" +} + +type GetUserWorkMomentsCommentsMsgReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + Pagination *sdk_ws.RequestPagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserWorkMomentsCommentsMsgReq) Reset() { *m = GetUserWorkMomentsCommentsMsgReq{} } +func (m *GetUserWorkMomentsCommentsMsgReq) String() string { return proto.CompactTextString(m) } +func (*GetUserWorkMomentsCommentsMsgReq) ProtoMessage() {} +func (*GetUserWorkMomentsCommentsMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{34} +} +func (m *GetUserWorkMomentsCommentsMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserWorkMomentsCommentsMsgReq.Unmarshal(m, b) +} +func (m *GetUserWorkMomentsCommentsMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserWorkMomentsCommentsMsgReq.Marshal(b, m, deterministic) +} +func (dst *GetUserWorkMomentsCommentsMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserWorkMomentsCommentsMsgReq.Merge(dst, src) +} +func (m *GetUserWorkMomentsCommentsMsgReq) XXX_Size() int { + return xxx_messageInfo_GetUserWorkMomentsCommentsMsgReq.Size(m) +} +func (m *GetUserWorkMomentsCommentsMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserWorkMomentsCommentsMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserWorkMomentsCommentsMsgReq proto.InternalMessageInfo + +func (m *GetUserWorkMomentsCommentsMsgReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *GetUserWorkMomentsCommentsMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +func (m *GetUserWorkMomentsCommentsMsgReq) GetPagination() *sdk_ws.RequestPagination { + if m != nil { + return m.Pagination + } + return nil +} + +type GetUserWorkMomentsCommentsMsgResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + CommentsMsgs []*CommentsMsg `protobuf:"bytes,2,rep,name=commentsMsgs" json:"commentsMsgs,omitempty"` + Pagination *sdk_ws.ResponsePagination `protobuf:"bytes,3,opt,name=Pagination" json:"Pagination,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *GetUserWorkMomentsCommentsMsgResp) Reset() { *m = GetUserWorkMomentsCommentsMsgResp{} } +func (m *GetUserWorkMomentsCommentsMsgResp) String() string { return proto.CompactTextString(m) } +func (*GetUserWorkMomentsCommentsMsgResp) ProtoMessage() {} +func (*GetUserWorkMomentsCommentsMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{35} +} +func (m *GetUserWorkMomentsCommentsMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_GetUserWorkMomentsCommentsMsgResp.Unmarshal(m, b) +} +func (m *GetUserWorkMomentsCommentsMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_GetUserWorkMomentsCommentsMsgResp.Marshal(b, m, deterministic) +} +func (dst *GetUserWorkMomentsCommentsMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetUserWorkMomentsCommentsMsgResp.Merge(dst, src) +} +func (m *GetUserWorkMomentsCommentsMsgResp) XXX_Size() int { + return xxx_messageInfo_GetUserWorkMomentsCommentsMsgResp.Size(m) +} +func (m *GetUserWorkMomentsCommentsMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_GetUserWorkMomentsCommentsMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_GetUserWorkMomentsCommentsMsgResp proto.InternalMessageInfo + +func (m *GetUserWorkMomentsCommentsMsgResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +func (m *GetUserWorkMomentsCommentsMsgResp) GetCommentsMsgs() []*CommentsMsg { + if m != nil { + return m.CommentsMsgs + } + return nil +} + +func (m *GetUserWorkMomentsCommentsMsgResp) GetPagination() *sdk_ws.ResponsePagination { + if m != nil { + return m.Pagination + } + return nil +} + +type ClearUserWorkMomentsCommentsMsgReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ClearUserWorkMomentsCommentsMsgReq) Reset() { *m = ClearUserWorkMomentsCommentsMsgReq{} } +func (m *ClearUserWorkMomentsCommentsMsgReq) String() string { return proto.CompactTextString(m) } +func (*ClearUserWorkMomentsCommentsMsgReq) ProtoMessage() {} +func (*ClearUserWorkMomentsCommentsMsgReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{36} +} +func (m *ClearUserWorkMomentsCommentsMsgReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ClearUserWorkMomentsCommentsMsgReq.Unmarshal(m, b) +} +func (m *ClearUserWorkMomentsCommentsMsgReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ClearUserWorkMomentsCommentsMsgReq.Marshal(b, m, deterministic) +} +func (dst *ClearUserWorkMomentsCommentsMsgReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClearUserWorkMomentsCommentsMsgReq.Merge(dst, src) +} +func (m *ClearUserWorkMomentsCommentsMsgReq) XXX_Size() int { + return xxx_messageInfo_ClearUserWorkMomentsCommentsMsgReq.Size(m) +} +func (m *ClearUserWorkMomentsCommentsMsgReq) XXX_DiscardUnknown() { + xxx_messageInfo_ClearUserWorkMomentsCommentsMsgReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ClearUserWorkMomentsCommentsMsgReq proto.InternalMessageInfo + +func (m *ClearUserWorkMomentsCommentsMsgReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *ClearUserWorkMomentsCommentsMsgReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type ClearUserWorkMomentsCommentsMsgResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ClearUserWorkMomentsCommentsMsgResp) Reset() { *m = ClearUserWorkMomentsCommentsMsgResp{} } +func (m *ClearUserWorkMomentsCommentsMsgResp) String() string { return proto.CompactTextString(m) } +func (*ClearUserWorkMomentsCommentsMsgResp) ProtoMessage() {} +func (*ClearUserWorkMomentsCommentsMsgResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{37} +} +func (m *ClearUserWorkMomentsCommentsMsgResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ClearUserWorkMomentsCommentsMsgResp.Unmarshal(m, b) +} +func (m *ClearUserWorkMomentsCommentsMsgResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ClearUserWorkMomentsCommentsMsgResp.Marshal(b, m, deterministic) +} +func (dst *ClearUserWorkMomentsCommentsMsgResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ClearUserWorkMomentsCommentsMsgResp.Merge(dst, src) +} +func (m *ClearUserWorkMomentsCommentsMsgResp) XXX_Size() int { + return xxx_messageInfo_ClearUserWorkMomentsCommentsMsgResp.Size(m) +} +func (m *ClearUserWorkMomentsCommentsMsgResp) XXX_DiscardUnknown() { + xxx_messageInfo_ClearUserWorkMomentsCommentsMsgResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ClearUserWorkMomentsCommentsMsgResp proto.InternalMessageInfo + +func (m *ClearUserWorkMomentsCommentsMsgResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + +type SetUserWorkMomentsLevelReq struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Level int32 `protobuf:"varint,2,opt,name=level" json:"level,omitempty"` + OperationID string `protobuf:"bytes,3,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetUserWorkMomentsLevelReq) Reset() { *m = SetUserWorkMomentsLevelReq{} } +func (m *SetUserWorkMomentsLevelReq) String() string { return proto.CompactTextString(m) } +func (*SetUserWorkMomentsLevelReq) ProtoMessage() {} +func (*SetUserWorkMomentsLevelReq) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{38} +} +func (m *SetUserWorkMomentsLevelReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetUserWorkMomentsLevelReq.Unmarshal(m, b) +} +func (m *SetUserWorkMomentsLevelReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetUserWorkMomentsLevelReq.Marshal(b, m, deterministic) +} +func (dst *SetUserWorkMomentsLevelReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetUserWorkMomentsLevelReq.Merge(dst, src) +} +func (m *SetUserWorkMomentsLevelReq) XXX_Size() int { + return xxx_messageInfo_SetUserWorkMomentsLevelReq.Size(m) +} +func (m *SetUserWorkMomentsLevelReq) XXX_DiscardUnknown() { + xxx_messageInfo_SetUserWorkMomentsLevelReq.DiscardUnknown(m) +} + +var xxx_messageInfo_SetUserWorkMomentsLevelReq proto.InternalMessageInfo + +func (m *SetUserWorkMomentsLevelReq) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *SetUserWorkMomentsLevelReq) GetLevel() int32 { + if m != nil { + return m.Level + } + return 0 +} + +func (m *SetUserWorkMomentsLevelReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" +} + +type SetUserWorkMomentsLevelResp struct { + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *SetUserWorkMomentsLevelResp) Reset() { *m = SetUserWorkMomentsLevelResp{} } +func (m *SetUserWorkMomentsLevelResp) String() string { return proto.CompactTextString(m) } +func (*SetUserWorkMomentsLevelResp) ProtoMessage() {} +func (*SetUserWorkMomentsLevelResp) Descriptor() ([]byte, []int) { + return fileDescriptor_office_8a5f7d4f1783db20, []int{39} +} +func (m *SetUserWorkMomentsLevelResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_SetUserWorkMomentsLevelResp.Unmarshal(m, b) +} +func (m *SetUserWorkMomentsLevelResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_SetUserWorkMomentsLevelResp.Marshal(b, m, deterministic) +} +func (dst *SetUserWorkMomentsLevelResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_SetUserWorkMomentsLevelResp.Merge(dst, src) +} +func (m *SetUserWorkMomentsLevelResp) XXX_Size() int { + return xxx_messageInfo_SetUserWorkMomentsLevelResp.Size(m) +} +func (m *SetUserWorkMomentsLevelResp) XXX_DiscardUnknown() { + xxx_messageInfo_SetUserWorkMomentsLevelResp.DiscardUnknown(m) +} + +var xxx_messageInfo_SetUserWorkMomentsLevelResp proto.InternalMessageInfo + +func (m *SetUserWorkMomentsLevelResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp + } + return nil +} + func init() { proto.RegisterType((*CommonResp)(nil), "office.CommonResp") proto.RegisterType((*TagUser)(nil), "office.TagUser") @@ -975,6 +2155,28 @@ func init() { proto.RegisterType((*GetTagSendLogsResp)(nil), "office.GetTagSendLogsResp") proto.RegisterType((*GetUserTagByIDReq)(nil), "office.GetUserTagByIDReq") proto.RegisterType((*GetUserTagByIDResp)(nil), "office.GetUserTagByIDResp") + proto.RegisterType((*LikeUser)(nil), "office.LikeUser") + proto.RegisterType((*Comment)(nil), "office.Comment") + proto.RegisterType((*WorkMoment)(nil), "office.WorkMoment") + proto.RegisterType((*CreateOneWorkMomentReq)(nil), "office.CreateOneWorkMomentReq") + proto.RegisterType((*CreateOneWorkMomentResp)(nil), "office.CreateOneWorkMomentResp") + proto.RegisterType((*DeleteOneWorkMomentReq)(nil), "office.DeleteOneWorkMomentReq") + proto.RegisterType((*DeleteOneWorkMomentResp)(nil), "office.DeleteOneWorkMomentResp") + proto.RegisterType((*LikeOneWorkMomentReq)(nil), "office.LikeOneWorkMomentReq") + proto.RegisterType((*LikeOneWorkMomentResp)(nil), "office.LikeOneWorkMomentResp") + proto.RegisterType((*CommentOneWorkMomentReq)(nil), "office.CommentOneWorkMomentReq") + proto.RegisterType((*CommentOneWorkMomentResp)(nil), "office.CommentOneWorkMomentResp") + proto.RegisterType((*GetUserWorkMomentsReq)(nil), "office.GetUserWorkMomentsReq") + proto.RegisterType((*GetUserWorkMomentsResp)(nil), "office.GetUserWorkMomentsResp") + proto.RegisterType((*GetUserFriendWorkMomentsReq)(nil), "office.GetUserFriendWorkMomentsReq") + proto.RegisterType((*GetUserFriendWorkMomentsResp)(nil), "office.GetUserFriendWorkMomentsResp") + proto.RegisterType((*CommentsMsg)(nil), "office.CommentsMsg") + proto.RegisterType((*GetUserWorkMomentsCommentsMsgReq)(nil), "office.GetUserWorkMomentsCommentsMsgReq") + proto.RegisterType((*GetUserWorkMomentsCommentsMsgResp)(nil), "office.GetUserWorkMomentsCommentsMsgResp") + proto.RegisterType((*ClearUserWorkMomentsCommentsMsgReq)(nil), "office.ClearUserWorkMomentsCommentsMsgReq") + proto.RegisterType((*ClearUserWorkMomentsCommentsMsgResp)(nil), "office.ClearUserWorkMomentsCommentsMsgResp") + proto.RegisterType((*SetUserWorkMomentsLevelReq)(nil), "office.SetUserWorkMomentsLevelReq") + proto.RegisterType((*SetUserWorkMomentsLevelResp)(nil), "office.SetUserWorkMomentsLevelResp") } // Reference imports to suppress errors if they are not otherwise used. @@ -995,6 +2197,17 @@ type OfficeServiceClient interface { SendMsg2Tag(ctx context.Context, in *SendMsg2TagReq, opts ...grpc.CallOption) (*SendMsg2TagResp, error) GetTagSendLogs(ctx context.Context, in *GetTagSendLogsReq, opts ...grpc.CallOption) (*GetTagSendLogsResp, error) GetUserTagByID(ctx context.Context, in *GetUserTagByIDReq, opts ...grpc.CallOption) (*GetUserTagByIDResp, error) + CreateOneWorkMoment(ctx context.Context, in *CreateOneWorkMomentReq, opts ...grpc.CallOption) (*CreateOneWorkMomentResp, error) + DeleteOneWorkMoment(ctx context.Context, in *DeleteOneWorkMomentReq, opts ...grpc.CallOption) (*DeleteOneWorkMomentResp, error) + LikeOneWorkMoment(ctx context.Context, in *LikeOneWorkMomentReq, opts ...grpc.CallOption) (*LikeOneWorkMomentResp, error) + CommentOneWorkMoment(ctx context.Context, in *CommentOneWorkMomentReq, opts ...grpc.CallOption) (*CommentOneWorkMomentResp, error) + // / user self + GetUserWorkMoments(ctx context.Context, in *GetUserWorkMomentsReq, opts ...grpc.CallOption) (*GetUserWorkMomentsResp, error) + // / users friend + GetUserFriendWorkMoments(ctx context.Context, in *GetUserFriendWorkMomentsReq, opts ...grpc.CallOption) (*GetUserFriendWorkMomentsResp, error) + GetUserWorkMomentsCommentsMsg(ctx context.Context, in *GetUserWorkMomentsCommentsMsgReq, opts ...grpc.CallOption) (*GetUserWorkMomentsCommentsMsgResp, error) + ClearUserWorkMomentsCommentsMsg(ctx context.Context, in *ClearUserWorkMomentsCommentsMsgReq, opts ...grpc.CallOption) (*ClearUserWorkMomentsCommentsMsgResp, error) + SetUserWorkMomentsLevel(ctx context.Context, in *SetUserWorkMomentsLevelReq, opts ...grpc.CallOption) (*SetUserWorkMomentsLevelResp, error) } type officeServiceClient struct { @@ -1068,6 +2281,87 @@ func (c *officeServiceClient) GetUserTagByID(ctx context.Context, in *GetUserTag return out, nil } +func (c *officeServiceClient) CreateOneWorkMoment(ctx context.Context, in *CreateOneWorkMomentReq, opts ...grpc.CallOption) (*CreateOneWorkMomentResp, error) { + out := new(CreateOneWorkMomentResp) + err := grpc.Invoke(ctx, "/office.OfficeService/CreateOneWorkMoment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) DeleteOneWorkMoment(ctx context.Context, in *DeleteOneWorkMomentReq, opts ...grpc.CallOption) (*DeleteOneWorkMomentResp, error) { + out := new(DeleteOneWorkMomentResp) + err := grpc.Invoke(ctx, "/office.OfficeService/DeleteOneWorkMoment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) LikeOneWorkMoment(ctx context.Context, in *LikeOneWorkMomentReq, opts ...grpc.CallOption) (*LikeOneWorkMomentResp, error) { + out := new(LikeOneWorkMomentResp) + err := grpc.Invoke(ctx, "/office.OfficeService/LikeOneWorkMoment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) CommentOneWorkMoment(ctx context.Context, in *CommentOneWorkMomentReq, opts ...grpc.CallOption) (*CommentOneWorkMomentResp, error) { + out := new(CommentOneWorkMomentResp) + err := grpc.Invoke(ctx, "/office.OfficeService/CommentOneWorkMoment", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetUserWorkMoments(ctx context.Context, in *GetUserWorkMomentsReq, opts ...grpc.CallOption) (*GetUserWorkMomentsResp, error) { + out := new(GetUserWorkMomentsResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetUserWorkMoments", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetUserFriendWorkMoments(ctx context.Context, in *GetUserFriendWorkMomentsReq, opts ...grpc.CallOption) (*GetUserFriendWorkMomentsResp, error) { + out := new(GetUserFriendWorkMomentsResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetUserFriendWorkMoments", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) GetUserWorkMomentsCommentsMsg(ctx context.Context, in *GetUserWorkMomentsCommentsMsgReq, opts ...grpc.CallOption) (*GetUserWorkMomentsCommentsMsgResp, error) { + out := new(GetUserWorkMomentsCommentsMsgResp) + err := grpc.Invoke(ctx, "/office.OfficeService/GetUserWorkMomentsCommentsMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) ClearUserWorkMomentsCommentsMsg(ctx context.Context, in *ClearUserWorkMomentsCommentsMsgReq, opts ...grpc.CallOption) (*ClearUserWorkMomentsCommentsMsgResp, error) { + out := new(ClearUserWorkMomentsCommentsMsgResp) + err := grpc.Invoke(ctx, "/office.OfficeService/ClearUserWorkMomentsCommentsMsg", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *officeServiceClient) SetUserWorkMomentsLevel(ctx context.Context, in *SetUserWorkMomentsLevelReq, opts ...grpc.CallOption) (*SetUserWorkMomentsLevelResp, error) { + out := new(SetUserWorkMomentsLevelResp) + err := grpc.Invoke(ctx, "/office.OfficeService/SetUserWorkMomentsLevel", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // Server API for OfficeService service type OfficeServiceServer interface { @@ -1078,6 +2372,17 @@ type OfficeServiceServer interface { SendMsg2Tag(context.Context, *SendMsg2TagReq) (*SendMsg2TagResp, error) GetTagSendLogs(context.Context, *GetTagSendLogsReq) (*GetTagSendLogsResp, error) GetUserTagByID(context.Context, *GetUserTagByIDReq) (*GetUserTagByIDResp, error) + CreateOneWorkMoment(context.Context, *CreateOneWorkMomentReq) (*CreateOneWorkMomentResp, error) + DeleteOneWorkMoment(context.Context, *DeleteOneWorkMomentReq) (*DeleteOneWorkMomentResp, error) + LikeOneWorkMoment(context.Context, *LikeOneWorkMomentReq) (*LikeOneWorkMomentResp, error) + CommentOneWorkMoment(context.Context, *CommentOneWorkMomentReq) (*CommentOneWorkMomentResp, error) + // / user self + GetUserWorkMoments(context.Context, *GetUserWorkMomentsReq) (*GetUserWorkMomentsResp, error) + // / users friend + GetUserFriendWorkMoments(context.Context, *GetUserFriendWorkMomentsReq) (*GetUserFriendWorkMomentsResp, error) + GetUserWorkMomentsCommentsMsg(context.Context, *GetUserWorkMomentsCommentsMsgReq) (*GetUserWorkMomentsCommentsMsgResp, error) + ClearUserWorkMomentsCommentsMsg(context.Context, *ClearUserWorkMomentsCommentsMsgReq) (*ClearUserWorkMomentsCommentsMsgResp, error) + SetUserWorkMomentsLevel(context.Context, *SetUserWorkMomentsLevelReq) (*SetUserWorkMomentsLevelResp, error) } func RegisterOfficeServiceServer(s *grpc.Server, srv OfficeServiceServer) { @@ -1210,6 +2515,168 @@ func _OfficeService_GetUserTagByID_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _OfficeService_CreateOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateOneWorkMomentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).CreateOneWorkMoment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/CreateOneWorkMoment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).CreateOneWorkMoment(ctx, req.(*CreateOneWorkMomentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_DeleteOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteOneWorkMomentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).DeleteOneWorkMoment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/DeleteOneWorkMoment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).DeleteOneWorkMoment(ctx, req.(*DeleteOneWorkMomentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_LikeOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LikeOneWorkMomentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).LikeOneWorkMoment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/LikeOneWorkMoment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).LikeOneWorkMoment(ctx, req.(*LikeOneWorkMomentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_CommentOneWorkMoment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CommentOneWorkMomentReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).CommentOneWorkMoment(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/CommentOneWorkMoment", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).CommentOneWorkMoment(ctx, req.(*CommentOneWorkMomentReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetUserWorkMoments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserWorkMomentsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetUserWorkMoments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetUserWorkMoments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetUserWorkMoments(ctx, req.(*GetUserWorkMomentsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetUserFriendWorkMoments_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserFriendWorkMomentsReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetUserFriendWorkMoments(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetUserFriendWorkMoments", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetUserFriendWorkMoments(ctx, req.(*GetUserFriendWorkMomentsReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_GetUserWorkMomentsCommentsMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetUserWorkMomentsCommentsMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).GetUserWorkMomentsCommentsMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/GetUserWorkMomentsCommentsMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).GetUserWorkMomentsCommentsMsg(ctx, req.(*GetUserWorkMomentsCommentsMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_ClearUserWorkMomentsCommentsMsg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ClearUserWorkMomentsCommentsMsgReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).ClearUserWorkMomentsCommentsMsg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/ClearUserWorkMomentsCommentsMsg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).ClearUserWorkMomentsCommentsMsg(ctx, req.(*ClearUserWorkMomentsCommentsMsgReq)) + } + return interceptor(ctx, in, info, handler) +} + +func _OfficeService_SetUserWorkMomentsLevel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SetUserWorkMomentsLevelReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(OfficeServiceServer).SetUserWorkMomentsLevel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/office.OfficeService/SetUserWorkMomentsLevel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(OfficeServiceServer).SetUserWorkMomentsLevel(ctx, req.(*SetUserWorkMomentsLevelReq)) + } + return interceptor(ctx, in, info, handler) +} + var _OfficeService_serviceDesc = grpc.ServiceDesc{ ServiceName: "office.OfficeService", HandlerType: (*OfficeServiceServer)(nil), @@ -1242,64 +2709,143 @@ var _OfficeService_serviceDesc = grpc.ServiceDesc{ MethodName: "GetUserTagByID", Handler: _OfficeService_GetUserTagByID_Handler, }, + { + MethodName: "CreateOneWorkMoment", + Handler: _OfficeService_CreateOneWorkMoment_Handler, + }, + { + MethodName: "DeleteOneWorkMoment", + Handler: _OfficeService_DeleteOneWorkMoment_Handler, + }, + { + MethodName: "LikeOneWorkMoment", + Handler: _OfficeService_LikeOneWorkMoment_Handler, + }, + { + MethodName: "CommentOneWorkMoment", + Handler: _OfficeService_CommentOneWorkMoment_Handler, + }, + { + MethodName: "GetUserWorkMoments", + Handler: _OfficeService_GetUserWorkMoments_Handler, + }, + { + MethodName: "GetUserFriendWorkMoments", + Handler: _OfficeService_GetUserFriendWorkMoments_Handler, + }, + { + MethodName: "GetUserWorkMomentsCommentsMsg", + Handler: _OfficeService_GetUserWorkMomentsCommentsMsg_Handler, + }, + { + MethodName: "ClearUserWorkMomentsCommentsMsg", + Handler: _OfficeService_ClearUserWorkMomentsCommentsMsg_Handler, + }, + { + MethodName: "SetUserWorkMomentsLevel", + Handler: _OfficeService_SetUserWorkMomentsLevel_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "office/office.proto", } -func init() { proto.RegisterFile("office/office.proto", fileDescriptor_office_7f5adce6bc494f97) } +func init() { proto.RegisterFile("office/office.proto", fileDescriptor_office_8a5f7d4f1783db20) } -var fileDescriptor_office_7f5adce6bc494f97 = []byte{ - // 810 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xd1, 0x6a, 0xdb, 0x4a, - 0x10, 0x45, 0x76, 0x6c, 0xc7, 0xe3, 0x24, 0xbe, 0xd9, 0x9b, 0x9b, 0xeb, 0x2b, 0x6e, 0x5b, 0x57, - 0xb4, 0x10, 0x5a, 0xb0, 0xc1, 0xed, 0x43, 0xa1, 0x34, 0x94, 0xd8, 0xc1, 0xb8, 0x24, 0x4d, 0x50, - 0x9c, 0x97, 0x3e, 0xd4, 0x6c, 0xec, 0xb1, 0x10, 0x89, 0x25, 0x65, 0x57, 0x4e, 0xe8, 0x6b, 0x7f, - 0xa1, 0xdf, 0xd4, 0xbe, 0xf7, 0x1f, 0xfa, 0x21, 0x45, 0x2b, 0x69, 0xb5, 0x2b, 0xdb, 0x04, 0x0c, - 0x7d, 0x92, 0x66, 0x76, 0x66, 0x74, 0xe6, 0xec, 0xec, 0x59, 0xc1, 0xdf, 0xfe, 0x74, 0xea, 0x8e, - 0xb1, 0x1d, 0x3f, 0x5a, 0x01, 0xf3, 0x43, 0x9f, 0x94, 0x63, 0xcb, 0x7c, 0x7a, 0x16, 0xa0, 0x37, - 0x1a, 0x9c, 0xb6, 0x83, 0x6b, 0xa7, 0x2d, 0x96, 0xda, 0x7c, 0x72, 0x3d, 0xba, 0xe7, 0xed, 0x7b, - 0x1e, 0x87, 0x5a, 0x87, 0x00, 0x5d, 0x7f, 0x36, 0xf3, 0x3d, 0x1b, 0x79, 0x40, 0x1a, 0x50, 0x41, - 0xc6, 0xba, 0xfe, 0x04, 0x1b, 0x46, 0xd3, 0x38, 0x28, 0xd9, 0xa9, 0x49, 0xf6, 0xa1, 0x8c, 0x8c, - 0x9d, 0x72, 0xa7, 0x51, 0x68, 0x1a, 0x07, 0x55, 0x3b, 0xb1, 0xac, 0x77, 0x50, 0x19, 0x52, 0xe7, - 0x92, 0x23, 0x8b, 0x42, 0xe6, 0x1c, 0xd9, 0xa0, 0x27, 0x72, 0xab, 0x76, 0x62, 0x11, 0x13, 0x36, - 0xa3, 0xb7, 0x8f, 0x74, 0x86, 0x49, 0xb2, 0xb4, 0xad, 0x2b, 0x28, 0x0e, 0xa9, 0x43, 0xf6, 0xa0, - 0x14, 0x52, 0x47, 0x66, 0xc6, 0x46, 0x84, 0x26, 0xa4, 0x8e, 0x92, 0x97, 0x9a, 0xe4, 0x65, 0x5c, - 0xf2, 0xc4, 0xe5, 0x61, 0xa3, 0xd8, 0x2c, 0x1e, 0xd4, 0x3a, 0xf5, 0x56, 0xc2, 0x40, 0x82, 0xc6, - 0x96, 0x01, 0xd6, 0x07, 0xd8, 0xe9, 0x63, 0x18, 0x39, 0x87, 0xd4, 0xe1, 0x36, 0xde, 0xae, 0x44, - 0xda, 0x84, 0x9a, 0x1f, 0x20, 0xa3, 0xa1, 0xeb, 0x7b, 0x83, 0x5e, 0xf2, 0x51, 0xd5, 0x65, 0x4d, - 0xa1, 0xae, 0xd5, 0xe2, 0x01, 0xe9, 0x00, 0x8c, 0x25, 0x83, 0xa2, 0x60, 0xad, 0x43, 0x52, 0x34, - 0x19, 0xb7, 0xb6, 0x12, 0x45, 0x9e, 0xc0, 0x46, 0x48, 0x1d, 0xde, 0x28, 0x08, 0xec, 0x35, 0x05, - 0xbb, 0x2d, 0x16, 0xac, 0xaf, 0x06, 0x6c, 0x75, 0x19, 0xd2, 0x10, 0x23, 0x1f, 0xde, 0xaa, 0x5c, - 0x18, 0x3a, 0x17, 0x59, 0x33, 0x05, 0xad, 0x99, 0xc7, 0x00, 0xf1, 0x9b, 0x64, 0xa9, 0x6a, 0x2b, - 0x9e, 0x7c, 0xb3, 0x1b, 0x8b, 0xcd, 0x76, 0x61, 0x5b, 0xc1, 0xb0, 0x5e, 0xab, 0xd6, 0x67, 0xd8, - 0xea, 0xe1, 0x0d, 0xca, 0x46, 0x56, 0x71, 0x2f, 0x47, 0xa0, 0xa0, 0x8e, 0x40, 0x0e, 0x64, 0x71, - 0x29, 0x48, 0xa5, 0xfe, 0x9a, 0x20, 0x7f, 0x1a, 0x50, 0xbd, 0xc0, 0x70, 0x2d, 0x88, 0x0d, 0xa8, - 0x78, 0x78, 0x2f, 0x76, 0x26, 0x86, 0x97, 0x9a, 0xa4, 0x05, 0xc4, 0xf5, 0xc6, 0x0c, 0x29, 0xc7, - 0xcb, 0x6c, 0x27, 0x36, 0xc4, 0x4e, 0x2c, 0x59, 0x21, 0x2f, 0xe0, 0x2f, 0x86, 0x93, 0xf9, 0x58, - 0x8d, 0x2e, 0x89, 0xe8, 0x05, 0x7f, 0x9e, 0x98, 0xf2, 0x22, 0x31, 0xef, 0x01, 0xd2, 0x96, 0xd6, - 0x64, 0xe5, 0x97, 0x01, 0x3b, 0x17, 0xe8, 0x4d, 0x4e, 0xb9, 0xd3, 0xd1, 0xc6, 0x50, 0x20, 0x33, - 0x04, 0xb2, 0xd4, 0x8c, 0x4e, 0xf9, 0x65, 0x7a, 0x24, 0x0b, 0x62, 0x49, 0xda, 0xe4, 0x7f, 0xa8, - 0xf6, 0x99, 0x3f, 0x0f, 0x94, 0x49, 0xcc, 0x1c, 0x11, 0xdd, 0x1c, 0xbd, 0x89, 0x9c, 0xc1, 0xc4, - 0x8a, 0xe8, 0x88, 0xde, 0x90, 0x9d, 0xdf, 0xd0, 0x70, 0xea, 0xb3, 0xd9, 0xa0, 0xd7, 0x28, 0x09, - 0x55, 0x5a, 0xf0, 0x47, 0xb8, 0xc6, 0xbe, 0x17, 0xa2, 0x17, 0x26, 0x54, 0xa4, 0x66, 0x9e, 0xa8, - 0xca, 0x22, 0x51, 0xc7, 0x50, 0xd7, 0xba, 0x5c, 0x93, 0xad, 0x6f, 0x06, 0xec, 0xf6, 0x05, 0xe1, - 0x51, 0xb5, 0x13, 0x3f, 0x96, 0x9a, 0x1e, 0xc0, 0x39, 0x75, 0x5c, 0x4f, 0x7c, 0x2c, 0xa9, 0xf4, - 0xac, 0xc5, 0x91, 0xdd, 0x21, 0x1b, 0xd1, 0xc0, 0x1d, 0x05, 0x94, 0xd1, 0x19, 0x6f, 0xd9, 0x78, - 0x3b, 0x47, 0x1e, 0x66, 0xb1, 0xb6, 0x92, 0xb7, 0xf2, 0x8c, 0x3f, 0x7c, 0x3c, 0x7c, 0x80, 0x0c, - 0x91, 0xa6, 0x9b, 0xc6, 0x03, 0xba, 0xa9, 0x72, 0x5a, 0xd0, 0x39, 0x35, 0x61, 0x33, 0xda, 0x81, - 0xa1, 0x9b, 0xcc, 0x7c, 0xd1, 0x96, 0xb6, 0xf5, 0xdd, 0x00, 0x92, 0xa7, 0x61, 0x4d, 0x95, 0x3c, - 0xd6, 0xb8, 0x2b, 0x88, 0x9c, 0xe7, 0x4b, 0xb9, 0xe3, 0x81, 0xef, 0x71, 0x5c, 0x41, 0xde, 0x6b, - 0xa8, 0x85, 0x19, 0x9a, 0xe4, 0xbe, 0x20, 0x4a, 0xdf, 0xc9, 0x92, 0xad, 0x86, 0x59, 0x63, 0xb1, - 0x9b, 0x89, 0xd2, 0x1f, 0x7d, 0x19, 0xf4, 0xfe, 0x84, 0x78, 0x39, 0x82, 0x2b, 0xed, 0x23, 0x6b, - 0x72, 0xf5, 0x08, 0x8a, 0x21, 0x75, 0x12, 0x92, 0xb4, 0x0b, 0x25, 0xf2, 0x77, 0x7e, 0x14, 0x61, - 0xfb, 0x4c, 0xf8, 0x2e, 0x90, 0xdd, 0xb9, 0x63, 0x24, 0x87, 0x50, 0x53, 0x6e, 0x32, 0xb2, 0x9f, - 0xa6, 0xe8, 0x57, 0xa5, 0xf9, 0xef, 0x52, 0x3f, 0x0f, 0xc8, 0x1b, 0xa8, 0xca, 0xcb, 0x81, 0xec, - 0x49, 0x74, 0xca, 0x9d, 0x65, 0xfe, 0xb3, 0xc4, 0x1b, 0x67, 0x4a, 0xc5, 0xce, 0x32, 0xd5, 0x4b, - 0x22, 0xcb, 0xd4, 0xa5, 0xbd, 0x0d, 0xe5, 0x58, 0xd2, 0xc8, 0x6e, 0x1a, 0x20, 0x55, 0xdb, 0x24, - 0x79, 0x17, 0x0f, 0xa2, 0x26, 0x95, 0xa3, 0x9d, 0x35, 0xa9, 0xab, 0x5a, 0xd6, 0x64, 0x5e, 0x07, - 0xfa, 0xe2, 0xd7, 0x41, 0x99, 0x65, 0xf2, 0x9f, 0xc2, 0x87, 0x7e, 0xd4, 0x4d, 0x73, 0xd5, 0x92, - 0x2c, 0xa4, 0x6c, 0xb4, 0x56, 0x48, 0x9f, 0x32, 0xad, 0x50, 0x6e, 0x36, 0x8e, 0x76, 0x3f, 0xd5, - 0x5b, 0xc9, 0xcf, 0xde, 0xdb, 0xf8, 0x71, 0x55, 0x16, 0x7f, 0x72, 0xaf, 0x7e, 0x07, 0x00, 0x00, - 0xff, 0xff, 0xed, 0x02, 0x0a, 0x32, 0x0b, 0x0a, 0x00, 0x00, +var fileDescriptor_office_8a5f7d4f1783db20 = []byte{ + // 1494 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x59, 0xcd, 0x6e, 0xdb, 0xc6, + 0x13, 0x07, 0x25, 0x4b, 0xb2, 0x46, 0x4e, 0x1c, 0xaf, 0x1d, 0x5b, 0x7f, 0x26, 0xb6, 0x15, 0x26, + 0x7f, 0xc0, 0x49, 0x00, 0xa9, 0x50, 0x03, 0xb4, 0x40, 0xd1, 0xa0, 0x88, 0x94, 0x1a, 0x6e, 0xad, + 0xc4, 0xa5, 0x9c, 0x06, 0xe9, 0x21, 0x06, 0x2d, 0xad, 0x59, 0xc2, 0x12, 0xc9, 0x70, 0x69, 0x09, + 0xe9, 0xb1, 0x87, 0xbe, 0x40, 0x0f, 0x3d, 0xf5, 0xd2, 0x57, 0x28, 0xfa, 0x08, 0x3d, 0xf4, 0x54, + 0xf4, 0xd4, 0x53, 0x6f, 0x7d, 0x8f, 0x16, 0xbb, 0xfc, 0xda, 0xe5, 0x87, 0xa4, 0xd0, 0x0d, 0xd0, + 0x9e, 0xc4, 0x99, 0x9d, 0x9d, 0x9d, 0xf9, 0xcd, 0xee, 0xcc, 0xee, 0x08, 0xd6, 0xad, 0xb3, 0x33, + 0x63, 0x80, 0x5b, 0xde, 0x4f, 0xd3, 0x76, 0x2c, 0xd7, 0x42, 0x65, 0x8f, 0x92, 0x6f, 0x3d, 0xb5, + 0xb1, 0x79, 0x72, 0xd0, 0x6b, 0xd9, 0xe7, 0x7a, 0x8b, 0x0d, 0xb5, 0xc8, 0xf0, 0xfc, 0x64, 0x4a, + 0x5a, 0x53, 0xe2, 0x89, 0x2a, 0x0f, 0x01, 0x3a, 0xd6, 0x78, 0x6c, 0x99, 0x2a, 0x26, 0x36, 0xaa, + 0x43, 0x05, 0x3b, 0x4e, 0xc7, 0x1a, 0xe2, 0xba, 0xd4, 0x90, 0xf6, 0x4a, 0x6a, 0x40, 0xa2, 0x4d, + 0x28, 0x63, 0xc7, 0xe9, 0x11, 0xbd, 0x5e, 0x68, 0x48, 0x7b, 0x55, 0xd5, 0xa7, 0x94, 0x0f, 0xa1, + 0x72, 0xac, 0xe9, 0xcf, 0x08, 0x76, 0xa8, 0xc8, 0x05, 0xc1, 0xce, 0x41, 0x97, 0xcd, 0xad, 0xaa, + 0x3e, 0x85, 0x64, 0x58, 0xa6, 0x5f, 0x4f, 0xb4, 0x31, 0xf6, 0x27, 0x87, 0xb4, 0x72, 0x0a, 0xc5, + 0x63, 0x4d, 0x47, 0x1b, 0x50, 0x72, 0x35, 0x3d, 0x9c, 0xe9, 0x11, 0xd4, 0x1a, 0x57, 0xd3, 0xb9, + 0x79, 0x01, 0x89, 0xee, 0x7b, 0x2a, 0x0f, 0x0d, 0xe2, 0xd6, 0x8b, 0x8d, 0xe2, 0x5e, 0xad, 0xbd, + 0xda, 0xf4, 0x11, 0xf0, 0xad, 0x51, 0x43, 0x01, 0xe5, 0x13, 0xb8, 0xba, 0x8f, 0x5d, 0xca, 0x3c, + 0xd6, 0x74, 0xa2, 0xe2, 0x57, 0x99, 0x96, 0x36, 0xa0, 0x66, 0xd9, 0xd8, 0xd1, 0x5c, 0xc3, 0x32, + 0x0f, 0xba, 0xfe, 0xa2, 0x3c, 0x4b, 0x39, 0x83, 0x55, 0x41, 0x17, 0xb1, 0x51, 0x1b, 0x60, 0x10, + 0x22, 0xc8, 0x14, 0xd6, 0xda, 0x28, 0xb0, 0x26, 0xc2, 0x56, 0xe5, 0xa4, 0xd0, 0x2e, 0x2c, 0xb9, + 0x9a, 0x4e, 0xea, 0x05, 0x66, 0x7b, 0x8d, 0xb3, 0x5d, 0x65, 0x03, 0xca, 0xd7, 0x12, 0xac, 0x74, + 0x1c, 0xac, 0xb9, 0x98, 0xf2, 0xf0, 0x2b, 0x1e, 0x0b, 0x49, 0xc4, 0x22, 0x72, 0xa6, 0x20, 0x38, + 0xb3, 0x03, 0xe0, 0x7d, 0x85, 0x28, 0x55, 0x55, 0x8e, 0x13, 0x77, 0x76, 0x29, 0xe9, 0x6c, 0x07, + 0xae, 0x70, 0x36, 0xe4, 0x73, 0x55, 0x79, 0x09, 0x2b, 0x5d, 0x3c, 0xc2, 0xa1, 0x23, 0x59, 0xd8, + 0x87, 0x5b, 0xa0, 0xc0, 0x6f, 0x81, 0x98, 0x91, 0xc5, 0x54, 0x23, 0x39, 0xfd, 0x39, 0x8d, 0xfc, + 0x4d, 0x82, 0x6a, 0x1f, 0xbb, 0xb9, 0x4c, 0xac, 0x43, 0xc5, 0xc4, 0x53, 0x16, 0x19, 0xcf, 0xbc, + 0x80, 0x44, 0x4d, 0x40, 0x86, 0x39, 0x70, 0xb0, 0x46, 0xf0, 0xb3, 0x28, 0x12, 0x4b, 0x2c, 0x12, + 0x29, 0x23, 0xe8, 0x1e, 0x5c, 0x73, 0xf0, 0xf0, 0x62, 0xc0, 0x4b, 0x97, 0x98, 0x74, 0x82, 0x1f, + 0x07, 0xa6, 0x9c, 0x04, 0xe6, 0x23, 0x80, 0xc0, 0xa5, 0x9c, 0xa8, 0xfc, 0x29, 0xc1, 0xd5, 0x3e, + 0x36, 0x87, 0x3d, 0xa2, 0xb7, 0x85, 0x6d, 0xc8, 0x2c, 0x93, 0x98, 0x65, 0x01, 0x49, 0x4f, 0xf9, + 0xb3, 0xe0, 0x48, 0x16, 0xd8, 0x50, 0x48, 0xa3, 0x9b, 0x50, 0xdd, 0x77, 0xac, 0x0b, 0x9b, 0xdb, + 0x89, 0x11, 0x83, 0xc2, 0x4d, 0xb0, 0x39, 0x0c, 0xf7, 0xa0, 0x4f, 0x51, 0x38, 0xe8, 0x17, 0x76, + 0x8e, 0x46, 0x9a, 0x7b, 0x66, 0x39, 0xe3, 0x83, 0x6e, 0xbd, 0xc4, 0xb2, 0x52, 0x82, 0x4f, 0xed, + 0x1a, 0x58, 0xa6, 0x8b, 0x4d, 0xd7, 0x87, 0x22, 0x20, 0xe3, 0x40, 0x55, 0x92, 0x40, 0x3d, 0x86, + 0x55, 0xc1, 0xcb, 0x9c, 0x68, 0x7d, 0x2b, 0xc1, 0xda, 0x3e, 0x03, 0x9c, 0x6a, 0x3b, 0xb4, 0xbc, + 0x54, 0xd3, 0x05, 0x38, 0xd2, 0x74, 0xc3, 0x64, 0x8b, 0xf9, 0x9a, 0xee, 0x34, 0x09, 0x76, 0x26, + 0xd8, 0x39, 0xd1, 0x6c, 0xe3, 0xc4, 0xd6, 0x1c, 0x6d, 0x4c, 0x9a, 0x2a, 0x7e, 0x75, 0x81, 0x89, + 0x1b, 0xc9, 0xaa, 0xdc, 0xbc, 0xcc, 0x33, 0x3e, 0xff, 0x78, 0x58, 0x00, 0x91, 0x45, 0x42, 0xde, + 0x94, 0xe6, 0xe4, 0x4d, 0x1e, 0xd3, 0x82, 0x88, 0xa9, 0x0c, 0xcb, 0x34, 0x02, 0xc7, 0x86, 0xbf, + 0xe7, 0x8b, 0x6a, 0x48, 0x2b, 0x3f, 0x4b, 0x80, 0xe2, 0x30, 0xe4, 0xcc, 0x92, 0x8f, 0x05, 0xec, + 0x0a, 0x6c, 0xce, 0xff, 0x53, 0xb1, 0x23, 0xb6, 0x65, 0x12, 0x9c, 0x01, 0xde, 0x03, 0xa8, 0xb9, + 0x91, 0x35, 0x7e, 0xbd, 0x40, 0x9c, 0xdf, 0xfe, 0x90, 0xca, 0x8b, 0x29, 0x03, 0x16, 0x4d, 0x3f, + 0xd3, 0x3f, 0x7a, 0x7d, 0xd0, 0x7d, 0x1b, 0xc9, 0x4b, 0x67, 0x58, 0x09, 0x8b, 0xe4, 0xc4, 0x6a, + 0x1b, 0x8a, 0xae, 0xa6, 0xfb, 0x20, 0x09, 0x05, 0x85, 0xf2, 0x95, 0x87, 0xb0, 0x7c, 0x68, 0x9c, + 0xe3, 0xdc, 0x75, 0xfa, 0x0f, 0x09, 0x2a, 0x74, 0x65, 0x1a, 0xfd, 0x1c, 0xf3, 0x29, 0x14, 0x0e, + 0xb6, 0x47, 0xaf, 0xbd, 0x0c, 0x16, 0x40, 0xc1, 0xb1, 0xd0, 0x1d, 0xb8, 0x12, 0x92, 0x4c, 0x85, + 0x97, 0x0c, 0x44, 0x26, 0xcd, 0x24, 0xfe, 0x26, 0xf4, 0x93, 0x41, 0x55, 0x8d, 0x18, 0x33, 0xb2, + 0xc0, 0x0e, 0xc0, 0xc0, 0x2b, 0x65, 0x74, 0xcf, 0x56, 0x58, 0x16, 0xe1, 0x38, 0xca, 0x5f, 0x05, + 0x80, 0xe7, 0x96, 0x73, 0xde, 0xb3, 0x98, 0x8b, 0x0a, 0xac, 0x4c, 0x43, 0x2a, 0x74, 0x54, 0xe0, + 0x65, 0x9e, 0x49, 0xce, 0x88, 0xa2, 0x68, 0x44, 0x13, 0xaa, 0x23, 0x3f, 0x08, 0x84, 0x95, 0x81, + 0x5a, 0xfb, 0x5a, 0x10, 0xa9, 0x20, 0x3a, 0x6a, 0x24, 0x42, 0x4f, 0xeb, 0xc0, 0xc3, 0x9c, 0xb0, + 0x3a, 0xc0, 0x9d, 0x56, 0x3f, 0x16, 0x6a, 0x28, 0x80, 0xde, 0x81, 0xf5, 0xe9, 0x97, 0x56, 0x47, + 0x33, 0xfb, 0x98, 0xaf, 0x1f, 0x65, 0x96, 0x6d, 0xd3, 0x86, 0x50, 0x1b, 0x36, 0x3c, 0xb6, 0x2b, + 0x4e, 0xa9, 0xb0, 0x29, 0xa9, 0x63, 0x14, 0x7f, 0x83, 0x1c, 0x39, 0xc6, 0x44, 0x73, 0x71, 0x7d, + 0xb9, 0x21, 0xed, 0x2d, 0xab, 0x11, 0x83, 0xee, 0x00, 0x83, 0x1c, 0x5d, 0x9c, 0x8e, 0x8c, 0x41, + 0xbd, 0xca, 0x06, 0x43, 0x9a, 0x46, 0xa0, 0x13, 0x45, 0x00, 0xbc, 0x08, 0x44, 0x1c, 0xe5, 0x1b, + 0x09, 0x36, 0x3d, 0xf2, 0xa9, 0x89, 0xa3, 0x50, 0xd0, 0x53, 0xd7, 0x06, 0x88, 0x90, 0x8f, 0x9f, + 0x07, 0x4e, 0x94, 0x93, 0xba, 0x44, 0xc6, 0xec, 0xc1, 0x56, 0xaa, 0x1d, 0x39, 0xcb, 0xc2, 0x04, + 0x36, 0xbd, 0xfb, 0x49, 0xc2, 0xad, 0xcb, 0x6c, 0xb2, 0x85, 0xdc, 0x48, 0x5d, 0x37, 0xa7, 0x1b, + 0x2e, 0x6c, 0xd0, 0x2d, 0x9a, 0x70, 0x22, 0x2b, 0x19, 0x28, 0xb0, 0xf2, 0x9c, 0x77, 0xce, 0x33, + 0x5f, 0xe0, 0x2d, 0xe0, 0xc4, 0xa7, 0x70, 0x3d, 0x65, 0xd5, 0x9c, 0x2e, 0xfc, 0x28, 0xc1, 0x96, + 0x7f, 0x6e, 0xde, 0xc4, 0x8d, 0x69, 0x8a, 0x1b, 0xd3, 0x98, 0x1b, 0x73, 0x72, 0x1b, 0x97, 0x12, + 0x96, 0x66, 0xde, 0x4e, 0x4a, 0x49, 0x08, 0x9e, 0x40, 0x3d, 0xdd, 0xe8, 0x9c, 0x28, 0x7c, 0x27, + 0xc1, 0x75, 0xbf, 0xe6, 0x44, 0xda, 0x66, 0xbe, 0x8a, 0xba, 0x29, 0x65, 0xf8, 0xcd, 0xaf, 0x30, + 0xf3, 0x83, 0xfd, 0x8b, 0x04, 0x9b, 0x69, 0x96, 0xe5, 0xac, 0x88, 0x0f, 0xa0, 0x16, 0x85, 0x29, + 0x78, 0x6a, 0xa5, 0xa5, 0x0d, 0x5e, 0x2c, 0x76, 0xe7, 0x28, 0xe6, 0xbc, 0x73, 0x28, 0xdf, 0x4b, + 0x70, 0xc3, 0xf7, 0xe5, 0x63, 0xc7, 0xc0, 0xe6, 0xf0, 0x5f, 0x86, 0xf5, 0xaf, 0x12, 0xdc, 0xcc, + 0xb6, 0xef, 0xbf, 0x88, 0xf8, 0x04, 0x6a, 0xfe, 0x39, 0x21, 0x3d, 0xa2, 0xa3, 0xbb, 0xf4, 0xc8, + 0x8d, 0xb9, 0x82, 0x91, 0x28, 0x9d, 0xc1, 0xf8, 0x42, 0x67, 0x3c, 0xb3, 0xa8, 0x2b, 0x3f, 0x48, + 0xd0, 0x48, 0xee, 0x5a, 0xce, 0x94, 0x4b, 0x35, 0x1c, 0x62, 0x1b, 0xa2, 0x98, 0x6f, 0x43, 0x28, + 0xbf, 0x4b, 0x70, 0x6b, 0x8e, 0x91, 0x39, 0x63, 0xfe, 0x1e, 0xac, 0x0c, 0x22, 0x35, 0x41, 0xd0, + 0xd7, 0x63, 0x60, 0xb3, 0x25, 0x04, 0xc1, 0x7f, 0x2a, 0xec, 0x2f, 0x41, 0xe9, 0x8c, 0xb0, 0xe6, + 0xbc, 0x25, 0xfc, 0x95, 0x17, 0x70, 0x7b, 0xae, 0xfe, 0x9c, 0x99, 0x78, 0x04, 0x72, 0x3f, 0x11, + 0x93, 0x43, 0x3c, 0xc1, 0xa3, 0x39, 0x4f, 0x8d, 0x11, 0x95, 0x61, 0xc6, 0x96, 0x54, 0x8f, 0x58, + 0xe0, 0xc4, 0x7f, 0x06, 0x37, 0x32, 0x57, 0xcb, 0xe7, 0x40, 0xfb, 0x27, 0x80, 0x2b, 0x4f, 0x99, + 0x44, 0x1f, 0x3b, 0x13, 0x63, 0x80, 0xd1, 0x43, 0xa8, 0x71, 0xed, 0x31, 0xb4, 0x19, 0x28, 0x10, + 0xfb, 0x6f, 0xf2, 0x56, 0x2a, 0x9f, 0xd8, 0xe8, 0x7d, 0xa8, 0x86, 0x1d, 0x27, 0xb4, 0x11, 0x2e, + 0xcf, 0x35, 0xc2, 0xe4, 0xeb, 0x29, 0x5c, 0x6f, 0x66, 0xd8, 0x06, 0x8a, 0x66, 0xf2, 0x9d, 0xa7, + 0x68, 0xa6, 0xd8, 0x2f, 0x6a, 0x41, 0xd9, 0xeb, 0x93, 0xa0, 0xb5, 0x40, 0x20, 0x6c, 0x05, 0xc9, + 0x28, 0xce, 0x22, 0x36, 0x75, 0x92, 0xeb, 0x17, 0x44, 0x4e, 0x8a, 0xad, 0x92, 0xc8, 0xc9, 0x78, + 0x73, 0x61, 0x9f, 0xf5, 0x23, 0xb9, 0x07, 0x32, 0xfa, 0x1f, 0x87, 0x87, 0xd8, 0x3f, 0x90, 0xe5, + 0xac, 0xa1, 0x50, 0x11, 0xf7, 0x7a, 0x14, 0x14, 0x89, 0x4f, 0x57, 0x41, 0x51, 0xfc, 0xc1, 0xf9, + 0x39, 0xac, 0xa7, 0x5c, 0x79, 0xd1, 0x8e, 0x08, 0x75, 0xfc, 0xd2, 0x24, 0xef, 0xce, 0x1c, 0xf7, + 0xf4, 0xa6, 0xdc, 0x41, 0x23, 0xbd, 0xe9, 0x17, 0xe3, 0x48, 0x6f, 0xd6, 0x05, 0xf6, 0x08, 0xd6, + 0x12, 0xd7, 0x42, 0x74, 0x93, 0x7f, 0x4a, 0x25, 0x74, 0x6e, 0xcf, 0x18, 0x25, 0x36, 0x7a, 0x01, + 0x1b, 0x69, 0xb7, 0x2c, 0xb4, 0x1b, 0x4b, 0x64, 0x09, 0xbd, 0x8d, 0xd9, 0x02, 0xc4, 0x46, 0xfd, + 0xf0, 0x8d, 0xcf, 0x1d, 0x3c, 0xb4, 0x1d, 0x0b, 0x87, 0x78, 0x3f, 0x90, 0x77, 0x66, 0x0d, 0x13, + 0x1b, 0x61, 0xa8, 0x67, 0x95, 0x6f, 0x74, 0x3b, 0x36, 0x37, 0xed, 0x02, 0x22, 0xdf, 0x99, 0x2f, + 0x44, 0x6c, 0xe4, 0xc2, 0xf6, 0xcc, 0xb2, 0x81, 0xf6, 0xb2, 0xed, 0x14, 0x53, 0xb0, 0x7c, 0x77, + 0x41, 0x49, 0x62, 0xa3, 0xaf, 0x60, 0x77, 0x4e, 0xce, 0x45, 0xf7, 0x42, 0xd8, 0xe7, 0x26, 0x7f, + 0xf9, 0xfe, 0xc2, 0xb2, 0xc4, 0x46, 0xa7, 0xb0, 0x95, 0x91, 0x26, 0x91, 0xc2, 0xe5, 0x82, 0x8c, + 0xac, 0x2d, 0xdf, 0x9e, 0x2b, 0x43, 0xec, 0x47, 0x6b, 0x5f, 0xac, 0x36, 0xfd, 0x3f, 0x6c, 0x3e, + 0xf0, 0x7e, 0x4e, 0xcb, 0xec, 0xdf, 0x98, 0x77, 0xff, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xb2, 0xc1, + 0x31, 0xd6, 0xcf, 0x19, 0x00, 0x00, } diff --git a/pkg/proto/office/office.proto b/pkg/proto/office/office.proto index edaf5307d..6642f674f 100644 --- a/pkg/proto/office/office.proto +++ b/pkg/proto/office/office.proto @@ -106,6 +106,139 @@ message GetUserTagByIDResp { Tag tag = 2; } +/// WorkMoment + +message LikeUser { + string userID = 1; + string userName = 2; +} + +message Comment { + string userID = 1; + string userName = 2; + string replyUserID = 3; + string replyUserName = 4; + string contentID = 5; + string content = 6; + int32 createTime = 7; +} + +message WorkMoment { + string workMomentID = 1; + string userID = 2; + string content = 3; + repeated LikeUser likeUsers = 4; + repeated Comment comments = 5; + repeated string whoCanSeeUserIDList = 6; + repeated string whoCantSeeUserIDList = 7; + bool isPrivate = 8; + bool isPublic = 9; + int32 CreateTime = 10; +} + +message CreateOneWorkMomentReq { + WorkMoment workMoment = 1; + string userID = 2; + string operationID = 3; +} + +message CreateOneWorkMomentResp { + CommonResp commonResp = 1; +} + +message DeleteOneWorkMomentReq { + string workMomentID = 1; + string userID = 2; + string operationID = 3; +} + +message DeleteOneWorkMomentResp { + CommonResp commonResp = 1; +} + +message LikeOneWorkMomentReq { + string userID = 1; + string WorkMomentID = 2; + string operationID = 3; +} + +message LikeOneWorkMomentResp { + CommonResp commonResp = 1; +} + +message CommentOneWorkMomentReq { + string userID = 1; + string workMomentID = 2; + string replyUserID = 3; + string content = 4; + string operationID = 5; +} + +message CommentOneWorkMomentResp { + CommonResp commonResp = 1; +} + +message GetUserWorkMomentsReq { + string userID = 1; + server_api_params.RequestPagination Pagination = 2; + string operationID = 3; +} + +message GetUserWorkMomentsResp { + CommonResp commonResp = 1; + repeated WorkMoment workMoments = 2; + server_api_params.ResponsePagination Pagination = 3; +} + +message GetUserFriendWorkMomentsReq { + string userID = 1; + server_api_params.RequestPagination Pagination = 2; + string operationID = 3; +} + +message GetUserFriendWorkMomentsResp { + CommonResp commonResp = 1; + repeated WorkMoment workMoments = 2; + server_api_params.ResponsePagination Pagination = 3; +} + +message CommentsMsg { + Comment comment = 1; + string workMomentID = 2; + string content = 3; +} + +message GetUserWorkMomentsCommentsMsgReq { + string userID = 1; + string operationID = 2; + server_api_params.RequestPagination Pagination = 3; +} + +message GetUserWorkMomentsCommentsMsgResp { + CommonResp commonResp = 1; + repeated CommentsMsg commentsMsgs = 2; + server_api_params.ResponsePagination Pagination = 3; +} + +message ClearUserWorkMomentsCommentsMsgReq { + string userID = 1; + string operationID = 2; +} + +message ClearUserWorkMomentsCommentsMsgResp { + CommonResp commonResp = 1; +} + +message SetUserWorkMomentsLevelReq { + string userID = 1; + int32 level = 2; + string operationID = 3; +} + +message SetUserWorkMomentsLevelResp { + CommonResp commonResp = 1; +} + service OfficeService { rpc GetUserTags(GetUserTagsReq) returns(GetUserTagsResp); rpc CreateTag(CreateTagReq) returns(CreateTagResp); @@ -114,5 +247,17 @@ service OfficeService { rpc SendMsg2Tag(SendMsg2TagReq) returns(SendMsg2TagResp); rpc GetTagSendLogs(GetTagSendLogsReq) returns(GetTagSendLogsResp); rpc GetUserTagByID(GetUserTagByIDReq) returns(GetUserTagByIDResp); + + rpc CreateOneWorkMoment(CreateOneWorkMomentReq) returns(CreateOneWorkMomentResp); + rpc DeleteOneWorkMoment(DeleteOneWorkMomentReq) returns(DeleteOneWorkMomentResp); + rpc LikeOneWorkMoment(LikeOneWorkMomentReq) returns(LikeOneWorkMomentResp); + rpc CommentOneWorkMoment(CommentOneWorkMomentReq) returns(CommentOneWorkMomentResp); + /// user self + rpc GetUserWorkMoments(GetUserWorkMomentsReq) returns(GetUserWorkMomentsResp); + /// users friend + rpc GetUserFriendWorkMoments(GetUserFriendWorkMomentsReq) returns(GetUserFriendWorkMomentsResp); + rpc GetUserWorkMomentsCommentsMsg(GetUserWorkMomentsCommentsMsgReq) returns(GetUserWorkMomentsCommentsMsgResp); + rpc ClearUserWorkMomentsCommentsMsg(ClearUserWorkMomentsCommentsMsgReq) returns(ClearUserWorkMomentsCommentsMsgResp); + rpc SetUserWorkMomentsLevel(SetUserWorkMomentsLevelReq) returns(SetUserWorkMomentsLevelResp); } diff --git a/pkg/utils/strings.go b/pkg/utils/strings.go index 38262a95c..49d883f7c 100644 --- a/pkg/utils/strings.go +++ b/pkg/utils/strings.go @@ -43,6 +43,14 @@ func IsContain(target string, List []string) bool { } return false } +func IsContainInt32(target int32, List []int32) bool { + for _, element := range List { + if target == element { + return true + } + } + return false +} func InterfaceArrayToStringArray(data []interface{}) (i []string) { for _, param := range data {