Files
open-im-server/internal/api/group.go
T

117 lines
3.3 KiB
Go
Raw Normal View History

2023-02-28 14:20:26 +08:00
package api
2021-06-28 15:27:35 +08:00
2023-02-27 18:11:00 +08:00
import (
2023-03-17 11:27:34 +08:00
"github.com/OpenIMSDK/Open-IM-Server/pkg/a2r"
2023-03-16 10:46:06 +08:00
"github.com/OpenIMSDK/Open-IM-Server/pkg/discoveryregistry"
"github.com/OpenIMSDK/Open-IM-Server/pkg/proto/group"
2023-06-20 22:12:01 +08:00
"github.com/OpenIMSDK/Open-IM-Server/pkg/rpcclient"
2023-03-08 17:29:03 +08:00
2023-02-27 18:11:00 +08:00
"github.com/gin-gonic/gin"
)
2021-06-28 15:27:35 +08:00
2023-06-20 22:12:01 +08:00
type GroupApi rpcclient.Group
2023-02-27 18:11:00 +08:00
2023-06-20 22:12:01 +08:00
func NewGroupApi(discov discoveryregistry.SvcDiscoveryRegistry) GroupApi {
return GroupApi(*rpcclient.NewGroup(discov))
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) CreateGroup(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.CreateGroup, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) SetGroupInfo(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.SetGroupInfo, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) JoinGroup(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.JoinGroup, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) QuitGroup(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.QuitGroup, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) ApplicationGroupResponse(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.GroupApplicationResponse, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) TransferGroupOwner(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.TransferGroupOwner, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) GetRecvGroupApplicationList(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.GetGroupApplicationList, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) GetUserReqGroupApplicationList(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.GetUserReqApplicationList, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) GetGroupsInfo(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.GetGroupsInfo, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) KickGroupMember(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.KickGroupMember, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) GetGroupMembersInfo(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.GetGroupMembersInfo, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) GetGroupMemberList(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.GetGroupMemberList, o.Client, c)
2023-04-12 18:16:02 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) InviteUserToGroup(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.InviteUserToGroup, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) GetJoinedGroupList(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.GetJoinedGroupList, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) DismissGroup(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.DismissGroup, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) MuteGroupMember(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.MuteGroupMember, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) CancelMuteGroupMember(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.CancelMuteGroupMember, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) MuteGroup(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.MuteGroup, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) CancelMuteGroup(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.CancelMuteGroup, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) SetGroupMemberInfo(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.SetGroupMemberInfo, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) GetGroupAbstractInfo(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.GetGroupAbstractInfo, o.Client, c)
2023-02-27 18:11:00 +08:00
}
//func (g *Group) SetGroupMemberNickname(c *gin.Context) {
2023-06-20 17:03:20 +08:00
// a2r.Call(group.GroupClient.SetGroupMemberNickname, g.userClient, c)
2023-02-09 14:33:35 +08:00
//}
//
2023-02-27 18:11:00 +08:00
//func (g *Group) GetGroupAllMemberList(c *gin.Context) {
2023-06-20 17:03:20 +08:00
// a2r.Call(group.GroupClient.GetGroupAllMember, g.userClient, c)
2023-01-09 18:01:41 +08:00
//}
2023-02-27 18:11:00 +08:00
2023-06-20 22:12:01 +08:00
func (o *GroupApi) GetJoinedSuperGroupList(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.GetJoinedSuperGroupList, o.Client, c)
2023-02-27 18:11:00 +08:00
}
2023-06-20 22:12:01 +08:00
func (o *GroupApi) GetSuperGroupsInfo(c *gin.Context) {
2023-06-20 21:15:23 +08:00
a2r.Call(group.GroupClient.GetSuperGroupsInfo, o.Client, c)
2023-02-27 18:11:00 +08:00
}