package com.iwunu.nbiot.lock.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;

import lombok.Getter;

@Component
@Getter
public class AepMqConfig {
	@Value("${aep_tenantId}")
	private String tenantId;

	@Value("${aep_token}")
	private String token;
	
	@Value("${aep_mq_online_topic}")
	private String onlineTopic;
	
	@Value("${aep_mq_report_topic}")
	private String reportTopic;
	
	@Value("${aep_mq_respond_topic}")
	private String respondTopic;	
	
	@Value("${aep_mq_change_topic}")
	private String changeTopic;	
	
	@Value("${serverUrlAndPort}")
	private String serverUrlAndPort;
	
	@Value("${aep_app_id}")
	private String appId;
	
	@Value("${aep_app_key}")
	private String appKey;
	
	@Value("${aep_app_secret}")
	private String appSecret;
	
	@Value("${aep_master_apikey}")
	private String masterApikey;
	
	@Value("${aep_product_id}")
	private String productId;
	
	public JSONObject postParamJson() {
		JSONObject json =  new JSONObject();
		json.put("operator", "***");//自定义
		json.put("productId", this.productId);
		json.put("ttl", "7200");
		json.put("level", 1);
		return json;
	}
	public JSONObject getParamJson() {
		JSONObject json =  new JSONObject();
		json.put("productId", this.productId);
		return json;
	}
	public JSONObject createParamJson() {
		JSONObject json =  new JSONObject();
		JSONObject other =  new JSONObject();
		json.put("operator", "***");//自定义
		json.put("productId", this.productId);
		other.put("autoObserver", 0);
		json.put("other", other);
		return json;
	}
}
