mongodb整合,功能优化调整

yun-zuoyi
alwaysfrin 7 years ago
parent f5732c6ffb
commit 1a40cde203

@ -1,5 +1,6 @@
package cn.estsh.i3plus.core.api.iservice.busi;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
import java.util.List;
@ -16,31 +17,34 @@ public interface ILogOperateService {
/**
*
* @param logOperate
* @return
*/
void insertLogOperate(LogOperate logOperate);
LogOperate insertLogOperate(LogOperate logOperate);
/**
*
* @param id
*
* @param logOperate
* @param pager
* @return
*/
void deleteLogOperateById(String id);
List<LogOperate> listLogOperate(LogOperate logOperate,Pager pager);
/**
*
* @param logOperate
* id
* @param id
*/
void updateLogOperate(LogOperate logOperate);
void deleteLogOperateById(long id);
/**
*
* @return
*
* @param ids
*/
List<LogOperate> listLogOperate();
void deleteLogOperateByIds(String[] ids);
/**
* id
* id
* @param id
* @return
*/
LogOperate getLogOperateById(String id);
LogOperate getLogOperateById(long id);
}

@ -2,6 +2,7 @@ package cn.estsh.i3plus.core.api.iservice.busi;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleLanguage;
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleResource;

@ -0,0 +1,112 @@
package cn.estsh.i3plus.core.apiservice.controller;
import cn.estsh.i3plus.core.api.iservice.busi.ILogOperateService;
import cn.estsh.i3plus.core.api.iservice.busi.ISystemResourceService;
import cn.estsh.i3plus.platform.common.convert.ConvertBean;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleLanguage;
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleResource;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Locale;
/**
* @Description : demo
* @Reference :
* @Author : alwaysfrin
* @CreateDate : 2018-09-26 10:34
* @Modify:
**/
@RestController
@RequestMapping("/demo-mongo-service")
@Api(description="系统服务demo")
public class DemoMongoController {
private static final Logger LOGGER = LoggerFactory.getLogger(DemoMongoController.class);
@Autowired
private ILogOperateService logOperateService;
@PostMapping(value="/logoperate/insert")
@ApiOperation(value="添加操作日志",notes = "添加操作日志,可用于国际化")
public ResultBean insertLogOperate(LogOperate logOperate) {
try {
logOperateService.insertLogOperate(logOperate);
return ResultBean.success("操作成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
LOGGER.error(busExcep.getErrorMsg() + "{}",busExcep.getErrorDetail(),busExcep);
return ResultBean.fail(busExcep.getErrorShow()).build();
}catch(Exception e){
LOGGER.error(e.getMessage(),e);
return ResultBean.fail(e.getMessage()).setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
}
}
/**
*
* @return
*/
@DeleteMapping(value="/logoperate/delete/{id}")
@ApiOperation(value="删除日志",notes = "删除日志")
public ResultBean deleteLog(@PathVariable String id) {
try {
logOperateService.deleteLogOperateById(Long.parseLong(id));
return ResultBean.success("删除日志成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
LOGGER.error(busExcep.getErrorMsg() + "{}",busExcep.getErrorDetail(),busExcep);
return ResultBean.fail(busExcep.getErrorShow()).build();
}catch(Exception e){
return ResultBean.fail(e.getMessage()).setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
}
}
@GetMapping(value="/logoperate/query")
@ApiOperation(value="查询日志",notes = "查询日志")
public ResultBean queryLanguage(LogOperate logOperate,Pager pager) {
try {
List logList = logOperateService.listLogOperate(logOperate,pager);
return ResultBean.success("操作成功").setResultList(logList).setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
LOGGER.error(busExcep.getErrorMsg() + "{}",busExcep.getErrorDetail(),busExcep);
return ResultBean.fail(busExcep.getErrorShow());
}catch(Exception e){
LOGGER.error(ImppExceptionEnum.SYSTEM_EXCEPTION.getDescription() + "{}",e.getMessage(),e);
return ResultBean.fail().setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
}
}
@GetMapping(value="/logoperate/get/{id}")
@ApiOperation(value="根据id查询日志",notes = "根据id查询日志")
public ResultBean getLogById(@PathVariable String id) {
try {
logOperateService.getLogOperateById(Long.parseLong(id));
return ResultBean.success().setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
LOGGER.error(busExcep.getErrorMsg() + "{}",busExcep.getErrorDetail(),busExcep);
return ResultBean.fail(busExcep.getErrorShow());
}catch(Exception e){
LOGGER.error(ImppExceptionEnum.SYSTEM_EXCEPTION.getDescription() + "{}",e.getMessage(),e);
return ResultBean.fail().setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
}
}
}

@ -64,7 +64,7 @@ public class LogOperateController {
// 条件验证
ValidatorBean.checkNotNull(id,"id不能为空");
logOperateService.deleteLogOperateById(id);
logOperateService.deleteLogOperateById(Long.parseLong(id));
return ResultBean.success("删除成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
LOGGER.error(busExcep.getErrorMsg() + "{}",busExcep.getErrorDetail(),busExcep);
@ -75,31 +75,11 @@ public class LogOperateController {
}
}
@PutMapping(value = "/update")
@ApiOperation(value = "修改操作日志",notes = "修改操作日志")
public ResultBean updateLogOperate(LogOperate logOperate){
try {
// 登录用户
SessionUser user = AuthUtil.getSessionUser();
// 修改初始化
ConvertBean.modelUpdate(logOperate,user);
logOperateService.updateLogOperate(logOperate);
return ResultBean.success("修改成功").setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
}catch(ImppBusiException busExcep){
LOGGER.error(busExcep.getErrorMsg() + "{}",busExcep.getErrorDetail(),busExcep);
return ResultBean.fail(busExcep.getErrorShow());
}catch(Exception e){
LOGGER.error(ImppExceptionEnum.SYSTEM_EXCEPTION.getDescription() + "{}",e.getMessage(),e);
return ResultBean.fail().setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
}
}
@GetMapping(value = "/list")
@ApiOperation(value = "查询全部操作日志",notes = "查询全部操作日志")
public ResultBean findLogOperateAll(){
try {
List<LogOperate> logOperateList = logOperateService.listLogOperate();
List<LogOperate> logOperateList = logOperateService.listLogOperate(null,null);
return ResultBean.success("查询成功")
.setResultList(logOperateList)
.setCode(ResourceEnumUtil.MESSAGE.SUCCESS.getCode());
@ -117,7 +97,7 @@ public class LogOperateController {
@ApiOperation(value = "根据id查询操作日志",notes = "根据id查询操作日志")
public ResultBean getLogOperateById(@PathParam("id") String id){
try{
LogOperate logOperate = logOperateService.getLogOperateById(id);
LogOperate logOperate = logOperateService.getLogOperateById(Long.parseLong(id));
if (logOperate != null) {
return ResultBean.success("查询成功")
.setResultObject(logOperate)

@ -131,6 +131,7 @@ public class OrganizeController {
LOGGER.error(busExcep.getErrorMsg() + "{}", busExcep.getErrorDetail(), busExcep);
return ResultBean.fail(busExcep.getErrorShow());
} catch (Exception e) {
e.printStackTrace();
LOGGER.error(ImppExceptionEnum.SYSTEM_EXCEPTION.getDescription() + "{}", e.getMessage(), e);
return ResultBean.fail().setCode(ImppExceptionEnum.SYSTEM_EXCEPTION.getCode());
}

@ -64,7 +64,7 @@ public class SysResourceBindleListener implements ApplicationListener<ContextRef
for(String key : resMap.keySet()){
//放入缓存
redisRes.putHashMap(key,resMap.get(key));
redisRes.putHashMap(key,resMap.get(key),0);
}
LOGGER.info("【资源配置文件已全部加载:{}】",resMap.size());

@ -0,0 +1,66 @@
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.core.api.iservice.busi.ILogOperateService;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
import cn.estsh.i3plus.pojo.platform.repository.LogOperateRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Optional;
/**
* @Description :
* @Reference :
* @Author : yunhao
* @Date : 2018-10-25 13:54
* @Modify :
**/
@Service
public class LogOperateService implements ILogOperateService {
public static final Logger LOGGER = LoggerFactory.getLogger(LogOperateService.class);
@Autowired
public LogOperateRepository logOperateRDao;
@Override
public LogOperate insertLogOperate(LogOperate logOperate) {
return logOperateRDao.insert(logOperate);
}
@Override
public List<LogOperate> listLogOperate(LogOperate logOperate, Pager pager) {
return logOperateRDao.findAll();
}
@Override
public void deleteLogOperateById(long id) {
logOperateRDao.deleteById(id);
}
@Override
public void deleteLogOperateByIds(String[] ids) {
for(String idStr : ids){
logOperateRDao.deleteById(Long.parseLong(idStr));
}
}
@Override
public LogOperate getLogOperateById(long id) {
System.out.println("id====" + id);
List list = logOperateRDao.findAll();
System.out.println(list.size());
Optional optional = logOperateRDao.findById(id);
if(optional != null) {
System.out.println(optional);
System.out.println(optional.get());
return (LogOperate) optional.get();
}else{
return null;
}
}
}

@ -1,56 +0,0 @@
package cn.estsh.i3plus.core.apiservice.serviceimpl.busi;
import cn.estsh.i3plus.core.api.iservice.busi.ILogOperateService;
import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
import cn.estsh.i3plus.pojo.platform.repository.LogOperateRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @Description :
* @Reference :
* @Author : yunhao
* @Date : 2018-10-25 13:54
* @Modify :
**/
@Service
public class LogOperateServiceImpl implements ILogOperateService {
public static final Logger LOGGER = LoggerFactory.getLogger(LogOperateServiceImpl.class);
@Autowired
public LogOperateRepository logOperateRDao;
@Override
public void insertLogOperate(LogOperate logOperate) {
LOGGER.info("操作日志 LOG_ACTION :{}",logOperate);
logOperateRDao.insert(logOperate);
}
@Override
public void deleteLogOperateById(String id) {
LOGGER.info("操作日志 LOG_ACTION id:{}",id);
logOperateRDao.deleteById(Long.parseLong(id));
}
@Override
public void updateLogOperate(LogOperate logOperate) {
LOGGER.info("操作日志 LOG_ACTION :{}",logOperate);
logOperateRDao.update(logOperate);
}
@Override
public List<LogOperate> listLogOperate() {
LOGGER.info("操作日志 LOG_ACTION list");
return logOperateRDao.list();
}
@Override
public LogOperate getLogOperateById(String id) {
LOGGER.info("操作日志 LOG_ACTION id:{}",id);
return logOperateRDao.getById(Long.parseLong(id));
}
}

@ -18,8 +18,8 @@ import java.util.List;
* @Modify :
**/
@Service
public class LogSystemServiceImpl implements ILogSystemService {
public static final Logger LOGGER = LoggerFactory.getLogger(LogSystemServiceImpl.class);
public class LogSystemService implements ILogSystemService {
public static final Logger LOGGER = LoggerFactory.getLogger(LogSystemService.class);
@Autowired
private LogSystemRepository logSystemRDao;
@ -39,18 +39,20 @@ public class LogSystemServiceImpl implements ILogSystemService {
@Override
public void updateLogSystem(LogSystem logSystem) {
LOGGER.info("系统日志 SYS_SYSTEM {}",logSystem);
logSystemRDao.update(logSystem);
//logSystemRDao.update(logSystem);
}
@Override
public List<LogSystem> listLogSystem() {
LOGGER.info("系统日志 LOG_SYSTEM list");
return logSystemRDao.list();
//return logSystemRDao.list();
return null;
}
@Override
public LogSystem getLogSystemById(String id) {
LOGGER.info("系统日志 LOG_SYSTEM id:{}",id);
return logSystemRDao.getById(Long.parseLong(id));
//return logSystemRDao.getById(Long.parseLong(id));
return null;
}
}

@ -93,6 +93,6 @@ public class OrganizeServiceImpl implements IOrganizeService {
@Override
public Organize getOrganizeById(String id) {
LOGGER.info("组织 ORGANIZE find id:{}", id);
return organizeRDao.getOne(Long.parseLong(id));
return organizeRDao.getById(Long.parseLong(id));
}
}

@ -5,16 +5,24 @@ import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.bean.ListPager;
import cn.estsh.i3plus.pojo.base.common.Pager;
import cn.estsh.i3plus.pojo.base.common.PagerHelper;
import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleLanguage;
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleResource;
import cn.estsh.i3plus.pojo.platform.repository.LogOperateRepository;
import cn.estsh.i3plus.pojo.platform.repository.LogSystemRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysLocaleLanguageRepository;
import cn.estsh.i3plus.pojo.platform.repository.SysLocaleResourceRepository;
import cn.estsh.i3plus.pojo.platform.sqlpack.CoreHqlPack;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.util.ImppRedis;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description :
@ -26,12 +34,21 @@ import java.util.List;
@Service
public class SystemResourceService implements ISystemResourceService {
@Resource(name="redisRes")
private ImppRedis redisRes;
@Autowired
private SysLocaleLanguageRepository sysLocaleLanguageRDao;
@Autowired
private SysLocaleResourceRepository sysLocaleResourceRDao;
@Autowired
private LogOperateRepository logOperateRDao;
@Autowired
private LogSystemRepository logSystemRDao;
@Override
public SysLocaleLanguage insertSysLocaleLanguage(SysLocaleLanguage lang) {
return sysLocaleLanguageRDao.insert(lang);
@ -72,12 +89,31 @@ public class SystemResourceService implements ISystemResourceService {
@Override
public SysLocaleResource insertSysLocaleResource(SysLocaleResource res) {
return sysLocaleResourceRDao.insert(res);
res = sysLocaleResourceRDao.insert(res);
putResourceToCache(res); //更新缓存
return res;
}
@Override
public SysLocaleResource updateSysLocaleResource(SysLocaleResource res) {
return sysLocaleResourceRDao.save(res);
res = sysLocaleResourceRDao.save(res);
putResourceToCache(res); //更新缓存
return res;
}
private void putResourceToCache(SysLocaleResource res){
//通过编码获取语言资源
Map resMap = redisRes.getHashMap(res.getResourceKey());
if(resMap != null ) {
// 语言,国际化内容
resMap.put(res.getLanguageCode(),res.getResourceValue());
}else{
resMap = new HashMap<String,String>();
resMap.put(res.getLanguageCode(),res.getResourceValue());
redisRes.putHashMap(res.getResourceKey(),resMap,0);
}
}
@Override

@ -1,3 +1,6 @@
#项目端口
server.port=8080
#用户登陆路径
filter.shiro.user.loginuri = /login
#系统管理员登陆路径
@ -17,6 +20,13 @@ impp.web.cross = false
#允许前端跨域提交ip地址多个以逗号分隔
impp.web.cross.hosts = http://localhost
################ 日志据源 ################
spring.data.mongodb.database=mongoDBSource
spring.data.mongodb.uri=192.168.1.55:27017
spring.data.mongodb.username=sa
spring.data.mongodb.password=i3plus
spring.data.mongodb.port=27017
################ 主数据源 ################
# mysql
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver

@ -0,0 +1,106 @@
#项目端口
server.port=8080
#用户登陆路径
filter.shiro.user.loginuri = /login
#系统管理员登陆路径
filter.shiro.admin.loginuri = /salogin
#运维人员登陆路径
filter.shiro.saadmin.loginuri = /salogin
#用户授权过滤路径
filter.shiro.user.filteruri = /operate/*
#用户授权过滤路径
filter.shiro.admin.filteruri = /adoperate/*
#用户授权过滤路径
filter.shiro.saadmin.filteruri = /saoperate/*
#是否允许前端跨域提交impp.web.cross.hosts
impp.web.cross = false
#允许前端跨域提交ip地址多个以逗号分隔
impp.web.cross.hosts = http://localhost
################ log-db据源 ################
spring.data.mongodb.uri=mongodb://sa:i3plus@192.168.1.55:27017/i3plus
################ 主数据源 ################
# mysql
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.url=jdbc:mysql://localhost:3306/i3wms
##Sql-server##
#spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver
#spring.datasource.url=jdbc:sqlserver://127.0.0.1:1433;databaseName=i3wms
##oracle##
#spring.datasource.driver-class-name=oracle.jdbc.driver.OracleDriver
#spring.datasource.url=jdbc:oracle:thin:@127.0.0.1:1521:i3wms
#spring.datasource.username=root
#spring.datasource.password=123456
##主数据源,读写
#impp.write.datasource.type=com.zaxxer.hikari.HikariDataSource
impp.write.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.write.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8
impp.write.datasource.username=i3_dev_core
impp.write.datasource.password=i3_core_pass
##辅数据源,只读
#impp.read.datasource.type=com.zaxxer.hikari.HikariDataSource
impp.read.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.read.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8
impp.read.datasource.username=i3_dev_core
impp.read.datasource.password=i3_core_pass
##############定时任务持久化##############
impp.schedule.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.schedule.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_schedule?autoReconnect=true&useSSL=false&characterEncoding=utf-8
impp.schedule.datasource.username=i3_dev_schedule
impp.schedule.datasource.password=i3_schedule_pass
impp.schedule.datasource.max-connections=20
#定时任务在服务启动后多少秒执行
impp.schedule.start.after-second=20
#是否集群部署
impp.schedule.datasource.is-clustered=true
#执行检测(毫秒),若宕机由其他定时器执行
impp.schedule.datasource.cluster-checkin-interval=30000
#线程数
impp.schedule.thread-count=10
#线程优先级1-10默认为5
impp.schedule.thread-priority=5
################ 数据池设置 ################
spring.datasource.maximum-pool-size=100
spring.datasource.max-active=3
spring.datasource.max-idle=3
spring.datasource.min-idle=1
spring.datasource.initial-size=1
spring.datasource.max-wait=10000
spring.datasource.validation-query=SELECT 1
spring.datasource.test-on-borrow=false
spring.datasource.test-while-idle=true
spring.datasource.time-between-eviction-runs-millis=18800
################ JPA设置设置 ################
# mysql
spring.jpa.database=MYSQL
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
##Sql-server##
#spring.jpa.database=sql_server
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLServerDialect
##oracle##
#spring.jpa.database=oracle
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
# mysql
spring.datasource.validationQuery=SELECT 1
##Sql-server##
# spring.datasource.validationQuery=SELECT 1
##oracle##
# spring.datasource.validationQuery=SELECT 1 FROM DUAL
#ImprovedNamingStrategy / physical_naming_strategy java属性映射到数据库字段时命名规则
# spring.jpa.properties.hibernate.physical_naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy/org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
#表关系create,create-drop,update,validate
spring.jpa.properties.hibernate.hbm2ddl.auto=update
#是否显示sql
spring.jpa.show-sql=true

@ -1,18 +1,29 @@
#用户登陆路径
#项目端口
server.port=8080
#用户登陆路径
filter.shiro.user.loginuri = /login
#系统管理员登陆路径
#系统管理员登陆路径
filter.shiro.admin.loginuri = /salogin
#运维人员登陆路径
#运维人员登陆路径
filter.shiro.saadmin.loginuri = /salogin
#用户授权过滤路径
#用户授权过滤路径
filter.shiro.user.filteruri = /operate/*
#用户授权过滤路径
#用户授权过滤路径
filter.shiro.admin.filteruri = /adoperate/*
#用户授权过滤路径
#用户授权过滤路径
filter.shiro.saadmin.filteruri = /saoperate/*
################ 主数据源 ################
#是否允许前端跨域提交impp.web.cross.hosts
impp.web.cross = false
#允许前端跨域提交ip地址多个以逗号分隔
impp.web.cross.hosts = http://localhost
################ log-db据源 ################
spring.data.mongodb.uri=mongodb://sa:i3plus@192.168.1.55:27017/i3plus
################ 主数据源 ################
# mysql
#spring.datasource.driver-class-name=com.mysql.jdbc.Driver
#spring.datasource.url=jdbc:mysql://localhost:3306/i3wms
@ -25,39 +36,39 @@ filter.shiro.saadmin.filteruri = /saoperate/*
#spring.datasource.username=root
#spring.datasource.password=123456
##主数据源,读写
##主数据源,读写
#impp.write.datasource.type=com.zaxxer.hikari.HikariDataSource
impp.write.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.write.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/test_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8
impp.write.datasource.username=i3_core
impp.write.datasource.password=i3_core_123456
impp.write.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8
impp.write.datasource.username=i3_dev_core
impp.write.datasource.password=i3_core_pass
##辅数据源,只读
##辅数据源,只读
#impp.read.datasource.type=com.zaxxer.hikari.HikariDataSource
impp.read.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.read.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/test_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8
impp.read.datasource.username=i3_core
impp.read.datasource.password=i3_core_123456
impp.read.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_core?autoReconnect=true&useSSL=false&characterEncoding=utf-8
impp.read.datasource.username=i3_dev_core
impp.read.datasource.password=i3_core_pass
##############定时任务持久化##############
##############定时任务持久化##############
impp.schedule.datasource.driver-class-name=com.mysql.jdbc.Driver
impp.schedule.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/test_i3_schedule?autoReconnect=true&useSSL=false&characterEncoding=utf-8
impp.schedule.datasource.username=i3_schedule
impp.schedule.datasource.password=i3_schedule_123456
impp.schedule.datasource.jdbc-url=jdbc:mysql://192.168.1.55:3306/dev_i3_schedule?autoReconnect=true&useSSL=false&characterEncoding=utf-8
impp.schedule.datasource.username=i3_dev_schedule
impp.schedule.datasource.password=i3_schedule_pass
impp.schedule.datasource.max-connections=20
#定时任务在服务启动后多少秒执行
#定时任务在服务启动后多少秒执行
impp.schedule.start.after-second=20
#是否集群部署
#是否集群部署
impp.schedule.datasource.is-clustered=true
#执行检测(毫秒),若宕机由其他定时器执行
#执行检测(毫秒),若宕机由其他定时器执行
impp.schedule.datasource.cluster-checkin-interval=30000
#线程数
#线程数
impp.schedule.thread-count=10
#线程优先级1-10默认为5
#线程优先级1-10默认为5
impp.schedule.thread-priority=5
################ 数据池设置 ################
################ 数据池设置 ################
spring.datasource.maximum-pool-size=100
spring.datasource.max-active=3
spring.datasource.max-idle=3
@ -69,7 +80,7 @@ spring.datasource.test-on-borrow=false
spring.datasource.test-while-idle=true
spring.datasource.time-between-eviction-runs-millis=18800
################ JPA设置设置 ################
################ JPA设置设置 ################
# mysql
spring.jpa.database=MYSQL
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialect
@ -87,9 +98,9 @@ spring.datasource.validationQuery=SELECT 1
##oracle##
# spring.datasource.validationQuery=SELECT 1 FROM DUAL
#ImprovedNamingStrategy / physical_naming_strategy java属性映射到数据库字段时命名规则
#ImprovedNamingStrategy / physical_naming_strategy java属性映射到数据库字段时命名规则
# spring.jpa.properties.hibernate.physical_naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy/org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
#表关系create,create-drop,update,validate
#表关系create,create-drop,update,validate
spring.jpa.properties.hibernate.hbm2ddl.auto=update
#是否显示sql
#是否显示sql
spring.jpa.show-sql=true

@ -1,7 +1,5 @@
#项目名称
spring.application.name=${project.name}
#项目端口
server.port=8080
#使用配置
spring.profiles.active=dev

Loading…
Cancel
Save