package cn.iocoder.yudao.module.system.controller.admin.sys;

import cn.iocoder.yudao.module.system.controller.admin.sys.vo.ServiceItemLevelPageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.sys.vo.ServiceItemLevelRespVO;
import cn.iocoder.yudao.module.system.controller.admin.sys.vo.ServiceItemLevelSaveReqVO;
import cn.iocoder.yudao.module.system.dal.dataobject.biz.ServiceItemLevelDO;
import cn.iocoder.yudao.module.system.service.sys.ServiceItemLevelService;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;

import javax.validation.constraints.*;
import javax.validation.*;
import javax.servlet.http.*;
import java.util.*;
import java.io.IOException;

import cn.iocoder.yudao.framework.common.pojo.PageParam;
import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;

import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;

import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;

/**
 * @Author: jinyd
 * @CreateTime: 2025/4/1  14:11
 * @Description:
 * @Version: 4.0
 */


@Tag(name = "管理后台 - 服务项目会员等级")
@RestController
@RequestMapping("/sys/service-item-level")
@Validated
public class ServiceItemLevelController {

    @Resource
    private ServiceItemLevelService serviceItemLevelService;

//    @PostMapping("/create")
//    @Operation(summary = "创建服务项目会员等级")
//    public CommonResult<Long> createServiceItemLevel(@Valid @RequestBody ServiceItemLevelSaveReqVO createReqVO) {
//        return success(serviceItemLevelService.createServiceItemLevel(createReqVO));
//    }

//    @PutMapping("/update")
//    @Operation(summary = "更新服务项目会员等级")
//    public CommonResult<Boolean> updateServiceItemLevel(@Valid @RequestBody ServiceItemLevelSaveReqVO updateReqVO) {
//        serviceItemLevelService.updateServiceItemLevel(updateReqVO);
//        return success(true);
//    }

//    @DeleteMapping("/delete")
//    @Operation(summary = "删除服务项目会员等级")
//    @Parameter(name = "id", description = "编号", required = true)
//    public CommonResult<Boolean> deleteServiceItemLevel(@RequestParam("id") Long id) {
//        serviceItemLevelService.deleteServiceItemLevel(id);
//        return success(true);
//    }

//    @GetMapping("/get")
//    @Operation(summary = "获得服务项目会员等级")
//    @Parameter(name = "id", description = "编号", required = true, example = "1024")
//    public CommonResult<ServiceItemLevelRespVO> getServiceItemLevel(@RequestParam("id") Long id) {
//        ServiceItemLevelDO serviceItemLevel = serviceItemLevelService.getServiceItemLevel(id);
//        return success(BeanUtils.toBean(serviceItemLevel, ServiceItemLevelRespVO.class));
//    }

//    @GetMapping("/page")
//    @Operation(summary = "获得服务项目会员等级分页")
//    public CommonResult<PageResult<ServiceItemLevelRespVO>> getServiceItemLevelPage(@Valid ServiceItemLevelPageReqVO pageReqVO) {
//        PageResult<ServiceItemLevelDO> pageResult = serviceItemLevelService.getServiceItemLevelPage(pageReqVO);
//        return success(BeanUtils.toBean(pageResult, ServiceItemLevelRespVO.class));
//    }

//    @GetMapping("/export-excel")
//    @Operation(summary = "导出服务项目会员等级 Excel")
//    @ApiAccessLog(operateType = EXPORT)
//    public void exportServiceItemLevelExcel(@Valid ServiceItemLevelPageReqVO pageReqVO,
//                                            HttpServletResponse response) throws IOException {
//        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
//        List<ServiceItemLevelDO> list = serviceItemLevelService.getServiceItemLevelPage(pageReqVO).getList();
//        // 导出 Excel
//        ExcelUtils.write(response, "服务项目会员等级.xls", "数据", ServiceItemLevelRespVO.class,
//                BeanUtils.toBean(list, ServiceItemLevelRespVO.class));
//    }

}
