新增获取网费奖励列表
This commit is contained in:
30
internal/controller/reward/reward_v1_list_internet_charge.go
Normal file
30
internal/controller/reward/reward_v1_list_internet_charge.go
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package reward
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"github.com/gogf/gf/v2/frame/g"
|
||||||
|
"server/internal/model"
|
||||||
|
"server/internal/service"
|
||||||
|
|
||||||
|
"server/api/reward/v1"
|
||||||
|
)
|
||||||
|
|
||||||
|
func (c *ControllerV1) ListInternetCharge(ctx context.Context, req *v1.ListInternetChargeReq) (res *v1.ListRes, err error) {
|
||||||
|
fromCtx := g.RequestFromCtx(ctx)
|
||||||
|
operatorId := fromCtx.GetCtxVar("id").Int64()
|
||||||
|
operatorRole := fromCtx.GetCtxVar("role").String()
|
||||||
|
out, err := service.Reward().ListInternetCharge(ctx, &model.RewardListIn{Page: req.Page,
|
||||||
|
Size: req.Size,
|
||||||
|
OperatorId: operatorId,
|
||||||
|
OperatorRole: operatorRole,
|
||||||
|
StoreId: req.StoreId,
|
||||||
|
RewardTypeId: req.RewardTypeId,
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return &v1.ListRes{
|
||||||
|
List: out.List,
|
||||||
|
Total: out.Total,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user