mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 20:30:40 +08:00
Merge branch 'tuoyun'
This commit is contained in:
commit
b536165910
@ -10,6 +10,7 @@ import (
|
|||||||
"Open_IM/internal/api/office"
|
"Open_IM/internal/api/office"
|
||||||
apiThird "Open_IM/internal/api/third"
|
apiThird "Open_IM/internal/api/third"
|
||||||
"Open_IM/internal/api/user"
|
"Open_IM/internal/api/user"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
"Open_IM/pkg/utils"
|
"Open_IM/pkg/utils"
|
||||||
"flag"
|
"flag"
|
||||||
@ -67,7 +68,11 @@ func main() {
|
|||||||
groupRouterGroup.POST("/get_group_members_info", group.GetGroupMembersInfo) //1
|
groupRouterGroup.POST("/get_group_members_info", group.GetGroupMembersInfo) //1
|
||||||
groupRouterGroup.POST("/invite_user_to_group", group.InviteUserToGroup) //1
|
groupRouterGroup.POST("/invite_user_to_group", group.InviteUserToGroup) //1
|
||||||
groupRouterGroup.POST("/get_joined_group_list", group.GetJoinedGroupList) //1
|
groupRouterGroup.POST("/get_joined_group_list", group.GetJoinedGroupList) //1
|
||||||
groupRouterGroup.POST("/dismiss_group", group.DismissGroup)
|
groupRouterGroup.POST("/dismiss_group", group.DismissGroup) //
|
||||||
|
groupRouterGroup.POST("/mute_group_member", group.MuteGroupMember)
|
||||||
|
groupRouterGroup.POST("/cancel_mute_group_member", group.CancelMuteGroupMember) //MuteGroup
|
||||||
|
groupRouterGroup.POST("/mute_group", group.MuteGroup)
|
||||||
|
groupRouterGroup.POST("/cancel_mute_group", group.CancelMuteGroup)
|
||||||
}
|
}
|
||||||
//certificate
|
//certificate
|
||||||
authRouterGroup := r.Group("/auth")
|
authRouterGroup := r.Group("/auth")
|
||||||
@ -114,6 +119,7 @@ func main() {
|
|||||||
officeGroup := r.Group("/office")
|
officeGroup := r.Group("/office")
|
||||||
{
|
{
|
||||||
officeGroup.POST("/get_user_tags", office.GetUserTags)
|
officeGroup.POST("/get_user_tags", office.GetUserTags)
|
||||||
|
officeGroup.POST("/get_user_tag_by_id", office.GetUserTagByID)
|
||||||
officeGroup.POST("/create_tag", office.CreateTag)
|
officeGroup.POST("/create_tag", office.CreateTag)
|
||||||
officeGroup.POST("/delete_tag", office.DeleteTag)
|
officeGroup.POST("/delete_tag", office.DeleteTag)
|
||||||
officeGroup.POST("/set_tag", office.SetTag)
|
officeGroup.POST("/set_tag", office.SetTag)
|
||||||
@ -121,7 +127,7 @@ func main() {
|
|||||||
officeGroup.POST("/get_send_tag_log", office.GetTagSendLogs)
|
officeGroup.POST("/get_send_tag_log", office.GetTagSendLogs)
|
||||||
}
|
}
|
||||||
apiThird.MinioInit()
|
apiThird.MinioInit()
|
||||||
log.NewPrivateLog("api")
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
ginPort := flag.Int("port", 10000, "get ginServerPort from cmd,default 10000 as port")
|
ginPort := flag.Int("port", 10000, "get ginServerPort from cmd,default 10000 as port")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
r.Run(":" + strconv.Itoa(*ginPort))
|
r.Run(":" + strconv.Itoa(*ginPort))
|
||||||
|
@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"Open_IM/internal/demo/register"
|
"Open_IM/internal/demo/register"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
"Open_IM/pkg/utils"
|
"Open_IM/pkg/utils"
|
||||||
"flag"
|
"flag"
|
||||||
@ -23,7 +24,7 @@ func main() {
|
|||||||
authRouterGroup.POST("/login", register.Login)
|
authRouterGroup.POST("/login", register.Login)
|
||||||
authRouterGroup.POST("/reset_password", register.ResetPassword)
|
authRouterGroup.POST("/reset_password", register.ResetPassword)
|
||||||
}
|
}
|
||||||
log.NewPrivateLog("demo")
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
ginPort := flag.Int("port", 42233, "get ginServerPort from cmd,default 42233 as port")
|
ginPort := flag.Int("port", 42233, "get ginServerPort from cmd,default 42233 as port")
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
r.Run(":" + strconv.Itoa(*ginPort))
|
r.Run(":" + strconv.Itoa(*ginPort))
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
commonDB "Open_IM/pkg/common/db"
|
commonDB "Open_IM/pkg/common/db"
|
||||||
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
"Open_IM/pkg/common/db/mysql_model/im_mysql_model"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
@ -8,7 +9,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
log.NewPrivateLog("timer")
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
//for {
|
//for {
|
||||||
// fmt.Println("start delete mongodb expired record")
|
// fmt.Println("start delete mongodb expired record")
|
||||||
// timeUnixBegin := time.Now().Unix()
|
// timeUnixBegin := time.Now().Unix()
|
||||||
|
@ -148,7 +148,7 @@ log:
|
|||||||
rotationTime: 24
|
rotationTime: 24
|
||||||
remainRotationCount: 3 #日志数量
|
remainRotationCount: 3 #日志数量
|
||||||
#日志级别 6表示全都打印,测试阶段建议设置为6
|
#日志级别 6表示全都打印,测试阶段建议设置为6
|
||||||
remainLogLevel: 4
|
remainLogLevel: 6
|
||||||
elasticSearchSwitch: false
|
elasticSearchSwitch: false
|
||||||
elasticSearchAddr: [ 127.0.0.1:9201 ]
|
elasticSearchAddr: [ 127.0.0.1:9201 ]
|
||||||
elasticSearchUser: ""
|
elasticSearchUser: ""
|
||||||
@ -366,6 +366,56 @@ notification:
|
|||||||
ext: "groupDismissed ext"
|
ext: "groupDismissed ext"
|
||||||
defaultTips:
|
defaultTips:
|
||||||
tips: "group dismissed"
|
tips: "group dismissed"
|
||||||
|
|
||||||
|
|
||||||
|
groupMuted:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupMuted title"
|
||||||
|
desc: "groupMuted desc"
|
||||||
|
ext: "groupMuted ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "group Muted"
|
||||||
|
|
||||||
|
groupCancelMuted:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupCancelMuted title"
|
||||||
|
desc: "groupCancelMuted desc"
|
||||||
|
ext: "groupCancelMuted ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "group Cancel Muted"
|
||||||
|
|
||||||
|
|
||||||
|
groupMemberMuted:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupMemberMuted title"
|
||||||
|
desc: "groupMemberMuted desc"
|
||||||
|
ext: "groupMemberMuted ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "group Member Muted"
|
||||||
|
|
||||||
|
groupMemberCancelMuted:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 3
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: false
|
||||||
|
title: "groupMemberCancelMuted title"
|
||||||
|
desc: "groupMemberCancelMuted desc"
|
||||||
|
ext: "groupMemberCancelMuted ext"
|
||||||
|
defaultTips:
|
||||||
|
tips: "group Member Cancel Muted"
|
||||||
#############################friend#################################
|
#############################friend#################################
|
||||||
|
|
||||||
friendApplicationAdded:
|
friendApplicationAdded:
|
||||||
@ -501,6 +551,19 @@ notification:
|
|||||||
defaultTips:
|
defaultTips:
|
||||||
tips: "conversation opt update"
|
tips: "conversation opt update"
|
||||||
|
|
||||||
|
conversationSetPrivate:
|
||||||
|
conversation:
|
||||||
|
reliabilityLevel: 2
|
||||||
|
unreadCount: true
|
||||||
|
offlinePush:
|
||||||
|
switch: true
|
||||||
|
title: "burn after reading"
|
||||||
|
desc: "burn after reading"
|
||||||
|
ext: "burn after reading"
|
||||||
|
defaultTips:
|
||||||
|
openTips: "burn after reading was opened"
|
||||||
|
closeTips: "burn after reading was closed"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#---------------demo configuration---------------------#
|
#---------------demo configuration---------------------#
|
||||||
|
2
go.mod
2
go.mod
@ -22,7 +22,7 @@ require (
|
|||||||
github.com/gin-gonic/gin v1.7.0
|
github.com/gin-gonic/gin v1.7.0
|
||||||
github.com/go-playground/validator/v10 v10.4.1
|
github.com/go-playground/validator/v10 v10.4.1
|
||||||
github.com/go-sql-driver/mysql v1.6.0 // indirect
|
github.com/go-sql-driver/mysql v1.6.0 // indirect
|
||||||
github.com/gogo/protobuf v1.3.2 // indirect
|
github.com/gogo/protobuf v1.3.2
|
||||||
github.com/golang-jwt/jwt/v4 v4.1.0
|
github.com/golang-jwt/jwt/v4 v4.1.0
|
||||||
github.com/golang/protobuf v1.5.2
|
github.com/golang/protobuf v1.5.2
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
|
6
go.sum
6
go.sum
@ -53,6 +53,7 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy
|
|||||||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||||
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho=
|
||||||
|
github.com/alibabacloud-go/darabonba-openapi v0.1.7/go.mod h1:6FV1Bt1AItYIlC2rVopPTumrRNtkfPBmrPVAZ8v2bLk=
|
||||||
github.com/alibabacloud-go/darabonba-openapi v0.1.11 h1:w59gtSA0s87p0U5NNG/N/PIHsRP3rtj7qCP9hx9+GL8=
|
github.com/alibabacloud-go/darabonba-openapi v0.1.11 h1:w59gtSA0s87p0U5NNG/N/PIHsRP3rtj7qCP9hx9+GL8=
|
||||||
github.com/alibabacloud-go/darabonba-openapi v0.1.11/go.mod h1:MPJMxv7HYrFm5m9uOZWkDYsAWyZztEgnBRfk9Fg0eIU=
|
github.com/alibabacloud-go/darabonba-openapi v0.1.11/go.mod h1:MPJMxv7HYrFm5m9uOZWkDYsAWyZztEgnBRfk9Fg0eIU=
|
||||||
github.com/alibabacloud-go/darabonba-string v1.0.0/go.mod h1:93cTfV3vuPhhEwGGpKKqhVW4jLe7tDpo3LUM0i0g6mA=
|
github.com/alibabacloud-go/darabonba-string v1.0.0/go.mod h1:93cTfV3vuPhhEwGGpKKqhVW4jLe7tDpo3LUM0i0g6mA=
|
||||||
@ -62,8 +63,11 @@ github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.8 h1:KXMiCg99Jx7B6V+DlRFbWw
|
|||||||
github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.8/go.mod h1:8aL6tSyQIWJygF7W/Vqxdf/QDbN2S+u57k36bEA8hD8=
|
github.com/alibabacloud-go/dysmsapi-20170525/v2 v2.0.8/go.mod h1:8aL6tSyQIWJygF7W/Vqxdf/QDbN2S+u57k36bEA8hD8=
|
||||||
github.com/alibabacloud-go/endpoint-util v1.1.0 h1:r/4D3VSw888XGaeNpP994zDUaxdgTSHBbVfZlzf6b5Q=
|
github.com/alibabacloud-go/endpoint-util v1.1.0 h1:r/4D3VSw888XGaeNpP994zDUaxdgTSHBbVfZlzf6b5Q=
|
||||||
github.com/alibabacloud-go/endpoint-util v1.1.0/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE=
|
github.com/alibabacloud-go/endpoint-util v1.1.0/go.mod h1:O5FuCALmCKs2Ff7JFJMudHs0I5EBgecXXxZRyswlEjE=
|
||||||
|
github.com/alibabacloud-go/openapi-util v0.0.8/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws=
|
||||||
github.com/alibabacloud-go/openapi-util v0.0.9 h1:Z0DP4LFzkM/rW2nxOMiiLoQVZSeE3jVc5jrZ9Fd/UX0=
|
github.com/alibabacloud-go/openapi-util v0.0.9 h1:Z0DP4LFzkM/rW2nxOMiiLoQVZSeE3jVc5jrZ9Fd/UX0=
|
||||||
github.com/alibabacloud-go/openapi-util v0.0.9/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws=
|
github.com/alibabacloud-go/openapi-util v0.0.9/go.mod h1:sQuElr4ywwFRlCCberQwKRFhRzIyG4QTP/P4y1CJ6Ws=
|
||||||
|
github.com/alibabacloud-go/sts-20150401 v1.1.0 h1:1yVyKz02ES6aKo3xVjmoPLBH1OAmmSqPkhKRdjEkmYs=
|
||||||
|
github.com/alibabacloud-go/sts-20150401 v1.1.0/go.mod h1:QW4O/c7Hp4krHYt+6xwnoG8EyZW3V9GYkl6EgIBmxJc=
|
||||||
github.com/alibabacloud-go/tea v1.1.0/go.mod h1:IkGyUSX4Ba1V+k4pCtJUc6jDpZLFph9QMy2VUPTwukg=
|
github.com/alibabacloud-go/tea v1.1.0/go.mod h1:IkGyUSX4Ba1V+k4pCtJUc6jDpZLFph9QMy2VUPTwukg=
|
||||||
github.com/alibabacloud-go/tea v1.1.7/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4=
|
github.com/alibabacloud-go/tea v1.1.7/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4=
|
||||||
github.com/alibabacloud-go/tea v1.1.8/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4=
|
github.com/alibabacloud-go/tea v1.1.8/go.mod h1:/tmnEaQMyb4Ky1/5D+SE1BAsa5zj/KeGOFfwYm3N/p4=
|
||||||
@ -1095,6 +1099,8 @@ gopkg.in/ini.v1 v1.56.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
|||||||
gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
gopkg.in/ini.v1 v1.57.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
gopkg.in/ini.v1 v1.63.2 h1:tGK/CyBg7SMzb60vP1M03vNZ3VDu3wGQJwn7Sxi9r3c=
|
gopkg.in/ini.v1 v1.63.2 h1:tGK/CyBg7SMzb60vP1M03vNZ3VDu3wGQJwn7Sxi9r3c=
|
||||||
gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
|
gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI=
|
||||||
|
gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
|
||||||
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw=
|
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22 h1:VpOs+IwYnYBaFnrNAeB8UUWtL3vEUnzSCL1nVjPhqrw=
|
||||||
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
|
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22/go.mod h1:yeKp02qBN3iKW1OzL3MGk2IdtZzaj7SFntXj72NppTA=
|
||||||
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
|
||||||
|
@ -128,7 +128,7 @@ func GetConversation(c *gin.Context) {
|
|||||||
client := pbUser.NewUserClient(etcdConn)
|
client := pbUser.NewUserClient(etcdConn)
|
||||||
respPb, err := client.GetConversation(context.Background(), &reqPb)
|
respPb, err := client.GetConversation(context.Background(), &reqPb)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetConversation rpc failed, ", reqPb.String(), err.Error())
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()})
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -192,7 +192,7 @@ func SetRecvMsgOpt(c *gin.Context) {
|
|||||||
client := pbUser.NewUserClient(etcdConn)
|
client := pbUser.NewUserClient(etcdConn)
|
||||||
respPb, err := client.SetRecvMsgOpt(context.Background(), &reqPb)
|
respPb, err := client.SetRecvMsgOpt(context.Background(), &reqPb)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation rpc failed, ", reqPb.String(), err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetRecvMsgOpt rpc failed, ", reqPb.String(), err.Error())
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()})
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 500, "errMsg": "GetAllConversationMsgOpt rpc failed, " + err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -568,3 +568,131 @@ func DismissGroup(c *gin.Context) {
|
|||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp)
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp)
|
||||||
c.JSON(http.StatusOK, resp)
|
c.JSON(http.StatusOK, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func MuteGroupMember(c *gin.Context) {
|
||||||
|
params := api.MuteGroupMemberReq{}
|
||||||
|
if err := c.BindJSON(¶ms); err != nil {
|
||||||
|
log.NewError("0", "BindJSON failed ", err.Error())
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
req := &rpc.MuteGroupMemberReq{}
|
||||||
|
utils.CopyStructFields(req, ¶ms)
|
||||||
|
var ok bool
|
||||||
|
ok, req.OpUserID = 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
|
||||||
|
}
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String())
|
||||||
|
|
||||||
|
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName)
|
||||||
|
client := rpc.NewGroupClient(etcdConn)
|
||||||
|
reply, err := client.MuteGroupMember(context.Background(), req)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), " failed ", req.String())
|
||||||
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp := api.MuteGroupMemberResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}}
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp)
|
||||||
|
c.JSON(http.StatusOK, resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
func CancelMuteGroupMember(c *gin.Context) {
|
||||||
|
params := api.CancelMuteGroupMemberReq{}
|
||||||
|
if err := c.BindJSON(¶ms); err != nil {
|
||||||
|
log.NewError("0", "BindJSON failed ", err.Error())
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
req := &rpc.CancelMuteGroupMemberReq{}
|
||||||
|
utils.CopyStructFields(req, ¶ms)
|
||||||
|
var ok bool
|
||||||
|
ok, req.OpUserID = 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
|
||||||
|
}
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String())
|
||||||
|
|
||||||
|
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName)
|
||||||
|
client := rpc.NewGroupClient(etcdConn)
|
||||||
|
reply, err := client.CancelMuteGroupMember(context.Background(), req)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), " failed ", req.String())
|
||||||
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp := api.CancelMuteGroupMemberResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}}
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp)
|
||||||
|
c.JSON(http.StatusOK, resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
func MuteGroup(c *gin.Context) {
|
||||||
|
params := api.MuteGroupReq{}
|
||||||
|
if err := c.BindJSON(¶ms); err != nil {
|
||||||
|
log.NewError("0", "BindJSON failed ", err.Error())
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
req := &rpc.MuteGroupReq{}
|
||||||
|
utils.CopyStructFields(req, ¶ms)
|
||||||
|
var ok bool
|
||||||
|
ok, req.OpUserID = 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
|
||||||
|
}
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String())
|
||||||
|
|
||||||
|
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName)
|
||||||
|
client := rpc.NewGroupClient(etcdConn)
|
||||||
|
reply, err := client.MuteGroup(context.Background(), req)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), " failed ", req.String())
|
||||||
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp := api.MuteGroupResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}}
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp)
|
||||||
|
c.JSON(http.StatusOK, resp)
|
||||||
|
}
|
||||||
|
|
||||||
|
func CancelMuteGroup(c *gin.Context) {
|
||||||
|
params := api.CancelMuteGroupReq{}
|
||||||
|
if err := c.BindJSON(¶ms); err != nil {
|
||||||
|
log.NewError("0", "BindJSON failed ", err.Error())
|
||||||
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
req := &rpc.CancelMuteGroupReq{}
|
||||||
|
utils.CopyStructFields(req, ¶ms)
|
||||||
|
var ok bool
|
||||||
|
ok, req.OpUserID = 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
|
||||||
|
}
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api args ", req.String())
|
||||||
|
|
||||||
|
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName)
|
||||||
|
client := rpc.NewGroupClient(etcdConn)
|
||||||
|
reply, err := client.CancelMuteGroup(context.Background(), req)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), " failed ", req.String())
|
||||||
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
resp := api.CancelMuteGroupResp{CommResp: api.CommResp{ErrCode: reply.CommonResp.ErrCode, ErrMsg: reply.CommonResp.ErrMsg}}
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " api return ", resp)
|
||||||
|
c.JSON(http.StatusOK, resp)
|
||||||
|
}
|
||||||
|
@ -140,7 +140,7 @@ func ManagementSendMsg(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
log.NewInfo("", data, params)
|
log.NewInfo("", data, params)
|
||||||
token := c.Request.Header.Get("token")
|
token := c.Request.Header.Get("token")
|
||||||
claims, err := token_verify.ParseToken(token)
|
claims, err := token_verify.ParseToken(token, params.OperationID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(params.OperationID, "parse token failed", err.Error())
|
log.NewError(params.OperationID, "parse token failed", err.Error())
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "parse token failed", "sendTime": 0, "MsgID": ""})
|
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "parse token failed", "sendTime": 0, "MsgID": ""})
|
||||||
@ -218,16 +218,16 @@ type ManagementSendMsgReq struct {
|
|||||||
|
|
||||||
type PictureBaseInfo struct {
|
type PictureBaseInfo struct {
|
||||||
UUID string `mapstructure:"uuid"`
|
UUID string `mapstructure:"uuid"`
|
||||||
Type string `mapstructure:"type" validate:"required"`
|
Type string `mapstructure:"type" `
|
||||||
Size int64 `mapstructure:"size" validate:"required"`
|
Size int64 `mapstructure:"size" `
|
||||||
Width int32 `mapstructure:"width" validate:"required"`
|
Width int32 `mapstructure:"width" `
|
||||||
Height int32 `mapstructure:"height" validate:"required"`
|
Height int32 `mapstructure:"height"`
|
||||||
Url string `mapstructure:"url" validate:"required"`
|
Url string `mapstructure:"url" `
|
||||||
}
|
}
|
||||||
|
|
||||||
type PictureElem struct {
|
type PictureElem struct {
|
||||||
SourcePath string `mapstructure:"sourcePath"`
|
SourcePath string `mapstructure:"sourcePath"`
|
||||||
SourcePicture PictureBaseInfo `mapstructure:"sourcePicture" validate:"required"`
|
SourcePicture PictureBaseInfo `mapstructure:"sourcePicture"`
|
||||||
BigPicture PictureBaseInfo `mapstructure:"bigPicture" `
|
BigPicture PictureBaseInfo `mapstructure:"bigPicture" `
|
||||||
SnapshotPicture PictureBaseInfo `mapstructure:"snapshotPicture"`
|
SnapshotPicture PictureBaseInfo `mapstructure:"snapshotPicture"`
|
||||||
}
|
}
|
||||||
@ -282,25 +282,15 @@ type RevokeElem struct {
|
|||||||
RevokeMsgClientID string `mapstructure:"revokeMsgClientID" validate:"required"`
|
RevokeMsgClientID string `mapstructure:"revokeMsgClientID" validate:"required"`
|
||||||
}
|
}
|
||||||
type OANotificationElem struct {
|
type OANotificationElem struct {
|
||||||
NotificationName string `mapstructure:"notificationName" validate:"required"`
|
NotificationName string `mapstructure:"notificationName" validate:"required"`
|
||||||
NotificationFaceURL string `mapstructure:"notificationFaceURL" validate:"required"`
|
NotificationFaceURL string `mapstructure:"notificationFaceURL" validate:"required"`
|
||||||
NotificationType int32 `mapstructure:"notificationType" validate:"required"`
|
NotificationType int32 `mapstructure:"notificationType" validate:"required"`
|
||||||
Text string `mapstructure:"text" validate:"required"`
|
Text string `mapstructure:"text" validate:"required"`
|
||||||
Url string `mapstructure:"url"`
|
Url string `mapstructure:"url"`
|
||||||
MixType int32 `mapstructure:"mixType"`
|
MixType int32 `mapstructure:"mixType"`
|
||||||
Image struct {
|
PictureElem PictureElem `mapstructure:"pictureElem"`
|
||||||
SourceUrl string `mapstructure:"sourceUrl"`
|
SoundElem SoundElem `mapstructure:"soundElem"`
|
||||||
SnapshotUrl string `mapstructure:"snapshotUrl"`
|
VideoElem VideoElem `mapstructure:"videoElem"`
|
||||||
} `mapstructure:"image"`
|
FileElem FileElem `mapstructure:"fileElem"`
|
||||||
Video struct {
|
Ex string `mapstructure:"ex"`
|
||||||
SourceUrl string `mapstructure:"sourceUrl"`
|
|
||||||
SnapshotUrl string `mapstructure:"snapshotUrl"`
|
|
||||||
Duration int64 `mapstructure:"duration"`
|
|
||||||
} `mapstructure:"video"`
|
|
||||||
File struct {
|
|
||||||
SourceUrl string `mapstructure:"sourceUrl"`
|
|
||||||
FileName string `mapstructure:"fileName"`
|
|
||||||
FileSize int64 `mapstructure:"fileSize"`
|
|
||||||
} `mapstructure:"file"`
|
|
||||||
Ex string `mapstructure:"ex"`
|
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,11 @@ func GetUserTags(c *gin.Context) {
|
|||||||
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
|
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
|
||||||
}
|
}
|
||||||
resp.Data.Tags = respPb.Tags
|
if respPb.Tags != nil {
|
||||||
|
resp.Data.Tags = respPb.Tags
|
||||||
|
} else {
|
||||||
|
resp.Data.Tags = []*pbOffice.Tag{}
|
||||||
|
}
|
||||||
c.JSON(http.StatusOK, resp)
|
c.JSON(http.StatusOK, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -229,8 +233,48 @@ func GetTagSendLogs(c *gin.Context) {
|
|||||||
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
|
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
|
||||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
|
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
|
||||||
}
|
}
|
||||||
resp.Data.Logs = respPb.TagSendLogs
|
if respPb.TagSendLogs != nil {
|
||||||
|
resp.Data.Logs = respPb.TagSendLogs
|
||||||
|
} else {
|
||||||
|
resp.Data.Logs = []*pbOffice.TagSendLog{}
|
||||||
|
}
|
||||||
resp.Data.ShowNumber = respPb.Pagination.ShowNumber
|
resp.Data.ShowNumber = respPb.Pagination.ShowNumber
|
||||||
resp.Data.CurrentPage = respPb.Pagination.CurrentPage
|
resp.Data.CurrentPage = respPb.Pagination.CurrentPage
|
||||||
c.JSON(http.StatusOK, resp)
|
c.JSON(http.StatusOK, resp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetUserTagByID(c *gin.Context) {
|
||||||
|
var (
|
||||||
|
req apistruct.GetUserTagByIDReq
|
||||||
|
resp apistruct.GetUserTagByIDResp
|
||||||
|
reqPb pbOffice.GetUserTagByIDReq
|
||||||
|
respPb *pbOffice.GetUserTagByIDResp
|
||||||
|
)
|
||||||
|
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
|
||||||
|
}
|
||||||
|
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
|
||||||
|
reqPb.TagID = req.TagID
|
||||||
|
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfficeName)
|
||||||
|
client := pbOffice.NewOfficeServiceClient(etcdConn)
|
||||||
|
respPb, err := client.GetUserTagByID(context.Background(), &reqPb)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserTagByID failed", err.Error())
|
||||||
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "CreateTag rpc server failed" + err.Error()})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := utils.CopyStructFields(&resp.CommResp, respPb.CommonResp); err != nil {
|
||||||
|
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "CopyStructFields failed", err.Error())
|
||||||
|
}
|
||||||
|
resp.Data.Tag = respPb.Tag
|
||||||
|
c.JSON(http.StatusOK, resp)
|
||||||
|
}
|
||||||
|
@ -81,7 +81,7 @@ func MinioUploadFile(c *gin.Context) {
|
|||||||
_, err = minioClient.PutObject(context.Background(), config.Config.Credential.Minio.Bucket, newName, fileObj, file.Size, minio.PutObjectOptions{ContentType: newType})
|
_, err = minioClient.PutObject(context.Background(), config.Config.Credential.Minio.Bucket, newName, fileObj, file.Size, minio.PutObjectOptions{ContentType: newType})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "open file error")
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "open file error")
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"errCode": 400, "errMsg": "invalid file path" + err.Error()})
|
c.JSON(http.StatusInternalServerError, gin.H{"errCode": 500, "errMsg": "invalid file path" + err.Error()})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp.NewName = newName
|
resp.NewName = newName
|
||||||
|
@ -2,6 +2,7 @@ package gate
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"Open_IM/pkg/common/config"
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
"Open_IM/pkg/statistics"
|
"Open_IM/pkg/statistics"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -20,7 +21,7 @@ var (
|
|||||||
|
|
||||||
func Init(rpcPort, wsPort int) {
|
func Init(rpcPort, wsPort int) {
|
||||||
//log initialization
|
//log initialization
|
||||||
log.NewPrivateLog(config.Config.ModuleName.LongConnSvrName)
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
rwLock = new(sync.RWMutex)
|
rwLock = new(sync.RWMutex)
|
||||||
validate = validator.New()
|
validate = validator.New()
|
||||||
statistics.NewStatistics(&sendMsgCount, config.Config.ModuleName.LongConnSvrName, fmt.Sprintf("%d second recv to msg_gateway sendMsgCount", sendMsgCount), 300)
|
statistics.NewStatistics(&sendMsgCount, config.Config.ModuleName.LongConnSvrName, fmt.Sprintf("%d second recv to msg_gateway sendMsgCount", sendMsgCount), 300)
|
||||||
|
@ -80,6 +80,22 @@ func (mc *HistoryConsumerHandler) handleChatWs2Mongo(msg []byte, msgKey string)
|
|||||||
mc.groupMsgCount++
|
mc.groupMsgCount++
|
||||||
}
|
}
|
||||||
go sendMessageToPush(&msgFromMQ, msgFromMQ.MsgData.RecvID)
|
go sendMessageToPush(&msgFromMQ, msgFromMQ.MsgData.RecvID)
|
||||||
|
case constant.NotificationChatType:
|
||||||
|
log.NewDebug(msgFromMQ.OperationID, "msg_transfer msg type = NotificationChatType", isHistory, isPersist)
|
||||||
|
if isHistory {
|
||||||
|
err := saveUserChat(msgKey, &msgFromMQ)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(operationID, "single data insert to mongo err", err.Error(), msgFromMQ.String())
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mc.singleMsgCount++
|
||||||
|
log.NewDebug(msgFromMQ.OperationID, "sendMessageToPush cost time ", utils.GetCurrentTimestampByNano()-time)
|
||||||
|
}
|
||||||
|
if !isSenderSync && msgKey == msgFromMQ.MsgData.SendID {
|
||||||
|
} else {
|
||||||
|
go sendMessageToPush(&msgFromMQ, msgKey)
|
||||||
|
}
|
||||||
|
log.NewDebug(operationID, "saveUserChat cost time ", utils.GetCurrentTimestampByNano()-time)
|
||||||
default:
|
default:
|
||||||
log.NewError(msgFromMQ.OperationID, "SessionType error", msgFromMQ.String())
|
log.NewError(msgFromMQ.OperationID, "SessionType error", msgFromMQ.String())
|
||||||
return
|
return
|
||||||
|
@ -2,6 +2,7 @@ package logic
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"Open_IM/pkg/common/config"
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/kafka"
|
"Open_IM/pkg/common/kafka"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
)
|
)
|
||||||
@ -13,7 +14,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Init() {
|
func Init() {
|
||||||
log.NewPrivateLog(config.Config.ModuleName.MsgTransferName)
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
persistentCH.Init()
|
persistentCH.Init()
|
||||||
historyCH.Init()
|
historyCH.Init()
|
||||||
producer = kafka.NewKafkaProducer(config.Config.Kafka.Ms2pschat.Addr, config.Config.Kafka.Ms2pschat.Topic)
|
producer = kafka.NewKafkaProducer(config.Config.Kafka.Ms2pschat.Addr, config.Config.Kafka.Ms2pschat.Topic)
|
||||||
|
@ -34,26 +34,31 @@ func (pc *PersistentConsumerHandler) Init() {
|
|||||||
|
|
||||||
func (pc *PersistentConsumerHandler) handleChatWs2Mysql(msg []byte, msgKey string) {
|
func (pc *PersistentConsumerHandler) handleChatWs2Mysql(msg []byte, msgKey string) {
|
||||||
log.NewInfo("msg come here mysql!!!", "", "msg", string(msg))
|
log.NewInfo("msg come here mysql!!!", "", "msg", string(msg))
|
||||||
|
var tag bool
|
||||||
msgFromMQ := pbMsg.MsgDataToMQ{}
|
msgFromMQ := pbMsg.MsgDataToMQ{}
|
||||||
err := proto.Unmarshal(msg, &msgFromMQ)
|
err := proto.Unmarshal(msg, &msgFromMQ)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorByKv("msg_transfer Unmarshal msg err", "", "msg", string(msg), "err", err.Error())
|
log.NewError(msgFromMQ.OperationID, "msg_transfer Unmarshal msg err", "msg", string(msg), "err", err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
//Control whether to store history messages (mysql)
|
//Control whether to store history messages (mysql)
|
||||||
isPersist := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsPersistent)
|
isPersist := utils.GetSwitchFromOptions(msgFromMQ.MsgData.Options, constant.IsPersistent)
|
||||||
//Only process receiver data
|
//Only process receiver data
|
||||||
if isPersist {
|
if isPersist {
|
||||||
if msgKey == msgFromMQ.MsgData.RecvID && msgFromMQ.MsgData.SessionType == constant.SingleChatType {
|
switch msgFromMQ.MsgData.SessionType {
|
||||||
log.InfoByKv("msg_transfer msg persisting", msgFromMQ.OperationID)
|
case constant.SingleChatType, constant.NotificationChatType:
|
||||||
if err = im_mysql_msg_model.InsertMessageToChatLog(msgFromMQ); err != nil {
|
if msgKey == msgFromMQ.MsgData.RecvID {
|
||||||
log.ErrorByKv("Message insert failed", msgFromMQ.OperationID, "err", err.Error(), "msg", msgFromMQ.String())
|
tag = true
|
||||||
return
|
|
||||||
}
|
}
|
||||||
} else if msgFromMQ.MsgData.SessionType == constant.GroupChatType && msgKey == msgFromMQ.MsgData.SendID {
|
case constant.GroupChatType:
|
||||||
log.InfoByKv("msg_transfer msg persisting", msgFromMQ.OperationID)
|
if msgKey == msgFromMQ.MsgData.SendID || utils.IsContain(msgFromMQ.MsgData.SendID, config.Config.Manager.AppManagerUid) {
|
||||||
|
tag = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if tag {
|
||||||
|
log.NewInfo(msgFromMQ.OperationID, "msg_transfer msg persisting", string(msg))
|
||||||
if err = im_mysql_msg_model.InsertMessageToChatLog(msgFromMQ); err != nil {
|
if err = im_mysql_msg_model.InsertMessageToChatLog(msgFromMQ); err != nil {
|
||||||
log.ErrorByKv("Message insert failed", msgFromMQ.OperationID, "err", err.Error(), "msg", msgFromMQ.String())
|
log.NewError(msgFromMQ.OperationID, "Message insert failed", "err", err.Error(), "msg", msgFromMQ.String())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Init(rpcPort int) {
|
func Init(rpcPort int) {
|
||||||
log.NewPrivateLog(config.Config.ModuleName.PushName)
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
rpcServer.Init(rpcPort)
|
rpcServer.Init(rpcPort)
|
||||||
pushCh.Init()
|
pushCh.Init()
|
||||||
pushTerminal = []int32{constant.IOSPlatformID, constant.AndroidPlatformID}
|
pushTerminal = []int32{constant.IOSPlatformID, constant.AndroidPlatformID}
|
||||||
|
@ -24,7 +24,7 @@ type adminCMSServer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewAdminCMSServer(port int) *adminCMSServer {
|
func NewAdminCMSServer(port int) *adminCMSServer {
|
||||||
log.NewPrivateLog("AdminCMS")
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
return &adminCMSServer{
|
return &adminCMSServer{
|
||||||
rpcPort: port,
|
rpcPort: port,
|
||||||
rpcRegisterName: config.Config.RpcRegisterName.OpenImAdminCMSName,
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImAdminCMSName,
|
||||||
@ -66,12 +66,12 @@ func (s *adminCMSServer) Run() {
|
|||||||
func (s *adminCMSServer) AdminLogin(_ context.Context, req *pbAdminCMS.AdminLoginReq) (*pbAdminCMS.AdminLoginResp, error) {
|
func (s *adminCMSServer) AdminLogin(_ context.Context, req *pbAdminCMS.AdminLoginReq) (*pbAdminCMS.AdminLoginResp, error) {
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||||
resp := &pbAdminCMS.AdminLoginResp{}
|
resp := &pbAdminCMS.AdminLoginResp{}
|
||||||
for i, adminID := range config.Config.Manager.AppManagerUid{
|
for i, adminID := range config.Config.Manager.AppManagerUid {
|
||||||
if adminID == req.AdminID && config.Config.Manager.Secrets[i] == req.Secret {
|
if adminID == req.AdminID && config.Config.Manager.Secrets[i] == req.Secret {
|
||||||
token, expTime, err := token_verify.CreateToken(adminID, constant.SingleChatType)
|
token, expTime, err := token_verify.CreateToken(adminID, constant.SingleChatType)
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "generate token success", "token: ", token, "expTime:", expTime)
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "generate token success", "token: ", token, "expTime:", expTime)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "generate token failed", "adminID: ", adminID, err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "generate token failed", "adminID: ", adminID, err.Error())
|
||||||
return resp, openIMHttp.WrapError(constant.ErrTokenUnknown)
|
return resp, openIMHttp.WrapError(constant.ErrTokenUnknown)
|
||||||
}
|
}
|
||||||
resp.Token = token
|
resp.Token = token
|
||||||
@ -84,4 +84,4 @@ func (s *adminCMSServer) AdminLogin(_ context.Context, req *pbAdminCMS.AdminLogi
|
|||||||
return resp, openIMHttp.WrapError(constant.ErrTokenMalformed)
|
return resp, openIMHttp.WrapError(constant.ErrTokenMalformed)
|
||||||
}
|
}
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ type rpcAuth struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewRpcAuthServer(port int) *rpcAuth {
|
func NewRpcAuthServer(port int) *rpcAuth {
|
||||||
log.NewPrivateLog("auth")
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
return &rpcAuth{
|
return &rpcAuth{
|
||||||
rpcPort: port,
|
rpcPort: port,
|
||||||
rpcRegisterName: config.Config.RpcRegisterName.OpenImAuthName,
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImAuthName,
|
||||||
|
@ -29,7 +29,7 @@ type friendServer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewFriendServer(port int) *friendServer {
|
func NewFriendServer(port int) *friendServer {
|
||||||
log.NewPrivateLog("friend")
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
return &friendServer{
|
return &friendServer{
|
||||||
rpcPort: port,
|
rpcPort: port,
|
||||||
rpcRegisterName: config.Config.RpcRegisterName.OpenImFriendName,
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImFriendName,
|
||||||
|
@ -31,7 +31,7 @@ type groupServer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewGroupServer(port int) *groupServer {
|
func NewGroupServer(port int) *groupServer {
|
||||||
log.NewPrivateLog("group")
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
return &groupServer{
|
return &groupServer{
|
||||||
rpcPort: port,
|
rpcPort: port,
|
||||||
rpcRegisterName: config.Config.RpcRegisterName.OpenImGroupName,
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImGroupName,
|
||||||
@ -41,16 +41,16 @@ func NewGroupServer(port int) *groupServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *groupServer) Run() {
|
func (s *groupServer) Run() {
|
||||||
log.NewInfo("0", "group rpc start ")
|
log.NewInfo("", "group rpc start ")
|
||||||
ip := utils.ServerIP
|
ip := utils.ServerIP
|
||||||
registerAddress := ip + ":" + strconv.Itoa(s.rpcPort)
|
registerAddress := ip + ":" + strconv.Itoa(s.rpcPort)
|
||||||
//listener network
|
//listener network
|
||||||
listener, err := net.Listen("tcp", registerAddress)
|
listener, err := net.Listen("tcp", registerAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError("0", "Listen failed ", err.Error(), registerAddress)
|
log.NewError("", "Listen failed ", err.Error(), registerAddress)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.NewInfo("0", "listen network success, ", registerAddress, listener)
|
log.NewInfo("", "listen network success, ", registerAddress, listener)
|
||||||
defer listener.Close()
|
defer listener.Close()
|
||||||
//grpc server
|
//grpc server
|
||||||
srv := grpc.NewServer()
|
srv := grpc.NewServer()
|
||||||
@ -59,15 +59,15 @@ func (s *groupServer) Run() {
|
|||||||
pbGroup.RegisterGroupServer(srv, s)
|
pbGroup.RegisterGroupServer(srv, s)
|
||||||
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10)
|
err = getcdv3.RegisterEtcd(s.etcdSchema, strings.Join(s.etcdAddr, ","), ip, s.rpcPort, s.rpcRegisterName, 10)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError("0", "RegisterEtcd failed ", err.Error())
|
log.NewError("", "RegisterEtcd failed ", err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = srv.Serve(listener)
|
err = srv.Serve(listener)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError("0", "Serve failed ", err.Error())
|
log.NewError("", "Serve failed ", err.Error())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.NewInfo("0", "group rpc success")
|
log.NewInfo("", "group rpc success")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupReq) (*pbGroup.CreateGroupResp, error) {
|
func (s *groupServer) CreateGroup(ctx context.Context, req *pbGroup.CreateGroupReq) (*pbGroup.CreateGroupResp, error) {
|
||||||
@ -273,8 +273,11 @@ func (s *groupServer) GetGroupAllMember(ctx context.Context, req *pbGroup.GetGro
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, v := range memberList {
|
for _, v := range memberList {
|
||||||
|
log.Debug(req.OperationID, v)
|
||||||
var node open_im_sdk.GroupMemberFullInfo
|
var node open_im_sdk.GroupMemberFullInfo
|
||||||
cp.GroupMemberDBCopyOpenIM(&node, &v)
|
cp.GroupMemberDBCopyOpenIM(&node, &v)
|
||||||
|
log.Debug(req.OperationID, "db value:", v.MuteEndTime, "seconds: ", v.MuteEndTime.Unix())
|
||||||
|
log.Debug(req.OperationID, "cp value: ", node)
|
||||||
resp.MemberList = append(resp.MemberList, &node)
|
resp.MemberList = append(resp.MemberList, &node)
|
||||||
}
|
}
|
||||||
log.NewInfo(req.OperationID, "GetGroupAllMember rpc return ", resp.String())
|
log.NewInfo(req.OperationID, "GetGroupAllMember rpc return ", resp.String())
|
||||||
@ -355,7 +358,7 @@ func (s *groupServer) KickGroupMember(ctx context.Context, req *pbGroup.KickGrou
|
|||||||
//remove
|
//remove
|
||||||
var resp pbGroup.KickGroupMemberResp
|
var resp pbGroup.KickGroupMemberResp
|
||||||
for _, v := range req.KickedUserIDList {
|
for _, v := range req.KickedUserIDList {
|
||||||
//owner cant kicked
|
//owner can‘t kicked
|
||||||
if v == groupOwnerUserID {
|
if v == groupOwnerUserID {
|
||||||
log.NewError(req.OperationID, "failed, can't kick owner ", v)
|
log.NewError(req.OperationID, "failed, can't kick owner ", v)
|
||||||
resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1})
|
resp.Id2ResultList = append(resp.Id2ResultList, &pbGroup.Id2Result{UserID: v, Result: -1})
|
||||||
@ -969,24 +972,26 @@ func (s *groupServer) DismissGroup(ctx context.Context, req *pbGroup.DismissGrou
|
|||||||
|
|
||||||
func (s *groupServer) MuteGroupMember(ctx context.Context, req *pbGroup.MuteGroupMemberReq) (*pbGroup.MuteGroupMemberResp, error) {
|
func (s *groupServer) MuteGroupMember(ctx context.Context, req *pbGroup.MuteGroupMemberReq) (*pbGroup.MuteGroupMemberResp, error) {
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String())
|
||||||
if !imdb.IsGroupOwnerAdmin(req.GroupID, req.UserID) && !token_verify.IsMangerUserID(req.OpUserID) {
|
if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsMangerUserID(req.OpUserID) {
|
||||||
log.Error(req.OperationID, "verify failed ", req.OpUserID, req.GroupID)
|
log.Error(req.OperationID, "verify failed ", req.GroupID, req.UserID)
|
||||||
return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil
|
return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil
|
||||||
}
|
}
|
||||||
groupMemberInfo := db.GroupMember{GroupID: req.GroupID, UserID: req.UserID}
|
groupMemberInfo := db.GroupMember{GroupID: req.GroupID, UserID: req.UserID}
|
||||||
groupMemberInfo.MuteEndTime = time.Unix(int64(time.Now().Second())+int64(req.MutedSeconds), 0)
|
|
||||||
|
groupMemberInfo.MuteEndTime = time.Unix(int64(time.Now().Second())+int64(req.MutedSeconds), time.Now().UnixNano())
|
||||||
err := imdb.UpdateGroupMemberInfo(groupMemberInfo)
|
err := imdb.UpdateGroupMemberInfo(groupMemberInfo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(req.OperationID, "UpdateGroupMemberInfo failed ", err.Error(), groupMemberInfo)
|
log.Error(req.OperationID, "UpdateGroupMemberInfo failed ", err.Error(), groupMemberInfo)
|
||||||
return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
||||||
}
|
}
|
||||||
|
chat.GroupMemberMutedNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID, req.MutedSeconds)
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""})
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""})
|
||||||
return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil
|
return &pbGroup.MuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *groupServer) CancelMuteGroupMember(ctx context.Context, req *pbGroup.CancelMuteGroupMemberReq) (*pbGroup.CancelMuteGroupMemberResp, error) {
|
func (s *groupServer) CancelMuteGroupMember(ctx context.Context, req *pbGroup.CancelMuteGroupMemberReq) (*pbGroup.CancelMuteGroupMemberResp, error) {
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String())
|
||||||
if !imdb.IsGroupOwnerAdmin(req.GroupID, req.UserID) && !token_verify.IsMangerUserID(req.OpUserID) {
|
if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsMangerUserID(req.OpUserID) {
|
||||||
log.Error(req.OperationID, "verify failed ", req.OpUserID, req.GroupID)
|
log.Error(req.OperationID, "verify failed ", req.OpUserID, req.GroupID)
|
||||||
return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil
|
return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil
|
||||||
}
|
}
|
||||||
@ -997,14 +1002,40 @@ func (s *groupServer) CancelMuteGroupMember(ctx context.Context, req *pbGroup.Ca
|
|||||||
log.Error(req.OperationID, "UpdateGroupMemberInfo failed ", err.Error(), groupMemberInfo)
|
log.Error(req.OperationID, "UpdateGroupMemberInfo failed ", err.Error(), groupMemberInfo)
|
||||||
return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
||||||
}
|
}
|
||||||
|
chat.GroupMemberCancelMutedNotification(req.OperationID, req.OpUserID, req.GroupID, req.UserID)
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""})
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""})
|
||||||
return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil
|
return &pbGroup.CancelMuteGroupMemberResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *groupServer) MuteGroup(ctx context.Context, req *pbGroup.MuteGroupReq) (*pbGroup.MuteGroupResp, error) {
|
func (s *groupServer) MuteGroup(ctx context.Context, req *pbGroup.MuteGroupReq) (*pbGroup.MuteGroupResp, error) {
|
||||||
return nil, nil
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String())
|
||||||
|
if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsMangerUserID(req.OpUserID) {
|
||||||
|
log.Error(req.OperationID, "verify failed ", req.GroupID, req.GroupID)
|
||||||
|
return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil
|
||||||
|
}
|
||||||
|
err := imdb.OperateGroupStatus(req.GroupID, constant.GroupStatusMuted)
|
||||||
|
if err != nil {
|
||||||
|
log.Error(req.OperationID, "OperateGroupStatus failed ", err.Error(), req.GroupID, constant.GroupStatusMuted)
|
||||||
|
return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
||||||
|
}
|
||||||
|
chat.GroupMutedNotification(req.OperationID, req.OpUserID, req.GroupID)
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""})
|
||||||
|
return &pbGroup.MuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *groupServer) CancelMuteGroup(ctx context.Context, req *pbGroup.CancelMuteGroupReq) (*pbGroup.CancelMuteGroupResp, error) {
|
func (s *groupServer) CancelMuteGroup(ctx context.Context, req *pbGroup.CancelMuteGroupReq) (*pbGroup.CancelMuteGroupResp, error) {
|
||||||
return nil, nil
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc args ", req.String())
|
||||||
|
if !imdb.IsGroupOwnerAdmin(req.GroupID, req.OpUserID) && !token_verify.IsMangerUserID(req.OpUserID) {
|
||||||
|
log.Error(req.OperationID, "verify failed ", req.OpUserID, req.GroupID)
|
||||||
|
return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrAccess.ErrCode, ErrMsg: constant.ErrAccess.ErrMsg}}, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
err := imdb.UpdateGroupInfoDefaultZero(req.GroupID, map[string]interface{}{"status": constant.GroupOk})
|
||||||
|
if err != nil {
|
||||||
|
log.Error(req.OperationID, "UpdateGroupInfoDefaultZero failed ", err.Error(), req.GroupID)
|
||||||
|
return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}}, nil
|
||||||
|
}
|
||||||
|
chat.GroupCancelMutedNotification(req.OperationID, req.OpUserID, req.GroupID)
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return ", pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""})
|
||||||
|
return &pbGroup.CancelMuteGroupResp{CommonResp: &pbGroup.CommonResp{ErrCode: 0, ErrMsg: ""}}, nil
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,7 @@ type messageCMSServer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewMessageCMSServer(port int) *messageCMSServer {
|
func NewMessageCMSServer(port int) *messageCMSServer {
|
||||||
log.NewPrivateLog("MessageCMS")
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
return &messageCMSServer{
|
return &messageCMSServer{
|
||||||
rpcPort: port,
|
rpcPort: port,
|
||||||
rpcRegisterName: config.Config.RpcRegisterName.OpenImMessageCMSName,
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImMessageCMSName,
|
||||||
@ -84,8 +84,8 @@ func (s *messageCMSServer) GetChatLogs(_ context.Context, req *pbMessageCMS.GetC
|
|||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "time string parse error", err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "time string parse error", err.Error())
|
||||||
}
|
}
|
||||||
chatLog := db.ChatLog{
|
chatLog := db.ChatLog{
|
||||||
Content: req.Content,
|
Content: req.Content,
|
||||||
SendTime: time,
|
SendTime: time,
|
||||||
ContentType: req.ContentType,
|
ContentType: req.ContentType,
|
||||||
SessionType: req.SessionType,
|
SessionType: req.SessionType,
|
||||||
}
|
}
|
||||||
@ -101,20 +101,20 @@ func (s *messageCMSServer) GetChatLogs(_ context.Context, req *pbMessageCMS.GetC
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetChatLogCount", err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetChatLogCount", err.Error())
|
||||||
}
|
}
|
||||||
chatLogs, err := imdb.GetChatLog(chatLog, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
chatLogs, err := imdb.GetChatLog(chatLog, req.Pagination.PageNumber, req.Pagination.ShowNumber)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetChatLog", err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetChatLog", err.Error())
|
||||||
return resp, errors.WrapError(constant.ErrDB)
|
return resp, errors.WrapError(constant.ErrDB)
|
||||||
}
|
}
|
||||||
for _, chatLog := range chatLogs {
|
for _, chatLog := range chatLogs {
|
||||||
pbChatLog := &pbMessageCMS.ChatLogs{
|
pbChatLog := &pbMessageCMS.ChatLogs{
|
||||||
SessionType: chatLog.SessionType,
|
SessionType: chatLog.SessionType,
|
||||||
ContentType: chatLog.ContentType,
|
ContentType: chatLog.ContentType,
|
||||||
SearchContent: req.Content,
|
SearchContent: req.Content,
|
||||||
WholeContent: chatLog.Content,
|
WholeContent: chatLog.Content,
|
||||||
Date: chatLog.CreateTime.String(),
|
Date: chatLog.CreateTime.String(),
|
||||||
SenderNickName: chatLog.SenderNickname,
|
SenderNickName: chatLog.SenderNickname,
|
||||||
SenderId: chatLog.SendID,
|
SenderId: chatLog.SendID,
|
||||||
}
|
}
|
||||||
if chatLog.SenderNickname == "" {
|
if chatLog.SenderNickname == "" {
|
||||||
sendUser, err := imdb.GetUserByUserID(chatLog.SendID)
|
sendUser, err := imdb.GetUserByUserID(chatLog.SendID)
|
||||||
|
@ -10,12 +10,12 @@ import (
|
|||||||
"github.com/golang/protobuf/proto"
|
"github.com/golang/protobuf/proto"
|
||||||
)
|
)
|
||||||
|
|
||||||
func conversationNotification(contentType int32, m proto.Message, operationID, userID string) {
|
func SetConversationNotification(operationID, sendID, recvID string, contentType int, m proto.Message, tips open_im_sdk.TipsComm) {
|
||||||
|
log.NewInfo(operationID, "args: ", sendID, recvID, contentType, m.String(), tips.String())
|
||||||
var err error
|
var err error
|
||||||
var tips open_im_sdk.TipsComm
|
|
||||||
tips.Detail, err = proto.Marshal(m)
|
tips.Detail, err = proto.Marshal(m)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(operationID, utils.GetSelfFuncName(), "Marshal failed ", err.Error(), m.String())
|
log.NewError(operationID, "Marshal failed ", err.Error(), m.String())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
marshaler := jsonpb.Marshaler{
|
marshaler := jsonpb.Marshaler{
|
||||||
@ -24,15 +24,10 @@ func conversationNotification(contentType int32, m proto.Message, operationID, u
|
|||||||
EmitDefaults: false,
|
EmitDefaults: false,
|
||||||
}
|
}
|
||||||
tips.JsonDetail, _ = marshaler.MarshalToString(m)
|
tips.JsonDetail, _ = marshaler.MarshalToString(m)
|
||||||
cn := config.Config.Notification
|
|
||||||
switch contentType {
|
|
||||||
case constant.ConversationOptChangeNotification:
|
|
||||||
tips.DefaultTips = cn.ConversationOptUpdate.DefaultTips.Tips
|
|
||||||
}
|
|
||||||
var n NotificationMsg
|
var n NotificationMsg
|
||||||
n.SendID = userID
|
n.SendID = sendID
|
||||||
n.RecvID = userID
|
n.RecvID = recvID
|
||||||
n.ContentType = contentType
|
n.ContentType = int32(contentType)
|
||||||
n.SessionType = constant.SingleChatType
|
n.SessionType = constant.SingleChatType
|
||||||
n.MsgFrom = constant.SysMsgType
|
n.MsgFrom = constant.SysMsgType
|
||||||
n.OperationID = operationID
|
n.OperationID = operationID
|
||||||
@ -44,10 +39,38 @@ func conversationNotification(contentType int32, m proto.Message, operationID, u
|
|||||||
Notification(&n)
|
Notification(&n)
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetConversationNotification(operationID, userID string) {
|
// SetPrivate调用
|
||||||
log.NewInfo(operationID, utils.GetSelfFuncName(), "userID: ", userID)
|
func ConversationSetPrivateNotification(operationID, sendID, recvID string, isPrivateChat bool) {
|
||||||
conversationUpdateTips := open_im_sdk.ConversationUpdateTips{
|
log.NewInfo(operationID, utils.GetSelfFuncName())
|
||||||
|
conversationSetPrivateTips := &open_im_sdk.ConversationSetPrivateTips{
|
||||||
|
RecvID: recvID,
|
||||||
|
SendID: sendID,
|
||||||
|
IsPrivate: isPrivateChat,
|
||||||
|
}
|
||||||
|
var tips open_im_sdk.TipsComm
|
||||||
|
var tipsMsg string
|
||||||
|
//var senderName string
|
||||||
|
//senderName, err := im_mysql_model.GetUserNameByUserID(sendID)
|
||||||
|
//if err != nil {
|
||||||
|
// log.NewError(operationID, utils.GetSelfFuncName(), err.Error())
|
||||||
|
// senderName = sendID
|
||||||
|
//}
|
||||||
|
if isPrivateChat == true {
|
||||||
|
tipsMsg = config.Config.Notification.ConversationSetPrivate.DefaultTips.OpenTips
|
||||||
|
} else {
|
||||||
|
tipsMsg = config.Config.Notification.ConversationSetPrivate.DefaultTips.CloseTips
|
||||||
|
}
|
||||||
|
tips.DefaultTips = tipsMsg
|
||||||
|
SetConversationNotification(operationID, sendID, recvID, constant.ConversationPrivateChatNotification, conversationSetPrivateTips, tips)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 会话改变
|
||||||
|
func ConversationChangeNotification(operationID, userID string) {
|
||||||
|
log.NewInfo(operationID, utils.GetSelfFuncName())
|
||||||
|
ConversationChangedTips := &open_im_sdk.ConversationUpdateTips{
|
||||||
UserID: userID,
|
UserID: userID,
|
||||||
}
|
}
|
||||||
conversationNotification(constant.ConversationOptChangeNotification, &conversationUpdateTips, operationID, userID)
|
var tips open_im_sdk.TipsComm
|
||||||
|
tips.DefaultTips = config.Config.Notification.ConversationOptUpdate.DefaultTips.Tips
|
||||||
|
SetConversationNotification(operationID, userID, userID, constant.ConversationOptChangeNotification, ConversationChangedTips, tips)
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ func (rpc *rpcChat) DelMsgList(_ context.Context, req *commonPb.DelMsgListReq) (
|
|||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsg failed", err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "DelMsg failed", err.Error())
|
||||||
resp.ErrMsg = constant.ErrDB.ErrMsg
|
resp.ErrMsg = constant.ErrDB.ErrMsg
|
||||||
resp.ErrCode = constant.ErrDB.ErrCode
|
resp.ErrCode = constant.ErrDB.ErrCode
|
||||||
return resp, err
|
return resp, nil
|
||||||
}
|
}
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||||
return resp, nil
|
return resp, nil
|
||||||
|
@ -160,6 +160,14 @@ func groupNotification(contentType int32, m proto.Message, sendID, groupID, recv
|
|||||||
tips.DefaultTips = toNickname + " " + cn.MemberEnter.DefaultTips.Tips
|
tips.DefaultTips = toNickname + " " + cn.MemberEnter.DefaultTips.Tips
|
||||||
case constant.GroupDismissedNotification:
|
case constant.GroupDismissedNotification:
|
||||||
tips.DefaultTips = toNickname + "" + cn.GroupDismissed.DefaultTips.Tips
|
tips.DefaultTips = toNickname + "" + cn.GroupDismissed.DefaultTips.Tips
|
||||||
|
case constant.GroupMutedNotification:
|
||||||
|
tips.DefaultTips = toNickname + "" + cn.GroupMuted.DefaultTips.Tips
|
||||||
|
case constant.GroupCancelMutedNotification:
|
||||||
|
tips.DefaultTips = toNickname + "" + cn.GroupCancelMuted.DefaultTips.Tips
|
||||||
|
case constant.GroupMemberMutedNotification:
|
||||||
|
tips.DefaultTips = toNickname + "" + cn.GroupMemberMuted.DefaultTips.Tips
|
||||||
|
case constant.GroupMemberCancelMutedNotification:
|
||||||
|
tips.DefaultTips = toNickname + "" + cn.GroupMemberCancelMuted.DefaultTips.Tips
|
||||||
default:
|
default:
|
||||||
log.Error(operationID, "contentType failed ", contentType)
|
log.Error(operationID, "contentType failed ", contentType)
|
||||||
return
|
return
|
||||||
@ -227,6 +235,71 @@ func GroupInfoSetNotification(operationID, opUserID, groupID string) {
|
|||||||
groupNotification(constant.GroupInfoSetNotification, &GroupInfoChangedTips, opUserID, groupID, "", operationID)
|
groupNotification(constant.GroupInfoSetNotification, &GroupInfoChangedTips, opUserID, groupID, "", operationID)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GroupMutedNotification(operationID, opUserID, groupID string) {
|
||||||
|
tips := open_im_sdk.GroupMutedTips{Group: &open_im_sdk.GroupInfo{},
|
||||||
|
OpUser: &open_im_sdk.GroupMemberFullInfo{}}
|
||||||
|
if err := setGroupInfo(groupID, tips.Group); err != nil {
|
||||||
|
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil {
|
||||||
|
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
groupNotification(constant.GroupMutedNotification, &tips, opUserID, groupID, "", operationID)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GroupCancelMutedNotification(operationID, opUserID, groupID string) {
|
||||||
|
tips := open_im_sdk.GroupCancelMutedTips{Group: &open_im_sdk.GroupInfo{},
|
||||||
|
OpUser: &open_im_sdk.GroupMemberFullInfo{}}
|
||||||
|
if err := setGroupInfo(groupID, tips.Group); err != nil {
|
||||||
|
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil {
|
||||||
|
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
groupNotification(constant.GroupCancelMutedNotification, &tips, opUserID, groupID, "", operationID)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GroupMemberMutedNotification(operationID, opUserID, groupID, groupMemberUserID string, mutedSeconds uint32) {
|
||||||
|
tips := open_im_sdk.GroupMemberMutedTips{Group: &open_im_sdk.GroupInfo{},
|
||||||
|
OpUser: &open_im_sdk.GroupMemberFullInfo{}, MutedUser: &open_im_sdk.GroupMemberFullInfo{}}
|
||||||
|
tips.MutedSeconds = mutedSeconds
|
||||||
|
if err := setGroupInfo(groupID, tips.Group); err != nil {
|
||||||
|
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil {
|
||||||
|
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := setGroupMemberInfo(groupID, groupMemberUserID, tips.MutedUser); err != nil {
|
||||||
|
log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
groupNotification(constant.GroupMemberMutedNotification, &tips, opUserID, groupID, "", operationID)
|
||||||
|
}
|
||||||
|
|
||||||
|
func GroupMemberCancelMutedNotification(operationID, opUserID, groupID, groupMemberUserID string) {
|
||||||
|
tips := open_im_sdk.GroupMemberCancelMutedTips{Group: &open_im_sdk.GroupInfo{},
|
||||||
|
OpUser: &open_im_sdk.GroupMemberFullInfo{}, MutedUser: &open_im_sdk.GroupMemberFullInfo{}}
|
||||||
|
if err := setGroupInfo(groupID, tips.Group); err != nil {
|
||||||
|
log.Error(operationID, "setGroupInfo failed ", err.Error(), groupID)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := setOpUserInfo(opUserID, groupID, tips.OpUser); err != nil {
|
||||||
|
log.Error(operationID, "setOpUserInfo failed ", err.Error(), opUserID, groupID)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if err := setGroupMemberInfo(groupID, groupMemberUserID, tips.MutedUser); err != nil {
|
||||||
|
log.Error(operationID, "setGroupMemberInfo failed ", err.Error(), groupID, groupMemberUserID)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
groupNotification(constant.GroupMemberCancelMutedNotification, &tips, opUserID, groupID, "", operationID)
|
||||||
|
}
|
||||||
|
|
||||||
//message ReceiveJoinApplicationTips{
|
//message ReceiveJoinApplicationTips{
|
||||||
// GroupInfo Group = 1;
|
// GroupInfo Group = 1;
|
||||||
// PublicUserInfo Applicant = 2;
|
// PublicUserInfo Applicant = 2;
|
||||||
|
@ -2,6 +2,7 @@ package msg
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"Open_IM/pkg/common/config"
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/kafka"
|
"Open_IM/pkg/common/kafka"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
"Open_IM/pkg/grpc-etcdv3/getcdv3"
|
"Open_IM/pkg/grpc-etcdv3/getcdv3"
|
||||||
@ -22,7 +23,7 @@ type rpcChat struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewRpcChatServer(port int) *rpcChat {
|
func NewRpcChatServer(port int) *rpcChat {
|
||||||
log.NewPrivateLog("msg")
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
rc := rpcChat{
|
rc := rpcChat{
|
||||||
rpcPort: port,
|
rpcPort: port,
|
||||||
rpcRegisterName: config.Config.RpcRegisterName.OpenImOfflineMessageName,
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImOfflineMessageName,
|
||||||
|
@ -281,6 +281,23 @@ func (rpc *rpcChat) SendMsg(_ context.Context, pb *pbChat.SendMsgReq) (*pbChat.S
|
|||||||
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendGroupMsg failed", err.Error())
|
log.NewError(pb.OperationID, utils.GetSelfFuncName(), "callbackAfterSendGroupMsg failed", err.Error())
|
||||||
}
|
}
|
||||||
return returnMsg(&replay, pb, 0, "", msgToMQ.MsgData.ServerMsgID, msgToMQ.MsgData.SendTime)
|
return returnMsg(&replay, pb, 0, "", msgToMQ.MsgData.ServerMsgID, msgToMQ.MsgData.SendTime)
|
||||||
|
case constant.NotificationChatType:
|
||||||
|
msgToMQ.MsgData = pb.MsgData
|
||||||
|
log.NewInfo(msgToMQ.OperationID, msgToMQ)
|
||||||
|
err1 := rpc.sendMsgToKafka(&msgToMQ, msgToMQ.MsgData.RecvID)
|
||||||
|
if err1 != nil {
|
||||||
|
log.NewError(msgToMQ.OperationID, "kafka send msg err:RecvID", msgToMQ.MsgData.RecvID, msgToMQ.String())
|
||||||
|
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||||
|
}
|
||||||
|
|
||||||
|
if msgToMQ.MsgData.SendID != msgToMQ.MsgData.RecvID { //Filter messages sent to yourself
|
||||||
|
err2 := rpc.sendMsgToKafka(&msgToMQ, msgToMQ.MsgData.SendID)
|
||||||
|
if err2 != nil {
|
||||||
|
log.NewError(msgToMQ.OperationID, "kafka send msg err:SendID", msgToMQ.MsgData.SendID, msgToMQ.String())
|
||||||
|
return returnMsg(&replay, pb, 201, "kafka send msg err", "", 0)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnMsg(&replay, pb, 0, "", msgToMQ.MsgData.ServerMsgID, msgToMQ.MsgData.SendTime)
|
||||||
default:
|
default:
|
||||||
return returnMsg(&replay, pb, 203, "unkonwn sessionType", "", 0)
|
return returnMsg(&replay, pb, 203, "unkonwn sessionType", "", 0)
|
||||||
}
|
}
|
||||||
@ -513,6 +530,38 @@ func Notification(n *NotificationMsg) {
|
|||||||
ex = config.Config.Notification.GroupDismissed.OfflinePush.Ext
|
ex = config.Config.Notification.GroupDismissed.OfflinePush.Ext
|
||||||
reliabilityLevel = config.Config.Notification.GroupDismissed.Conversation.ReliabilityLevel
|
reliabilityLevel = config.Config.Notification.GroupDismissed.Conversation.ReliabilityLevel
|
||||||
unReadCount = config.Config.Notification.GroupDismissed.Conversation.UnreadCount
|
unReadCount = config.Config.Notification.GroupDismissed.Conversation.UnreadCount
|
||||||
|
|
||||||
|
case constant.GroupMutedNotification:
|
||||||
|
pushSwitch = config.Config.Notification.GroupMuted.OfflinePush.PushSwitch
|
||||||
|
title = config.Config.Notification.GroupMuted.OfflinePush.Title
|
||||||
|
desc = config.Config.Notification.GroupMuted.OfflinePush.Desc
|
||||||
|
ex = config.Config.Notification.GroupMuted.OfflinePush.Ext
|
||||||
|
reliabilityLevel = config.Config.Notification.GroupMuted.Conversation.ReliabilityLevel
|
||||||
|
unReadCount = config.Config.Notification.GroupMuted.Conversation.UnreadCount
|
||||||
|
|
||||||
|
case constant.GroupCancelMutedNotification:
|
||||||
|
pushSwitch = config.Config.Notification.GroupCancelMuted.OfflinePush.PushSwitch
|
||||||
|
title = config.Config.Notification.GroupCancelMuted.OfflinePush.Title
|
||||||
|
desc = config.Config.Notification.GroupCancelMuted.OfflinePush.Desc
|
||||||
|
ex = config.Config.Notification.GroupCancelMuted.OfflinePush.Ext
|
||||||
|
reliabilityLevel = config.Config.Notification.GroupCancelMuted.Conversation.ReliabilityLevel
|
||||||
|
unReadCount = config.Config.Notification.GroupCancelMuted.Conversation.UnreadCount
|
||||||
|
|
||||||
|
case constant.GroupMemberMutedNotification:
|
||||||
|
pushSwitch = config.Config.Notification.GroupMemberMuted.OfflinePush.PushSwitch
|
||||||
|
title = config.Config.Notification.GroupMemberMuted.OfflinePush.Title
|
||||||
|
desc = config.Config.Notification.GroupMemberMuted.OfflinePush.Desc
|
||||||
|
ex = config.Config.Notification.GroupMemberMuted.OfflinePush.Ext
|
||||||
|
reliabilityLevel = config.Config.Notification.GroupMemberMuted.Conversation.ReliabilityLevel
|
||||||
|
unReadCount = config.Config.Notification.GroupMemberMuted.Conversation.UnreadCount
|
||||||
|
|
||||||
|
case constant.GroupMemberCancelMutedNotification:
|
||||||
|
pushSwitch = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.PushSwitch
|
||||||
|
title = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.Title
|
||||||
|
desc = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.Desc
|
||||||
|
ex = config.Config.Notification.GroupMemberCancelMuted.OfflinePush.Ext
|
||||||
|
reliabilityLevel = config.Config.Notification.GroupMemberCancelMuted.Conversation.ReliabilityLevel
|
||||||
|
unReadCount = config.Config.Notification.GroupMemberCancelMuted.Conversation.UnreadCount
|
||||||
}
|
}
|
||||||
switch reliabilityLevel {
|
switch reliabilityLevel {
|
||||||
case constant.UnreliableNotification:
|
case constant.UnreliableNotification:
|
||||||
@ -539,6 +588,6 @@ func Notification(n *NotificationMsg) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), err.Error())
|
log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), err.Error())
|
||||||
} else if reply.ErrCode != 0 {
|
} else if reply.ErrCode != 0 {
|
||||||
log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String())
|
log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), reply.ErrCode, reply.ErrMsg)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,20 +10,24 @@ import (
|
|||||||
"Open_IM/pkg/utils"
|
"Open_IM/pkg/utils"
|
||||||
"context"
|
"context"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TagSendMessage(operationID, sendID, recvID, content string, contentType int32) {
|
func TagSendMessage(operationID, sendID, recvID, content string, senderPlatformID int32) {
|
||||||
log.NewInfo(operationID, utils.GetSelfFuncName(), "args: ", sendID, recvID, content, contentType)
|
log.NewInfo(operationID, utils.GetSelfFuncName(), "args: ", sendID, recvID, content)
|
||||||
var req pbChat.SendMsgReq
|
var req pbChat.SendMsgReq
|
||||||
var msgData pbCommon.MsgData
|
var msgData pbCommon.MsgData
|
||||||
msgData.SendID = sendID
|
msgData.SendID = sendID
|
||||||
msgData.RecvID = recvID
|
msgData.RecvID = recvID
|
||||||
msgData.ContentType = contentType
|
msgData.ContentType = constant.Custom
|
||||||
msgData.SessionType = constant.SingleChatType
|
msgData.SessionType = constant.SingleChatType
|
||||||
msgData.MsgFrom = constant.UserMsgType
|
msgData.MsgFrom = constant.UserMsgType
|
||||||
msgData.Content = []byte(content)
|
msgData.Content = []byte(content)
|
||||||
msgData.Options = map[string]bool{}
|
msgData.Options = map[string]bool{}
|
||||||
msgData.Options[constant.IsSenderConversationUpdate] = false
|
msgData.Options[constant.IsSenderConversationUpdate] = false
|
||||||
|
msgData.SendTime = time.Now().Unix()
|
||||||
|
msgData.CreateTime = time.Now().Unix()
|
||||||
|
msgData.SenderPlatformID = senderPlatformID
|
||||||
req.MsgData = &msgData
|
req.MsgData = &msgData
|
||||||
req.OperationID = operationID
|
req.OperationID = operationID
|
||||||
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
|
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImOfflineMessageName)
|
||||||
|
@ -16,6 +16,7 @@ import (
|
|||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type officeServer struct {
|
type officeServer struct {
|
||||||
@ -26,7 +27,7 @@ type officeServer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewOfficeServer(port int) *officeServer {
|
func NewOfficeServer(port int) *officeServer {
|
||||||
log.NewPrivateLog("office")
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
return &officeServer{
|
return &officeServer{
|
||||||
rpcPort: port,
|
rpcPort: port,
|
||||||
rpcRegisterName: config.Config.RpcRegisterName.OpenImOfficeName,
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImOfficeName,
|
||||||
@ -103,7 +104,7 @@ func (s *officeServer) GetUserTags(_ context.Context, req *pbOffice.GetUserTagsR
|
|||||||
|
|
||||||
func (s *officeServer) CreateTag(_ context.Context, req *pbOffice.CreateTagReq) (resp *pbOffice.CreateTagResp, err error) {
|
func (s *officeServer) CreateTag(_ context.Context, req *pbOffice.CreateTagReq) (resp *pbOffice.CreateTagResp, err error) {
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "CreateTag req", req.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "CreateTag req", req.String())
|
||||||
userIDList := utils.RemoveUserIDRepByMap(req.UserIDList)
|
userIDList := utils.RemoveRepeatedStringInList(req.UserIDList)
|
||||||
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "userIDList: ", userIDList)
|
log.NewDebug(req.OperationID, utils.GetSelfFuncName(), "userIDList: ", userIDList)
|
||||||
resp = &pbOffice.CreateTagResp{CommonResp: &pbOffice.CommonResp{}}
|
resp = &pbOffice.CreateTagResp{CommonResp: &pbOffice.CommonResp{}}
|
||||||
if err := db.DB.CreateTag(req.UserID, req.TagName, userIDList); err != nil {
|
if err := db.DB.CreateTag(req.UserID, req.TagName, userIDList); err != nil {
|
||||||
@ -132,8 +133,8 @@ func (s *officeServer) DeleteTag(_ context.Context, req *pbOffice.DeleteTagReq)
|
|||||||
func (s *officeServer) SetTag(_ context.Context, req *pbOffice.SetTagReq) (resp *pbOffice.SetTagResp, err error) {
|
func (s *officeServer) SetTag(_ context.Context, req *pbOffice.SetTagReq) (resp *pbOffice.SetTagResp, err error) {
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||||
resp = &pbOffice.SetTagResp{CommonResp: &pbOffice.CommonResp{}}
|
resp = &pbOffice.SetTagResp{CommonResp: &pbOffice.CommonResp{}}
|
||||||
IncreaseUserIDList := utils.RemoveUserIDRepByMap(req.IncreaseUserIDList)
|
IncreaseUserIDList := utils.RemoveRepeatedStringInList(req.IncreaseUserIDList)
|
||||||
reduceUserIDList := utils.RemoveUserIDRepByMap(req.ReduceUserIDList)
|
reduceUserIDList := utils.RemoveRepeatedStringInList(req.ReduceUserIDList)
|
||||||
if err := db.DB.SetTag(req.UserID, req.TagID, req.NewName, IncreaseUserIDList, reduceUserIDList); err != nil {
|
if err := db.DB.SetTag(req.UserID, req.TagID, req.NewName, IncreaseUserIDList, reduceUserIDList); err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetTag failed", err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetTag failed", err.Error())
|
||||||
resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg
|
resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg
|
||||||
@ -147,11 +148,57 @@ func (s *officeServer) SetTag(_ context.Context, req *pbOffice.SetTagReq) (resp
|
|||||||
func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagReq) (resp *pbOffice.SendMsg2TagResp, err error) {
|
func (s *officeServer) SendMsg2Tag(_ context.Context, req *pbOffice.SendMsg2TagReq) (resp *pbOffice.SendMsg2TagResp, err error) {
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||||
resp = &pbOffice.SendMsg2TagResp{CommonResp: &pbOffice.CommonResp{}}
|
resp = &pbOffice.SendMsg2TagResp{CommonResp: &pbOffice.CommonResp{}}
|
||||||
userIDList, err := db.DB.GetUserIDListByTagID(req.SendID, req.TagID)
|
var tagUserIDList []string
|
||||||
for _, userID := range userIDList {
|
for _, tagID := range req.TagList {
|
||||||
msg.TagSendMessage(req.OperationID, req.SendID, userID, req.Content, req.ContentType)
|
userIDList, err := db.DB.GetUserIDListByTagID(req.SendID, tagID)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserIDListByTagID failed", err.Error())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
tagUserIDList = append(tagUserIDList, userIDList...)
|
||||||
}
|
}
|
||||||
if err := db.DB.SaveTagSendLog(req); err != nil {
|
var groupUserIDList []string
|
||||||
|
for _, groupID := range req.GroupList {
|
||||||
|
userIDList, err := im_mysql_model.GetGroupMemberIDListByGroupID(groupID)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetGroupMemberIDListByGroupID failed", err.Error())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), userIDList)
|
||||||
|
groupUserIDList = append(groupUserIDList, userIDList...)
|
||||||
|
}
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), groupUserIDList, req.GroupList)
|
||||||
|
var userIDList []string
|
||||||
|
userIDList = append(userIDList, tagUserIDList...)
|
||||||
|
userIDList = append(userIDList, groupUserIDList...)
|
||||||
|
userIDList = append(userIDList, req.UserList...)
|
||||||
|
userIDList = utils.RemoveRepeatedStringInList(userIDList)
|
||||||
|
for i, userID := range userIDList {
|
||||||
|
if userID == req.SendID || userID == "" {
|
||||||
|
userIDList = append(userIDList[:i], userIDList[i+1:]...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "total userIDList result: ", userIDList)
|
||||||
|
for _, userID := range userIDList {
|
||||||
|
msg.TagSendMessage(req.OperationID, req.SendID, userID, req.Content, req.SenderPlatformID)
|
||||||
|
}
|
||||||
|
var tagSendLogs db.TagSendLog
|
||||||
|
for _, userID := range userIDList {
|
||||||
|
userName, err := im_mysql_model.GetUserNameByUserID(userID)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID failed", err.Error())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
tagSendLogs.UserList = append(tagSendLogs.UserList, db.TagUser{
|
||||||
|
UserID: userID,
|
||||||
|
UserName: userName,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
tagSendLogs.SendID = req.SendID
|
||||||
|
tagSendLogs.Content = req.Content
|
||||||
|
tagSendLogs.SenderPlatformID = req.SenderPlatformID
|
||||||
|
tagSendLogs.SendTime = time.Now().Unix()
|
||||||
|
if err := db.DB.SaveTagSendLog(&tagSendLogs); err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SaveTagSendLog failed", err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SaveTagSendLog failed", err.Error())
|
||||||
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
|
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
|
||||||
resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg
|
resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg
|
||||||
@ -184,3 +231,33 @@ func (s *officeServer) GetTagSendLogs(_ context.Context, req *pbOffice.GetTagSen
|
|||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *officeServer) GetUserTagByID(_ context.Context, req *pbOffice.GetUserTagByIDReq) (resp *pbOffice.GetUserTagByIDResp, err error) {
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||||
|
resp = &pbOffice.GetUserTagByIDResp{
|
||||||
|
CommonResp: &pbOffice.CommonResp{},
|
||||||
|
Tag: &pbOffice.Tag{},
|
||||||
|
}
|
||||||
|
tag, err := db.DB.GetTagByID(req.UserID, req.TagID)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetTagByID failed", err.Error())
|
||||||
|
resp.CommonResp.ErrCode = constant.ErrDB.ErrCode
|
||||||
|
resp.CommonResp.ErrMsg = constant.ErrDB.ErrMsg
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
|
for _, userID := range tag.UserList {
|
||||||
|
userName, err := im_mysql_model.GetUserNameByUserID(userID)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetUserNameByUserID failed", err.Error())
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
resp.Tag.UserList = append(resp.Tag.UserList, &pbOffice.TagUser{
|
||||||
|
UserID: userID,
|
||||||
|
UserName: userName,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
resp.Tag.TagID = tag.TagID
|
||||||
|
resp.Tag.TagName = tag.TagName
|
||||||
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
|
@ -19,10 +19,10 @@ import (
|
|||||||
//open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
//open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
||||||
"Open_IM/pkg/utils"
|
"Open_IM/pkg/utils"
|
||||||
//"context"
|
//"context"
|
||||||
|
errors "Open_IM/pkg/common/http"
|
||||||
"net"
|
"net"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
errors "Open_IM/pkg/common/http"
|
|
||||||
|
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
)
|
)
|
||||||
@ -35,7 +35,7 @@ type statisticsServer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewStatisticsServer(port int) *statisticsServer {
|
func NewStatisticsServer(port int) *statisticsServer {
|
||||||
log.NewPrivateLog("Statistics")
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
return &statisticsServer{
|
return &statisticsServer{
|
||||||
rpcPort: port,
|
rpcPort: port,
|
||||||
rpcRegisterName: config.Config.RpcRegisterName.OpenImStatisticsName,
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImStatisticsName,
|
||||||
@ -164,7 +164,7 @@ func GetRangeDate(from, to time.Time) [][2]time.Time {
|
|||||||
}
|
}
|
||||||
// month
|
// month
|
||||||
case !isInOneMonth(from, to):
|
case !isInOneMonth(from, to):
|
||||||
if to.Sub(from) < time.Hour * 24 * 30 {
|
if to.Sub(from) < time.Hour*24*30 {
|
||||||
for i := 0; ; i++ {
|
for i := 0; ; i++ {
|
||||||
fromTime := from.Add(time.Hour * 24 * time.Duration(i))
|
fromTime := from.Add(time.Hour * 24 * time.Duration(i))
|
||||||
toTime := from.Add(time.Hour * 24 * time.Duration(i+1))
|
toTime := from.Add(time.Hour * 24 * time.Duration(i+1))
|
||||||
@ -251,7 +251,7 @@ func (s *statisticsServer) GetGroupStatistics(_ context.Context, req *pbStatisti
|
|||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "GetIncreaseGroupNum", v, err.Error())
|
||||||
}
|
}
|
||||||
resp.TotalGroupNumList[index] = &pbStatistics.DateNumList{
|
resp.TotalGroupNumList[index] = &pbStatistics.DateNumList{
|
||||||
Date: v[0].String(),
|
Date: v[0].String(),
|
||||||
Num: num,
|
Num: num,
|
||||||
}
|
}
|
||||||
}(wg, i, v)
|
}(wg, i, v)
|
||||||
|
@ -32,7 +32,7 @@ type userServer struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewUserServer(port int) *userServer {
|
func NewUserServer(port int) *userServer {
|
||||||
log.NewPrivateLog("user")
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
return &userServer{
|
return &userServer{
|
||||||
rpcPort: port,
|
rpcPort: port,
|
||||||
rpcRegisterName: config.Config.RpcRegisterName.OpenImUserName,
|
rpcRegisterName: config.Config.RpcRegisterName.OpenImUserName,
|
||||||
@ -72,6 +72,30 @@ func (s *userServer) Run() {
|
|||||||
log.NewInfo("0", "rpc user success")
|
log.NewInfo("0", "rpc user success")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func syncPeerUserConversation(conversation *pbUser.Conversation, operationID string) error {
|
||||||
|
peerUserConversation := db.Conversation{
|
||||||
|
OwnerUserID: conversation.UserID,
|
||||||
|
ConversationID: "single_" + conversation.OwnerUserID,
|
||||||
|
ConversationType: constant.SingleChatType,
|
||||||
|
UserID: conversation.OwnerUserID,
|
||||||
|
GroupID: "",
|
||||||
|
RecvMsgOpt: 0,
|
||||||
|
UnreadCount: 0,
|
||||||
|
DraftTextTime: 0,
|
||||||
|
IsPinned: false,
|
||||||
|
IsPrivateChat: conversation.IsPrivateChat,
|
||||||
|
AttachedInfo: "",
|
||||||
|
Ex: "",
|
||||||
|
}
|
||||||
|
err := imdb.PeerUserSetConversation(peerUserConversation)
|
||||||
|
if err != nil {
|
||||||
|
log.NewError(operationID, utils.GetSelfFuncName(), "SetConversation error", err.Error())
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
chat.ConversationSetPrivateNotification(operationID, conversation.OwnerUserID, conversation.UserID, conversation.IsPrivateChat)
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func (s *userServer) GetUserInfo(ctx context.Context, req *pbUser.GetUserInfoReq) (*pbUser.GetUserInfoResp, error) {
|
func (s *userServer) GetUserInfo(ctx context.Context, req *pbUser.GetUserInfoReq) (*pbUser.GetUserInfoResp, error) {
|
||||||
log.NewInfo(req.OperationID, "GetUserInfo args ", req.String())
|
log.NewInfo(req.OperationID, "GetUserInfo args ", req.String())
|
||||||
var userInfoList []*sdkws.UserInfo
|
var userInfoList []*sdkws.UserInfo
|
||||||
@ -96,6 +120,9 @@ func (s *userServer) GetUserInfo(ctx context.Context, req *pbUser.GetUserInfoReq
|
|||||||
|
|
||||||
func (s *userServer) BatchSetConversations(ctx context.Context, req *pbUser.BatchSetConversationsReq) (*pbUser.BatchSetConversationsResp, error) {
|
func (s *userServer) BatchSetConversations(ctx context.Context, req *pbUser.BatchSetConversationsReq) (*pbUser.BatchSetConversationsResp, error) {
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||||
|
if req.NotificationType == 0 {
|
||||||
|
req.NotificationType = constant.ConversationOptChangeNotification
|
||||||
|
}
|
||||||
resp := &pbUser.BatchSetConversationsResp{}
|
resp := &pbUser.BatchSetConversationsResp{}
|
||||||
for _, v := range req.Conversations {
|
for _, v := range req.Conversations {
|
||||||
conversation := db.Conversation{}
|
conversation := db.Conversation{}
|
||||||
@ -113,8 +140,14 @@ func (s *userServer) BatchSetConversations(ctx context.Context, req *pbUser.Batc
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
resp.Success = append(resp.Success, v.ConversationID)
|
resp.Success = append(resp.Success, v.ConversationID)
|
||||||
|
// if is set private chat operation,then peer user need to sync and set tips\
|
||||||
|
if v.ConversationType == constant.SingleChatType && req.NotificationType == constant.ConversationPrivateChatNotification {
|
||||||
|
if err := syncPeerUserConversation(v, req.OperationID); err != nil {
|
||||||
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "syncPeerUserConversation", err.Error())
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
chat.SetConversationNotification(req.OperationID, req.OwnerUserID)
|
chat.ConversationChangeNotification(req.OperationID, req.OwnerUserID)
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return", resp.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return", resp.String())
|
||||||
resp.CommonResp = &pbUser.CommonResp{}
|
resp.CommonResp = &pbUser.CommonResp{}
|
||||||
return resp, nil
|
return resp, nil
|
||||||
@ -173,6 +206,9 @@ func (s *userServer) GetConversations(ctx context.Context, req *pbUser.GetConver
|
|||||||
|
|
||||||
func (s *userServer) SetConversation(ctx context.Context, req *pbUser.SetConversationReq) (*pbUser.SetConversationResp, error) {
|
func (s *userServer) SetConversation(ctx context.Context, req *pbUser.SetConversationReq) (*pbUser.SetConversationResp, error) {
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "req: ", req.String())
|
||||||
|
if req.NotificationType == 0 {
|
||||||
|
req.NotificationType = constant.ConversationOptChangeNotification
|
||||||
|
}
|
||||||
resp := &pbUser.SetConversationResp{}
|
resp := &pbUser.SetConversationResp{}
|
||||||
var conversation db.Conversation
|
var conversation db.Conversation
|
||||||
if err := utils.CopyStructFields(&conversation, req.Conversation); err != nil {
|
if err := utils.CopyStructFields(&conversation, req.Conversation); err != nil {
|
||||||
@ -189,7 +225,17 @@ func (s *userServer) SetConversation(ctx context.Context, req *pbUser.SetConvers
|
|||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
chat.SetConversationNotification(req.OperationID, req.Conversation.OwnerUserID)
|
// notification
|
||||||
|
if req.Conversation.ConversationType == constant.SingleChatType && req.NotificationType == constant.ConversationPrivateChatNotification {
|
||||||
|
//sync peer user conversation if conversation is singleChatType
|
||||||
|
if err := syncPeerUserConversation(req.Conversation, req.OperationID); err != nil {
|
||||||
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "syncPeerUserConversation", err.Error())
|
||||||
|
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
||||||
|
return resp, nil
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
chat.ConversationChangeNotification(req.OperationID, req.Conversation.OwnerUserID)
|
||||||
|
}
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return", resp.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "rpc return", resp.String())
|
||||||
resp.CommonResp = &pbUser.CommonResp{}
|
resp.CommonResp = &pbUser.CommonResp{}
|
||||||
return resp, nil
|
return resp, nil
|
||||||
@ -207,13 +253,24 @@ func (s *userServer) SetRecvMsgOpt(ctx context.Context, req *pbUser.SetRecvMsgOp
|
|||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
stringList := strings.Split(req.ConversationID, "_")
|
||||||
|
if len(stringList) > 1 {
|
||||||
|
switch stringList[0] {
|
||||||
|
case "single_":
|
||||||
|
conversation.UserID = stringList[1]
|
||||||
|
conversation.ConversationType = constant.SingleChatType
|
||||||
|
case "group":
|
||||||
|
conversation.GroupID = stringList[1]
|
||||||
|
conversation.ConversationType = constant.GroupChatType
|
||||||
|
}
|
||||||
|
}
|
||||||
err := imdb.SetRecvMsgOpt(conversation)
|
err := imdb.SetRecvMsgOpt(conversation)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error())
|
log.NewError(req.OperationID, utils.GetSelfFuncName(), "SetConversation error", err.Error())
|
||||||
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
resp.CommonResp = &pbUser.CommonResp{ErrCode: constant.ErrDB.ErrCode, ErrMsg: constant.ErrDB.ErrMsg}
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
chat.SetConversationNotification(req.OperationID, req.OwnerUserID)
|
chat.ConversationChangeNotification(req.OperationID, req.OwnerUserID)
|
||||||
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
log.NewInfo(req.OperationID, utils.GetSelfFuncName(), "resp: ", resp.String())
|
||||||
resp.CommonResp = &pbUser.CommonResp{}
|
resp.CommonResp = &pbUser.CommonResp{}
|
||||||
return resp, nil
|
return resp, nil
|
||||||
|
@ -76,7 +76,7 @@ func Test_ParseToken(t *testing.T) {
|
|||||||
uid := "1"
|
uid := "1"
|
||||||
platform := int32(1)
|
platform := int32(1)
|
||||||
tokenString, _, _ := token_verify.CreateToken(uid, platform)
|
tokenString, _, _ := token_verify.CreateToken(uid, platform)
|
||||||
claims, err := token_verify.ParseToken(tokenString)
|
claims, err := token_verify.ParseToken(tokenString, "")
|
||||||
if err == nil {
|
if err == nil {
|
||||||
assert.Equal(t, claims.UID, uid)
|
assert.Equal(t, claims.UID, uid)
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,8 @@ type SetReceiveMessageOptResp struct {
|
|||||||
|
|
||||||
type Conversation struct {
|
type Conversation struct {
|
||||||
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
||||||
ConversationID string `json:"conversationID"`
|
ConversationID string `json:"conversationID" binding:"required"`
|
||||||
ConversationType int32 `json:"conversationType"`
|
ConversationType int32 `json:"conversationType" binding:"required"`
|
||||||
UserID string `json:"userID"`
|
UserID string `json:"userID"`
|
||||||
GroupID string `json:"groupID"`
|
GroupID string `json:"groupID"`
|
||||||
RecvMsgOpt int32 `json:"recvMsgOpt" binding:"omitempty,oneof=0 1 2"`
|
RecvMsgOpt int32 `json:"recvMsgOpt" binding:"omitempty,oneof=0 1 2"`
|
||||||
@ -49,7 +49,8 @@ type Conversation struct {
|
|||||||
|
|
||||||
type SetConversationReq struct {
|
type SetConversationReq struct {
|
||||||
Conversation
|
Conversation
|
||||||
OperationID string `json:"operationID" binding:"required"`
|
NotificationType int32 `json:"notificationType"`
|
||||||
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SetConversationResp struct {
|
type SetConversationResp struct {
|
||||||
@ -57,9 +58,10 @@ type SetConversationResp struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type BatchSetConversationsReq struct {
|
type BatchSetConversationsReq struct {
|
||||||
Conversations []Conversation `json:"conversations" binding:"required"`
|
Conversations []Conversation `json:"conversations" binding:"required"`
|
||||||
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
NotificationType int32 `json:"notificationType"`
|
||||||
OperationID string `json:"operationID" binding:"required"`
|
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
||||||
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type BatchSetConversationsResp struct {
|
type BatchSetConversationsResp struct {
|
||||||
@ -103,10 +105,11 @@ type GetConversationsResp struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SetRecvMsgOptReq struct {
|
type SetRecvMsgOptReq struct {
|
||||||
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
OwnerUserID string `json:"ownerUserID" binding:"required"`
|
||||||
ConversationID string `json:"conversationID"`
|
ConversationID string `json:"conversationID"`
|
||||||
RecvMsgOpt int32 `json:"recvMsgOpt" binding:"omitempty,oneof=0 1 2"`
|
RecvMsgOpt int32 `json:"recvMsgOpt" binding:"omitempty,oneof=0 1 2"`
|
||||||
OperationID string `json:"operationID" binding:"required"`
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
|
NotificationType int32 `json:"notificationType"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type SetRecvMsgOptResp struct {
|
type SetRecvMsgOptResp struct {
|
||||||
|
@ -185,3 +185,38 @@ type DismissGroupReq struct {
|
|||||||
type DismissGroupResp struct {
|
type DismissGroupResp struct {
|
||||||
CommResp
|
CommResp
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type MuteGroupMemberReq struct {
|
||||||
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
|
GroupID string `json:"groupID" binding:"required"`
|
||||||
|
UserID string `json:"userID" binding:"required"`
|
||||||
|
MutedSeconds uint32 `json:"mutedSeconds" binding:"required"`
|
||||||
|
}
|
||||||
|
type MuteGroupMemberResp struct {
|
||||||
|
CommResp
|
||||||
|
}
|
||||||
|
|
||||||
|
type CancelMuteGroupMemberReq struct {
|
||||||
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
|
GroupID string `json:"groupID" binding:"required"`
|
||||||
|
UserID string `json:"userID" binding:"required"`
|
||||||
|
}
|
||||||
|
type CancelMuteGroupMemberResp struct {
|
||||||
|
CommResp
|
||||||
|
}
|
||||||
|
|
||||||
|
type MuteGroupReq struct {
|
||||||
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
|
GroupID string `json:"groupID" binding:"required"`
|
||||||
|
}
|
||||||
|
type MuteGroupResp struct {
|
||||||
|
CommResp
|
||||||
|
}
|
||||||
|
|
||||||
|
type CancelMuteGroupReq struct {
|
||||||
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
|
GroupID string `json:"groupID" binding:"required"`
|
||||||
|
}
|
||||||
|
type CancelMuteGroupResp struct {
|
||||||
|
CommResp
|
||||||
|
}
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type GetUserTagsReq struct {
|
type GetUserTagsReq struct {
|
||||||
OperationID string `json:"operationID"`
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetUserTagsResp struct {
|
type GetUserTagsResp struct {
|
||||||
@ -47,10 +47,12 @@ type SetTagResp struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SendMsg2TagReq struct {
|
type SendMsg2TagReq struct {
|
||||||
TagID string `json:"tagID" binding:"required"`
|
TagList []string `json:"tagList"`
|
||||||
|
UserList []string `json:"userList"`
|
||||||
|
GroupList []string `json:"groupList"`
|
||||||
|
|
||||||
SenderPlatformID int32 `json:"senderPlatformID" binding:"required"`
|
SenderPlatformID int32 `json:"senderPlatformID" binding:"required"`
|
||||||
Content string `json:"content" binding:"required"`
|
Content string `json:"content" binding:"required"`
|
||||||
ContentType int32 `json:"contentType" binding:"required"`
|
|
||||||
OperationID string `json:"operationID" binding:"required"`
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,3 +74,15 @@ type GetTagSendLogsResp struct {
|
|||||||
ShowNumber int32 `json:"showNumber"`
|
ShowNumber int32 `json:"showNumber"`
|
||||||
} `json:"data"`
|
} `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetUserTagByIDReq struct {
|
||||||
|
TagID string `json:"tagID" binding:"required"`
|
||||||
|
OperationID string `json:"operationID" binding:"required"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetUserTagByIDResp struct {
|
||||||
|
CommResp
|
||||||
|
Data struct {
|
||||||
|
Tag *pbOffice.Tag `json:"tag"`
|
||||||
|
} `json:"data"`
|
||||||
|
}
|
||||||
|
@ -270,6 +270,30 @@ type config struct {
|
|||||||
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||||
} `yaml:"groupDismissed"`
|
} `yaml:"groupDismissed"`
|
||||||
|
|
||||||
|
GroupMuted struct {
|
||||||
|
Conversation PConversation `yaml:"conversation"`
|
||||||
|
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||||
|
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||||
|
} `yaml:"groupMuted"`
|
||||||
|
|
||||||
|
GroupCancelMuted struct {
|
||||||
|
Conversation PConversation `yaml:"conversation"`
|
||||||
|
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||||
|
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||||
|
} `yaml:"groupCancelMuted"`
|
||||||
|
|
||||||
|
GroupMemberMuted struct {
|
||||||
|
Conversation PConversation `yaml:"conversation"`
|
||||||
|
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||||
|
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||||
|
} `yaml:"groupMemberMuted"`
|
||||||
|
|
||||||
|
GroupMemberCancelMuted struct {
|
||||||
|
Conversation PConversation `yaml:"conversation"`
|
||||||
|
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||||
|
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||||
|
} `yaml:"groupMemberCancelMuted"`
|
||||||
|
|
||||||
////////////////////////user///////////////////////
|
////////////////////////user///////////////////////
|
||||||
UserInfoUpdated struct {
|
UserInfoUpdated struct {
|
||||||
Conversation PConversation `yaml:"conversation"`
|
Conversation PConversation `yaml:"conversation"`
|
||||||
@ -326,6 +350,14 @@ type config struct {
|
|||||||
OfflinePush POfflinePush `yaml:"offlinePush"`
|
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||||
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
DefaultTips PDefaultTips `yaml:"defaultTips"`
|
||||||
} `yaml:"conversationOptUpdate"`
|
} `yaml:"conversationOptUpdate"`
|
||||||
|
ConversationSetPrivate struct {
|
||||||
|
Conversation PConversation `yaml:"conversation"`
|
||||||
|
OfflinePush POfflinePush `yaml:"offlinePush"`
|
||||||
|
DefaultTips struct {
|
||||||
|
OpenTips string `yaml:"openTips"`
|
||||||
|
CloseTips string `yaml:"closeTips"`
|
||||||
|
} `yaml:"defaultTips"`
|
||||||
|
} `yaml:"conversationSetPrivate"`
|
||||||
}
|
}
|
||||||
Demo struct {
|
Demo struct {
|
||||||
Port []int `yaml:"openImDemoPort"`
|
Port []int `yaml:"openImDemoPort"`
|
||||||
|
@ -56,13 +56,11 @@ const (
|
|||||||
FriendRemarkSetNotification = 1206 //set_friend_remark?
|
FriendRemarkSetNotification = 1206 //set_friend_remark?
|
||||||
BlackAddedNotification = 1207 //add_black
|
BlackAddedNotification = 1207 //add_black
|
||||||
BlackDeletedNotification = 1208 //remove_black
|
BlackDeletedNotification = 1208 //remove_black
|
||||||
ConversationOptChangeNotification = 1300 // change conversation opt
|
|
||||||
|
ConversationOptChangeNotification = 1300 // change conversation opt
|
||||||
|
|
||||||
UserNotificationBegin = 1301
|
UserNotificationBegin = 1301
|
||||||
UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204
|
UserInfoUpdatedNotification = 1303 //SetSelfInfoTip = 204
|
||||||
ConversationNotification = 1307
|
|
||||||
ConversationNotNotification = 1308
|
|
||||||
ConversationDefault = 0
|
|
||||||
UserNotificationEnd = 1399
|
UserNotificationEnd = 1399
|
||||||
OANotification = 1400
|
OANotification = 1400
|
||||||
|
|
||||||
@ -79,11 +77,18 @@ const (
|
|||||||
MemberInvitedNotification = 1509
|
MemberInvitedNotification = 1509
|
||||||
MemberEnterNotification = 1510
|
MemberEnterNotification = 1510
|
||||||
GroupDismissedNotification = 1511
|
GroupDismissedNotification = 1511
|
||||||
|
GroupMemberMutedNotification = 1512
|
||||||
|
GroupMemberCancelMutedNotification = 1513
|
||||||
|
GroupMutedNotification = 1514
|
||||||
|
GroupCancelMutedNotification = 1515
|
||||||
|
|
||||||
SignalingNotificationBegin = 1600
|
SignalingNotificationBegin = 1600
|
||||||
SignalingNotification = 1601
|
SignalingNotification = 1601
|
||||||
SignalingNotificationEnd = 1699
|
SignalingNotificationEnd = 1699
|
||||||
NotificationEnd = 2000
|
|
||||||
|
ConversationPrivateChatNotification = 1701
|
||||||
|
|
||||||
|
NotificationEnd = 2000
|
||||||
|
|
||||||
//status
|
//status
|
||||||
MsgNormal = 1
|
MsgNormal = 1
|
||||||
@ -226,3 +231,5 @@ func GroupIsBanPrivateChat(status int32) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const BigVersion = "v3"
|
const BigVersion = "v3"
|
||||||
|
|
||||||
|
const LogFileName = "OpenIM.log"
|
||||||
|
@ -2,6 +2,7 @@ package db
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"Open_IM/pkg/common/config"
|
"Open_IM/pkg/common/config"
|
||||||
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
"Open_IM/pkg/utils"
|
"Open_IM/pkg/utils"
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -33,6 +34,7 @@ func key(dbAddress, dbName string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
|
log.NewPrivateLog(constant.LogFileName)
|
||||||
//var mgoSession *mgo.Session
|
//var mgoSession *mgo.Session
|
||||||
var mongoClient *mongo.Client
|
var mongoClient *mongo.Client
|
||||||
var err1 error
|
var err1 error
|
||||||
@ -51,7 +53,7 @@ func init() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
|
mongoClient, err := mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
|
||||||
if err != nil{
|
if err != nil {
|
||||||
log.NewError(" mongo.Connect failed, try ", utils.GetSelfFuncName(), err.Error(), uri)
|
log.NewError(" mongo.Connect failed, try ", utils.GetSelfFuncName(), err.Error(), uri)
|
||||||
time.Sleep(time.Duration(30) * time.Second)
|
time.Sleep(time.Duration(30) * time.Second)
|
||||||
mongoClient, err1 = mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
|
mongoClient, err1 = mongo.Connect(context.TODO(), options.Client().ApplyURI(uri))
|
||||||
|
@ -5,7 +5,6 @@ import (
|
|||||||
"Open_IM/pkg/common/constant"
|
"Open_IM/pkg/common/constant"
|
||||||
"Open_IM/pkg/common/log"
|
"Open_IM/pkg/common/log"
|
||||||
pbMsg "Open_IM/pkg/proto/chat"
|
pbMsg "Open_IM/pkg/proto/chat"
|
||||||
officePb "Open_IM/pkg/proto/office"
|
|
||||||
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
open_im_sdk "Open_IM/pkg/proto/sdk_ws"
|
||||||
"Open_IM/pkg/utils"
|
"Open_IM/pkg/utils"
|
||||||
"context"
|
"context"
|
||||||
@ -470,6 +469,14 @@ func (d *DataBases) CreateTag(userID, tagName string, userList []string) error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (d *DataBases) GetTagByID(userID, tagID string) (Tag, error) {
|
||||||
|
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
||||||
|
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cTag)
|
||||||
|
var tag Tag
|
||||||
|
err := c.FindOne(ctx, bson.M{"user_id": userID, "tag_id": tagID}).Decode(&tag)
|
||||||
|
return tag, err
|
||||||
|
}
|
||||||
|
|
||||||
func (d *DataBases) DeleteTag(userID, tagID string) error {
|
func (d *DataBases) DeleteTag(userID, tagID string) error {
|
||||||
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
||||||
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cTag)
|
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cTag)
|
||||||
@ -491,7 +498,7 @@ func (d *DataBases) SetTag(userID, tagID, newName string, increaseUserIDList []s
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
tag.UserList = append(tag.UserList, increaseUserIDList...)
|
tag.UserList = append(tag.UserList, increaseUserIDList...)
|
||||||
tag.UserList = utils.RemoveUserIDRepByMap(tag.UserList)
|
tag.UserList = utils.RemoveRepeatedStringInList(tag.UserList)
|
||||||
for _, v := range reduceUserIDList {
|
for _, v := range reduceUserIDList {
|
||||||
for i2, v2 := range tag.UserList {
|
for i2, v2 := range tag.UserList {
|
||||||
if v == v2 {
|
if v == v2 {
|
||||||
@ -526,30 +533,16 @@ type TagUser struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TagSendLog struct {
|
type TagSendLog struct {
|
||||||
TagID string `bson:"tag_id"`
|
UserList []TagUser `bson:"tag_list"`
|
||||||
TagName string `bson:"tag_name"`
|
SendID string `bson:"send_id"`
|
||||||
SendID string `bson:"send_id"`
|
SenderPlatformID int32 `bson:"sender_platform_id"`
|
||||||
SenderPlatformID int32 `bson:"sender_platform_id"`
|
Content string `bson:"content"`
|
||||||
Content string `bson:"content"`
|
SendTime int64 `bson:"send_time"`
|
||||||
ContentType int32 `bson:"content_type"`
|
|
||||||
SendTime int64 `bson:"send_time"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (d *DataBases) SaveTagSendLog(sendReq *officePb.SendMsg2TagReq) error {
|
func (d *DataBases) SaveTagSendLog(tagSendLog *TagSendLog) error {
|
||||||
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
ctx, _ := context.WithTimeout(context.Background(), time.Duration(config.Config.Mongo.DBTimeout)*time.Second)
|
||||||
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cTag)
|
c := d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSendLog)
|
||||||
var tag Tag
|
|
||||||
_ = c.FindOne(ctx, bson.M{"user_id": sendReq.SendID, "tag_id": sendReq.TagID}).Decode(&tag)
|
|
||||||
c = d.mongoClient.Database(config.Config.Mongo.DBDatabase).Collection(cSendLog)
|
|
||||||
tagSendLog := TagSendLog{
|
|
||||||
TagID: sendReq.TagID,
|
|
||||||
TagName: tag.TagName,
|
|
||||||
SendID: sendReq.SendID,
|
|
||||||
SenderPlatformID: sendReq.SenderPlatformID,
|
|
||||||
Content: sendReq.Content,
|
|
||||||
ContentType: sendReq.ContentType,
|
|
||||||
SendTime: time.Now().Unix(),
|
|
||||||
}
|
|
||||||
_, err := c.InsertOne(ctx, tagSendLog)
|
_, err := c.InsertOne(ctx, tagSendLog)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
@ -571,7 +564,7 @@ func (d *DataBases) GetTagSendLogs(userID string, showNumber, pageNumber int32)
|
|||||||
}
|
}
|
||||||
|
|
||||||
func generateTagID(tagName, userID string) string {
|
func generateTagID(tagName, userID string) string {
|
||||||
return utils.Md5(tagName + userID + strconv.Itoa(rand.Int()))
|
return utils.Md5(tagName + userID + strconv.Itoa(rand.Int()) + time.Now().String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func getCurrentTimestampByMill() int64 {
|
func getCurrentTimestampByMill() int64 {
|
||||||
|
@ -30,9 +30,7 @@ func InsertIntoGroupMember(toInsertInfo db.GroupMember) error {
|
|||||||
if toInsertInfo.RoleLevel == 0 {
|
if toInsertInfo.RoleLevel == 0 {
|
||||||
toInsertInfo.RoleLevel = constant.GroupOrdinaryUsers
|
toInsertInfo.RoleLevel = constant.GroupOrdinaryUsers
|
||||||
}
|
}
|
||||||
if toInsertInfo.MuteEndTime.Unix() == 0 {
|
toInsertInfo.MuteEndTime = time.Unix(int64(time.Now().Second()), 0)
|
||||||
toInsertInfo.MuteEndTime = time.Unix(0, 0)
|
|
||||||
}
|
|
||||||
err = dbConn.Table("group_members").Create(toInsertInfo).Error
|
err = dbConn.Table("group_members").Create(toInsertInfo).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
@ -68,6 +66,24 @@ func GetGroupMemberListByGroupID(groupID string) ([]db.GroupMember, error) {
|
|||||||
return groupMemberList, nil
|
return groupMemberList, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func GetGroupMemberIDListByGroupID(groupID string) ([]string, error) {
|
||||||
|
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
dbConn.LogMode(true)
|
||||||
|
var groupMembers []db.GroupMember
|
||||||
|
err = dbConn.Table("group_members").Select("user_id").Where("group_id=?", groupID).Find(&groupMembers).Error
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
var groupMemberIDList []string
|
||||||
|
for _, v := range groupMembers {
|
||||||
|
groupMemberIDList = append(groupMemberIDList, v.UserID)
|
||||||
|
}
|
||||||
|
return groupMemberIDList, nil
|
||||||
|
}
|
||||||
|
|
||||||
func GetGroupMemberListByGroupIDAndRoleLevel(groupID string, roleLevel int32) ([]db.GroupMember, error) {
|
func GetGroupMemberListByGroupIDAndRoleLevel(groupID string, roleLevel int32) ([]db.GroupMember, error) {
|
||||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -216,10 +216,10 @@ func GetGroupMaster(groupId string) (db.GroupMember, error) {
|
|||||||
return groupMember, nil
|
return groupMember, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func UpdateGroupInfoDefaultZero(groupInfo db.Group, args map[string]interface{}) error {
|
func UpdateGroupInfoDefaultZero(groupID string, args map[string]interface{}) error {
|
||||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return dbConn.Model(groupInfo).Updates(args).Error
|
return dbConn.Table("groups").Where("group_id = ? ", groupID).Update(args).Error
|
||||||
}
|
}
|
||||||
|
@ -325,6 +325,25 @@ func SetConversation(conversation db.Conversation) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func PeerUserSetConversation(conversation db.Conversation) error {
|
||||||
|
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
dbConn.LogMode(true)
|
||||||
|
newConversation := conversation
|
||||||
|
if dbConn.Model(&db.Conversation{}).Find(&newConversation).RowsAffected == 0 {
|
||||||
|
log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "not exist in db, create")
|
||||||
|
return dbConn.Model(&db.Conversation{}).Create(conversation).Error
|
||||||
|
// if exist, then update record
|
||||||
|
}
|
||||||
|
log.NewDebug("", utils.GetSelfFuncName(), "conversation", conversation, "exist in db, update")
|
||||||
|
//force update
|
||||||
|
return dbConn.Model(conversation).Where("owner_user_id = ? and conversation_id = ?", conversation.OwnerUserID, conversation.ConversationID).
|
||||||
|
Update(map[string]interface{}{"is_private_chat": conversation.IsPrivateChat}).Error
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func SetRecvMsgOpt(conversation db.Conversation) error {
|
func SetRecvMsgOpt(conversation db.Conversation) error {
|
||||||
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
dbConn, err := db.DB.MysqlDB.DefaultGormDB()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -63,10 +63,10 @@ func loggerInit(moduleName string) *Logger {
|
|||||||
}
|
}
|
||||||
func NewLfsHook(rotationTime time.Duration, maxRemainNum uint, moduleName string) logrus.Hook {
|
func NewLfsHook(rotationTime time.Duration, maxRemainNum uint, moduleName string) logrus.Hook {
|
||||||
lfsHook := lfshook.NewHook(lfshook.WriterMap{
|
lfsHook := lfshook.NewHook(lfshook.WriterMap{
|
||||||
logrus.DebugLevel: initRotateLogs(rotationTime, maxRemainNum, "debug", moduleName),
|
logrus.DebugLevel: initRotateLogs(rotationTime, maxRemainNum, "all", moduleName),
|
||||||
logrus.InfoLevel: initRotateLogs(rotationTime, maxRemainNum, "info", moduleName),
|
logrus.InfoLevel: initRotateLogs(rotationTime, maxRemainNum, "all", moduleName),
|
||||||
logrus.WarnLevel: initRotateLogs(rotationTime, maxRemainNum, "warn", moduleName),
|
logrus.WarnLevel: initRotateLogs(rotationTime, maxRemainNum, "all", moduleName),
|
||||||
logrus.ErrorLevel: initRotateLogs(rotationTime, maxRemainNum, "error", moduleName),
|
logrus.ErrorLevel: initRotateLogs(rotationTime, maxRemainNum, "all", moduleName),
|
||||||
}, &nested.Formatter{
|
}, &nested.Formatter{
|
||||||
TimestampFormat: "2006-01-02 15:04:05.000",
|
TimestampFormat: "2006-01-02 15:04:05.000",
|
||||||
HideKeys: false,
|
HideKeys: false,
|
||||||
|
@ -101,7 +101,7 @@ func GetClaimFromToken(tokensString string) (*Claims, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsAppManagerAccess(token string, OpUserID string) bool {
|
func IsAppManagerAccess(token string, OpUserID string) bool {
|
||||||
claims, err := ParseToken(token)
|
claims, err := ParseToken(token, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -130,7 +130,7 @@ func CheckAccess(OpUserID string, OwnerUserID string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetUserIDFromToken(token string, operationID string) (bool, string) {
|
func GetUserIDFromToken(token string, operationID string) (bool, string) {
|
||||||
claims, err := ParseToken(token)
|
claims, err := ParseToken(token, operationID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(operationID, "ParseToken failed, ", err.Error(), token)
|
log.Error(operationID, "ParseToken failed, ", err.Error(), token)
|
||||||
return false, ""
|
return false, ""
|
||||||
@ -138,31 +138,31 @@ func GetUserIDFromToken(token string, operationID string) (bool, string) {
|
|||||||
return true, claims.UID
|
return true, claims.UID
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseToken(tokensString string) (claims *Claims, err error) {
|
func ParseToken(tokensString, operationID string) (claims *Claims, err error) {
|
||||||
|
|
||||||
claims, err = GetClaimFromToken(tokensString)
|
claims, err = GetClaimFromToken(tokensString)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError("", "token validate err", err.Error())
|
log.NewError(operationID, "token validate err", err.Error(), tokensString)
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
m, err := commonDB.DB.GetTokenMapByUidPid(claims.UID, claims.Platform)
|
m, err := commonDB.DB.GetTokenMapByUidPid(claims.UID, claims.Platform)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError("", "get token from redis err", err.Error())
|
log.NewError(operationID, "get token from redis err", err.Error(), tokensString)
|
||||||
return nil, &constant.ErrTokenInvalid
|
return nil, &constant.ErrTokenInvalid
|
||||||
}
|
}
|
||||||
if m == nil {
|
if m == nil {
|
||||||
log.NewError("", "get token from redis err", "m is nil")
|
log.NewError(operationID, "get token from redis err", "m is nil", tokensString)
|
||||||
return nil, &constant.ErrTokenInvalid
|
return nil, &constant.ErrTokenInvalid
|
||||||
}
|
}
|
||||||
if v, ok := m[tokensString]; ok {
|
if v, ok := m[tokensString]; ok {
|
||||||
switch v {
|
switch v {
|
||||||
case constant.NormalToken:
|
case constant.NormalToken:
|
||||||
log.NewDebug("", "this is normal return", claims)
|
log.NewDebug(operationID, "this is normal return", claims)
|
||||||
return claims, nil
|
return claims, nil
|
||||||
case constant.InValidToken:
|
case constant.InValidToken:
|
||||||
return nil, &constant.ErrTokenInvalid
|
return nil, &constant.ErrTokenInvalid
|
||||||
case constant.KickedToken:
|
case constant.KickedToken:
|
||||||
|
log.Error(operationID, "this token has been kicked by other same terminal ", constant.ErrTokenKicked)
|
||||||
return nil, &constant.ErrTokenKicked
|
return nil, &constant.ErrTokenKicked
|
||||||
case constant.ExpiredToken:
|
case constant.ExpiredToken:
|
||||||
return nil, &constant.ErrTokenExpired
|
return nil, &constant.ErrTokenExpired
|
||||||
@ -170,6 +170,7 @@ func ParseToken(tokensString string) (claims *Claims, err error) {
|
|||||||
return nil, &constant.ErrTokenUnknown
|
return nil, &constant.ErrTokenUnknown
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
log.NewError(operationID, "redis token map not find", constant.ErrTokenUnknown)
|
||||||
return nil, &constant.ErrTokenUnknown
|
return nil, &constant.ErrTokenUnknown
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,7 +196,7 @@ func ParseRedisInterfaceToken(redisToken interface{}) (*Claims, error) {
|
|||||||
|
|
||||||
//Validation token, false means failure, true means successful verification
|
//Validation token, false means failure, true means successful verification
|
||||||
func VerifyToken(token, uid string) (bool, error) {
|
func VerifyToken(token, uid string) (bool, error) {
|
||||||
claims, err := ParseToken(token)
|
claims, err := ParseToken(token, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
@ -207,7 +208,7 @@ func VerifyToken(token, uid string) (bool, error) {
|
|||||||
return true, nil
|
return true, nil
|
||||||
}
|
}
|
||||||
func WsVerifyToken(token, uid string, platformID string) (bool, error, string) {
|
func WsVerifyToken(token, uid string, platformID string) (bool, error, string) {
|
||||||
claims, err := ParseToken(token)
|
claims, err := ParseToken(token, "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false, err, "parse token err"
|
return false, err, "parse token err"
|
||||||
}
|
}
|
||||||
|
@ -118,7 +118,14 @@ func GroupMemberDBCopyOpenIM(dst *open_im_sdk.GroupMemberFullInfo, src *db.Group
|
|||||||
dst.AppMangerLevel = 1
|
dst.AppMangerLevel = 1
|
||||||
}
|
}
|
||||||
dst.JoinTime = int32(src.JoinTime.Unix())
|
dst.JoinTime = int32(src.JoinTime.Unix())
|
||||||
dst.MuteEndTime = uint32(src.JoinTime.Unix())
|
if src.MuteEndTime.Unix() < 0 {
|
||||||
|
dst.JoinTime = 0
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
dst.MuteEndTime = uint32(src.MuteEndTime.Unix())
|
||||||
|
if dst.MuteEndTime < uint32(time.Now().Unix()) {
|
||||||
|
dst.MuteEndTime = 0
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ func (m *CommonResp) Reset() { *m = CommonResp{} }
|
|||||||
func (m *CommonResp) String() string { return proto.CompactTextString(m) }
|
func (m *CommonResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*CommonResp) ProtoMessage() {}
|
func (*CommonResp) ProtoMessage() {}
|
||||||
func (*CommonResp) Descriptor() ([]byte, []int) {
|
func (*CommonResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{0}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{0}
|
||||||
}
|
}
|
||||||
func (m *CommonResp) XXX_Unmarshal(b []byte) error {
|
func (m *CommonResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_CommonResp.Unmarshal(m, b)
|
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 (m *TagUser) String() string { return proto.CompactTextString(m) }
|
||||||
func (*TagUser) ProtoMessage() {}
|
func (*TagUser) ProtoMessage() {}
|
||||||
func (*TagUser) Descriptor() ([]byte, []int) {
|
func (*TagUser) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{1}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{1}
|
||||||
}
|
}
|
||||||
func (m *TagUser) XXX_Unmarshal(b []byte) error {
|
func (m *TagUser) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_TagUser.Unmarshal(m, b)
|
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 (m *Tag) String() string { return proto.CompactTextString(m) }
|
||||||
func (*Tag) ProtoMessage() {}
|
func (*Tag) ProtoMessage() {}
|
||||||
func (*Tag) Descriptor() ([]byte, []int) {
|
func (*Tag) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{2}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{2}
|
||||||
}
|
}
|
||||||
func (m *Tag) XXX_Unmarshal(b []byte) error {
|
func (m *Tag) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_Tag.Unmarshal(m, b)
|
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 (m *GetUserTagsReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetUserTagsReq) ProtoMessage() {}
|
func (*GetUserTagsReq) ProtoMessage() {}
|
||||||
func (*GetUserTagsReq) Descriptor() ([]byte, []int) {
|
func (*GetUserTagsReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{3}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{3}
|
||||||
}
|
}
|
||||||
func (m *GetUserTagsReq) XXX_Unmarshal(b []byte) error {
|
func (m *GetUserTagsReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetUserTagsReq.Unmarshal(m, b)
|
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 (m *GetUserTagsResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetUserTagsResp) ProtoMessage() {}
|
func (*GetUserTagsResp) ProtoMessage() {}
|
||||||
func (*GetUserTagsResp) Descriptor() ([]byte, []int) {
|
func (*GetUserTagsResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{4}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{4}
|
||||||
}
|
}
|
||||||
func (m *GetUserTagsResp) XXX_Unmarshal(b []byte) error {
|
func (m *GetUserTagsResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetUserTagsResp.Unmarshal(m, b)
|
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 (m *CreateTagReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*CreateTagReq) ProtoMessage() {}
|
func (*CreateTagReq) ProtoMessage() {}
|
||||||
func (*CreateTagReq) Descriptor() ([]byte, []int) {
|
func (*CreateTagReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{5}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{5}
|
||||||
}
|
}
|
||||||
func (m *CreateTagReq) XXX_Unmarshal(b []byte) error {
|
func (m *CreateTagReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_CreateTagReq.Unmarshal(m, b)
|
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 (m *CreateTagResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*CreateTagResp) ProtoMessage() {}
|
func (*CreateTagResp) ProtoMessage() {}
|
||||||
func (*CreateTagResp) Descriptor() ([]byte, []int) {
|
func (*CreateTagResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{6}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{6}
|
||||||
}
|
}
|
||||||
func (m *CreateTagResp) XXX_Unmarshal(b []byte) error {
|
func (m *CreateTagResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_CreateTagResp.Unmarshal(m, b)
|
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 (m *DeleteTagReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*DeleteTagReq) ProtoMessage() {}
|
func (*DeleteTagReq) ProtoMessage() {}
|
||||||
func (*DeleteTagReq) Descriptor() ([]byte, []int) {
|
func (*DeleteTagReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{7}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{7}
|
||||||
}
|
}
|
||||||
func (m *DeleteTagReq) XXX_Unmarshal(b []byte) error {
|
func (m *DeleteTagReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_DeleteTagReq.Unmarshal(m, b)
|
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 (m *DeleteTagResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*DeleteTagResp) ProtoMessage() {}
|
func (*DeleteTagResp) ProtoMessage() {}
|
||||||
func (*DeleteTagResp) Descriptor() ([]byte, []int) {
|
func (*DeleteTagResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{8}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{8}
|
||||||
}
|
}
|
||||||
func (m *DeleteTagResp) XXX_Unmarshal(b []byte) error {
|
func (m *DeleteTagResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_DeleteTagResp.Unmarshal(m, b)
|
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 (m *SetTagReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*SetTagReq) ProtoMessage() {}
|
func (*SetTagReq) ProtoMessage() {}
|
||||||
func (*SetTagReq) Descriptor() ([]byte, []int) {
|
func (*SetTagReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{9}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{9}
|
||||||
}
|
}
|
||||||
func (m *SetTagReq) XXX_Unmarshal(b []byte) error {
|
func (m *SetTagReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_SetTagReq.Unmarshal(m, b)
|
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 (m *SetTagResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*SetTagResp) ProtoMessage() {}
|
func (*SetTagResp) ProtoMessage() {}
|
||||||
func (*SetTagResp) Descriptor() ([]byte, []int) {
|
func (*SetTagResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{10}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{10}
|
||||||
}
|
}
|
||||||
func (m *SetTagResp) XXX_Unmarshal(b []byte) error {
|
func (m *SetTagResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_SetTagResp.Unmarshal(m, b)
|
return xxx_messageInfo_SetTagResp.Unmarshal(m, b)
|
||||||
@ -571,12 +571,13 @@ func (m *SetTagResp) GetCommonResp() *CommonResp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type SendMsg2TagReq struct {
|
type SendMsg2TagReq struct {
|
||||||
TagID string `protobuf:"bytes,1,opt,name=tagID" json:"tagID,omitempty"`
|
TagList []string `protobuf:"bytes,1,rep,name=tagList" json:"tagList,omitempty"`
|
||||||
SendID string `protobuf:"bytes,2,opt,name=sendID" json:"sendID,omitempty"`
|
UserList []string `protobuf:"bytes,2,rep,name=UserList" json:"UserList,omitempty"`
|
||||||
SenderPlatformID int32 `protobuf:"varint,3,opt,name=senderPlatformID" json:"senderPlatformID,omitempty"`
|
GroupList []string `protobuf:"bytes,3,rep,name=GroupList" json:"GroupList,omitempty"`
|
||||||
Content string `protobuf:"bytes,4,opt,name=content" json:"content,omitempty"`
|
SendID string `protobuf:"bytes,4,opt,name=sendID" json:"sendID,omitempty"`
|
||||||
ContentType int32 `protobuf:"varint,5,opt,name=contentType" json:"contentType,omitempty"`
|
SenderPlatformID int32 `protobuf:"varint,5,opt,name=senderPlatformID" json:"senderPlatformID,omitempty"`
|
||||||
OperationID string `protobuf:"bytes,6,opt,name=operationID" json:"operationID,omitempty"`
|
Content string `protobuf:"bytes,6,opt,name=content" json:"content,omitempty"`
|
||||||
|
OperationID string `protobuf:"bytes,7,opt,name=operationID" json:"operationID,omitempty"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_unrecognized []byte `json:"-"`
|
||||||
XXX_sizecache int32 `json:"-"`
|
XXX_sizecache int32 `json:"-"`
|
||||||
@ -586,7 +587,7 @@ func (m *SendMsg2TagReq) Reset() { *m = SendMsg2TagReq{} }
|
|||||||
func (m *SendMsg2TagReq) String() string { return proto.CompactTextString(m) }
|
func (m *SendMsg2TagReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*SendMsg2TagReq) ProtoMessage() {}
|
func (*SendMsg2TagReq) ProtoMessage() {}
|
||||||
func (*SendMsg2TagReq) Descriptor() ([]byte, []int) {
|
func (*SendMsg2TagReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{11}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{11}
|
||||||
}
|
}
|
||||||
func (m *SendMsg2TagReq) XXX_Unmarshal(b []byte) error {
|
func (m *SendMsg2TagReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_SendMsg2TagReq.Unmarshal(m, b)
|
return xxx_messageInfo_SendMsg2TagReq.Unmarshal(m, b)
|
||||||
@ -606,11 +607,25 @@ func (m *SendMsg2TagReq) XXX_DiscardUnknown() {
|
|||||||
|
|
||||||
var xxx_messageInfo_SendMsg2TagReq proto.InternalMessageInfo
|
var xxx_messageInfo_SendMsg2TagReq proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *SendMsg2TagReq) GetTagID() string {
|
func (m *SendMsg2TagReq) GetTagList() []string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.TagID
|
return m.TagList
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *SendMsg2TagReq) GetUserList() []string {
|
||||||
|
if m != nil {
|
||||||
|
return m.UserList
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *SendMsg2TagReq) GetGroupList() []string {
|
||||||
|
if m != nil {
|
||||||
|
return m.GroupList
|
||||||
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SendMsg2TagReq) GetSendID() string {
|
func (m *SendMsg2TagReq) GetSendID() string {
|
||||||
@ -634,13 +649,6 @@ func (m *SendMsg2TagReq) GetContent() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *SendMsg2TagReq) GetContentType() int32 {
|
|
||||||
if m != nil {
|
|
||||||
return m.ContentType
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *SendMsg2TagReq) GetOperationID() string {
|
func (m *SendMsg2TagReq) GetOperationID() string {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.OperationID
|
return m.OperationID
|
||||||
@ -659,7 +667,7 @@ func (m *SendMsg2TagResp) Reset() { *m = SendMsg2TagResp{} }
|
|||||||
func (m *SendMsg2TagResp) String() string { return proto.CompactTextString(m) }
|
func (m *SendMsg2TagResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*SendMsg2TagResp) ProtoMessage() {}
|
func (*SendMsg2TagResp) ProtoMessage() {}
|
||||||
func (*SendMsg2TagResp) Descriptor() ([]byte, []int) {
|
func (*SendMsg2TagResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{12}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{12}
|
||||||
}
|
}
|
||||||
func (m *SendMsg2TagResp) XXX_Unmarshal(b []byte) error {
|
func (m *SendMsg2TagResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_SendMsg2TagResp.Unmarshal(m, b)
|
return xxx_messageInfo_SendMsg2TagResp.Unmarshal(m, b)
|
||||||
@ -699,7 +707,7 @@ func (m *GetTagSendLogsReq) Reset() { *m = GetTagSendLogsReq{} }
|
|||||||
func (m *GetTagSendLogsReq) String() string { return proto.CompactTextString(m) }
|
func (m *GetTagSendLogsReq) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetTagSendLogsReq) ProtoMessage() {}
|
func (*GetTagSendLogsReq) ProtoMessage() {}
|
||||||
func (*GetTagSendLogsReq) Descriptor() ([]byte, []int) {
|
func (*GetTagSendLogsReq) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{13}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{13}
|
||||||
}
|
}
|
||||||
func (m *GetTagSendLogsReq) XXX_Unmarshal(b []byte) error {
|
func (m *GetTagSendLogsReq) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetTagSendLogsReq.Unmarshal(m, b)
|
return xxx_messageInfo_GetTagSendLogsReq.Unmarshal(m, b)
|
||||||
@ -741,21 +749,19 @@ func (m *GetTagSendLogsReq) GetOperationID() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type TagSendLog struct {
|
type TagSendLog struct {
|
||||||
TagID string `protobuf:"bytes,1,opt,name=tagID" json:"tagID,omitempty"`
|
UserList []*TagUser `protobuf:"bytes,1,rep,name=userList" json:"userList,omitempty"`
|
||||||
TagName string `protobuf:"bytes,2,opt,name=tagName" json:"tagName,omitempty"`
|
Content string `protobuf:"bytes,2,opt,name=content" json:"content,omitempty"`
|
||||||
ContentType int32 `protobuf:"varint,3,opt,name=contentType" json:"contentType,omitempty"`
|
SendTime int64 `protobuf:"varint,3,opt,name=sendTime" json:"sendTime,omitempty"`
|
||||||
Content string `protobuf:"bytes,4,opt,name=content" json:"content,omitempty"`
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
SendTime int64 `protobuf:"varint,5,opt,name=sendTime" json:"sendTime,omitempty"`
|
XXX_unrecognized []byte `json:"-"`
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
XXX_sizecache int32 `json:"-"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
|
||||||
XXX_sizecache int32 `json:"-"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *TagSendLog) Reset() { *m = TagSendLog{} }
|
func (m *TagSendLog) Reset() { *m = TagSendLog{} }
|
||||||
func (m *TagSendLog) String() string { return proto.CompactTextString(m) }
|
func (m *TagSendLog) String() string { return proto.CompactTextString(m) }
|
||||||
func (*TagSendLog) ProtoMessage() {}
|
func (*TagSendLog) ProtoMessage() {}
|
||||||
func (*TagSendLog) Descriptor() ([]byte, []int) {
|
func (*TagSendLog) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{14}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{14}
|
||||||
}
|
}
|
||||||
func (m *TagSendLog) XXX_Unmarshal(b []byte) error {
|
func (m *TagSendLog) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_TagSendLog.Unmarshal(m, b)
|
return xxx_messageInfo_TagSendLog.Unmarshal(m, b)
|
||||||
@ -775,25 +781,11 @@ func (m *TagSendLog) XXX_DiscardUnknown() {
|
|||||||
|
|
||||||
var xxx_messageInfo_TagSendLog proto.InternalMessageInfo
|
var xxx_messageInfo_TagSendLog proto.InternalMessageInfo
|
||||||
|
|
||||||
func (m *TagSendLog) GetTagID() string {
|
func (m *TagSendLog) GetUserList() []*TagUser {
|
||||||
if m != nil {
|
if m != nil {
|
||||||
return m.TagID
|
return m.UserList
|
||||||
}
|
}
|
||||||
return ""
|
return nil
|
||||||
}
|
|
||||||
|
|
||||||
func (m *TagSendLog) GetTagName() string {
|
|
||||||
if m != nil {
|
|
||||||
return m.TagName
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (m *TagSendLog) GetContentType() int32 {
|
|
||||||
if m != nil {
|
|
||||||
return m.ContentType
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *TagSendLog) GetContent() string {
|
func (m *TagSendLog) GetContent() string {
|
||||||
@ -823,7 +815,7 @@ func (m *GetTagSendLogsResp) Reset() { *m = GetTagSendLogsResp{} }
|
|||||||
func (m *GetTagSendLogsResp) String() string { return proto.CompactTextString(m) }
|
func (m *GetTagSendLogsResp) String() string { return proto.CompactTextString(m) }
|
||||||
func (*GetTagSendLogsResp) ProtoMessage() {}
|
func (*GetTagSendLogsResp) ProtoMessage() {}
|
||||||
func (*GetTagSendLogsResp) Descriptor() ([]byte, []int) {
|
func (*GetTagSendLogsResp) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_office_8580c3f7b2871da9, []int{15}
|
return fileDescriptor_office_7f5adce6bc494f97, []int{15}
|
||||||
}
|
}
|
||||||
func (m *GetTagSendLogsResp) XXX_Unmarshal(b []byte) error {
|
func (m *GetTagSendLogsResp) XXX_Unmarshal(b []byte) error {
|
||||||
return xxx_messageInfo_GetTagSendLogsResp.Unmarshal(m, b)
|
return xxx_messageInfo_GetTagSendLogsResp.Unmarshal(m, b)
|
||||||
@ -864,6 +856,106 @@ func (m *GetTagSendLogsResp) GetTagSendLogs() []*TagSendLog {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type GetUserTagByIDReq struct {
|
||||||
|
UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"`
|
||||||
|
TagID string `protobuf:"bytes,2,opt,name=tagID" json:"tagID,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 *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}
|
||||||
|
}
|
||||||
|
func (m *GetUserTagByIDReq) XXX_Unmarshal(b []byte) error {
|
||||||
|
return xxx_messageInfo_GetUserTagByIDReq.Unmarshal(m, b)
|
||||||
|
}
|
||||||
|
func (m *GetUserTagByIDReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
return xxx_messageInfo_GetUserTagByIDReq.Marshal(b, m, deterministic)
|
||||||
|
}
|
||||||
|
func (dst *GetUserTagByIDReq) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_GetUserTagByIDReq.Merge(dst, src)
|
||||||
|
}
|
||||||
|
func (m *GetUserTagByIDReq) XXX_Size() int {
|
||||||
|
return xxx_messageInfo_GetUserTagByIDReq.Size(m)
|
||||||
|
}
|
||||||
|
func (m *GetUserTagByIDReq) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_GetUserTagByIDReq.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_GetUserTagByIDReq proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *GetUserTagByIDReq) GetUserID() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.UserID
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GetUserTagByIDReq) GetTagID() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.TagID
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GetUserTagByIDReq) GetOperationID() string {
|
||||||
|
if m != nil {
|
||||||
|
return m.OperationID
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetUserTagByIDResp struct {
|
||||||
|
CommonResp *CommonResp `protobuf:"bytes,1,opt,name=commonResp" json:"commonResp,omitempty"`
|
||||||
|
Tag *Tag `protobuf:"bytes,2,opt,name=tag" json:"tag,omitempty"`
|
||||||
|
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
||||||
|
XXX_unrecognized []byte `json:"-"`
|
||||||
|
XXX_sizecache int32 `json:"-"`
|
||||||
|
}
|
||||||
|
|
||||||
|
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}
|
||||||
|
}
|
||||||
|
func (m *GetUserTagByIDResp) XXX_Unmarshal(b []byte) error {
|
||||||
|
return xxx_messageInfo_GetUserTagByIDResp.Unmarshal(m, b)
|
||||||
|
}
|
||||||
|
func (m *GetUserTagByIDResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
||||||
|
return xxx_messageInfo_GetUserTagByIDResp.Marshal(b, m, deterministic)
|
||||||
|
}
|
||||||
|
func (dst *GetUserTagByIDResp) XXX_Merge(src proto.Message) {
|
||||||
|
xxx_messageInfo_GetUserTagByIDResp.Merge(dst, src)
|
||||||
|
}
|
||||||
|
func (m *GetUserTagByIDResp) XXX_Size() int {
|
||||||
|
return xxx_messageInfo_GetUserTagByIDResp.Size(m)
|
||||||
|
}
|
||||||
|
func (m *GetUserTagByIDResp) XXX_DiscardUnknown() {
|
||||||
|
xxx_messageInfo_GetUserTagByIDResp.DiscardUnknown(m)
|
||||||
|
}
|
||||||
|
|
||||||
|
var xxx_messageInfo_GetUserTagByIDResp proto.InternalMessageInfo
|
||||||
|
|
||||||
|
func (m *GetUserTagByIDResp) GetCommonResp() *CommonResp {
|
||||||
|
if m != nil {
|
||||||
|
return m.CommonResp
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *GetUserTagByIDResp) GetTag() *Tag {
|
||||||
|
if m != nil {
|
||||||
|
return m.Tag
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterType((*CommonResp)(nil), "office.CommonResp")
|
proto.RegisterType((*CommonResp)(nil), "office.CommonResp")
|
||||||
proto.RegisterType((*TagUser)(nil), "office.TagUser")
|
proto.RegisterType((*TagUser)(nil), "office.TagUser")
|
||||||
@ -881,6 +973,8 @@ func init() {
|
|||||||
proto.RegisterType((*GetTagSendLogsReq)(nil), "office.GetTagSendLogsReq")
|
proto.RegisterType((*GetTagSendLogsReq)(nil), "office.GetTagSendLogsReq")
|
||||||
proto.RegisterType((*TagSendLog)(nil), "office.TagSendLog")
|
proto.RegisterType((*TagSendLog)(nil), "office.TagSendLog")
|
||||||
proto.RegisterType((*GetTagSendLogsResp)(nil), "office.GetTagSendLogsResp")
|
proto.RegisterType((*GetTagSendLogsResp)(nil), "office.GetTagSendLogsResp")
|
||||||
|
proto.RegisterType((*GetUserTagByIDReq)(nil), "office.GetUserTagByIDReq")
|
||||||
|
proto.RegisterType((*GetUserTagByIDResp)(nil), "office.GetUserTagByIDResp")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
@ -900,6 +994,7 @@ type OfficeServiceClient interface {
|
|||||||
SetTag(ctx context.Context, in *SetTagReq, opts ...grpc.CallOption) (*SetTagResp, error)
|
SetTag(ctx context.Context, in *SetTagReq, opts ...grpc.CallOption) (*SetTagResp, error)
|
||||||
SendMsg2Tag(ctx context.Context, in *SendMsg2TagReq, opts ...grpc.CallOption) (*SendMsg2TagResp, error)
|
SendMsg2Tag(ctx context.Context, in *SendMsg2TagReq, opts ...grpc.CallOption) (*SendMsg2TagResp, error)
|
||||||
GetTagSendLogs(ctx context.Context, in *GetTagSendLogsReq, opts ...grpc.CallOption) (*GetTagSendLogsResp, error)
|
GetTagSendLogs(ctx context.Context, in *GetTagSendLogsReq, opts ...grpc.CallOption) (*GetTagSendLogsResp, error)
|
||||||
|
GetUserTagByID(ctx context.Context, in *GetUserTagByIDReq, opts ...grpc.CallOption) (*GetUserTagByIDResp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type officeServiceClient struct {
|
type officeServiceClient struct {
|
||||||
@ -964,6 +1059,15 @@ func (c *officeServiceClient) GetTagSendLogs(ctx context.Context, in *GetTagSend
|
|||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *officeServiceClient) GetUserTagByID(ctx context.Context, in *GetUserTagByIDReq, opts ...grpc.CallOption) (*GetUserTagByIDResp, error) {
|
||||||
|
out := new(GetUserTagByIDResp)
|
||||||
|
err := grpc.Invoke(ctx, "/office.OfficeService/GetUserTagByID", in, out, c.cc, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
// Server API for OfficeService service
|
// Server API for OfficeService service
|
||||||
|
|
||||||
type OfficeServiceServer interface {
|
type OfficeServiceServer interface {
|
||||||
@ -973,6 +1077,7 @@ type OfficeServiceServer interface {
|
|||||||
SetTag(context.Context, *SetTagReq) (*SetTagResp, error)
|
SetTag(context.Context, *SetTagReq) (*SetTagResp, error)
|
||||||
SendMsg2Tag(context.Context, *SendMsg2TagReq) (*SendMsg2TagResp, error)
|
SendMsg2Tag(context.Context, *SendMsg2TagReq) (*SendMsg2TagResp, error)
|
||||||
GetTagSendLogs(context.Context, *GetTagSendLogsReq) (*GetTagSendLogsResp, error)
|
GetTagSendLogs(context.Context, *GetTagSendLogsReq) (*GetTagSendLogsResp, error)
|
||||||
|
GetUserTagByID(context.Context, *GetUserTagByIDReq) (*GetUserTagByIDResp, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterOfficeServiceServer(s *grpc.Server, srv OfficeServiceServer) {
|
func RegisterOfficeServiceServer(s *grpc.Server, srv OfficeServiceServer) {
|
||||||
@ -1087,6 +1192,24 @@ func _OfficeService_GetTagSendLogs_Handler(srv interface{}, ctx context.Context,
|
|||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _OfficeService_GetUserTagByID_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetUserTagByIDReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(OfficeServiceServer).GetUserTagByID(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/office.OfficeService/GetUserTagByID",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(OfficeServiceServer).GetUserTagByID(ctx, req.(*GetUserTagByIDReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
var _OfficeService_serviceDesc = grpc.ServiceDesc{
|
var _OfficeService_serviceDesc = grpc.ServiceDesc{
|
||||||
ServiceName: "office.OfficeService",
|
ServiceName: "office.OfficeService",
|
||||||
HandlerType: (*OfficeServiceServer)(nil),
|
HandlerType: (*OfficeServiceServer)(nil),
|
||||||
@ -1115,60 +1238,68 @@ var _OfficeService_serviceDesc = grpc.ServiceDesc{
|
|||||||
MethodName: "GetTagSendLogs",
|
MethodName: "GetTagSendLogs",
|
||||||
Handler: _OfficeService_GetTagSendLogs_Handler,
|
Handler: _OfficeService_GetTagSendLogs_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetUserTagByID",
|
||||||
|
Handler: _OfficeService_GetUserTagByID_Handler,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Streams: []grpc.StreamDesc{},
|
Streams: []grpc.StreamDesc{},
|
||||||
Metadata: "office/office.proto",
|
Metadata: "office/office.proto",
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("office/office.proto", fileDescriptor_office_8580c3f7b2871da9) }
|
func init() { proto.RegisterFile("office/office.proto", fileDescriptor_office_7f5adce6bc494f97) }
|
||||||
|
|
||||||
var fileDescriptor_office_8580c3f7b2871da9 = []byte{
|
var fileDescriptor_office_7f5adce6bc494f97 = []byte{
|
||||||
// 751 bytes of a gzipped FileDescriptorProto
|
// 810 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xc1, 0x6e, 0xd3, 0x4c,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xd1, 0x6a, 0xdb, 0x4a,
|
||||||
0x10, 0x96, 0x93, 0x26, 0x6d, 0x26, 0x6d, 0xf3, 0x77, 0xff, 0x52, 0x82, 0x0f, 0x10, 0x2c, 0x90,
|
0x10, 0x45, 0x76, 0x6c, 0xc7, 0xe3, 0x24, 0xbe, 0xd9, 0x9b, 0x9b, 0xeb, 0x2b, 0x6e, 0x5b, 0x57,
|
||||||
0x2a, 0x90, 0x12, 0x29, 0x70, 0x40, 0x42, 0x54, 0x88, 0xa4, 0xaa, 0x8a, 0x5a, 0x5a, 0x6d, 0xd3,
|
0xb4, 0x10, 0x5a, 0xb0, 0xc1, 0xed, 0x43, 0xa1, 0x34, 0x94, 0xd8, 0xc1, 0xb8, 0x24, 0x4d, 0x50,
|
||||||
0x0b, 0x07, 0xa2, 0x6d, 0x32, 0xb1, 0xac, 0x36, 0xb6, 0xbb, 0xbb, 0x6d, 0xc5, 0x95, 0x57, 0x80,
|
0x9c, 0x97, 0x3e, 0xd4, 0x6c, 0xec, 0xb1, 0x10, 0x89, 0x25, 0x65, 0x57, 0x4e, 0xe8, 0x6b, 0x7f,
|
||||||
0x57, 0x42, 0xe2, 0xca, 0x03, 0x21, 0x21, 0xaf, 0xd7, 0xf6, 0xda, 0x49, 0x04, 0xe4, 0x94, 0x9d,
|
0xa1, 0xdf, 0xd4, 0xbe, 0xf7, 0x1f, 0xfa, 0x21, 0x45, 0x2b, 0x69, 0xb5, 0x2b, 0xdb, 0x04, 0x0c,
|
||||||
0xd9, 0x99, 0xc9, 0xf7, 0x7d, 0xb3, 0x3b, 0x6b, 0xf8, 0x3f, 0x98, 0x4c, 0xbc, 0x11, 0x76, 0xe2,
|
0x7d, 0x92, 0x66, 0x76, 0x66, 0x74, 0xe6, 0xec, 0xec, 0x59, 0xc1, 0xdf, 0xfe, 0x74, 0xea, 0x8e,
|
||||||
0x9f, 0x76, 0xc8, 0x03, 0x19, 0x90, 0x6a, 0x6c, 0xd9, 0x8f, 0x4f, 0x42, 0xf4, 0x87, 0x87, 0xc7,
|
0xb1, 0x1d, 0x3f, 0x5a, 0x01, 0xf3, 0x43, 0x9f, 0x94, 0x63, 0xcb, 0x7c, 0x7a, 0x16, 0xa0, 0x37,
|
||||||
0x9d, 0xf0, 0xd2, 0xed, 0xa8, 0xad, 0x8e, 0x18, 0x5f, 0x0e, 0xef, 0x44, 0xe7, 0x4e, 0xc4, 0xa1,
|
0x1a, 0x9c, 0xb6, 0x83, 0x6b, 0xa7, 0x2d, 0x96, 0xda, 0x7c, 0x72, 0x3d, 0xba, 0xe7, 0xed, 0x7b,
|
||||||
0xce, 0x1e, 0x40, 0x2f, 0x98, 0x4e, 0x03, 0x9f, 0xa2, 0x08, 0x49, 0x13, 0x56, 0x91, 0xf3, 0x5e,
|
0x1e, 0x87, 0x5a, 0x87, 0x00, 0x5d, 0x7f, 0x36, 0xf3, 0x3d, 0x1b, 0x79, 0x40, 0x1a, 0x50, 0x41,
|
||||||
0x30, 0xc6, 0xa6, 0xd5, 0xb2, 0x76, 0x2b, 0x34, 0x31, 0xc9, 0x0e, 0x54, 0x91, 0xf3, 0x63, 0xe1,
|
0xc6, 0xba, 0xfe, 0x04, 0x1b, 0x46, 0xd3, 0x38, 0x28, 0xd9, 0xa9, 0x49, 0xf6, 0xa1, 0x8c, 0x8c,
|
||||||
0x36, 0x4b, 0x2d, 0x6b, 0xb7, 0x46, 0xb5, 0xe5, 0xbc, 0x81, 0xd5, 0x01, 0x73, 0xcf, 0x05, 0xf2,
|
0x9d, 0x72, 0xa7, 0x51, 0x68, 0x1a, 0x07, 0x55, 0x3b, 0xb1, 0xac, 0x77, 0x50, 0x19, 0x52, 0xe7,
|
||||||
0x28, 0xe4, 0x46, 0x20, 0x3f, 0xec, 0xab, 0xdc, 0x1a, 0xd5, 0x16, 0xb1, 0x61, 0x2d, 0x5a, 0x7d,
|
0x92, 0x23, 0x8b, 0x42, 0xe6, 0x1c, 0xd9, 0xa0, 0x27, 0x72, 0xab, 0x76, 0x62, 0x11, 0x13, 0x36,
|
||||||
0x60, 0x53, 0xd4, 0xc9, 0xa9, 0xed, 0x5c, 0x40, 0x79, 0xc0, 0x5c, 0xb2, 0x0d, 0x15, 0xc9, 0xdc,
|
0xa3, 0xb7, 0x8f, 0x74, 0x86, 0x49, 0xb2, 0xb4, 0xad, 0x2b, 0x28, 0x0e, 0xa9, 0x43, 0xf6, 0xa0,
|
||||||
0x34, 0x33, 0x36, 0x22, 0x34, 0x92, 0xb9, 0x46, 0x5e, 0x62, 0x92, 0xe7, 0x71, 0xc9, 0x23, 0x4f,
|
0x14, 0x52, 0x47, 0x66, 0xc6, 0x46, 0x84, 0x26, 0xa4, 0x8e, 0x92, 0x97, 0x9a, 0xe4, 0x65, 0x5c,
|
||||||
0xc8, 0x66, 0xb9, 0x55, 0xde, 0xad, 0x77, 0x1b, 0x6d, 0xad, 0x80, 0x46, 0x43, 0xd3, 0x00, 0xe7,
|
0xf2, 0xc4, 0xe5, 0x61, 0xa3, 0xd8, 0x2c, 0x1e, 0xd4, 0x3a, 0xf5, 0x56, 0xc2, 0x40, 0x82, 0xc6,
|
||||||
0x3d, 0x6c, 0x1e, 0xa0, 0x8c, 0x9c, 0x03, 0xe6, 0x0a, 0x8a, 0xd7, 0x0b, 0x91, 0xb6, 0xa0, 0x1e,
|
0x96, 0x01, 0xd6, 0x07, 0xd8, 0xe9, 0x63, 0x18, 0x39, 0x87, 0xd4, 0xe1, 0x36, 0xde, 0xae, 0x44,
|
||||||
0x84, 0xc8, 0x99, 0xf4, 0x02, 0xff, 0xb0, 0xaf, 0xff, 0xd4, 0x74, 0x39, 0x13, 0x68, 0xe4, 0x6a,
|
0xda, 0x84, 0x9a, 0x1f, 0x20, 0xa3, 0xa1, 0xeb, 0x7b, 0x83, 0x5e, 0xf2, 0x51, 0xd5, 0x65, 0x4d,
|
||||||
0x89, 0x90, 0x74, 0x01, 0x46, 0xa9, 0x82, 0xaa, 0x60, 0xbd, 0x4b, 0x12, 0x34, 0x99, 0xb6, 0xd4,
|
0xa1, 0xae, 0xd5, 0xe2, 0x01, 0xe9, 0x00, 0x8c, 0x25, 0x83, 0xa2, 0x60, 0xad, 0x43, 0x52, 0x34,
|
||||||
0x88, 0x22, 0x8f, 0x60, 0x45, 0x32, 0x57, 0x34, 0x4b, 0x0a, 0x7b, 0xdd, 0xc0, 0x4e, 0xd5, 0x86,
|
0x19, 0xb7, 0xb6, 0x12, 0x45, 0x9e, 0xc0, 0x46, 0x48, 0x1d, 0xde, 0x28, 0x08, 0xec, 0x35, 0x05,
|
||||||
0xf3, 0xc5, 0x82, 0xf5, 0x1e, 0x47, 0x26, 0x31, 0xf2, 0xe1, 0xb5, 0xa9, 0x85, 0x95, 0xd7, 0x22,
|
0xbb, 0x2d, 0x16, 0xac, 0xaf, 0x06, 0x6c, 0x75, 0x19, 0xd2, 0x10, 0x23, 0x1f, 0xde, 0xaa, 0x5c,
|
||||||
0x23, 0x53, 0xca, 0x91, 0x79, 0x08, 0x10, 0xaf, 0x52, 0x95, 0x6a, 0xd4, 0xf0, 0x14, 0xc9, 0xae,
|
0x18, 0x3a, 0x17, 0x59, 0x33, 0x05, 0xad, 0x99, 0xc7, 0x00, 0xf1, 0x9b, 0x64, 0xa9, 0x6a, 0x2b,
|
||||||
0xcc, 0x92, 0xed, 0xc1, 0x86, 0x81, 0x61, 0x39, 0xaa, 0xce, 0x27, 0x58, 0xef, 0xe3, 0x15, 0xa6,
|
0x9e, 0x7c, 0xb3, 0x1b, 0x8b, 0xcd, 0x76, 0x61, 0x5b, 0xc1, 0xb0, 0x5e, 0xab, 0xd6, 0x67, 0xd8,
|
||||||
0x44, 0x16, 0x69, 0x9f, 0x1e, 0x81, 0x92, 0x79, 0x04, 0x0a, 0x20, 0xcb, 0x73, 0x41, 0x1a, 0xf5,
|
0xea, 0xe1, 0x0d, 0xca, 0x46, 0x56, 0x71, 0x2f, 0x47, 0xa0, 0xa0, 0x8e, 0x40, 0x0e, 0x64, 0x71,
|
||||||
0x97, 0x04, 0xf9, 0xd3, 0x82, 0xda, 0x19, 0xca, 0xa5, 0x20, 0x36, 0x61, 0xd5, 0xc7, 0x3b, 0xd5,
|
0x29, 0x48, 0xa5, 0xfe, 0x9a, 0x20, 0x7f, 0x1a, 0x50, 0xbd, 0xc0, 0x70, 0x2d, 0x88, 0x0d, 0xa8,
|
||||||
0x99, 0x18, 0x5e, 0x62, 0x92, 0x36, 0x10, 0xcf, 0x1f, 0x71, 0x64, 0x02, 0xcf, 0xb3, 0x4e, 0xac,
|
0x78, 0x78, 0x2f, 0x76, 0x26, 0x86, 0x97, 0x9a, 0xa4, 0x05, 0xc4, 0xf5, 0xc6, 0x0c, 0x29, 0xc7,
|
||||||
0xa8, 0x4e, 0xcc, 0xd9, 0x21, 0xcf, 0xe0, 0x3f, 0x8e, 0xe3, 0x9b, 0x91, 0x19, 0x5d, 0x51, 0xd1,
|
0xcb, 0x6c, 0x27, 0x36, 0xc4, 0x4e, 0x2c, 0x59, 0x21, 0x2f, 0xe0, 0x2f, 0x86, 0x93, 0xf9, 0x58,
|
||||||
0x33, 0xfe, 0xa2, 0x30, 0xd5, 0x59, 0x61, 0xde, 0x02, 0x24, 0x94, 0x96, 0x54, 0xe5, 0x87, 0x05,
|
0x8d, 0x2e, 0x89, 0xe8, 0x05, 0x7f, 0x9e, 0x98, 0xf2, 0x22, 0x31, 0xef, 0x01, 0xd2, 0x96, 0xd6,
|
||||||
0x9b, 0x67, 0xe8, 0x8f, 0x8f, 0x85, 0xdb, 0xd5, 0xd2, 0xcc, 0xbf, 0xa8, 0x3b, 0x50, 0x15, 0xe8,
|
0x64, 0xe5, 0x97, 0x01, 0x3b, 0x17, 0xe8, 0x4d, 0x4e, 0xb9, 0xd3, 0xd1, 0xc6, 0x50, 0x20, 0x33,
|
||||||
0x8f, 0xb3, 0x23, 0x18, 0x5b, 0x11, 0xa1, 0x68, 0x85, 0xfc, 0xf4, 0x8a, 0xc9, 0x49, 0xc0, 0xa7,
|
0x04, 0xb2, 0xd4, 0x8c, 0x4e, 0xf9, 0x65, 0x7a, 0x24, 0x0b, 0x62, 0x49, 0xda, 0xe4, 0x7f, 0xa8,
|
||||||
0xba, 0x85, 0x15, 0x3a, 0xe3, 0x8f, 0x64, 0x1c, 0x05, 0xbe, 0x44, 0x5f, 0xea, 0xa3, 0x98, 0x98,
|
0xf6, 0x99, 0x3f, 0x0f, 0x94, 0x49, 0xcc, 0x1c, 0x11, 0xdd, 0x1c, 0xbd, 0x89, 0x9c, 0xc1, 0xc4,
|
||||||
0x11, 0x55, 0xbd, 0x1c, 0x7c, 0x0e, 0xb1, 0x59, 0x51, 0x05, 0x4c, 0xd7, 0x5f, 0x88, 0xb1, 0x0f,
|
0x8a, 0xe8, 0x88, 0xde, 0x90, 0x9d, 0xdf, 0xd0, 0x70, 0xea, 0xb3, 0xd9, 0xa0, 0xd7, 0x28, 0x09,
|
||||||
0x8d, 0x1c, 0x93, 0x25, 0x15, 0xf9, 0x6a, 0xc1, 0xd6, 0x81, 0x12, 0x35, 0xaa, 0x76, 0x14, 0xc4,
|
0x55, 0x5a, 0xf0, 0x47, 0xb8, 0xc6, 0xbe, 0x17, 0xa2, 0x17, 0x26, 0x54, 0xa4, 0x66, 0x9e, 0xa8,
|
||||||
0xe3, 0xa4, 0x0f, 0x70, 0xca, 0x5c, 0xcf, 0x57, 0x7f, 0xa6, 0x2b, 0x3d, 0x69, 0x0b, 0xe4, 0xb7,
|
0xca, 0x22, 0x51, 0xc7, 0x50, 0xd7, 0xba, 0x5c, 0x93, 0xad, 0x6f, 0x06, 0xec, 0xf6, 0x05, 0xe1,
|
||||||
0xc8, 0x87, 0x2c, 0xf4, 0x86, 0x21, 0xe3, 0x6c, 0x2a, 0xda, 0x14, 0xaf, 0x6f, 0x50, 0xc8, 0x2c,
|
0x51, 0xb5, 0x13, 0x3f, 0x96, 0x9a, 0x1e, 0xc0, 0x39, 0x75, 0x5c, 0x4f, 0x7c, 0x2c, 0xa9, 0xf4,
|
||||||
0x96, 0x1a, 0x79, 0x0b, 0xef, 0xf1, 0x9f, 0xaf, 0xc0, 0x37, 0x0b, 0x20, 0x83, 0xf4, 0xcf, 0xc3,
|
0xac, 0xc5, 0x91, 0xdd, 0x21, 0x1b, 0xd1, 0xc0, 0x1d, 0x05, 0x94, 0xd1, 0x19, 0x6f, 0xd9, 0x78,
|
||||||
0xb4, 0xa0, 0x6f, 0x79, 0x56, 0xdf, 0xc5, 0xbd, 0xb1, 0x61, 0x2d, 0xea, 0xe4, 0xc0, 0x9b, 0xc6,
|
0x3b, 0x47, 0x1e, 0x66, 0xb1, 0xb6, 0x92, 0xb7, 0xf2, 0x8c, 0x3f, 0x7c, 0x3c, 0x7c, 0x80, 0x0c,
|
||||||
0x8d, 0x29, 0xd3, 0xd4, 0x76, 0xbe, 0x5b, 0x40, 0x8a, 0x62, 0x2d, 0x39, 0x2f, 0xf7, 0x73, 0x0a,
|
0x91, 0xa6, 0x9b, 0xc6, 0x03, 0xba, 0xa9, 0x72, 0x5a, 0xd0, 0x39, 0x35, 0x61, 0x33, 0xda, 0x81,
|
||||||
0x97, 0x54, 0xce, 0xd3, 0xb9, 0x0a, 0x8b, 0x30, 0xf0, 0x05, 0x2e, 0x90, 0xf8, 0x25, 0xd4, 0x65,
|
0xa1, 0x9b, 0xcc, 0x7c, 0xd1, 0x96, 0xb6, 0xf5, 0xdd, 0x00, 0x92, 0xa7, 0x61, 0x4d, 0x95, 0x3c,
|
||||||
0x86, 0x46, 0xbf, 0x1c, 0xc4, 0x98, 0xbe, 0x7a, 0x8b, 0x9a, 0x61, 0xdd, 0x5f, 0x25, 0xd8, 0x38,
|
0xd6, 0xb8, 0x2b, 0x88, 0x9c, 0xe7, 0x4b, 0xb9, 0xe3, 0x81, 0xef, 0x71, 0x5c, 0x41, 0xde, 0x6b,
|
||||||
0x51, 0x21, 0x67, 0xc8, 0x6f, 0xbd, 0x11, 0x92, 0x3d, 0xa8, 0x1b, 0xaf, 0x00, 0xd9, 0x49, 0x2a,
|
0xa8, 0x85, 0x19, 0x9a, 0xe4, 0xbe, 0x20, 0x4a, 0xdf, 0xc9, 0x92, 0xad, 0x86, 0x59, 0x63, 0xb1,
|
||||||
0xe4, 0x9f, 0x19, 0xfb, 0xfe, 0x5c, 0xbf, 0x08, 0xc9, 0x2b, 0xa8, 0xa5, 0x83, 0x95, 0x6c, 0xa7,
|
0x9b, 0x89, 0xd2, 0x1f, 0x7d, 0x19, 0xf4, 0xfe, 0x84, 0x78, 0x39, 0x82, 0x2b, 0xed, 0x23, 0x6b,
|
||||||
0xdc, 0x8d, 0x79, 0x6f, 0xdf, 0x9b, 0xe3, 0x8d, 0x33, 0xd3, 0x69, 0x97, 0x65, 0x9a, 0x03, 0x36,
|
0x72, 0xf5, 0x08, 0x8a, 0x21, 0x75, 0x12, 0x92, 0xb4, 0x0b, 0x25, 0xf2, 0x77, 0x7e, 0x14, 0x61,
|
||||||
0xcb, 0xcc, 0x8f, 0xc5, 0x0e, 0x54, 0xe3, 0x71, 0x40, 0xb6, 0x92, 0x80, 0x74, 0xe2, 0xd9, 0xa4,
|
0xfb, 0x4c, 0xf8, 0x2e, 0x90, 0xdd, 0xb9, 0x63, 0x24, 0x87, 0x50, 0x53, 0x6e, 0x32, 0xb2, 0x9f,
|
||||||
0xe8, 0x12, 0x61, 0x44, 0xd2, 0xb8, 0x32, 0x19, 0xc9, 0xfc, 0x44, 0xc8, 0x48, 0x16, 0xef, 0xd7,
|
0xa6, 0xe8, 0x57, 0xa5, 0xf9, 0xef, 0x52, 0x3f, 0x0f, 0xc8, 0x1b, 0xa8, 0xca, 0xcb, 0x81, 0xec,
|
||||||
0x81, 0x7a, 0x76, 0x8d, 0xee, 0x93, 0x07, 0x86, 0x1e, 0xf9, 0x2b, 0x64, 0xdb, 0x8b, 0xb6, 0x44,
|
0x49, 0x74, 0xca, 0x9d, 0x65, 0xfe, 0xb3, 0xc4, 0x1b, 0x67, 0x4a, 0xc5, 0xce, 0x32, 0xd5, 0x4b,
|
||||||
0xf8, 0x6e, 0xeb, 0x63, 0xa3, 0xad, 0xbf, 0x6f, 0x5e, 0xc7, 0x3f, 0x17, 0x55, 0xf5, 0xf1, 0xf2,
|
0x22, 0xcb, 0xd4, 0xa5, 0xbd, 0x0d, 0xe5, 0x58, 0xd2, 0xc8, 0x6e, 0x1a, 0x20, 0x55, 0xdb, 0x24,
|
||||||
0xe2, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x72, 0xfc, 0x2a, 0x94, 0xfe, 0x08, 0x00, 0x00,
|
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,
|
||||||
}
|
}
|
||||||
|
@ -64,12 +64,13 @@ message SetTagResp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message SendMsg2TagReq {
|
message SendMsg2TagReq {
|
||||||
string tagID = 1;
|
repeated string tagList = 1;
|
||||||
string sendID = 2;
|
repeated string UserList = 2;
|
||||||
int32 senderPlatformID = 3;
|
repeated string GroupList = 3;
|
||||||
string content = 4;
|
string sendID = 4;
|
||||||
int32 contentType = 5;
|
int32 senderPlatformID = 5;
|
||||||
string operationID = 6;
|
string content = 6;
|
||||||
|
string operationID = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SendMsg2TagResp {
|
message SendMsg2TagResp {
|
||||||
@ -83,11 +84,9 @@ message GetTagSendLogsReq {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message TagSendLog {
|
message TagSendLog {
|
||||||
string tagID = 1;
|
repeated TagUser userList = 1;
|
||||||
string tagName = 2;
|
string content = 2;
|
||||||
int32 contentType = 3;
|
int64 sendTime = 3;
|
||||||
string content = 4;
|
|
||||||
int64 sendTime = 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetTagSendLogsResp {
|
message GetTagSendLogsResp {
|
||||||
@ -96,6 +95,17 @@ message GetTagSendLogsResp {
|
|||||||
repeated TagSendLog tagSendLogs = 3;
|
repeated TagSendLog tagSendLogs = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message GetUserTagByIDReq {
|
||||||
|
string userID = 1;
|
||||||
|
string tagID = 2;
|
||||||
|
string operationID = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetUserTagByIDResp {
|
||||||
|
CommonResp commonResp = 1;
|
||||||
|
Tag tag = 2;
|
||||||
|
}
|
||||||
|
|
||||||
service OfficeService {
|
service OfficeService {
|
||||||
rpc GetUserTags(GetUserTagsReq) returns(GetUserTagsResp);
|
rpc GetUserTags(GetUserTagsReq) returns(GetUserTagsResp);
|
||||||
rpc CreateTag(CreateTagReq) returns(CreateTagResp);
|
rpc CreateTag(CreateTagReq) returns(CreateTagResp);
|
||||||
@ -103,5 +113,6 @@ service OfficeService {
|
|||||||
rpc SetTag(SetTagReq) returns(SetTagResp);
|
rpc SetTag(SetTagReq) returns(SetTagResp);
|
||||||
rpc SendMsg2Tag(SendMsg2TagReq) returns(SendMsg2TagResp);
|
rpc SendMsg2Tag(SendMsg2TagReq) returns(SendMsg2TagResp);
|
||||||
rpc GetTagSendLogs(GetTagSendLogsReq) returns(GetTagSendLogsResp);
|
rpc GetTagSendLogs(GetTagSendLogsReq) returns(GetTagSendLogsResp);
|
||||||
|
rpc GetUserTagByID(GetUserTagByIDReq) returns(GetUserTagByIDResp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -261,6 +261,33 @@ message GroupDismissedTips{
|
|||||||
int64 operationTime = 3;
|
int64 operationTime = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message GroupMemberMutedTips{
|
||||||
|
GroupInfo group = 1;
|
||||||
|
GroupMemberFullInfo opUser = 2;
|
||||||
|
int64 operationTime = 3;
|
||||||
|
GroupMemberFullInfo mutedUser = 4;
|
||||||
|
uint32 mutedSeconds = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GroupMemberCancelMutedTips{
|
||||||
|
GroupInfo group = 1;
|
||||||
|
GroupMemberFullInfo opUser = 2;
|
||||||
|
int64 operationTime = 3;
|
||||||
|
GroupMemberFullInfo mutedUser = 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GroupMutedTips{
|
||||||
|
GroupInfo group = 1;
|
||||||
|
GroupMemberFullInfo opUser = 2;
|
||||||
|
int64 operationTime = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GroupCancelMutedTips{
|
||||||
|
GroupInfo group = 1;
|
||||||
|
GroupMemberFullInfo opUser = 2;
|
||||||
|
int64 operationTime = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////friend/////////////////////
|
//////////////////////friend/////////////////////
|
||||||
//message FriendInfo{
|
//message FriendInfo{
|
||||||
@ -333,7 +360,12 @@ message UserInfoUpdatedTips{
|
|||||||
//////////////////////conversation/////////////////////
|
//////////////////////conversation/////////////////////
|
||||||
message ConversationUpdateTips{
|
message ConversationUpdateTips{
|
||||||
string UserID = 1;
|
string UserID = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message ConversationSetPrivateTips{
|
||||||
|
string recvID = 1;
|
||||||
|
string sendID = 2;
|
||||||
|
bool isPrivate = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -84,7 +84,8 @@ message Conversation{
|
|||||||
|
|
||||||
message SetConversationReq{
|
message SetConversationReq{
|
||||||
Conversation Conversation = 1;
|
Conversation Conversation = 1;
|
||||||
string OperationID = 2;
|
int32 notificationType = 2;
|
||||||
|
string OperationID = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SetConversationResp{
|
message SetConversationResp{
|
||||||
@ -95,7 +96,8 @@ message SetRecvMsgOptReq {
|
|||||||
string OwnerUserID = 1;
|
string OwnerUserID = 1;
|
||||||
string ConversationID = 2;
|
string ConversationID = 2;
|
||||||
int32 RecvMsgOpt = 3;
|
int32 RecvMsgOpt = 3;
|
||||||
string OperationID = 4;
|
int32 notificationType = 4;
|
||||||
|
string OperationID = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SetRecvMsgOptResp {
|
message SetRecvMsgOptResp {
|
||||||
@ -137,7 +139,8 @@ message GetAllConversationsResp{
|
|||||||
message BatchSetConversationsReq{
|
message BatchSetConversationsReq{
|
||||||
repeated Conversation Conversations = 1;
|
repeated Conversation Conversations = 1;
|
||||||
string OwnerUserID = 2;
|
string OwnerUserID = 2;
|
||||||
string OperationID = 3;
|
int32 notificationType = 3;
|
||||||
|
string OperationID = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message BatchSetConversationsResp{
|
message BatchSetConversationsResp{
|
||||||
|
@ -77,7 +77,7 @@ func OperationIDGenerator() string {
|
|||||||
return strconv.FormatInt(time.Now().UnixNano()+int64(rand.Uint32()), 10)
|
return strconv.FormatInt(time.Now().UnixNano()+int64(rand.Uint32()), 10)
|
||||||
}
|
}
|
||||||
|
|
||||||
func RemoveUserIDRepByMap(slc []string) []string {
|
func RemoveRepeatedStringInList(slc []string) []string {
|
||||||
var result []string
|
var result []string
|
||||||
tempMap := map[string]byte{}
|
tempMap := map[string]byte{}
|
||||||
for _, e := range slc {
|
for _, e := range slc {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user