package com.persagy.bdtp.adm.client;

import com.persagy.bdtp.adm.entity.oldadm.*;
import com.persagy.dmp.basic.config.DigitalFeignConfig;
import feign.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = "amd-old", configuration = DigitalFeignConfig.class,
		url = "${persagy.adm.oldPlatformUrl}")
public interface OldAdmClient {

	@PostMapping("/persagy-sso-server/users/login")
	Map<String, Object> login(
			@RequestBody Map<String, Object> params);

	@PostMapping("/datacenter/object/project/query")
	OldAdmResult<List<OProject>> queryProject(
			@RequestHeader("groupCode") String groupCode,
			@RequestHeader("projectId") String projectId,
			@RequestHeader("appId") String appId,
			@RequestHeader("userId") String userId,
			@RequestHeader("token") String token,
			@RequestBody Map<String, Object> params);

	@PostMapping("/datacenter/object/building/query")
	OldAdmResult<List<OBuilding>> queryBuilding(
			@RequestHeader("groupCode") String groupCode,
			@RequestHeader("projectId") String projectId,
			@RequestHeader("appId") String appId,
			@RequestHeader("userId") String userId,
			@RequestHeader("token") String token,
			@RequestBody Map<String, Object> params);

	@PostMapping("/datacenter/object/zone/query")
	OldAdmResult<List<OSpace>> querySpace(
			@RequestHeader("groupCode") String groupCode,
			@RequestHeader("projectId") String projectId,
			@RequestHeader("appId") String appId,
			@RequestHeader("userId") String userId,
			@RequestHeader("token") String token,
			@RequestBody Map<String, Object> params);

	@PostMapping("/datacenter/object/equip/query")
	OldAdmResult<List<OEquip>> queryEquip(
			@RequestHeader("groupCode") String groupCode,
			@RequestHeader("projectId") String projectId,
			@RequestHeader("appId") String appId,
			@RequestHeader("userId") String userId,
			@RequestHeader("token") String token,
			@RequestBody Map<String, Object> params);

	@GetMapping(value = "/image-service/common/file_get",consumes = MediaType.APPLICATION_OCTET_STREAM_VALUE)
	Response getFloorMap(@RequestParam String key, @RequestParam String systemId);

}
