mirror of
https://gitee.com/wangkang/udf.git
synced 2026-10-25 19:33:41 +00:00
添加rms和rabbitmq的配置文件rest服务
This commit is contained in:
+7
-1
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
package com.egridcloud.udf.amqp.rabbitmq;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@@ -24,13 +25,18 @@ import com.egridcloud.udf.amqp.rabbitmq.mate.SubscriberMate;
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "com.egridcloud.rabbitmq.properties")
|
||||
public class RabbitmqProperties {
|
||||
public class RabbitmqProperties implements Serializable {
|
||||
|
||||
/**
|
||||
* 描述 : 死信后缀
|
||||
*/
|
||||
public static final String DEAD_LETTER_SUFFIX = ".dlx";
|
||||
|
||||
/**
|
||||
* 描述 : ID
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 描述 : 发布者 ( key:应用名称 )
|
||||
*/
|
||||
|
||||
+8
-1
@@ -6,13 +6,20 @@
|
||||
*/
|
||||
package com.egridcloud.udf.amqp.rabbitmq.mate;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 描述 : ConsumerMate
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public class ConsumerMate {
|
||||
public class ConsumerMate implements Serializable {
|
||||
|
||||
/**
|
||||
* 描述 : ID
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 描述 : 应用名称
|
||||
|
||||
+8
-1
@@ -6,13 +6,20 @@
|
||||
*/
|
||||
package com.egridcloud.udf.amqp.rabbitmq.mate;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 描述 : ProducerMate
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public class ProducerMate {
|
||||
public class ProducerMate implements Serializable {
|
||||
|
||||
/**
|
||||
* 描述 : ID
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 描述 : 应用名称
|
||||
|
||||
+8
-1
@@ -6,13 +6,20 @@
|
||||
*/
|
||||
package com.egridcloud.udf.amqp.rabbitmq.mate;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 描述 : PublisherMate
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public class PublisherMate {
|
||||
public class PublisherMate implements Serializable {
|
||||
|
||||
/**
|
||||
* 描述 : ID
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 描述 : 权限列表
|
||||
|
||||
+8
-1
@@ -6,13 +6,20 @@
|
||||
*/
|
||||
package com.egridcloud.udf.amqp.rabbitmq.mate;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 描述 : SubscriberMate
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public class SubscriberMate {
|
||||
public class SubscriberMate implements Serializable {
|
||||
|
||||
/**
|
||||
* 描述 : ID
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 描述 : 权限列表
|
||||
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* RabbitmqController.java
|
||||
* Created at 2017-05-25
|
||||
* Created by Administrator
|
||||
* Copyright (C) 2016 egridcloud.com, All rights reserved.
|
||||
*/
|
||||
package com.egridcloud.udf.amqp.rabbitmq.web;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.egridcloud.udf.amqp.rabbitmq.RabbitmqProperties;
|
||||
import com.egridcloud.udf.core.RestResponse;
|
||||
|
||||
/**
|
||||
* 描述 : RabbitmqController
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("service/rabbitmq")
|
||||
public class RabbitmqController {
|
||||
|
||||
/**
|
||||
* 描述 : rabbitmqProperties
|
||||
*/
|
||||
@Autowired(required = false)
|
||||
private RabbitmqProperties rabbitmqProperties;
|
||||
|
||||
/**
|
||||
* 描述 : 返回rabbitmq配置
|
||||
*
|
||||
* @return rabbitmq配置
|
||||
*/
|
||||
@RequestMapping(value = "properties", method = RequestMethod.GET)
|
||||
public RestResponse<RabbitmqProperties> getProperties() {
|
||||
return new RestResponse<>(rabbitmqProperties);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
package com.egridcloud.udf.rms;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@@ -22,7 +23,12 @@ import com.egridcloud.udf.rms.mate.ServiceMate;
|
||||
*/
|
||||
@Component
|
||||
@ConfigurationProperties(prefix = "com.egridcloud.rms.properties")
|
||||
public class RmsProperties {
|
||||
public class RmsProperties implements Serializable {
|
||||
|
||||
/**
|
||||
* 描述 : ID
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 描述 : 应用清单(应用名称 : 应用地址)
|
||||
|
||||
@@ -6,13 +6,20 @@
|
||||
*/
|
||||
package com.egridcloud.udf.rms.mate;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 描述 : Application元数据
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public class ApplicationMate {
|
||||
public class ApplicationMate implements Serializable {
|
||||
|
||||
/**
|
||||
* 描述 : ID
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 描述 : 服务ID
|
||||
|
||||
@@ -6,13 +6,20 @@
|
||||
*/
|
||||
package com.egridcloud.udf.rms.mate;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 描述 : service元数据
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
public class ServiceMate {
|
||||
public class ServiceMate implements Serializable {
|
||||
|
||||
/**
|
||||
* 描述 : ID
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 描述 : 应用名称
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* RmsController.java
|
||||
* Created at 2017-05-25
|
||||
* Created by Administrator
|
||||
* Copyright (C) 2016 egridcloud.com, All rights reserved.
|
||||
*/
|
||||
package com.egridcloud.udf.rms.web;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.egridcloud.udf.core.RestResponse;
|
||||
import com.egridcloud.udf.rms.RmsConfig;
|
||||
import com.egridcloud.udf.rms.RmsProperties;
|
||||
|
||||
/**
|
||||
* 描述 : RmsController
|
||||
*
|
||||
* @author Administrator
|
||||
*
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("service/rms")
|
||||
public class RmsController {
|
||||
|
||||
/**
|
||||
* 描述 : rmsConfig
|
||||
*/
|
||||
@Autowired
|
||||
private RmsConfig rmsConfig;
|
||||
|
||||
/**
|
||||
* 描述 : rmsProperties
|
||||
*/
|
||||
@Autowired(required = false)
|
||||
private RmsProperties rmsProperties;
|
||||
|
||||
/**
|
||||
* 描述 : 返回rms扫描路径
|
||||
*
|
||||
* @return rms扫描路径
|
||||
*/
|
||||
@RequestMapping(value = "path/pattern", method = RequestMethod.GET)
|
||||
public RestResponse<String> getPathPatterns() {
|
||||
return new RestResponse<>(rmsConfig.getRmsPathPatterns());
|
||||
}
|
||||
|
||||
/**
|
||||
* 描述 : 获得rms配置详情
|
||||
*
|
||||
* @return rms配置详情
|
||||
*/
|
||||
@RequestMapping(value = "properties", method = RequestMethod.GET)
|
||||
public RestResponse<RmsProperties> getProperties() {
|
||||
return new RestResponse<>(rmsProperties);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user