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.
43 lines
1.5 KiB
43 lines
1.5 KiB
4 months ago
|
package serviceGame
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"log"
|
||
|
"tyj_admin/api/v1/game"
|
||
|
"tyj_admin/internal/serviceGame/internal"
|
||
|
)
|
||
|
|
||
|
type IGameMonthlyLottery interface {
|
||
|
Get(ctx context.Context, req *game.GetMonthlyLotteryReq) (res *game.GetMonthlyLotteryRes, err error)
|
||
|
Update(ctx context.Context, req *game.UpdateMonthlyLotteryReq) (res *game.UpdateMonthlyLotteryRes, err error)
|
||
|
Insert(ctx context.Context, req *game.InsertMonthlyLotteryReq) (res *game.InsertMonthlyLotteryRes, err error)
|
||
|
}
|
||
|
|
||
|
type gameMonthlyLotteryImpl struct {
|
||
|
}
|
||
|
|
||
|
var gameMonthlyLotteryService = gameMonthlyLotteryImpl{}
|
||
|
|
||
|
func GameMonthlyLottery() IGameMonthlyLottery {
|
||
|
return &gameMonthlyLotteryService
|
||
|
}
|
||
|
|
||
|
func (g *gameMonthlyLotteryImpl) Get(ctx context.Context, req *game.GetMonthlyLotteryReq) (res *game.GetMonthlyLotteryRes, err error) {
|
||
|
res = new(game.GetMonthlyLotteryRes)
|
||
|
res.MonthlyLottery, err = internal.GetMonthlyLottery(ctx, req.Date)
|
||
|
log.Print("res.MonthlyEvent: ", res.MonthlyLottery)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (g *gameMonthlyLotteryImpl) Update(ctx context.Context, req *game.UpdateMonthlyLotteryReq) (res *game.UpdateMonthlyLotteryRes, err error) {
|
||
|
err = internal.UpdateMonthlyLottery(ctx, req.MonthlyLottery)
|
||
|
log.Print("UpdateMonthlyEvent", err)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (g *gameMonthlyLotteryImpl) Insert(ctx context.Context, req *game.InsertMonthlyLotteryReq) (res *game.InsertMonthlyLotteryRes, err error) {
|
||
|
err = internal.InsertMonthlyLottery(ctx, req.MonthlyLottery)
|
||
|
//log.Print("insertMonthlyEvent", err)
|
||
|
return
|
||
|
}
|