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.
33 lines
815 B
33 lines
815 B
2 years ago
|
package controller
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"fmt"
|
||
|
"tyj_admin/api/v1/game"
|
||
|
"tyj_admin/internal/serviceGame"
|
||
|
"tyj_admin/library/libUtils"
|
||
|
)
|
||
|
|
||
|
var GameNotice = noticeController{}
|
||
|
|
||
|
type noticeController struct {
|
||
|
BaseController
|
||
|
}
|
||
|
|
||
|
func (c *noticeController) Add(ctx context.Context, req *game.AddNoticeReq) (res *game.AddNoticeRes, err error) {
|
||
|
res, err = serviceGame.GameNotice().AddNotice(ctx, req)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (c *noticeController) Get(ctx context.Context, req *game.GetNoticeReq) (res *game.GetNoticeRes, err error) {
|
||
|
ip := libUtils.GetClientIp(ctx)
|
||
|
fmt.Println(ip)
|
||
|
res, err = serviceGame.GameNotice().GetNotice(ctx, req)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (c *noticeController) PopNotice(ctx context.Context, req *game.PopReq) (res *game.PopRes, err error) {
|
||
|
res, err = serviceGame.GameNotice().PopNotice(ctx, req)
|
||
|
return
|
||
|
}
|