package com.yuchen.saas.park.api.feign.service;

import com.yuchen.saas.park.api.entity.park.PmgBatParkInfo;
import com.yuchen.saas.park.api.entity.pldoor.PlVisitorPowerSet;
import com.yuchen.saas.park.api.request.PlVisitorParkingSpotRequest;
import com.yuchen.saas.park.api.response.ParkInfoResponse;
import com.yuchen.saas.park.api.vo.park.ApplyManageParkDetailVO;
import com.yuchen.saas.park.api.vo.pldoor.PlIntervieweeVO;
import com.yuchen.saas.park.api.vo.pldoor.PlVisitorSpotVO;
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.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

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

/**
 * @Author: 肖润飞
 * @CreateTime: 2022/11/15 16:18
 * @Description: 访客 feign 接口
 * @Version: 1.0
 */
@FeignClient(
        value = AppNameConstant.SAAS_PARK,
        fallbackFactory = ParkFeignServiceFallback.class
)
public interface ParkFeignService {

    @GetMapping("/parkInfo/getAllVisitor")
    R getParkAll();

    @GetMapping("/parkInfo/getAll")
    R<List<PmgBatParkInfo>> getRoleParkAll();

    @GetMapping("/parkInfo/getParkInfo")
    R<PmgBatParkInfo> getParkInfo(@RequestParam Long parkId);


    @GetMapping("/parkInfo/list/park/scopeValue")
    R<List<ParkInfoResponse>> getParkListByScopeValue(@RequestParam("tenantId") String tenantId, @RequestParam("scopeValue") String scopeValue);

    @GetMapping("/parkInfo/list/park/tenant")
    R<List<ParkInfoResponse>> getParkList(@RequestParam(required = false) Long tenantId,@RequestParam(required = false) Long parkId,@RequestParam(required = false) String parkName);

    @GetMapping("/parkInfo/getParkAll2")
    R<List<PmgBatParkInfo>> getParkAll2();

    @GetMapping("/parkInfo/getParkInfoListById")
    R<List<PmgBatParkInfo>> getParkInfoListById(@RequestParam Long parkId);

    @GetMapping("/parkInfo/getParkNamesByIds")
    R<String> getParkNamesByIds(@RequestParam String parkIds);

    @GetMapping("/parkInfo/getParkMap")
    R<Map<Long, String>> getParkMap(@RequestParam List<Long> parkIds);

    @GetMapping("/nestApplyManageParkBinding/bindingDetail")
    R<ApplyManageParkDetailVO> bindingDetail(@ApiParam(value = "园区id") @RequestParam(value = "parkId")@NotNull Long parkId) ;

    @GetMapping("/plDoorOpenDoorRecode/receiveIotEvent")
    R<PmgBatParkInfo> receiveIotEvent(@RequestParam String jsonObjectContent);

    @GetMapping("/parkInfo//getSpaceTree")
    R<PmgBatParkInfo> getSpaceTree(@RequestParam Long parkId) ;

    /**
     * 根据parkId获取访客权限配置
     * @param parkId
     * @return
     */
    @GetMapping("/plVisitorPowerSet/getPowerSetByProjectId")
    R<PlVisitorPowerSet> getPowerSetByProjectId(@RequestParam Long parkId) ;

    /**
     * 根据项目id,停车场id,车牌号获取授权车位列表
     * @param request
     * @return
     */
    @GetMapping("/plVisitorPowerSet/getParkingSpotByParam")
    R<List<PlVisitorSpotVO>> getParkingSpotByParam(@RequestParam PlVisitorParkingSpotRequest request) ;

    @GetMapping("/plVisitorInfo/getVisitorByParkIdCarNo")
    R<PlIntervieweeVO> getVisitorByParkIdCarNo(@RequestParam Long parkId, @RequestParam String carNo) ;

    /**
     * @param projectIdList 项目id列表 不能传空
     * @return map 返回项目名称map
     */
    @PostMapping("/parkInfo/getParkNameMap")
    R<Map<Long, String>> getParkNameMap(@RequestBody List<Long> projectIdList);

    /**
     * @param projectIdList 项目id列表 不能传空
     * @return map 返回项目信息map
     */
    @PostMapping("/parkInfo/getParkInfoMap")
    R<Map<Long, PmgBatParkInfo>> getParkInfoMap(@RequestBody List<Long> projectIdList);
}
