feat: add IM admin management
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
// Package sys
|
||||
// @Link https://github.com/bufanyun/hotgo
|
||||
// @Copyright Copyright (c) 2026 HotGo
|
||||
// @Author Ms <133814250@qq.com>
|
||||
// @License https://github.com/bufanyun/hotgo/blob/master/LICENSE
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/imtenant"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
var (
|
||||
ImTenant = cImTenant{}
|
||||
)
|
||||
|
||||
type cImTenant struct{}
|
||||
|
||||
// List 查看IM租户列表
|
||||
func (c *cImTenant) List(ctx context.Context, req *imtenant.ListReq) (res *imtenant.ListRes, err error) {
|
||||
list, totalCount, err := service.SysImTenant().List(ctx, &req.ImTenantListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if list == nil {
|
||||
list = []*sysin.ImTenantListModel{}
|
||||
}
|
||||
|
||||
res = new(imtenant.ListRes)
|
||||
res.List = list
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// Edit 更新IM租户
|
||||
func (c *cImTenant) Edit(ctx context.Context, req *imtenant.EditReq) (res *imtenant.EditRes, err error) {
|
||||
err = service.SysImTenant().Edit(ctx, &req.ImTenantEditInp)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取指定IM租户信息
|
||||
func (c *cImTenant) View(ctx context.Context, req *imtenant.ViewReq) (res *imtenant.ViewRes, err error) {
|
||||
data, err := service.SysImTenant().View(ctx, &req.ImTenantViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
res = new(imtenant.ViewRes)
|
||||
res.ImTenantViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// Status 更新IM租户状态
|
||||
func (c *cImTenant) Status(ctx context.Context, req *imtenant.StatusReq) (res *imtenant.StatusRes, err error) {
|
||||
err = service.SysImTenant().Status(ctx, &req.ImTenantStatusInp)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user