package com.yuchen.saas.parking.api.feign;

import com.yuchen.saas.parking.api.dto.*;
import com.yuchen.saas.parking.api.entity.ParkingPlace;
import com.yuchen.saas.parking.api.entity.ParkingPlacePerson;
import com.yuchen.saas.parking.api.vo.ParkingPlaceHasVO;
import com.yuchen.saas.parking.api.vo.ParkingPlaceMyVO;
import io.swagger.annotations.ApiOperation;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.mp.support.NestPage;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
  *@Author yuanzhelin
  *@Date 2024/11/30 17:06
  *@Description TODO
*/
@FeignClient(
        value = AppNameConstant.SAAS_PARKING,
        fallbackFactory = ParkingPlaceClientFallback.class
)
public interface ParkingPlaceClient {
    /**
     * 同步车位车主
     * @param dto
     * @return
     */
    @PostMapping("/parkingPlacePerson/sync")
    R syncPlacePerson(@RequestBody List<ParkingPlacePersonSyncDTO> dto);

    /**
     * 同步车位
     * @param dto
     * @return
     *
     */
    @PostMapping("/parking/place/sync")
    @ApiOperation(value = "同步车位", notes = "同步车位")
    R<Boolean> syncPlace(@RequestBody List<ParkingPlaceSyncDTO>  dto);

    @PostMapping("/parkingPlacePerson/property/place")
    @ApiOperation(value = "小程序获取产权车位", notes = "小程序获取产权车位")
    R<List<ParkingPlaceHasVO>> propertyPlace(@RequestBody ParkingPlaceHasQueryDTO dto);

    @PostMapping("/parkingPlacePerson/page")
    R<NestPage<ParkingPlacePerson>> ownedPlaces(@RequestBody ParkingPlacePersonQueryDTO dto);

    @PostMapping("/parking/place/select")
    R<NestPage<ParkingPlace>> selectPlace(@RequestBody ParkingPlaceSelectQueryDTO dto);

    /**
     * 小程序我的车位
     * @param dto
     * @return
     *
     */
    @PostMapping("/parkingPlacePerson/my/place")
    @ApiOperation(value = "小程序我的车位", notes = "小程序我的车位")
    R<List<ParkingPlaceMyVO>> myPlacePage(@RequestBody ParkingPlaceMyQueryDTO dto);
}
