package com.yuchen.saas.park.service.controller.property;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yuchen.saas.park.api.dto.elevator.ElevatorPersonDTO;
import com.yuchen.saas.park.api.dto.property.SaasParkPropertyFeeItemDetailDto;
import com.yuchen.saas.park.api.request.ElevatorPersonRequest;
import com.yuchen.saas.park.api.vo.elevator.ElevatorPersonVO;
import com.yuchen.saas.park.api.vo.property.SaasParkPropertyFeeItemDetailVo;
import com.yuchen.saas.park.service.service.property.ISaasParkPropertyFeeItemDetailService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nest.springwrap.core.mp.support.Query;
import org.nest.springwrap.core.tool.api.R;
import org.nest.springwrap.core.tool.utils.Func;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 物业-收费-收费设置-费用类型 前端控制器
 * </p>
 *
 * @author baichaojie
 * @since 2024-09-06
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@Api(value = "物业-收费-收费设置-费用类型", tags = "物业-收费-收费设置-费用类型")
@RequestMapping("/saasParkPropertyFeeItemDetail")
public class SaasParkPropertyFeeItemDetailController {

    private final ISaasParkPropertyFeeItemDetailService baseService;



    /**
     * 物业-收费-收费设置-费用类型  列表查询
     */
    @GetMapping("/pageByParam")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "物业-收费-收费设置-费用类型  列表查询", notes = "物业-收费-收费设置-费用类型  列表查询")
    public R<IPage<SaasParkPropertyFeeItemDetailVo>> pageByParam(@Valid SaasParkPropertyFeeItemDetailDto saasParkPropertyFeeItemDetailDto, Query query) {
        R<IPage<SaasParkPropertyFeeItemDetailVo>> pages =baseService.getList(saasParkPropertyFeeItemDetailDto, query);
        return pages;
    }



    /**
     * 物业-收费-收费设置-费用类型  新增或修改
     */
    @PostMapping("/saveOrUpdate")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "物业-收费-收费设置-费用类型  新增或修改", notes = "物业-收费-收费设置-费用类型  新增或修改")
    public R saveOrUpdate(@Valid @RequestBody SaasParkPropertyFeeItemDetailDto req) {
        return R.data(baseService.saveOrUpdateByParam(req));
    }



    /**
     * 物业-收费-收费设置-费用类型  删除
     *
     * @param saasParkPropertyFeeItemDetailDto
     * @return
     */
    @PostMapping("/removeId")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "物业-收费-收费设置-费用类型  删除", notes = "物业-收费-收费设置-费用类型  删除")
    public R removeId(@RequestBody SaasParkPropertyFeeItemDetailDto saasParkPropertyFeeItemDetailDto) {
        return R.data(baseService.removeById(saasParkPropertyFeeItemDetailDto.getId()));
    }



}
