62 lines
1.8 KiB
Go
62 lines
1.8 KiB
Go
// 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/imkafkacommand"
|
|
"hotgo/internal/model/input/sysin"
|
|
"hotgo/internal/service"
|
|
)
|
|
|
|
var ImKafkaCommand = cImKafkaCommand{}
|
|
|
|
type cImKafkaCommand struct{}
|
|
|
|
func (c *cImKafkaCommand) List(ctx context.Context, req *imkafkacommand.ListReq) (res *imkafkacommand.ListRes, err error) {
|
|
list, totalCount, err := service.SysImKafkaCommand().List(ctx, &req.ImKafkaCommandListInp)
|
|
if err != nil {
|
|
return
|
|
}
|
|
if list == nil {
|
|
list = []*sysin.ImKafkaCommandListModel{}
|
|
}
|
|
res = new(imkafkacommand.ListRes)
|
|
res.List = list
|
|
res.PageRes.Pack(req, totalCount)
|
|
return
|
|
}
|
|
|
|
func (c *cImKafkaCommand) View(ctx context.Context, req *imkafkacommand.ViewReq) (res *imkafkacommand.ViewRes, err error) {
|
|
data, err := service.SysImKafkaCommand().View(ctx, &req.ImKafkaCommandViewInp)
|
|
if err != nil {
|
|
return
|
|
}
|
|
res = new(imkafkacommand.ViewRes)
|
|
res.ImKafkaCommandViewModel = data
|
|
return
|
|
}
|
|
|
|
func (c *cImKafkaCommand) CacheInvalidate(ctx context.Context, req *imkafkacommand.CacheInvalidateReq) (res *imkafkacommand.CacheInvalidateRes, err error) {
|
|
data, err := service.SysImKafkaCommand().CacheInvalidate(ctx, &req.ImKafkaCacheInvalidateInp)
|
|
if err != nil {
|
|
return
|
|
}
|
|
res = new(imkafkacommand.CacheInvalidateRes)
|
|
res.ImKafkaEventModel = data
|
|
return
|
|
}
|
|
|
|
func (c *cImKafkaCommand) WorkbenchEvent(ctx context.Context, req *imkafkacommand.WorkbenchEventReq) (res *imkafkacommand.WorkbenchEventRes, err error) {
|
|
data, err := service.SysImKafkaCommand().WorkbenchEvent(ctx, &req.ImKafkaWorkbenchEventInp)
|
|
if err != nil {
|
|
return
|
|
}
|
|
res = new(imkafkacommand.WorkbenchEventRes)
|
|
res.ImKafkaEventModel = data
|
|
return
|
|
}
|