Browse Source

config改名

master
liuchen 10 months ago
parent
commit
d9b494a11c
  1. 15
      src/main/java/com/win/mq/config/MQConfigure.java
  2. 28
      src/main/java/com/win/mq/config/RMQConfigure.java
  3. 7
      src/main/java/com/win/mq/controller/ProduceController.java
  4. 4
      src/main/java/com/win/mq/utils/FileUtil.java

15
src/main/java/com/win/mq/config/MQConfigure.java

@ -0,0 +1,15 @@
package com.win.mq.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
@Data
@Configuration
@ConfigurationProperties(prefix = "rocketmq.config")
public class MQConfigure {
private String dataPath;
}

28
src/main/java/com/win/mq/config/RMQConfigure.java

@ -1,28 +0,0 @@
package com.win.mq.config;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.common.MixAll;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.web.server.ErrorPage;
import org.springframework.boot.web.server.ErrorPageRegistrar;
import org.springframework.boot.web.server.ErrorPageRegistry;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import java.io.File;
import static org.apache.rocketmq.client.ClientConfig.SEND_MESSAGE_WITH_VIP_CHANNEL_PROPERTY;
@Data
@Configuration
@ConfigurationProperties(prefix = "rocketmq.config")
public class RMQConfigure {
private String dataPath;
}

7
src/main/java/com/win/mq/controller/ProduceController.java

@ -1,7 +1,7 @@
package com.win.mq.controller;
import com.win.mq.common.CommonResult;
import com.win.mq.config.RMQConfigure;
import com.win.mq.config.MQConfigure;
import com.win.mq.exception.GlobalErrorCodeConstants;
import com.win.mq.rocket.RocketMQProducer;
import com.win.mq.utils.FileUtil;
@ -12,12 +12,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.DigestUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@Slf4j
@ -26,7 +23,7 @@ import java.util.List;
public class ProduceController {
@Autowired
private RMQConfigure configure;
private MQConfigure configure;
@Autowired
private FileUtil fileUtil;
@Autowired

4
src/main/java/com/win/mq/utils/FileUtil.java

@ -1,6 +1,6 @@
package com.win.mq.utils;
import com.win.mq.config.RMQConfigure;
import com.win.mq.config.MQConfigure;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@ -14,7 +14,7 @@ import java.io.IOException;
@Component
public class FileUtil {
@Autowired
private RMQConfigure configure;
private MQConfigure configure;
private String[] defaultTags;
public String[] readTags(String fileName) {

Loading…
Cancel
Save