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.
50 lines
1.8 KiB
50 lines
1.8 KiB
4 months ago
|
package serviceGame
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"log"
|
||
|
"tyj_admin/api/v1/game"
|
||
|
"tyj_admin/internal/serviceGame/internal"
|
||
|
)
|
||
|
|
||
|
type IGamePropExchange interface {
|
||
|
Get(ctx context.Context, req *game.GetPropExchangeReq) (res *game.GetPropExchangeRes, err error)
|
||
|
Update(ctx context.Context, req *game.UpdatePropExchangeReq) (res *game.UpdatePropExchangeRes, err error)
|
||
|
Insert(ctx context.Context, req *game.InsertPropExchangeReq) (res *game.InsertPropExchangeRes, err error)
|
||
|
Check(ctx context.Context, req *game.CheckPropExchangeReq) (res *game.CheckPropExchangeRes, err error)
|
||
|
}
|
||
|
|
||
|
type gamePropExchangeImpl struct {
|
||
|
}
|
||
|
|
||
|
var gamePropExchangeService = gamePropExchangeImpl{}
|
||
|
|
||
|
func GamePropExchange() IGamePropExchange {
|
||
|
return &gamePropExchangeService
|
||
|
}
|
||
|
|
||
|
func (g *gamePropExchangeImpl) Get(ctx context.Context, req *game.GetPropExchangeReq) (res *game.GetPropExchangeRes, err error) {
|
||
|
res = new(game.GetPropExchangeRes)
|
||
|
res.PropExchange, err = internal.GetPropExchange(ctx, req.Year, req.Id)
|
||
|
log.Print("res.PropExchange: ", res.PropExchange)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (g *gamePropExchangeImpl) Update(ctx context.Context, req *game.UpdatePropExchangeReq) (res *game.UpdatePropExchangeRes, err error) {
|
||
|
err = internal.UpdatePropExchange(ctx, req.PropExchange)
|
||
|
log.Print("UpdatePropExchange", err)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (g *gamePropExchangeImpl) Insert(ctx context.Context, req *game.InsertPropExchangeReq) (res *game.InsertPropExchangeRes, err error) {
|
||
|
err = internal.InsertPropExchange(ctx, req.PropExchange)
|
||
|
//log.Print("insertPropExchange", err)
|
||
|
return
|
||
|
}
|
||
|
|
||
|
func (g *gamePropExchangeImpl) Check(ctx context.Context, req *game.CheckPropExchangeReq) (res *game.CheckPropExchangeRes, err error) {
|
||
|
res = new(game.CheckPropExchangeRes)
|
||
|
res.PropExchange, err = internal.CheckPropExchange(ctx, req.PropExchange)
|
||
|
return
|
||
|
}
|