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

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.yuchen.saas.parking.api.entity.PmgBatParkParking;
import com.yuchen.saas.parking.api.entity.PmgBatParkParkingEntrance;
import com.yuchen.saas.parking.api.entity.PmgBatParkParkingRoadway;
import com.yuchen.saas.parking.api.entity.PmgBatParkingApplyBinding;
import com.yuchen.saas.parking.api.vo.ParkingApplyDetailVO;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.nest.springwrap.core.launch.app.AppNameConstant;
import org.nest.springwrap.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * 停车场对外暴漏接口
 *
 * @author 王勇
 * @version 1.0
 * @date 2021/5/25 17:14
 */
@FeignClient(
        value = AppNameConstant.SAAS_PARKING,
        fallback = PmgBatParkParkingClientFallback.class
)
public interface PmgBatParkParkingClient {

    /**
     * 查询停车场信息
     * @param type 0父级  1所有
     * @param name 停车场名称
     * @return
     */
    @GetMapping("/parking/PmgBatParkParking/listByType")
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "", notes = "0 父级  1子级")
    R<List<PmgBatParkParking>> listByType(@RequestParam Integer type, @RequestParam(value = "name", required = false) String name);

    /**
     * 查询园区下的所有车道
     * @param parkId 园区ID
     * @return
     */
    @GetMapping("/parking/PmgBatParkParking/getRoadwayListByParkId")
    @ApiOperation(value = "查询园区下的所有车道", notes = "传入查询信息")
    R<List<PmgBatParkParkingRoadway>> getRoadwayListByParkId(String parkId);

    /**
     * 查询停车场下所有车道
     * @param parkingId 停车场ID
     * @return
     */
    @GetMapping("/parking/PmgBatParkParking/getRoadwayListInByParkingId")
    @ApiOperation(value = "查询园区下的所有入口车道", notes = "停车场id")
    R<List<PmgBatParkParkingRoadway>> getRoadwayListInByParkingId(@RequestParam String parkingId);
    /**
     * 获得出入口列表
     * @param parkingId
     * @return
     * @tag pauly-lyz
     */
    @GetMapping("/parking/PmgBatParkParking/getEntranceList")
    @ApiOperation(value = "获得出入口列表", notes = "传入parkingId")
    R<List<PmgBatParkParkingEntrance>> getEntranceList(@RequestParam("parkingId") Long parkingId);
    /**
     * 根据园区ID获取园区下所有包期规则
     * @param parkId 园区ID
     * @return
     */
    @GetMapping("/parking/chargeRule/getListByParkId")
    @ApiOperation(value = "根据园区ID获取园区下所有包期规则", notes = "根据园区ID获取园区下所有包期规则")
    R getChargeRuleListByParkId(@RequestParam Long parkId);

    /**
     * 根据条件查询包期规则
     * @return
     */
    @GetMapping("/parking/chargeRule/getRuleList")
    @ApiOperation(value = "根据条件查询包期规则", notes = "根据条件查询包期规则")
    R getChargeRuleList(@RequestParam("parkId") Long parkId, @RequestParam("parkingId") Long parkingId);
    /**
     * 根据停车场ID查询停车场信息
     * @param id 停车场ID
     *      * @return
     */
    @GetMapping("/parking/PmgBatParkParking/getParkingById")
    @ApiOperation(value = "根据停车场ID查询停车场信息", notes = "根据停车场ID查询停车场信息")
    R<PmgBatParkParking> getParkingById(@ApiParam(value = "停车场id") @RequestParam Long id);

    @GetMapping("/parking/PmgBatParkParking/findByParkId")
    @ApiOperation(value = "根据园区ID获取停车场列表", notes = "根据园区ID获取停车场列表")
    R<List<PmgBatParkParking>> findByParkId(@ApiParam(value = "园区id") @RequestParam Long parkId);

    /**
     * 查询停车场列表信息
     *      * @return
     */
    @GetMapping("/parking/PmgBatParkParking/getParkingList")
    @ApiOperation(value = "查询停车场列表信息", notes = "查询停车场列表信息")
    R<List<PmgBatParkParking>> getParkingList();

    /**
     * 根据运营商ID查询停车场
     */
    @GetMapping("/parking/PmgBatParkParking/findByDeptId")
    R<List<PmgBatParkParking>> findByDeptId(@RequestParam Long deptId);

    /**
     * 根据停车场ID列表查询停车场名称列表
     */
    @GetMapping("/parking/PmgBatParkParking/getParkingNamesByIds")
    R<String> getParkingNamesByIds(@RequestParam String parkingIds);

    /**
     * 根据用户查询停车场list
     */
    @GetMapping("/parking/PmgBatParkParking/list")
    R<List<PmgBatParkParking>> list(@ApiParam(value = "停车场地址") @RequestParam(value = "address", required = false) String address,
                                   @ApiParam(value = "停车场名字") @RequestParam(value = "name", required = false) String name,
                                   @ApiParam(value = "租户id") @RequestParam(value = "tenantId", required = false) String tenantId,
                                   @ApiParam(value = "园区id") @RequestParam(value = "parkId", required = false) String parkId);

    @GetMapping("/pmgBatParkingApplyBinding/bindingDetail")
     R<ParkingApplyDetailVO> bindingDetail(@ApiParam(value = "停车场id") @RequestParam(value = "parkingId")@NotNull Long parkingId) ;

    @GetMapping("/pmgBatParkingApplyBinding/applyBindingParkingDetail")
    R<List<PmgBatParkingApplyBinding>> applyBindingParkingDetail(@ApiParam(value = "应用id") @RequestParam(value = "applyId")@NotNull Long applyId) ;

    @GetMapping("/parking/PmgBatParkParking/findByParkIdNoPermissions")
    @ApiOperation(value = "根据园区ID获取停车场列表(不带权限过滤)", notes = "根据园区ID获取停车场列表(不带权限过滤)")
    R<List<PmgBatParkParking>> findByParkIdNoPermissions(@ApiParam(value = "园区id") @RequestParam Long parkId);
}
