package com.seer.teach.mall.app.good.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.seer.teach.common.PageListBean;
import com.seer.teach.common.ResultBean;
import com.seer.teach.common.annotation.DecryptionAnnotation;
import com.seer.teach.common.annotation.EncryptionAnnotation;
import com.seer.teach.common.annotation.LogPrint;
import com.seer.teach.mall.request.GoodsCommentPageReqVO;
import com.seer.teach.mall.response.GoodsCommentResp;
import com.seer.teach.mall.app.good.service.IAppGoodsCommentService;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 商品评论 前端控制器
 * </p>
 *
 * @author Wang
 * @since 2025-07-03 10:22:05
 */
@EncryptionAnnotation
@DecryptionAnnotation
@Tag(name = "APP - 商品评价")
@Validated
@RequiredArgsConstructor
@RestController
@LogPrint
@RequestMapping("/app/goods/comment")
public class AppGoodsCommentController {

    private final IAppGoodsCommentService iAppGoodsCommentService;

    @PostMapping("/page")
    @SaCheckPermission("app:goods-comment:page")
    @Operation(summary = "获得商品评价分页")
    public ResultBean<PageListBean<GoodsCommentResp>> getOrderPage(@RequestBody GoodsCommentPageReqVO reqVO) {
        return ResultBean.success(iAppGoodsCommentService.getOrderPage(null,Boolean.FALSE,reqVO));
    }
}