Commit bcfed5b5 by 阳浪

配置信息

parent def59a6d
......@@ -41,7 +41,7 @@ public enum InternationalEnums {
SALTCONTROLLER3("SaltController3","用户名禁止明文传输"),
SALTCONTROLLER4("SaltController4","传递的appId有误"),
SALTCONTROLLER5("SaltController5","传递的盐和加密用户名中的盐不一致"),
SALTCONTROLLER6("SaltController6","学习平台暂无本账户信息,请联系管理员!"),
SALTCONTROLLER6("SaltController6","智慧党建暂无本账户信息,请联系管理员!"),
SALTCONTROLLER7("SaltController7","加密失败!"),
SALTCONTROLLER8("SaltController8","解密失败!"),
SALTCONTROLLER9("SaltController9","更新失败,无效的AppId"),
......
......@@ -4,8 +4,6 @@
package com.yizhi.core.application.log;
import com.yizhi.core.application.event.LogEvent;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
......@@ -16,11 +14,12 @@ import org.springframework.stereotype.Component;
@Component
public class LogEventPublisher{
@Autowired
RabbitTemplate rabbitTemplate;
/*@Autowired
RabbitTemplate rabbitTemplate;*/
public <T> void publish(LogEvent<T> event) {
rabbitTemplate.convertAndSend(event.getQueue(),event.getData());
//rabbitTemplate.convertAndSend(event.getQueue(),event.getData());
}
}
......@@ -17,8 +17,6 @@ import com.yizhi.core.application.operatelog.source.Version;
import com.yizhi.core.application.log.OperateLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;
......@@ -27,9 +25,9 @@ import com.yizhi.util.application.constant.QueueConstant;
import com.yizhi.util.application.json.JsonUtil;
public class OperationLogInteceptor implements HandlerInterceptor {
/*
@Autowired
private AmqpTemplate rabbitTemplate;
private AmqpTemplate rabbitTemplate;*/
private Logger logger = LoggerFactory.getLogger(getClass());
......@@ -86,7 +84,7 @@ public class OperationLogInteceptor implements HandlerInterceptor {
}
// 获取操作系统和浏览器信息
setBrowserAndOS(request, operateLog);
rabbitTemplate.convertAndSend(QueueConstant.OPERATE_LOG_QUEUE, operateLog);
//rabbitTemplate.convertAndSend(QueueConstant.OPERATE_LOG_QUEUE, operateLog);
logger.info("operate log ======", operateLog);
}
} catch (Exception el) {
......
......@@ -4,8 +4,6 @@
package com.yizhi.core.application.publish;
import com.yizhi.core.application.event.EventWrapper;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
......@@ -17,12 +15,13 @@ import org.springframework.stereotype.Component;
@Component
public class CloudEventPublisher {
@Autowired
RabbitTemplate rabbitTemplate;
//@Autowired
//RabbitTemplate rabbitTemplate;
public <T> void publish(String queue, EventWrapper<T> event) {
rabbitTemplate.convertAndSend(queue,event);
//rabbitTemplate.convertAndSend(queue,event);
}
}
\ No newline at end of file
......@@ -23,7 +23,6 @@ import io.jsonwebtoken.Claims;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
......
......@@ -9,7 +9,6 @@ import com.yizhi.logging.dto.RequestLogDTO;
import com.yizhi.util.application.constant.GlobalConstant;
import com.yizhi.util.application.constant.QueueConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
......@@ -42,9 +41,9 @@ public class LogPostFilter extends BaseZuulFilter {
@Value("${gateway.logSwitch:false}")
private Boolean logSwitch;
/*
@Autowired
private RabbitTemplate rabbitTemplate;
private RabbitTemplate rabbitTemplate;*/
@Override
public boolean shouldFilter() {
......@@ -110,7 +109,7 @@ public class LogPostFilter extends BaseZuulFilter {
.terminalType(getUserAgent(request.getHeader("User-Agent")))
.build();
rabbitTemplate.convertAndSend(QueueConstant.REQUEST_LOG_QUEUE, requestLogDTO);
//rabbitTemplate.convertAndSend(QueueConstant.REQUEST_LOG_QUEUE, requestLogDTO);
return null;
}
......
package com.yizhi.application.filter;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.nio.charset.Charset;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import com.yizhi.core.application.cache.CacheNamespace;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.stereotype.Component;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.util.StreamUtils;
import com.netflix.zuul.ZuulFilter;
import com.netflix.zuul.context.RequestContext;
import org.springframework.util.StringUtils;
/**
* @ClassName LogPostFilter
......
server.port=8090
spring.application.name=gateWay
ACTIVE=${spring.profiles.active}
spring.profiles.active=wmy4
spring.profiles.active=prod
# nacos
spring.cloud.nacos.config.shared-dataids=common-${spring.profiles.active}.properties
spring.cloud.nacos.config.namespace=${spring.profiles.active}
spring.cloud.nacos.config.prefix=${spring.application.name}
spring.cloud.nacos.config.file-extension=properties
spring.cloud.nacos.config.server-addr=192.168.1.9:8848
\ No newline at end of file
spring.cloud.nacos.config.server-addr=10.23.1.183:8848
\ No newline at end of file
......@@ -4,12 +4,13 @@ import com.yizhi.core.application.log.LogQueue;
import org.springframework.amqp.core.Queue;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
@SpringBootApplication(exclude = {RabbitAutoConfiguration.class})
@EnableDiscoveryClient
@ComponentScan(basePackages = {"com.yizhi"})
public class LogApplication {
......
server.port=35000
spring.application.name=log
ACTIVE=${spring.profiles.active}
spring.profiles.active=wmy401
spring.profiles.active=prod
# nacos
spring.cloud.nacos.config.shared-dataids=common-${spring.profiles.active}.properties
spring.cloud.nacos.config.namespace=${spring.profiles.active}
spring.cloud.nacos.config.prefix=${spring.application.name}
spring.cloud.nacos.config.file-extension=properties
spring.cloud.nacos.config.server-addr=192.168.1.7:3333
\ No newline at end of file
spring.cloud.nacos.config.server-addr=10.23.1.183:8848
\ No newline at end of file
......@@ -32,21 +32,6 @@
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus</artifactId>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-jdbc</artifactId>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.velocity</groupId>-->
<!-- <artifactId>velocity-engine-core</artifactId>-->
<!-- <version>2.0</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatisplus-spring-boot-starter</artifactId>
<version>1.0.5</version>
</dependency>
......
......@@ -58,7 +58,7 @@ public class MybatisCodeGenerator {
return super.processTypeConvert(fieldType);
}
});
dsc.setDriverName("com.mysql.jdbc.Driver");
dsc.setDriverName("com.mysql.cj.jdbc.Driver");
dsc.setUsername("root");
dsc.setPassword("fulan@321#$");
dsc.setUrl("jdbc:mysql://192.168.0.150:3306/cloud_message?characterEncoding=utf8");
......
......@@ -13,7 +13,7 @@ import java.util.List;
@Data
public class OutsideUserSyncVO {
@ApiModelProperty(value = "接入方的应用唯一标识(对接时学习平台会生成提供到给对方)")
@ApiModelProperty(value = "接入方的应用唯一标识(对接时智慧党建会生成提供到给对方)")
private String appId;
@ApiModelProperty(value = "接入的用户信息")
......
......@@ -20,10 +20,10 @@ public class SaltAccountVO {
@ApiModelProperty ("盐")
private String salt;
@ApiModelProperty ("学习平台提供给第三方的appId")
@ApiModelProperty ("智慧党建提供给第三方的appId")
private String appId;
@ApiModelProperty ("用户名验证方式:null或0=不验证用户名;1=第三方使用学习平台的加密规则验证用户名;2=学习平台使用第三方的加密规则验证用户名")
@ApiModelProperty ("用户名验证方式:null或0=不验证用户名;1=第三方使用智慧党建的加密规则验证用户名;2=智慧党建使用第三方的加密规则验证用户名")
private Integer type;
@ApiModelProperty ("终端类型:1=安卓,0=IOS,3=微信,4=PC")
......
......@@ -12,7 +12,7 @@ import lombok.Data;
public class SaltPlusAccountVO {
@ApiModelProperty ("学习平台提供给第三方的appId")
@ApiModelProperty ("智慧党建提供给第三方的appId")
private String appId;
@ApiModelProperty ("加密的账号名称(md5nm)")
......@@ -24,7 +24,7 @@ public class SaltPlusAccountVO {
@ApiModelProperty ("盐")
private String salt;
@ApiModelProperty ("用户名验证方式:null或0=不验证用户名;1=第三方使用学习平台的加密规则验证用户名;2=学习平台使用第三方的加密规则验证用户名")
@ApiModelProperty ("用户名验证方式:null或0=不验证用户名;1=第三方使用智慧党建的加密规则验证用户名;2=智慧党建使用第三方的加密规则验证用户名")
private Integer type;
@ApiModelProperty ("提供的一次性校验值,访问后立即失效")
......
......@@ -115,4 +115,8 @@
</plugins>
</build>
<properties>
<!-- 跳过测试 -->
<skipTests>true</skipTests>
</properties>
</project>
\ No newline at end of file
package com.yizhi.system.application; import feign.RequestInterceptor;import feign.RequestTemplate;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.cloud.client.discovery.EnableDiscoveryClient;import org.springframework.cloud.netflix.hystrix.EnableHystrix;import org.springframework.cloud.openfeign.EnableFeignClients;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.ComponentScan;import org.springframework.core.env.Environment;import org.springframework.scheduling.annotation.EnableAsync;import org.springframework.web.context.request.RequestContextHolder;import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest;import java.net.InetAddress;import java.net.UnknownHostException;import java.util.Enumeration; @EnableHystrix@SpringBootApplication@EnableDiscoveryClient@EnableFeignClients(basePackages = "com.yizhi")@EnableAsync@ComponentScan(basePackages = {"com.yizhi"})public class SystemApplication { private static final Logger logger = LoggerFactory.getLogger(SystemApplication.class); public static void main(String[] args) throws UnknownHostException { Environment env = SpringApplication.run(SystemApplication.class, args).getEnvironment(); String port = env.getProperty("server.port", "8080"); logger.info( "Access URLs:\n----------------------------------------------------------\n\t" + "Local: \t\thttp://127.0.0.1:{}\n\t" + "External: \thttp://{}:{}\n----------------------------------------------------------", port, InetAddress.getLocalHost().getHostAddress(), port); } @Bean //帮助调其他服务时,能取到上下文里面的信息 public RequestInterceptor headerInterceptor() { return new RequestInterceptor() { @Override public void apply(RequestTemplate requestTemplate) { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder .getRequestAttributes(); if (attributes != null) { HttpServletRequest request = attributes.getRequest(); Enumeration<String> headerNames = request.getHeaderNames(); if (headerNames != null) { while (headerNames.hasMoreElements()) { String name = headerNames.nextElement(); String values = request.getHeader(name); requestTemplate.header(name, values); } } } } }; } }
\ No newline at end of file
package com.yizhi.system.application; import feign.RequestInterceptor;import feign.RequestTemplate;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;import org.springframework.cloud.client.discovery.EnableDiscoveryClient;import org.springframework.cloud.netflix.hystrix.EnableHystrix;import org.springframework.cloud.openfeign.EnableFeignClients;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.ComponentScan;import org.springframework.core.env.Environment;import org.springframework.scheduling.annotation.EnableAsync;import org.springframework.web.context.request.RequestContextHolder;import org.springframework.web.context.request.ServletRequestAttributes; import javax.servlet.http.HttpServletRequest;import java.net.InetAddress;import java.net.UnknownHostException;import java.util.Enumeration; @EnableHystrix@SpringBootApplication(exclude = {RabbitAutoConfiguration.class})@EnableDiscoveryClient@EnableFeignClients(basePackages = "com.yizhi")@EnableAsync@ComponentScan(basePackages = {"com.yizhi"})public class SystemApplication { private static final Logger logger = LoggerFactory.getLogger(SystemApplication.class); public static void main(String[] args) throws UnknownHostException { Environment env = SpringApplication.run(SystemApplication.class, args).getEnvironment(); String port = env.getProperty("server.port", "8080"); logger.info( "Access URLs:\n----------------------------------------------------------\n\t" + "Local: \t\thttp://10.23.1.183:{}\n\t" + "External: \thttp://{}:{}\n----------------------------------------------------------", port, InetAddress.getLocalHost().getHostAddress(), port); } @Bean //帮助调其他服务时,能取到上下文里面的信息 public RequestInterceptor headerInterceptor() { return new RequestInterceptor() { @Override public void apply(RequestTemplate requestTemplate) { ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder .getRequestAttributes(); if (attributes != null) { HttpServletRequest request = attributes.getRequest(); Enumeration<String> headerNames = request.getHeaderNames(); if (headerNames != null) { while (headerNames.hasMoreElements()) { String name = headerNames.nextElement(); String values = request.getHeader(name); requestTemplate.header(name, values); } } } } }; } }
\ No newline at end of file
......
......@@ -5,7 +5,7 @@ package com.yizhi.system.application.constant;
*/
public interface CommunityParams {
final static String GET_TOKEN_LOCATION = "http://127.0.0.1:8301";
final static String GET_TOKEN_LOCATION = "http://10.23.1.183:8301";
final static String GET_TOKEN_URL = "/auth/oauth/token";
final static String SYMBOL_1 = "?";
final static String SYMBOL_2 = "=";
......
......@@ -7,7 +7,7 @@ public enum OutsideUserMsg {
TOKEN_INVALID("19011","令牌无效!"),
USER_IS_NULL("19010","用户名为空!"),
USER_STATUS_EXISTS("19009","同步的用户必须指定状态!"),
USER_NOT_EXISTS("19008","学习平台暂无本账户信息,请联系管理员!"),
USER_NOT_EXISTS("19008","智慧党建暂无本账户信息,请联系管理员!"),
USER_INFO_DECRYP_ERROR("19007","包含用户信息解密失败"),
USER_ORG_NAME_IS_EMPTY("19006","包含用户组织信息为空的用户"),
USER_FULL_NAME_IS_EMPTY("19005","包含用户昵称为空的用户"),
......
......@@ -54,7 +54,6 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.session.RowBounds;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -104,9 +103,9 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
private OrganizationCacheService organizationCacheService;
@Autowired
private AuthService authService;
/*
@Autowired
RabbitTemplate rabbitTemplate;
RabbitTemplate rabbitTemplate;*/
@Autowired
RedisCache redisCache;
......@@ -1491,7 +1490,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
rootOrg = rootOrg.selectOne(rootOrgEw);
if (null == rootOrg) {
failEvents.add(new TaskLogDetailEvent(taskId, "!!!查找根组织错误:未成功查询到根组织!!!"));
rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents);
// rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents);
return models;
}
......@@ -2044,7 +2043,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, Account> impl
}
//错误的信息发送给任务详情表
if (CollectionUtils.isNotEmpty(failEvents)) {
rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents);
// rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents);
}
return models;
} else {
......
......@@ -50,7 +50,6 @@ import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cache.annotation.Cacheable;
......@@ -85,8 +84,8 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
private SiteMapper siteMapper;
@Autowired
private AuthzGroupMemberMapper groupMemberMapper;
@Autowired
RabbitTemplate rabbitTemplate;
/*@Autowired
RabbitTemplate rabbitTemplate;*/
@Autowired
private IAuthzGroupMemberService groupMemberService;
@Autowired
......@@ -436,7 +435,7 @@ public class OrganizationServiceImpl extends ServiceImpl<OrganizationMapper, Org
}
//错误的信息发送给任务详情表
if (CollectionUtils.isNotEmpty(failEvents)) {
rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents);
//rabbitTemplate.convertAndSend(LogQueue.BATCH_TASK_LOG_DETAIL_QUEUE, failEvents);
}
}
return impModels;
......
server.port=35000
spring.application.name=system
ACTIVE=${spring.profiles.active}
spring.profiles.active=dev
spring.profiles.active=prod
# nacos
spring.cloud.nacos.config.shared-dataids=common-${spring.profiles.active}.properties
spring.cloud.nacos.config.namespace=${spring.profiles.active}
spring.cloud.nacos.config.prefix=${spring.application.name}
spring.cloud.nacos.config.file-extension=properties
spring.cloud.nacos.config.server-addr=192.168.1.22:3333
spring.cloud.nacos.config.server-addr=10.23.1.183:8848
mybatis-plus.global-config.logic-not-delete-value=0
mybatis-plus.global-config.logic-delete-value=1
mybatis-plus.global-config.sql-injector=com.baomidou.mybatisplus.mapper.LogicSqlInjector
......@@ -53,7 +53,7 @@
// DataSourceConfig dsc = new DataSourceConfig();
// dsc.setUrl("jdbc:mysql://172.17.3.163:3306/czt?useUnicode=true&useSSL=false&characterEncoding=utf8");
// // dsc.setSchemaName("public");
// dsc.setDriverName("com.mysql.jdbc.Driver");
// dsc.setDriverName("com.mysql.cj.jdbc.Driver");
// dsc.setUsername("root");
// dsc.setPassword("123456");
// mpg.setDataSource(dsc);
......
connection.url=jdbc:mysql://192.168.0.150:3306/cloud_security?useUnicode=true&characterEncoding=UTF-8&relaxAutoCommit=true&zeroDateTimeBehavior=convertToNull
connection.driverClassName=com.mysql.jdbc.Driver
connection.driverClassName=com.mysql.cj.jdbc.Driver
connection.username=root
connection.password=fulan@321#$
......@@ -146,7 +146,7 @@ public class RegexUtil {
}
/**
* 匹配IP地址(简单匹配,格式,如:192.168.1.1,127.0.0.1,没有匹配IP段的大小)
* 匹配IP地址(简单匹配,格式,如:192.168.1.1,10.23.1.183,没有匹配IP段的大小)
* @param ipAddress IPv4标准地址
* @return 验证成功返回true,验证失败返回false
*/
......
......@@ -55,8 +55,8 @@
<repositories>
<repository>
<id>learning-data-group</id>
<url>http://192.168.0.15:8081/repository/learning-data-group/</url>
<id>hqzhdj-data-group</id>
<url>http://192.168.0.15:8081/repository/hqzhdj-data-group/</url>
<releases>
<enabled>true</enabled>
</releases>
......@@ -69,8 +69,8 @@
<distributionManagement>
<snapshotRepository>
<id>learning-data</id>
<url>http://192.168.0.15:8081/repository/learning-data/</url>
<id>hqzhdj-data</id>
<url>http://192.168.0.15:8081/repository/hqzhdj-data/</url>
</snapshotRepository>
</distributionManagement>
......
......@@ -7,7 +7,7 @@
"parentPom": "elearn",
"servicePom": "elearn/cloud-system",
"dev": {
"JAVA_OPTS": "-Dspring.profiles.active=dev -Dspring.cloud.nacos.config.server-addr=192.168.1.22:3333,192.168.1.22:4444,192.168.1.22:5555"
"JAVA_OPTS": "-Dspring.profiles.active=prod -Dspring.cloud.nacos.config.server-addr=192.168.1.22:3333,192.168.1.22:4444,192.168.1.22:5555"
},
"sit": {
"JAVA_OPTS": "-Dspring.profiles.active=sit -Dspring.cloud.nacos.config.server-addr=192.168.1.13:3333,192.168.1.24:4444,192.168.1.38:5555"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment