You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.4 KiB
58 lines
1.4 KiB
4 months ago
|
package controller
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"tyj_admin/api/v1/game"
|
||
|
"tyj_admin/internal/model/entity"
|
||
|
"tyj_admin/internal/serviceGame"
|
||
|
)
|
||
|
|
||
|
var GameCorn = cornController{}
|
||
|
|
||
|
type cornController struct {
|
||
|
BaseController
|
||
|
}
|
||
|
|
||
|
func (c *cornController) Get(ctx context.Context, req *game.GetCronReq) (res *game.GetCronRes, err error) {
|
||
|
res, err = serviceGame.GameCron().GetCron(req)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (c *cornController) Add(ctx context.Context, req *game.AddCronReq) (res *game.AddCronRes, err error) {
|
||
|
serviceGame.GameCron().AddCron(entity.GameNoticeLog{
|
||
|
Id: req.Id,
|
||
|
Content: req.Content,
|
||
|
NoticeType: req.NoticeType,
|
||
|
NoticeId: req.NoticeId,
|
||
|
Channel: req.Channel,
|
||
|
SendTime: req.SendTime,
|
||
|
})
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (c *cornController) GetMail(ctx context.Context, req *game.GetMailCronReq) (res *game.GetMailCronRes, err error) {
|
||
|
res, err = serviceGame.GameCron().GetMailCron(req)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (c *cornController) AddMail(ctx context.Context, req *game.AddMailCronReq) (res *game.AddMailCronRes, err error) {
|
||
|
serviceGame.GameCron().AddMailCorn(entity.Mail{
|
||
|
//To: req.To,
|
||
|
Id: req.Id,
|
||
|
ServerId: req.ServerId,
|
||
|
From: req.From,
|
||
|
Type: req.Type,
|
||
|
Expired: req.Expired,
|
||
|
ValidDay: req.ValidDay,
|
||
|
Send: req.Send,
|
||
|
Time: req.Time,
|
||
|
NewGet: req.NewGet,
|
||
|
Title: req.Title,
|
||
|
//Greetings: req.Greetings,
|
||
|
Content: req.Content,
|
||
|
Drops: req.Drops,
|
||
|
OwnerId: req.OwnerId,
|
||
|
})
|
||
|
return
|
||
|
}
|