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

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.CueFlawDTO;
import com.tmerclub.cloud.cuerecycle.model.vo.CueFlawVO;
import com.tmerclub.cloud.cuerecycle.service.CueFlawService;
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.*;

/**
 * 球杆缺陷
 *
 * @author : frank
 * @create : 2025-04-13
 */
@Tag(name = "App-球杆缺陷")
@RestController("appCueFlawController")
@RequestMapping("/app/cueFlaw")
public class CueFlawController {
    @Resource
    CueFlawService cueFlawService;

    /**
     * 分页查询启用球杆缺陷列表
     *
     * @param pageDTO    分页参数
     * @return 分页数据
     */
    @GetMapping("/listEnabled")
    @Operation(summary = "分页查询启用球杆缺陷列表", description = "分页查询启用球杆缺陷列表")
    public ServerResponseEntity<PageVO<CueFlawVO>> listEnabled(@Valid PageDTO pageDTO) {
        PageVO<CueFlawVO> cueFlawPage = cueFlawService.listEnabled(pageDTO);
        return ServerResponseEntity.success(cueFlawPage);
    }
}