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