54 lines
2.0 KiB
Go
54 lines
2.0 KiB
Go
|
// ==========================================================================
|
|||
|
// GFast自动生成controller操作代码。
|
|||
|
// 生成日期:2024-04-11 16:58:12
|
|||
|
// 生成路径: internal/app/system/controller/notification_recipients.go
|
|||
|
// 生成人:gfast
|
|||
|
// desc:通知接收
|
|||
|
// company:云南奇讯科技有限公司
|
|||
|
// ==========================================================================
|
|||
|
|
|||
|
package controller
|
|||
|
|
|||
|
import (
|
|||
|
"context"
|
|||
|
"github.com/tiger1103/gfast/v3/api/v1/system"
|
|||
|
"github.com/tiger1103/gfast/v3/internal/app/system/service"
|
|||
|
)
|
|||
|
|
|||
|
type notificationRecipientsController struct {
|
|||
|
BaseController
|
|||
|
}
|
|||
|
|
|||
|
var NotificationRecipients = new(notificationRecipientsController)
|
|||
|
|
|||
|
// List 列表
|
|||
|
func (c *notificationRecipientsController) List(ctx context.Context, req *system.NotificationRecipientsSearchReq) (res *system.NotificationRecipientsSearchRes, err error) {
|
|||
|
res, err = service.NotificationRecipients().List(ctx, req)
|
|||
|
return
|
|||
|
}
|
|||
|
|
|||
|
// Get 获取通知接收
|
|||
|
func (c *notificationRecipientsController) Get(ctx context.Context, req *system.NotificationRecipientsGetReq) (res *system.NotificationRecipientsGetRes, err error) {
|
|||
|
res = new(system.NotificationRecipientsGetRes)
|
|||
|
res.NotificationRecipientsInfoRes, err = service.NotificationRecipients().GetById(ctx, req.Id)
|
|||
|
return
|
|||
|
}
|
|||
|
|
|||
|
// Add 添加通知接收
|
|||
|
func (c *notificationRecipientsController) Add(ctx context.Context, req *system.NotificationRecipientsAddReq) (res *system.NotificationRecipientsAddRes, err error) {
|
|||
|
err = service.NotificationRecipients().Add(ctx, req)
|
|||
|
return
|
|||
|
}
|
|||
|
|
|||
|
// Edit 修改通知接收
|
|||
|
func (c *notificationRecipientsController) Edit(ctx context.Context, req *system.NotificationRecipientsEditReq) (res *system.NotificationRecipientsEditRes, err error) {
|
|||
|
err = service.NotificationRecipients().Edit(ctx, req)
|
|||
|
return
|
|||
|
}
|
|||
|
|
|||
|
// Delete 删除通知接收
|
|||
|
func (c *notificationRecipientsController) Delete(ctx context.Context, req *system.NotificationRecipientsDeleteReq) (res *system.NotificationRecipientsDeleteRes, err error) {
|
|||
|
err = service.NotificationRecipients().Delete(ctx, req.Ids)
|
|||
|
return
|
|||
|
}
|