feat: 分库分表

This commit is contained in:
胥员员
2022-11-05 21:42:29 +08:00
parent e0d76a3bf9
commit ca6e8eff22
9 changed files with 186 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package com.yupi.project.service;
import com.yupi.project.mapper.OrderConfigMapper;
import com.yupi.project.model.entity.OrderConfigDO;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class OrderConfigMapperTest {
@Autowired
private OrderConfigMapper orderConfigMapper;
@Test
public void testSelectById() {
OrderConfigDO orderConfig = orderConfigMapper.selectById(1);
System.out.println(orderConfig);
}
}

View File

@@ -0,0 +1,28 @@
package com.yupi.project.service;
import com.yupi.project.mapper.OrderMapper;
import com.yupi.project.model.entity.OrderDO;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest
public class OrderMapperTest {
@Autowired
private OrderMapper orderMapper;
@Test
public void testInsert() {
OrderDO order = new OrderDO();
order.setId(2L);
order.setUserId(4);
orderMapper.insert(order);
}
}