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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yuchen.saas.park.api.dto.property.SaasParkPropertyFeePrePaySelectionDto;
import com.yuchen.saas.park.api.dto.renovation.SaasParkPropertyHouseRenovationHandleTypeDto;
import com.yuchen.saas.park.api.entity.renovation.SaasParkPropertyHouseRenovationApplyAllDto;
import com.yuchen.saas.park.api.entity.renovation.SaasParkPropertyHouseRenovationApplyDto;
import com.yuchen.saas.park.api.entity.renovation.ShenHeApplyDto;
import com.yuchen.saas.park.api.vo.renovation.SaasParkPropertyHouseRenovationApplyVo;
import com.yuchen.saas.park.api.vo.renovation.SaasParkPropertyHouseRenovationHandleTypeVo;
import com.yuchen.saas.park.service.service.renovation.ISaasParkPropertyHouseRenovationApplyService;
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.validation.Valid;

/**
 * <p>
 * 房源-装修人-施工方-关联申请表 前端控制器
 * </p>
 *
 * @author baichaojie
 * @since 2024-12-02
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/saasParkPropertyHouseRenovationApply")
public class SaasParkPropertyHouseRenovationApplyController {

    private final ISaasParkPropertyHouseRenovationApplyService baseService;


    /**
     * 房源-装修人-施工方-关联申请表
     * @param saasParkPropertyHouseRenovationApplyDto
     * @param query
     * @return
     */
    @GetMapping("/pageByParam")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "房源-装修人-施工方-关联申请表 ", notes = "房源-装修人-施工方-关联申请表")
    public R<IPage<SaasParkPropertyHouseRenovationApplyVo>> pageByParam(@Valid SaasParkPropertyHouseRenovationApplyAllDto saasParkPropertyHouseRenovationApplyDto, Query query) {
        R<IPage<SaasParkPropertyHouseRenovationApplyVo>> pages =baseService.getList(saasParkPropertyHouseRenovationApplyDto, query);
        return pages;
    }


    /**
     * 房源-装修人-施工方-关联申请表 提交审核
     * @param req
     * @return
     */
    @PostMapping("/submitApply")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "物业-收费-收费设置-费用分类  新增或修改", notes = "物业-收费-收费设置-费用分类  新增或修改")
    public R submitApply(@Valid @RequestBody SaasParkPropertyHouseRenovationApplyDto req) {
        return R.data(baseService.submitApply(req));
    }


    /**
     * 房源-装修人-施工方-关联申请表 审核
     * @param req
     * @return
     */
    @PostMapping("/shenHe")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "物业-收费-收费设置-费用分类  新增或修改", notes = "物业-收费-收费设置-费用分类  新增或修改")
    public R shenHe(@Valid @RequestBody ShenHeApplyDto req) {
        return R.data(baseService.shenHe(req));
    }


}
