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.property.SaasParkPropertyBillArrearsDto;
import com.yuchen.saas.park.api.dto.property.SaasParkPropertyBillInformationDto;
import com.yuchen.saas.park.api.vo.property.SaasParkPropertyBillInformationVo;
import com.yuchen.saas.park.service.service.property.ISaasParkPropertyBillInformationService;
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.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid;

/**
 * <p>
 * 物业-收费-前台收费-账单信息表 前端控制器
 * </p>
 *
 * @author baichaojie
 * @since 2024-09-26
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@Api(value = "物业-收费-前台收费-账单信息表 前端控制器", tags = "物业-收费-前台收费-账单信息表 前端控制器")
@RequestMapping("/saasParkPropertyBillInformation")
public class SaasParkPropertyBillInformationController {

    private final ISaasParkPropertyBillInformationService baseService;

    /**
     * 物业-收费-前台收费-账单信息表 列表查询
     * @param saasParkPropertyBillInformationDto
     * @param query
     * @return
     */
    @GetMapping("/pageByParam")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "物业-收费-前台收费-账单信息表 列表查询", notes = "物业-收费-前台收费-账单信息表  列表查询")
    public R<IPage<SaasParkPropertyBillInformationVo>> pageByParam(@Valid SaasParkPropertyBillInformationDto saasParkPropertyBillInformationDto, Query query) {
        R<IPage<SaasParkPropertyBillInformationVo>> pages =baseService.getList(saasParkPropertyBillInformationDto, query);
        return pages;
    }


    /**
     * 物业-收费-前台收费-账单信息表 新增或修改
     * @param req
     * @return
     */
    @PostMapping("/saveOrUpdate")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "物业-收费-前台收费-账单信息表  新增或修改", notes = "物业-收费-前台收费-账单信息表  新增或修改")
    public R saveOrUpdate(@Valid @RequestBody SaasParkPropertyBillInformationDto req) {
        return R.data(baseService.saveOrUpdateByParam(req));
    }


    /**
     * 物业-收费-前台收费-账单信息表  删除
     * @param saasParkPropertyBillInformationDto
     * @return
     */
    @PostMapping("/removeId")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "物业-收费-前台收费-账单信息表  删除", notes = "物业-收费-前台收费-账单信息表 删除")
    public R removeId(@RequestBody SaasParkPropertyBillInformationDto saasParkPropertyBillInformationDto) {
        return R.data(baseService.removeById(saasParkPropertyBillInformationDto.getId()));
    }


    /**
     * 物业-收费-前台收费-账单信息表 导出
     * @param reqDTO
     * @param response
     * @tag
     */
    @PostMapping("/export")
    @ApiOperationSupport(order = 6)
    @ApiOperation(value = "物业-收费-前台收费-账单信息表 导出", notes = "物业-收费-前台收费-账单信息表 导出")
    public void export(@RequestBody SaasParkPropertyBillInformationDto reqDTO, HttpServletResponse response){
        baseService.export(reqDTO,response);
    }

}
