实现了门店奖励的增删改查

This commit is contained in:
2025-06-17 18:11:27 +08:00
parent 427e70f94e
commit e21353df23
23 changed files with 659 additions and 42 deletions

View 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
}