mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-23 18:00:32 +08:00
callback kickoff
This commit is contained in:
parent
c4084cbcec
commit
aa7ba6d659
@ -18,10 +18,10 @@ import (
|
|||||||
"github.com/gin-gonic/gin"
|
"github.com/gin-gonic/gin"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetGroupById(c *gin.Context) {
|
func GetGroupByID(c *gin.Context) {
|
||||||
var (
|
var (
|
||||||
req cms_api_struct.GetGroupByIdRequest
|
req cms_api_struct.GetGroupByIDRequest
|
||||||
resp cms_api_struct.GetGroupByIdResponse
|
resp cms_api_struct.GetGroupByIDResponse
|
||||||
reqPb pbGroup.GetGroupByIdReq
|
reqPb pbGroup.GetGroupByIdReq
|
||||||
)
|
)
|
||||||
if err := c.ShouldBindQuery(&req); err != nil {
|
if err := c.ShouldBindQuery(&req); err != nil {
|
||||||
@ -31,7 +31,7 @@ func GetGroupById(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
reqPb.OperationID = utils.OperationIDGenerator()
|
reqPb.OperationID = utils.OperationIDGenerator()
|
||||||
log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req)
|
log.NewInfo(reqPb.OperationID, utils.GetSelfFuncName(), "req: ", req)
|
||||||
reqPb.GroupId = req.GroupId
|
reqPb.GroupID = req.GroupID
|
||||||
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID)
|
etcdConn := getcdv3.GetConn(config.Config.Etcd.EtcdSchema, strings.Join(config.Config.Etcd.EtcdAddr, ","), config.Config.RpcRegisterName.OpenImGroupName, reqPb.OperationID)
|
||||||
if etcdConn == nil {
|
if etcdConn == nil {
|
||||||
errMsg := reqPb.OperationID + "getcdv3.GetConn == nil"
|
errMsg := reqPb.OperationID + "getcdv3.GetConn == nil"
|
||||||
@ -40,19 +40,13 @@ func GetGroupById(c *gin.Context) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
client := pbGroup.NewGroupClient(etcdConn)
|
client := pbGroup.NewGroupClient(etcdConn)
|
||||||
respPb, err := client.GetGroupById(context.Background(), &reqPb)
|
respPb, err := client.GetGroupByID(context.Background(), &reqPb)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroupById failed ", err.Error())
|
log.NewError(reqPb.OperationID, utils.GetSelfFuncName(), "GetGroupById failed ", err.Error())
|
||||||
openIMHttp.RespHttp200(c, err, nil)
|
openIMHttp.RespHttp200(c, err, nil)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
resp.GroupName = respPb.CMSGroup.GroupInfo.GroupName
|
utils.CopyStructFields(&resp, respPb)
|
||||||
resp.GroupID = respPb.CMSGroup.GroupInfo.GroupID
|
|
||||||
resp.CreateTime = (utils.UnixSecondToTime(int64(respPb.CMSGroup.GroupInfo.CreateTime))).String()
|
|
||||||
resp.ProfilePhoto = respPb.CMSGroup.GroupInfo.FaceURL
|
|
||||||
resp.GroupMasterName = respPb.CMSGroup.GroupMasterName
|
|
||||||
resp.GroupMasterId = respPb.CMSGroup.GroupMasterId
|
|
||||||
resp.IsBanChat = constant.GroupIsBanChat(respPb.CMSGroup.GroupInfo.Status)
|
|
||||||
log.NewInfo("", utils.GetSelfFuncName(), "req: ", resp)
|
log.NewInfo("", utils.GetSelfFuncName(), "req: ", resp)
|
||||||
openIMHttp.RespHttp200(c, constant.OK, resp)
|
openIMHttp.RespHttp200(c, constant.OK, resp)
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ func NewGinRouter() *gin.Engine {
|
|||||||
}
|
}
|
||||||
groupRouterGroup := r2.Group("/group")
|
groupRouterGroup := r2.Group("/group")
|
||||||
{
|
{
|
||||||
groupRouterGroup.GET("/get_group_by_id", group.GetGroupById)
|
groupRouterGroup.GET("/get_group_by_id", group.GetGroupByID)
|
||||||
groupRouterGroup.GET("/get_groups", group.GetGroups)
|
groupRouterGroup.GET("/get_groups", group.GetGroups)
|
||||||
groupRouterGroup.GET("/get_group_by_name", group.GetGroupByName)
|
groupRouterGroup.GET("/get_group_by_name", group.GetGroupByName)
|
||||||
groupRouterGroup.GET("/get_group_members", group.GetGroupMembers)
|
groupRouterGroup.GET("/get_group_members", group.GetGroupMembers)
|
||||||
|
@ -1,21 +1,18 @@
|
|||||||
package cms_api_struct
|
package cms_api_struct
|
||||||
|
|
||||||
|
import server_api_params "Open_IM/pkg/proto/sdk_ws"
|
||||||
|
|
||||||
type GroupResponse struct {
|
type GroupResponse struct {
|
||||||
GroupName string `json:"group_name"`
|
GroupOwnerName string `json:"GroupOwnerName"`
|
||||||
GroupID string `json:"group_id"`
|
GroupOwnerID string `json:"GroupOwnerID"`
|
||||||
GroupMasterName string `json:"group_master_name"`
|
*server_api_params.GroupInfo
|
||||||
GroupMasterId string `json:"group_master_id"`
|
|
||||||
CreateTime string `json:"create_time"`
|
|
||||||
IsBanChat bool `json:"is_ban_chat"`
|
|
||||||
IsBanPrivateChat bool `json:"is_ban_private_chat"`
|
|
||||||
ProfilePhoto string `json:"profile_photo"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetGroupByIdRequest struct {
|
type GetGroupByIDRequest struct {
|
||||||
GroupId string `form:"group_id" binding:"required"`
|
GroupID string `form:"groupID" binding:"required"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetGroupByIdResponse struct {
|
type GetGroupByIDResponse struct {
|
||||||
GroupResponse
|
GroupResponse
|
||||||
}
|
}
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -215,8 +215,8 @@ message GetGroupAllMemberResp {
|
|||||||
|
|
||||||
message CMSGroup {
|
message CMSGroup {
|
||||||
server_api_params.GroupInfo GroupInfo = 1;
|
server_api_params.GroupInfo GroupInfo = 1;
|
||||||
string GroupMasterName = 2;
|
string GroupOwnerUserName = 2;
|
||||||
string GroupMasterId = 3;
|
string GroupOwnerUserID = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetGroupReq {
|
message GetGroupReq {
|
||||||
@ -243,12 +243,12 @@ message GetGroupsResp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message GetGroupMemberReq {
|
message GetGroupMemberReq {
|
||||||
string GroupId = 1;
|
string GroupID = 1;
|
||||||
string OperationID = 2;
|
string OperationID = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message OperateGroupStatusReq {
|
message OperateGroupStatusReq {
|
||||||
string GroupId = 1;
|
string GroupID = 1;
|
||||||
int32 Status = 2;
|
int32 Status = 2;
|
||||||
string OperationID = 3;
|
string OperationID = 3;
|
||||||
}
|
}
|
||||||
@ -258,8 +258,8 @@ message OperateGroupStatusResp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message OperateUserRoleReq {
|
message OperateUserRoleReq {
|
||||||
string GroupId = 1;
|
string GroupID = 1;
|
||||||
string UserId = 2;
|
string UserID = 2;
|
||||||
int32 RoleLevel = 3;
|
int32 RoleLevel = 3;
|
||||||
string OperationID = 4;
|
string OperationID = 4;
|
||||||
}
|
}
|
||||||
@ -269,7 +269,7 @@ message OperateUserRoleResp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message DeleteGroupReq {
|
message DeleteGroupReq {
|
||||||
string GroupId = 1;
|
string GroupID = 1;
|
||||||
string OperationID = 2;
|
string OperationID = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,17 +277,17 @@ message DeleteGroupResp {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetGroupByIdReq {
|
message GetGroupByIDReq {
|
||||||
string GroupId = 1;
|
string GroupID = 1;
|
||||||
string OperationID = 2;
|
string OperationID = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetGroupByIdResp {
|
message GetGroupByIDResp {
|
||||||
CMSGroup CMSGroup = 1;
|
CMSGroup CMSGroup = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetGroupMembersCMSReq {
|
message GetGroupMembersCMSReq {
|
||||||
string GroupId = 1;
|
string GroupID = 1;
|
||||||
string UserName = 2;
|
string UserName = 2;
|
||||||
server_api_params.RequestPagination Pagination = 3;
|
server_api_params.RequestPagination Pagination = 3;
|
||||||
string OperationID = 4;
|
string OperationID = 4;
|
||||||
@ -300,10 +300,10 @@ message GetGroupMembersCMSResp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message RemoveGroupMembersCMSReq {
|
message RemoveGroupMembersCMSReq {
|
||||||
string GroupId = 1;
|
string GroupID = 1;
|
||||||
repeated string UserIds = 2;
|
repeated string UserIDList = 2;
|
||||||
string OperationID = 3;
|
string OperationID = 3;
|
||||||
string OpUserId = 4;
|
string OpUserID = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message RemoveGroupMembersCMSResp {
|
message RemoveGroupMembersCMSResp {
|
||||||
@ -312,10 +312,10 @@ message RemoveGroupMembersCMSResp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message AddGroupMembersCMSReq {
|
message AddGroupMembersCMSReq {
|
||||||
string GroupId = 1;
|
string GroupID = 1;
|
||||||
repeated string UserIds = 2;
|
repeated string UserIDList = 2;
|
||||||
string OperationId = 3;
|
string OperationID = 3;
|
||||||
string OpUserId = 4;
|
string OpUserID = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AddGroupMembersCMSResp {
|
message AddGroupMembersCMSResp {
|
||||||
@ -463,7 +463,7 @@ service group{
|
|||||||
rpc inviteUserToGroup(InviteUserToGroupReq) returns (InviteUserToGroupResp);
|
rpc inviteUserToGroup(InviteUserToGroupReq) returns (InviteUserToGroupResp);
|
||||||
rpc getGroupAllMember(GetGroupAllMemberReq) returns(GetGroupAllMemberResp);
|
rpc getGroupAllMember(GetGroupAllMemberReq) returns(GetGroupAllMemberResp);
|
||||||
|
|
||||||
rpc GetGroupById(GetGroupByIdReq) returns(GetGroupByIdResp);
|
rpc GetGroupById(GetGroupByIDReq) returns(GetGroupByIDResp);
|
||||||
rpc GetGroup(GetGroupReq) returns(GetGroupResp);
|
rpc GetGroup(GetGroupReq) returns(GetGroupResp);
|
||||||
rpc GetGroups(GetGroupsReq) returns(GetGroupsResp);
|
rpc GetGroups(GetGroupsReq) returns(GetGroupsResp);
|
||||||
rpc OperateGroupStatus(OperateGroupStatusReq) returns(OperateGroupStatusResp);
|
rpc OperateGroupStatus(OperateGroupStatusReq) returns(OperateGroupStatusResp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user