实现了门店奖励的增删改查
This commit is contained in:
24
internal/controller/reward/reward_v1_list.go
Normal file
24
internal/controller/reward/reward_v1_list.go
Normal file
@ -0,0 +1,24 @@
|
||||
package reward
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
"server/internal/model"
|
||||
"server/internal/service"
|
||||
|
||||
"server/api/reward/v1"
|
||||
)
|
||||
|
||||
func (c *ControllerV1) List(ctx context.Context, req *v1.ListReq) (res *v1.ListRes, err error) {
|
||||
fromCtx := g.RequestFromCtx(ctx)
|
||||
operatorId := fromCtx.GetCtxVar("id").Int64()
|
||||
operatorRole := fromCtx.GetCtxVar("role").String()
|
||||
out, err := service.Reward().List(ctx, &model.RewardListIn{Page: req.Page, Size: req.Size, OperatorId: operatorId, OperatorRole: operatorRole, StoreId: req.StoreId})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &v1.ListRes{
|
||||
List: out.List,
|
||||
Total: out.Total,
|
||||
}, nil
|
||||
}
|
||||
Reference in New Issue
Block a user