feat: add IM admin P1 operations
This commit is contained in:
@@ -0,0 +1,46 @@
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/imexternalconfig"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
var ImExternalConfig = cImExternalConfig{}
|
||||
|
||||
type cImExternalConfig struct{}
|
||||
|
||||
func (c *cImExternalConfig) List(ctx context.Context, req *imexternalconfig.ListReq) (res *imexternalconfig.ListRes, err error) {
|
||||
list, totalCount, err := service.SysImExternalConfig().List(ctx, &req.ImExternalConfigListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if list == nil {
|
||||
list = []*sysin.ImExternalConfigListModel{}
|
||||
}
|
||||
res = new(imexternalconfig.ListRes)
|
||||
res.List = list
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *cImExternalConfig) View(ctx context.Context, req *imexternalconfig.ViewReq) (res *imexternalconfig.ViewRes, err error) {
|
||||
data, err := service.SysImExternalConfig().View(ctx, &req.ImExternalConfigViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
res = new(imexternalconfig.ViewRes)
|
||||
res.ImExternalConfigViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
func (c *cImExternalConfig) Update(ctx context.Context, req *imexternalconfig.UpdateReq) (res *imexternalconfig.UpdateRes, err error) {
|
||||
err = service.SysImExternalConfig().Update(ctx, &req.ImExternalConfigUpdateInp)
|
||||
return
|
||||
}
|
||||
|
||||
func (c *cImExternalConfig) Check(ctx context.Context, req *imexternalconfig.CheckReq) (res *imexternalconfig.CheckRes, err error) {
|
||||
err = service.SysImExternalConfig().Check(ctx, &req.ImExternalConfigCheckInp)
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
// 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/imfile"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
var (
|
||||
ImFile = cImFile{}
|
||||
)
|
||||
|
||||
type cImFile struct{}
|
||||
|
||||
// List 查看IM文件列表
|
||||
func (c *cImFile) List(ctx context.Context, req *imfile.ListReq) (res *imfile.ListRes, err error) {
|
||||
list, totalCount, err := service.SysImFile().List(ctx, &req.ImFileListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if list == nil {
|
||||
list = []*sysin.ImFileListModel{}
|
||||
}
|
||||
res = new(imfile.ListRes)
|
||||
res.List = list
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
|
||||
// View 获取IM文件详情
|
||||
func (c *cImFile) View(ctx context.Context, req *imfile.ViewReq) (res *imfile.ViewRes, err error) {
|
||||
data, err := service.SysImFile().View(ctx, &req.ImFileViewInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
res = new(imfile.ViewRes)
|
||||
res.ImFileViewModel = data
|
||||
return
|
||||
}
|
||||
|
||||
// Quarantine 隔离IM文件
|
||||
func (c *cImFile) Quarantine(ctx context.Context, req *imfile.QuarantineReq) (res *imfile.QuarantineRes, err error) {
|
||||
err = service.SysImFile().Quarantine(ctx, &req.ImFileActionInp)
|
||||
return
|
||||
}
|
||||
|
||||
// Delete 删除IM文件
|
||||
func (c *cImFile) Delete(ctx context.Context, req *imfile.DeleteReq) (res *imfile.DeleteRes, err error) {
|
||||
err = service.SysImFile().Delete(ctx, &req.ImFileActionInp)
|
||||
return
|
||||
}
|
||||
|
||||
// CleanupOrphan 清理IM孤儿文件
|
||||
func (c *cImFile) CleanupOrphan(ctx context.Context, req *imfile.CleanupOrphanReq) (res *imfile.CleanupOrphanRes, err error) {
|
||||
data, err := service.SysImFile().CleanupOrphan(ctx, &req.ImFileCleanupOrphanInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
res = new(imfile.CleanupOrphanRes)
|
||||
res.ImFileCleanupOrphanModel = data
|
||||
return
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package sys
|
||||
|
||||
import (
|
||||
"context"
|
||||
"hotgo/api/admin/imtaskdashboard"
|
||||
"hotgo/internal/model/input/sysin"
|
||||
"hotgo/internal/service"
|
||||
)
|
||||
|
||||
var ImTaskDashboard = cImTaskDashboard{}
|
||||
|
||||
type cImTaskDashboard struct{}
|
||||
|
||||
func (c *cImTaskDashboard) List(ctx context.Context, req *imtaskdashboard.ListReq) (res *imtaskdashboard.ListRes, err error) {
|
||||
list, totalCount, err := service.SysImTaskDashboard().List(ctx, &req.ImTaskDashboardListInp)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
if list == nil {
|
||||
list = []*sysin.ImTaskDashboardListModel{}
|
||||
}
|
||||
res = new(imtaskdashboard.ListRes)
|
||||
res.List = list
|
||||
res.PageRes.Pack(req, totalCount)
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user