Commit 5e6533a4 by naan1993

删掉测试多数据源的代码

parent e60994cc
package com.stylefeng.guns.modular.biz.service;
/**
* 测试多数据源的服务
*
* @author fengshuonan
* @date 2017-06-23 23:01
*/
public interface ITestService {
/**
* 测试多数据源的业务
*
* @author stylefeng
* @Date 2017/6/23 23:02
*/
void testBiz();
/**
* 测试多数据源的业务
*
* @author stylefeng
* @Date 2017/6/23 23:02
*/
void testGuns();
/**
* 测试多数据源的业务
*
* @author stylefeng
* @Date 2017/6/23 23:02
*/
void testAll();
}
package com.stylefeng.guns.modular.biz.service.impl;
import com.stylefeng.guns.common.constant.DSEnum;
import com.stylefeng.guns.common.persistence.dao.TestMapper;
import com.stylefeng.guns.common.persistence.model.Test;
import com.stylefeng.guns.core.mutidatasource.annotion.DataSource;
import com.stylefeng.guns.modular.biz.service.ITestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* 测试服务
*
* @author fengshuonan
* @date 2017-06-23 23:02
*/
@Service
public class TestServiceImpl implements ITestService {
@Autowired
TestMapper testMapper;
@Override
@DataSource(name = DSEnum.DATA_SOURCE_BIZ)
public void testBiz() {
Test test = testMapper.selectById(1);
test.setId(22);
test.insert();
}
@Override
@DataSource(name = DSEnum.DATA_SOURCE_GUNS)
public void testGuns() {
Test test = testMapper.selectById(1);
test.setId(33);
test.insert();
}
@Override
@Transactional
public void testAll() {
testBiz();
testGuns();
//int i = 1 / 0;
}
}
......@@ -13,7 +13,7 @@ public class GunsGeneratorConfig extends AbstractGeneratorConfig {
@Override
protected void globalConfig() {
globalConfig.setOutputDir("/Users/stylefeng/work/ideaSpace/guns/guns-admin/src/main/java");//写自己项目的绝对路径,注意具体到java目录
globalConfig.setOutputDir("D:\\ideaSpace\\guns\\guns-admin\\src\\main\\java");//写自己项目的绝对路径,注意具体到java目录
globalConfig.setFileOverride(true);
globalConfig.setEnableCache(false);
globalConfig.setBaseResultMap(true);
......@@ -34,7 +34,7 @@ public class GunsGeneratorConfig extends AbstractGeneratorConfig {
@Override
protected void strategyConfig() {
//strategy.setTablePrefix(new String[]{"_"});// 此处可以修改为您的表前缀
strategyConfig.setInclude(new String[]{"user"});//这里限制需要生成的表,不写则是生成所有表
strategyConfig.setInclude(new String[]{"expense"});//这里限制需要生成的表,不写则是生成所有表
strategyConfig.setNaming(NamingStrategy.underline_to_camel);
}
......@@ -48,12 +48,12 @@ public class GunsGeneratorConfig extends AbstractGeneratorConfig {
@Override
protected void contextConfig() {
contextConfig.setBizChName("用户管理");
contextConfig.setBizEnName("user");
contextConfig.setModuleName("system");
contextConfig.setProjectPath("/Users/stylefeng/work/ideaSpace/guns/guns-admin");//写自己项目的绝对路径
contextConfig.setEntityName("User");
sqlConfig.setParentMenuName("系统管理");//这里写已有菜单的名称,当做父节点
contextConfig.setBizChName("报销管理");
contextConfig.setBizEnName("expense");
contextConfig.setModuleName("flowable");
contextConfig.setProjectPath("D:\\ideaSpace\\guns\\guns-admin");//写自己项目的绝对路径
contextConfig.setEntityName("Expense");
sqlConfig.setParentMenuName(null);//这里写已有菜单的名称,当做父节点
/**
* mybatis-plus 生成器开关
......
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:flowable="http://flowable.org/bpmn"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://www.flowable.org/processdef">
<process id="holidayRequest" name="Holiday Request" isExecutable="true">
<startEvent id="startEvent"/>
<sequenceFlow sourceRef="startEvent" targetRef="approveTask"/>
<userTask id="approveTask" name="Approve or reject request" flowable:candidateGroups="managers"/>
<sequenceFlow sourceRef="approveTask" targetRef="decision"/>
<exclusiveGateway id="decision"/>
<sequenceFlow sourceRef="decision" targetRef="externalSystemCall">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[
${approved}
]]>
</conditionExpression>
</sequenceFlow>
<sequenceFlow sourceRef="decision" targetRef="sendRejectionMail">
<conditionExpression xsi:type="tFormalExpression">
<![CDATA[
${!approved}
]]>
</conditionExpression>
</sequenceFlow>
<serviceTask id="externalSystemCall" name="Enter holidays in external system"
flowable:class="com.stylefeng.guns.flowable.CallExternalSystemDelegate"/>
<sequenceFlow sourceRef="externalSystemCall" targetRef="holidayApprovedTask"/>
<userTask id="holidayApprovedTask" name="Holiday approved" flowable:assignee="${employee}"/>
<sequenceFlow sourceRef="holidayApprovedTask" targetRef="approveEnd"/>
<serviceTask id="sendRejectionMail" name="Send out rejection email"
flowable:class="org.flowable.SendRejectionMail"/>
<sequenceFlow sourceRef="sendRejectionMail" targetRef="rejectEnd"/>
<endEvent id="approveEnd"/>
<endEvent id="rejectEnd"/>
</process>
</definitions>
\ No newline at end of file
package com.stylefeng.guns.biz;
import com.stylefeng.guns.base.BaseJunit;
import com.stylefeng.guns.modular.biz.service.ITestService;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
/**
* 业务测试
*
* @author fengshuonan
* @date 2017-06-23 23:12
*/
public class BizTest extends BaseJunit {
@Autowired
ITestService testService;
@Test
public void test() {
//testService.testGuns();
testService.testBiz();
//testService.testAll();
}
}
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