package com.ruoyi.web.controller.info;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.PageQuery;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.core.validate.QueryGroup;
import com.ruoyi.info.order.domain.bo.OrderBo;
import com.ruoyi.info.order.domain.vo.OrderVo;
import com.ruoyi.info.order.service.IOrderReviewsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单评价Controller
 *
 * @author ruoyi
 * @date 2025-09-29
 */
@Validated
@Api(value = "订单评价控制器", tags = {"订单评价管理"})
@RequiredArgsConstructor
@RestController
@RequestMapping("/order/orderReviews")
public class OrderReviewsController extends BaseController {

    private final IOrderReviewsService iOrderReviewsService;

    /**
     * 分页查询订单评价列表
     */
    @ApiOperation("查询订单评价列表")
    @SaCheckPermission("order:orderReviews:list")
    @GetMapping("/page")
    public TableDataInfo<OrderVo> page(@Validated(QueryGroup.class) OrderBo bo, PageQuery pageQuery) {
        bo.setIsReviewed(true);
        return iOrderReviewsService.queryOrderList(bo, pageQuery);
    }

}
