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.SaasParkPropertyFeeOfflinePayDto;
import com.yuchen.saas.park.api.dto.property.SaasParkPropertyFeePreAccountDto;
import com.yuchen.saas.park.api.vo.property.SaasParkPropertyFeeOfflinePayVo;
import com.yuchen.saas.park.api.vo.property.SaasParkPropertyFeePreAccountVo;
import com.yuchen.saas.park.service.service.property.ISaasParkPropertyFeePreAccountService;
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-10-31
 */
@Slf4j
@RestController
@RequiredArgsConstructor
@RequestMapping("/saasParkPropertyFeePreAccount")
public class SaasParkPropertyFeePreAccountController {

    private final ISaasParkPropertyFeePreAccountService baseService;


    /**
     * 物业-收费-客户账户-预存账户 列表查询
     * @param saasParkPropertyFeePreAccountDto
     * @param query
     * @return
     */
    @GetMapping("/pageByParam")
    @ApiOperationSupport(order = 4)
    @ApiOperation(value = "物业-收费-客户账户-预存账户  列表查询", notes = "物业-收费-客户账户-预存账户 列表查询")
    public R<IPage<SaasParkPropertyFeePreAccountVo>> pageByParam(@Valid SaasParkPropertyFeePreAccountDto saasParkPropertyFeePreAccountDto, Query query) {
        R<IPage<SaasParkPropertyFeePreAccountVo>> pages =baseService.getList(saasParkPropertyFeePreAccountDto, query);
        return pages;
    }


    /**
     * 物业-收费-客户账户-预存账户 新增或修改
     * @param req
     * @return
     */
    @PostMapping("/saveOrUpdate")
    @ApiOperationSupport(order = 2)
    @ApiOperation(value = "物业-收费-客户账户-预存账户 新增或修改", notes = "物业-收费-客户账户-预存账户  新增或修改")
    public R saveOrUpdate(@Valid @RequestBody SaasParkPropertyFeePreAccountDto req) {
        return R.data(baseService.saveOrUpdateByParam(req));
    }


    /**
     * 物业-收费-客户账户-预存账户  删除
     * @param saasParkPropertyFeePreAccountDto
     * @return
     */
    @PostMapping("/removeId")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "物业-收费-前台收费-线下收款  删除", notes = "物业-收费-前台收费-线下收款  删除")
    public R removeId(@RequestBody SaasParkPropertyFeePreAccountDto saasParkPropertyFeePreAccountDto) {
        return R.data(baseService.removeById(saasParkPropertyFeePreAccountDto.getId()));
    }





}
