56 lines
1.4 KiB
Go
56 lines
1.4 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/imoutbox"
|
|
"hotgo/internal/model/input/sysin"
|
|
"hotgo/internal/service"
|
|
)
|
|
|
|
var (
|
|
ImOutbox = cImOutbox{}
|
|
)
|
|
|
|
type cImOutbox struct{}
|
|
|
|
func (c *cImOutbox) List(ctx context.Context, req *imoutbox.ListReq) (res *imoutbox.ListRes, err error) {
|
|
list, totalCount, err := service.SysImOutbox().List(ctx, &req.ImOutboxListInp)
|
|
if err != nil {
|
|
return
|
|
}
|
|
if list == nil {
|
|
list = []*sysin.ImOutboxListModel{}
|
|
}
|
|
|
|
res = new(imoutbox.ListRes)
|
|
res.List = list
|
|
res.PageRes.Pack(req, totalCount)
|
|
return
|
|
}
|
|
|
|
func (c *cImOutbox) View(ctx context.Context, req *imoutbox.ViewReq) (res *imoutbox.ViewRes, err error) {
|
|
data, err := service.SysImOutbox().View(ctx, &req.ImOutboxViewInp)
|
|
if err != nil {
|
|
return
|
|
}
|
|
|
|
res = new(imoutbox.ViewRes)
|
|
res.ImOutboxViewModel = data
|
|
return
|
|
}
|
|
|
|
func (c *cImOutbox) Retry(ctx context.Context, req *imoutbox.RetryReq) (res *imoutbox.RetryRes, err error) {
|
|
err = service.SysImOutbox().Retry(ctx, &req.ImOutboxActionInp)
|
|
return
|
|
}
|
|
|
|
func (c *cImOutbox) Dead(ctx context.Context, req *imoutbox.DeadReq) (res *imoutbox.DeadRes, err error) {
|
|
err = service.SysImOutbox().Dead(ctx, &req.ImOutboxActionInp)
|
|
return
|
|
}
|