package org.springblade.openinterface.dianxin.constants;

import lombok.Getter;
import lombok.Setter;
import org.redisson.misc.Hash;
import org.springblade.community.elevator.elevator.entity.Elevator;
import org.springblade.community.parkingveh.entity.ParkingVeh;
import org.springblade.smartapplication.facedevice.entity.FaceDevice;
import org.springblade.smartapplication.vcdevice.entity.VideoCloudDevice;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpMethod;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.Map;

/**
 * @author lidexi
 * @date 2021/6/22 15:32
 *
 * 电信集约平台接口appId,appsecret
 */
@Component
@Getter
@Setter
public class JiYueConf {

	/**
	 * 集约平台测试环境
	 */
//	public static final String APPID = "2fa1d3c2e2734ceb906ec6a586bcd094";
//	public static final String APPKEY = "866063211b142c8cfd1bf561074df99b1677a6bce84435eab9780c68157f45e61c884fa18f4fce6dc5ec2f8b094b65808806ec4a79a354c7447457dc66e7482f96b983fcc95671b5b71e3412c8f46eeeef1188f43144d68751eb56c563a72d7f31d3fda1e04cead205017c24c4c126f287448113debdbe545706e12e605e5495704dc652633ebeaf3b44335d8f927460cca8131c7460648eaa15b54d88363f47d67b6851e61cacf08c4fbfed564f9e3e8f4f71e8b3b1fe91817e848ff23d6c76a8cc13272f3370c5d3ccdc9a8f5c88931b913161d4fe86cc1080608442a355dc37f2a6cb136faa3defa7d87cdab5062a4caaaecff31c51ca7c8fc740700a2360";
//	public static final String BASEURL = "http://59.36.84.185:10099";

	/**
	 * 集约平台生产环境
	 */
	public static final String APPID = "ca6c11f29bed448dbfa717f50bcaf082";
	public static final String APPKEY = "781543acc50cd7854efb08fc23d2ec2209cf843fa85cb5f987950e776477b14925be57db2733eabb748b274dbf91a91e70007f53be0101ffca3fa825a050832f019e077965bb5882cdb99bbc2661583ab28ae2a8fea0e9cd3c44358322908edbeb955580408b7ed7b45a6313ab7169bc3b97f94b73050c87c77fdb5c3680f874011fdef158567f84c28fb281344fe75bc2cf591f9e42feee5bad4f2fad92d140469a43b0894a8d9524e18cefd3e056c5a9caa47918ec28050239370a4594bc99e47ec69da9f30f8b247c846b14eaf885eb61a4abd3d476fbb8745d8dda5e8bc59b71e418c20bbc70388d09030512c064bab30c0c855047c93e337cfb87b08324";
	public static final String BASEURL = "https://tyzhsq.ctwing.cn:18081";





	@Getter
	public enum UrlConstant{

		//小翼管家
		TOKEN("获取集约平台授权接口url",BASEURL+"/data-gateway/login/getToken", HttpMethod.POST),
		USERPUSH("用户基础数据推送接口url",BASEURL+"/sub-platform/v2/community/push",HttpMethod.POST),

		//数据融通-基础数据推送接口url
		RESIDENTIAL_PUSH("推送小区数据到数据融通url",BASEURL+"/data-gateway/community/v1/community/push",HttpMethod.POST),
		AREA_PUSH("推送区域数据到数据融通url",BASEURL+"/data-gateway/community/v1/area/push",HttpMethod.POST),
		BUILDING_PUSH("推送楼栋数据到数据融通",BASEURL+"/data-gateway/community/v1/building/push",HttpMethod.POST),
		UNIT_PUSH("推送单元数据到数据融通url",BASEURL+"/data-gateway/community/v1/unit/push",HttpMethod.POST),
		ROOM_PUSH("推送房间数据到数据融通url",BASEURL+"/data-gateway/community/v1/house/push",HttpMethod.POST),
		HOUSEUSER_PUSH("推送住户数据到数据融通url",BASEURL+"/data-gateway/community/v1/person/push",HttpMethod.POST),
		HOUSEUSERANDROOM_PUSH("推送住户房屋关系到数据融通url",BASEURL+"/data-gateway/community/v1/person-ref/push",HttpMethod.POST),
		ENTERPRISESTAFF_PUSH("推送员工数据到数据融通url",BASEURL+"/data-gateway/community/v1/staff/push",HttpMethod.POST),
		CAR_PUSH("推送机动车数据到数据融通url",BASEURL+"/data-gateway/community/v1/vehicle/push",HttpMethod.POST),
		DEVICE_PUSH("推送设备数据到数据融通url",BASEURL+"/data-gateway/community/v1/device/push",HttpMethod.POST),
		DEVICE_STATUS_PUSH("推送设备状态数据到数据融通url",BASEURL+"/data-gateway/community/v1/device-status/push",HttpMethod.POST),

		//数据融通-业务数据推送接口url
		ESTATE_REPAIR_PUSH("推送物业报修记录到数据融通url",BASEURL+"/data-gateway/community/v1/repair-event/push",HttpMethod.POST),
		ADVICES_PUSH("推送投诉建议记录到数据融通url",BASEURL+"/data-gateway/community/v1/suggest-event/push",HttpMethod.POST),
		USER_ACCESS_RECORD_PUSH("推送人员出入记录到数据融通url",BASEURL+"/data-gateway/community/v1/pass-record/push",HttpMethod.POST),
		CAR_RECODE_PUSH("推送车辆进出记录到数据融通url",BASEURL+"/data-gateway/community/v1/vehicle-access/push",HttpMethod.POST),
		FACE_CATCH_PUSH("推送人脸抓拍记录到数据融通url",BASEURL+"/data-gateway/community/v1/face-event/push",HttpMethod.POST),
		SMOKE_DEVICE_ALARM_PUSH("推送烟感告警记录到数据融通url",BASEURL+"/data-gateway/community/v1/smoke-alarm/push",HttpMethod.POST),
		GAS_DEVICE_ALARM_PUSH("推送气感告警记录到数据融通url",BASEURL+"/data-gateway/community/v1/gas-alarm/push",HttpMethod.POST);



		String name;
		String url;
		HttpMethod method;
		UrlConstant(String name, String url, HttpMethod method){
			this.name = name;
			this.url = url;
			this.method = method;
		}
	}

	/**
	 * 本地设备类型与集约平台设备类型对应
	 */

	public static Map<String,String> deviceRelationMap = new HashMap<>();

	static {
		//人脸门禁一体机
		deviceRelationMap.put(FaceDevice.class.getName(),"1");
		//视频监控摄像机
		deviceRelationMap.put(VideoCloudDevice.class.getName(),"6");
		//车牌识别抓拍机
		deviceRelationMap.put(ParkingVeh.class.getName(),"4");
		//烟雾报警器
		deviceRelationMap.put("100004","7");//烟感
		deviceRelationMap.put("10000002","7");//烟感-物模型
		//音柱
		deviceRelationMap.put("100036","8");
		//电表
		deviceRelationMap.put("100030","11");
		//水表
		deviceRelationMap.put("100002","12");//水表（大）
		deviceRelationMap.put("100001","12");//水表（小）

		//燃气报警器
		deviceRelationMap.put("100020","16");//气感
		deviceRelationMap.put("10000017","16");//气感物模型
		//智能井盖
		deviceRelationMap.put("10000001","17");

		//电梯
		deviceRelationMap.put(Elevator.class.getName(),"19");
		//地磁
		deviceRelationMap.put("100007","20");
		//垃圾桶
		deviceRelationMap.put("100022","21");
		//消防栓
		deviceRelationMap.put("960417","24");
		//一键告警
		deviceRelationMap.put("950414","38");
		//智慧灯杆
		deviceRelationMap.put("100011","39");

	}

}
