|
|
|
package controller
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"fmt"
|
|
|
|
"tyj_admin/api/v1/game"
|
|
|
|
"tyj_admin/internal/serviceGame"
|
|
|
|
)
|
|
|
|
|
|
|
|
var GameMail = mailController{}
|
|
|
|
|
|
|
|
type mailController struct {
|
|
|
|
BaseController
|
|
|
|
}
|
|
|
|
|
|
|
|
// mail 列表
|
|
|
|
func (c *mailController) MailList(ctx context.Context, req *game.MailsSearchReq) (res *game.MailsSearchRes, err error) {
|
|
|
|
res, err = serviceGame.GameMail().GetMailList(ctx, req)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *mailController) SendMail(ctx context.Context, req *game.MailSendReq) (res *game.MailSendRes, err error) {
|
|
|
|
res, err = serviceGame.GameMail().SendMail(ctx, req)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *mailController) DelMail(ctx context.Context, req *game.MailDelReq) (res *game.MailDelRes, err error) {
|
|
|
|
res, err = serviceGame.GameMail().DelMail(ctx, req)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *mailController) UpdateMail(ctx context.Context, req *game.MailUpdateReq) (res *game.MailUpdateRes, err error) {
|
|
|
|
res, err = serviceGame.GameMail().UpdateMail(ctx, req)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
type Model struct {
|
|
|
|
Id int32
|
|
|
|
Name string
|
|
|
|
Title string
|
|
|
|
To string
|
|
|
|
//Greetings string
|
|
|
|
Content string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *mailController) GetMailModel(ctx context.Context, req *game.GetMailDropModelReq) (res *game.GetMailDropModelRes, err error) {
|
|
|
|
res, err = serviceGame.GameMail().GetMailModel(ctx, req)
|
|
|
|
fmt.Println(res.Model)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *mailController) UpdateMailModel(ctx context.Context, req *game.UpdateMailDropModelReq) (res *game.UpdateMailDropModelRes, err error) {
|
|
|
|
res, err = serviceGame.GameMail().UpdateMailModel(ctx, req)
|
|
|
|
return
|
|
|
|
}
|