调整接口
This commit is contained in:
5
internal/controller/statistic/statistic.go
Normal file
5
internal/controller/statistic/statistic.go
Normal file
@ -0,0 +1,5 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package statistic
|
||||
15
internal/controller/statistic/statistic_new.go
Normal file
15
internal/controller/statistic/statistic_new.go
Normal file
@ -0,0 +1,15 @@
|
||||
// =================================================================================
|
||||
// This is auto-generated by GoFrame CLI tool only once. Fill this file as you wish.
|
||||
// =================================================================================
|
||||
|
||||
package statistic
|
||||
|
||||
import (
|
||||
"server/api/statistic"
|
||||
)
|
||||
|
||||
type ControllerV1 struct{}
|
||||
|
||||
func NewV1() statistic.IStatisticV1 {
|
||||
return &ControllerV1{}
|
||||
}
|
||||
@ -0,0 +1,15 @@
|
||||
package statistic
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"server/internal/consts"
|
||||
|
||||
"server/api/statistic/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) GetOnlineDevice(ctx context.Context, req *v1.GetOnlineDeviceReq) (res *v1.GetOnlineDeviceRes, err error) {
|
||||
card, err := g.Redis().SCard(ctx, fmt.Sprintf(consts.NetbarOnlineDeviceSetKey, req.NetbarAccount))
|
||||
return &v1.GetOnlineDeviceRes{Total: card}, err
|
||||
}
|
||||
17
internal/controller/store/store_v1_detail.go
Normal file
17
internal/controller/store/store_v1_detail.go
Normal file
@ -0,0 +1,17 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"context"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
"server/api/store/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) Detail(ctx context.Context, req *v1.DetailReq) (res *v1.DetailRes, err error) {
|
||||
out, err := service.Store().Detail(ctx, &model.StoreDetailIn{NetbarAccount: req.NetbarAccount})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.DetailRes{Id: out.Id}, nil
|
||||
}
|
||||
@ -13,11 +13,12 @@ func (c *ControllerV1) GetTask(ctx context.Context, req *v1.GetTaskReq) (res *v1
|
||||
|
||||
userId := g.RequestFromCtx(ctx).GetCtxVar("id").Int()
|
||||
out, err := service.Task().GetTask(ctx, &model.GetTaskIn{
|
||||
TaskId: req.TaskId,
|
||||
StoreId: req.StoreId,
|
||||
UserId: userId,
|
||||
GameId: req.GameId,
|
||||
TaskName: req.TaskName,
|
||||
TaskId: req.TaskId,
|
||||
StoreId: req.StoreId,
|
||||
NetBarAccount: req.NetBarAccount,
|
||||
UserId: userId,
|
||||
GameId: req.GameId,
|
||||
TaskName: req.TaskName,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
@ -13,11 +13,12 @@ func (c *ControllerV1) Ranking(ctx context.Context, req *v1.RankingReq) (res *v1
|
||||
//operatorId := g.RequestFromCtx(ctx).GetCtxVar("id").Int()
|
||||
operatorId := 4
|
||||
out, err := service.Task().UserTaskRankingList(ctx, &model.UserTaskRankingIn{
|
||||
Page: req.Page,
|
||||
Size: req.Size,
|
||||
StoreId: req.StoreId,
|
||||
Type: req.Type,
|
||||
OperatorId: operatorId,
|
||||
Page: req.Page,
|
||||
Size: req.Size,
|
||||
StoreId: req.StoreId,
|
||||
NetBarAccount: req.NetBarAccount,
|
||||
Type: req.Type,
|
||||
OperatorId: operatorId,
|
||||
})
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user