package com.tmerclub.cloud.cuerecycle.controller.admin;

import com.tmerclub.cloud.common.database.dto.PageDTO;
import com.tmerclub.cloud.common.database.vo.PageVO;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.cuerecycle.model.dto.CueOrderFlawDTO;
import com.tmerclub.cloud.cuerecycle.model.vo.CueOrderFlawVO;
import com.tmerclub.cloud.cuerecycle.service.CueOrderFlawService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 球杆商品瑕疵项
 *
 * @author : frank
 * @create : 2025-04-15
 */
@Tag(name = "后管-球杆商品瑕疵项")
@RestController("adminCueOrderFlawController")
@RequestMapping("/admin/cueOrderFlaw")
public class CueOrderFlawController {
    @Resource
    CueOrderFlawService cueOrderFlawService;

    /**
     * 分页查询
     *
     * @param pageDTO         分页参数
     * @param cueOrderFlawDTO 查询参数
     * @return 分页数据
     */
    @GetMapping("/page")
    @Operation(summary = "查询球杆商品瑕疵项分页列表", description = "查询球杆商品瑕疵项分页列表")
    public ServerResponseEntity<PageVO<CueOrderFlawVO>> page(@Valid PageDTO pageDTO, CueOrderFlawDTO cueOrderFlawDTO) {
        PageVO<CueOrderFlawVO> cueOrderFlawPage = cueOrderFlawService.page(pageDTO, cueOrderFlawDTO);
        return ServerResponseEntity.success(cueOrderFlawPage);
    }
}