package com.propertyManagement.web.controller.business.api;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.propertyManagement.business.domain.bo.WxCarportBo;
import com.propertyManagement.business.domain.bo.WxProprietorLedgerBo;
import com.propertyManagement.business.domain.vo.WxCarportVo;
import com.propertyManagement.business.listener.WxCarportImportListener;
import com.propertyManagement.business.service.IWxCarportService;
import com.propertyManagement.business.support.util.AuthUtil;
import com.propertyManagement.common.annotation.Log;
import com.propertyManagement.common.annotation.RepeatSubmit;
import com.propertyManagement.common.core.controller.BaseController;
import com.propertyManagement.common.core.domain.PageQuery;
import com.propertyManagement.common.core.domain.R;
import com.propertyManagement.common.core.page.TableDataInfo;
import com.propertyManagement.common.core.validate.AddGroup;
import com.propertyManagement.common.core.validate.EditGroup;
import com.propertyManagement.common.enums.BusinessType;
import com.propertyManagement.common.excel.ExcelResult;
import com.propertyManagement.common.utils.poi.ExcelUtil;
import lombok.RequiredArgsConstructor;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * 业主车位
 *
 * @author liushuai
 * @date 2025-05-26
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/carport")
public class ApiWxCarportController extends BaseController {

    private final IWxCarportService iWxCarportService;

    /**
     * 查询业主车位列表
     */
    @GetMapping("/listByType")
    public R<List<WxCarportVo>> list(@Validated @NotNull(message = "车位类型不能为空") Integer type) {
        WxCarportBo wxCarportBo = new WxCarportBo();
        wxCarportBo.setType(type);
        wxCarportBo.setProprietorId(AuthUtil.getWxUser().getProprietorId());
        return R.ok(iWxCarportService.queryList(wxCarportBo));
    }

}
