feat: 实现平台抽成、提现审批、异步任务集成及安全审计功能
This commit is contained in:
@@ -6,15 +6,19 @@ import (
|
||||
|
||||
"quyun/v2/app/errorx"
|
||||
user_dto "quyun/v2/app/http/v1/dto"
|
||||
"quyun/v2/app/jobs/args"
|
||||
"quyun/v2/app/requests"
|
||||
"quyun/v2/database/models"
|
||||
"quyun/v2/pkg/consts"
|
||||
"quyun/v2/providers/job"
|
||||
|
||||
"github.com/spf13/cast"
|
||||
)
|
||||
|
||||
// @provider
|
||||
type notification struct{}
|
||||
type notification struct {
|
||||
job *job.Job
|
||||
}
|
||||
|
||||
func (s *notification) List(ctx context.Context, page int, typeArg string) (*requests.Pager, error) {
|
||||
userID := ctx.Value(consts.CtxKeyUser)
|
||||
@@ -79,13 +83,12 @@ func (s *notification) MarkRead(ctx context.Context, id string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s *notification) Send(ctx context.Context, userID int64, typ string, title, content string) error {
|
||||
n := &models.Notification{
|
||||
func (s *notification) Send(ctx context.Context, userID int64, typ, title, content string) error {
|
||||
arg := args.NotificationArgs{
|
||||
UserID: userID,
|
||||
Type: typ,
|
||||
Title: title,
|
||||
Content: content,
|
||||
IsRead: false,
|
||||
}
|
||||
return models.NotificationQuery.WithContext(ctx).Create(n)
|
||||
return s.job.Add(arg)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user