Commit 8af60fdaa6b6c7dd4d9e73c18aedd6ee17a2f9e0
1 parent
cee1aa3e
1. 验证码的单元测试
2. 修复 h2 脚本的问题
Showing
13 changed files
with
119 additions
and
57 deletions
src/main/java/cn/iocoder/dashboard/modules/system/controller/common/SysCaptchaController.java
| @@ -21,8 +21,8 @@ public class SysCaptchaController { | @@ -21,8 +21,8 @@ public class SysCaptchaController { | ||
| 21 | @Resource | 21 | @Resource |
| 22 | private SysCaptchaService captchaService; | 22 | private SysCaptchaService captchaService; |
| 23 | 23 | ||
| 24 | - @ApiOperation("生成图片验证码") | ||
| 25 | @GetMapping("/get-image") | 24 | @GetMapping("/get-image") |
| 25 | + @ApiOperation("生成图片验证码") | ||
| 26 | public CommonResult<SysCaptchaImageRespVO> getCaptchaImage() { | 26 | public CommonResult<SysCaptchaImageRespVO> getCaptchaImage() { |
| 27 | return success(captchaService.getCaptchaImage()); | 27 | return success(captchaService.getCaptchaImage()); |
| 28 | } | 28 | } |
src/test/java/cn/iocoder/dashboard/BaseDbAndRedisUnitTest.java
| @@ -15,9 +15,9 @@ import org.springframework.test.context.ActiveProfiles; | @@ -15,9 +15,9 @@ import org.springframework.test.context.ActiveProfiles; | ||
| 15 | import org.springframework.test.context.jdbc.Sql; | 15 | import org.springframework.test.context.jdbc.Sql; |
| 16 | 16 | ||
| 17 | /** | 17 | /** |
| 18 | - * 依赖内存 DB 的单元测试 | 18 | + * 依赖内存 DB + Redis 的单元测试 |
| 19 | * | 19 | * |
| 20 | - * 注意,Service 层同样适用。对于 Service 层的单元测试,我们针对自己模块的 Mapper 走的是 H2 内存数据库,针对别的模块的 Service 走的是 Mock 方法 | 20 | + * 相比 {@link BaseDbUnitTest} 来说,额外增加了内存 Redis |
| 21 | * | 21 | * |
| 22 | * @author 芋道源码 | 22 | * @author 芋道源码 |
| 23 | */ | 23 | */ |
src/test/java/cn/iocoder/dashboard/BaseRedisUnitTest.java
0 → 100644
| 1 | +package cn.iocoder.dashboard; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.dashboard.config.RedisTestConfiguration; | ||
| 4 | +import cn.iocoder.dashboard.framework.redis.config.RedisConfig; | ||
| 5 | +import org.redisson.spring.starter.RedissonAutoConfiguration; | ||
| 6 | +import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; | ||
| 7 | +import org.springframework.boot.test.context.SpringBootTest; | ||
| 8 | +import org.springframework.context.annotation.Import; | ||
| 9 | +import org.springframework.test.context.ActiveProfiles; | ||
| 10 | + | ||
| 11 | +/** | ||
| 12 | + * 依赖内存 Redis 的单元测试 | ||
| 13 | + * | ||
| 14 | + * 相比 {@link BaseDbUnitTest} 来说,从内存 DB 改成了内存 Redis | ||
| 15 | + * | ||
| 16 | + * @author 芋道源码 | ||
| 17 | + */ | ||
| 18 | +@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE, classes = BaseRedisUnitTest.Application.class) | ||
| 19 | +@ActiveProfiles("unit-test") // 设置使用 application-unit-test 配置文件 | ||
| 20 | +public class BaseRedisUnitTest { | ||
| 21 | + | ||
| 22 | + @Import({ | ||
| 23 | + // Redis 配置类 | ||
| 24 | + RedisTestConfiguration.class, // Redis 测试配置类,用于启动 RedisServer | ||
| 25 | + RedisAutoConfiguration.class, // Spring Redis 自动配置类 | ||
| 26 | + RedisConfig.class, // 自己的 Redis 配置类 | ||
| 27 | + RedissonAutoConfiguration.class, // Redisson 自动高配置类 | ||
| 28 | + }) | ||
| 29 | + public static class Application { | ||
| 30 | + } | ||
| 31 | + | ||
| 32 | +} |
src/test/java/cn/iocoder/dashboard/BaseSpringBootUnitTest.java deleted
| 1 | -package cn.iocoder.dashboard; | ||
| 2 | - | ||
| 3 | -import org.junit.jupiter.api.AfterEach; | ||
| 4 | -import org.springframework.boot.test.context.SpringBootTest; | ||
| 5 | -import org.springframework.data.redis.core.RedisCallback; | ||
| 6 | -import org.springframework.data.redis.core.StringRedisTemplate; | ||
| 7 | -import org.springframework.test.context.ActiveProfiles; | ||
| 8 | -import org.springframework.test.context.jdbc.Sql; | ||
| 9 | - | ||
| 10 | -import javax.annotation.Resource; | ||
| 11 | - | ||
| 12 | -@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.NONE) | ||
| 13 | -@ActiveProfiles("unit-test") // 设置使用 application-unit-test 配置文件 | ||
| 14 | -@Sql(scripts = "/sql/clean.sql", executionPhase = Sql.ExecutionPhase.AFTER_TEST_METHOD) // 每个单元测试结束后,清理 DB | ||
| 15 | -@Deprecated | ||
| 16 | -public class BaseSpringBootUnitTest { | ||
| 17 | - | ||
| 18 | - @Resource | ||
| 19 | - private StringRedisTemplate stringRedisTemplate; | ||
| 20 | - | ||
| 21 | - /** | ||
| 22 | - * 每个单元测试结束后,清理 Redis | ||
| 23 | - */ | ||
| 24 | - @AfterEach | ||
| 25 | - public void cleanRedis() { | ||
| 26 | - stringRedisTemplate.execute((RedisCallback<Object>) connection -> { | ||
| 27 | - connection.flushDb(); | ||
| 28 | - return null; | ||
| 29 | - }); | ||
| 30 | - } | ||
| 31 | - | ||
| 32 | -} |
src/test/java/cn/iocoder/dashboard/config/RedisTestConfiguration.java
| 1 | package cn.iocoder.dashboard.config; | 1 | package cn.iocoder.dashboard.config; |
| 2 | 2 | ||
| 3 | import com.github.fppt.jedismock.RedisServer; | 3 | import com.github.fppt.jedismock.RedisServer; |
| 4 | -import org.redisson.spring.starter.RedissonAutoConfiguration; | ||
| 5 | -import org.springframework.boot.autoconfigure.AutoConfigureBefore; | ||
| 6 | -import org.springframework.boot.autoconfigure.data.redis.RedisAutoConfiguration; | ||
| 7 | import org.springframework.boot.autoconfigure.data.redis.RedisProperties; | 4 | import org.springframework.boot.autoconfigure.data.redis.RedisProperties; |
| 8 | import org.springframework.boot.context.properties.EnableConfigurationProperties; | 5 | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| 9 | import org.springframework.context.annotation.Bean; | 6 | import org.springframework.context.annotation.Bean; |
| 10 | import org.springframework.context.annotation.Configuration; | 7 | import org.springframework.context.annotation.Configuration; |
| 8 | +import org.springframework.context.annotation.Lazy; | ||
| 11 | 9 | ||
| 12 | import java.io.IOException; | 10 | import java.io.IOException; |
| 13 | 11 | ||
| 14 | @Configuration(proxyBeanMethods = false) | 12 | @Configuration(proxyBeanMethods = false) |
| 13 | +@Lazy(false) // 禁止延迟加载 | ||
| 15 | @EnableConfigurationProperties(RedisProperties.class) | 14 | @EnableConfigurationProperties(RedisProperties.class) |
| 16 | -@AutoConfigureBefore({RedisAutoConfiguration.class, RedissonAutoConfiguration.class}) // 在 Redis 自动配置前,进行初始化 | ||
| 17 | public class RedisTestConfiguration { | 15 | public class RedisTestConfiguration { |
| 18 | 16 | ||
| 19 | /** | 17 | /** |
src/test/java/cn/iocoder/dashboard/framework/quartz/core/scheduler/SchedulerManagerTest.java
| 1 | package cn.iocoder.dashboard.framework.quartz.core.scheduler; | 1 | package cn.iocoder.dashboard.framework.quartz.core.scheduler; |
| 2 | 2 | ||
| 3 | import cn.hutool.core.util.StrUtil; | 3 | import cn.hutool.core.util.StrUtil; |
| 4 | -import cn.iocoder.dashboard.BaseSpringBootUnitTest; | 4 | +import cn.iocoder.dashboard.BaseDbUnitTest; |
| 5 | import cn.iocoder.dashboard.modules.system.job.auth.SysUserSessionTimeoutJob; | 5 | import cn.iocoder.dashboard.modules.system.job.auth.SysUserSessionTimeoutJob; |
| 6 | import org.junit.jupiter.api.Test; | 6 | import org.junit.jupiter.api.Test; |
| 7 | import org.quartz.SchedulerException; | 7 | import org.quartz.SchedulerException; |
| 8 | 8 | ||
| 9 | import javax.annotation.Resource; | 9 | import javax.annotation.Resource; |
| 10 | 10 | ||
| 11 | -class SchedulerManagerTest extends BaseSpringBootUnitTest { | 11 | +class SchedulerManagerTest extends BaseDbUnitTest { |
| 12 | 12 | ||
| 13 | @Resource | 13 | @Resource |
| 14 | private SchedulerManager schedulerManager; | 14 | private SchedulerManager schedulerManager; |
src/test/java/cn/iocoder/dashboard/modules/system/service/common/SysCaptchaServiceTest.java
0 → 100644
| 1 | +package cn.iocoder.dashboard.modules.system.service.common; | ||
| 2 | + | ||
| 3 | +import cn.iocoder.dashboard.BaseRedisUnitTest; | ||
| 4 | +import cn.iocoder.dashboard.framework.captcha.config.CaptchaProperties; | ||
| 5 | +import cn.iocoder.dashboard.modules.system.controller.common.vo.SysCaptchaImageRespVO; | ||
| 6 | +import cn.iocoder.dashboard.modules.system.dal.redis.common.SysCaptchaRedisDAO; | ||
| 7 | +import cn.iocoder.dashboard.modules.system.service.common.impl.SysCaptchaServiceImpl; | ||
| 8 | +import org.junit.jupiter.api.Test; | ||
| 9 | +import org.springframework.context.annotation.Import; | ||
| 10 | + | ||
| 11 | +import javax.annotation.Resource; | ||
| 12 | + | ||
| 13 | +import static cn.iocoder.dashboard.util.RandomUtils.randomString; | ||
| 14 | +import static org.junit.jupiter.api.Assertions.*; | ||
| 15 | + | ||
| 16 | +@Import({SysCaptchaServiceImpl.class, CaptchaProperties.class, SysCaptchaRedisDAO.class}) | ||
| 17 | +public class SysCaptchaServiceTest extends BaseRedisUnitTest { | ||
| 18 | + | ||
| 19 | + @Resource | ||
| 20 | + private SysCaptchaServiceImpl captchaService; | ||
| 21 | + | ||
| 22 | + @Resource | ||
| 23 | + private SysCaptchaRedisDAO captchaRedisDAO; | ||
| 24 | + @Resource | ||
| 25 | + private CaptchaProperties captchaProperties; | ||
| 26 | + | ||
| 27 | + @Test | ||
| 28 | + public void testGetCaptchaImage() { | ||
| 29 | + // 调用 | ||
| 30 | + SysCaptchaImageRespVO respVO = captchaService.getCaptchaImage(); | ||
| 31 | + // 断言 | ||
| 32 | + assertNotNull(respVO.getUuid()); | ||
| 33 | + assertNotNull(respVO.getImg()); | ||
| 34 | + String captchaCode = captchaRedisDAO.get(respVO.getUuid()); | ||
| 35 | + assertNotNull(captchaCode); | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + @Test | ||
| 39 | + public void testGetCaptchaCode() { | ||
| 40 | + // 准备参数 | ||
| 41 | + String uuid = randomString(); | ||
| 42 | + String code = randomString(); | ||
| 43 | + // mock 数据 | ||
| 44 | + captchaRedisDAO.set(uuid, code, captchaProperties.getTimeout()); | ||
| 45 | + | ||
| 46 | + // 调用 | ||
| 47 | + String resultCode = captchaService.getCaptchaCode(uuid); | ||
| 48 | + // 断言 | ||
| 49 | + assertEquals(code, resultCode); | ||
| 50 | + } | ||
| 51 | + | ||
| 52 | + @Test | ||
| 53 | + public void testDeleteCaptchaCode() { | ||
| 54 | + // 准备参数 | ||
| 55 | + String uuid = randomString(); | ||
| 56 | + String code = randomString(); | ||
| 57 | + // mock 数据 | ||
| 58 | + captchaRedisDAO.set(uuid, code, captchaProperties.getTimeout()); | ||
| 59 | + | ||
| 60 | + // 调用 | ||
| 61 | + captchaService.deleteCaptchaCode(uuid); | ||
| 62 | + // 断言 | ||
| 63 | + assertNull(captchaRedisDAO.get(uuid)); | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | +} |
src/test/java/cn/iocoder/dashboard/modules/tool/dal/mysql/codegen/ToolInformationSchemaColumnMapperTest.java
| 1 | package cn.iocoder.dashboard.modules.tool.dal.mysql.codegen; | 1 | package cn.iocoder.dashboard.modules.tool.dal.mysql.codegen; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.BaseSpringBootUnitTest; | 3 | +import cn.iocoder.dashboard.BaseDbUnitTest; |
| 4 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolSchemaColumnDO; | 4 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolSchemaColumnDO; |
| 5 | import org.junit.jupiter.api.Test; | 5 | import org.junit.jupiter.api.Test; |
| 6 | 6 | ||
| @@ -9,7 +9,7 @@ import java.util.List; | @@ -9,7 +9,7 @@ import java.util.List; | ||
| 9 | 9 | ||
| 10 | import static org.junit.jupiter.api.Assertions.assertTrue; | 10 | import static org.junit.jupiter.api.Assertions.assertTrue; |
| 11 | 11 | ||
| 12 | -public class ToolInformationSchemaColumnMapperTest extends BaseSpringBootUnitTest { | 12 | +public class ToolInformationSchemaColumnMapperTest extends BaseDbUnitTest { |
| 13 | 13 | ||
| 14 | @Resource | 14 | @Resource |
| 15 | private ToolSchemaColumnMapper toolInformationSchemaColumnMapper; | 15 | private ToolSchemaColumnMapper toolInformationSchemaColumnMapper; |
src/test/java/cn/iocoder/dashboard/modules/tool/dal/mysql/codegen/ToolInformationSchemaTableMapperTest.java
| 1 | package cn.iocoder.dashboard.modules.tool.dal.mysql.codegen; | 1 | package cn.iocoder.dashboard.modules.tool.dal.mysql.codegen; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.BaseSpringBootUnitTest; | 3 | +import cn.iocoder.dashboard.BaseDbUnitTest; |
| 4 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolSchemaTableDO; | 4 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolSchemaTableDO; |
| 5 | import org.junit.jupiter.api.Test; | 5 | import org.junit.jupiter.api.Test; |
| 6 | 6 | ||
| @@ -9,7 +9,7 @@ import java.util.List; | @@ -9,7 +9,7 @@ import java.util.List; | ||
| 9 | 9 | ||
| 10 | import static org.junit.jupiter.api.Assertions.assertTrue; | 10 | import static org.junit.jupiter.api.Assertions.assertTrue; |
| 11 | 11 | ||
| 12 | -class ToolInformationSchemaTableMapperTest extends BaseSpringBootUnitTest { | 12 | +class ToolInformationSchemaTableMapperTest extends BaseDbUnitTest { |
| 13 | 13 | ||
| 14 | @Resource | 14 | @Resource |
| 15 | private ToolSchemaTableMapper toolInformationSchemaTableMapper; | 15 | private ToolSchemaTableMapper toolInformationSchemaTableMapper; |
src/test/java/cn/iocoder/dashboard/modules/tool/service/codegen/impl/ToolCodegenEngineTest.java
| 1 | package cn.iocoder.dashboard.modules.tool.service.codegen.impl; | 1 | package cn.iocoder.dashboard.modules.tool.service.codegen.impl; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.BaseSpringBootUnitTest; | 3 | +import cn.iocoder.dashboard.BaseDbUnitTest; |
| 4 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenColumnDO; | 4 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenColumnDO; |
| 5 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenTableDO; | 5 | import cn.iocoder.dashboard.modules.tool.dal.dataobject.codegen.ToolCodegenTableDO; |
| 6 | import cn.iocoder.dashboard.modules.tool.dal.mysql.codegen.ToolCodegenColumnMapper; | 6 | import cn.iocoder.dashboard.modules.tool.dal.mysql.codegen.ToolCodegenColumnMapper; |
| 7 | import cn.iocoder.dashboard.modules.tool.dal.mysql.codegen.ToolCodegenTableMapper; | 7 | import cn.iocoder.dashboard.modules.tool.dal.mysql.codegen.ToolCodegenTableMapper; |
| 8 | import org.junit.jupiter.api.Test; | 8 | import org.junit.jupiter.api.Test; |
| 9 | -import org.springframework.boot.test.context.SpringBootTest; | ||
| 10 | 9 | ||
| 11 | import javax.annotation.Resource; | 10 | import javax.annotation.Resource; |
| 12 | import java.util.List; | 11 | import java.util.List; |
| 13 | import java.util.Map; | 12 | import java.util.Map; |
| 14 | 13 | ||
| 15 | -public class ToolCodegenEngineTest extends BaseSpringBootUnitTest { | 14 | +public class ToolCodegenEngineTest extends BaseDbUnitTest { |
| 16 | 15 | ||
| 17 | @Resource | 16 | @Resource |
| 18 | private ToolCodegenTableMapper codegenTableMapper; | 17 | private ToolCodegenTableMapper codegenTableMapper; |
src/test/java/cn/iocoder/dashboard/modules/tool/service/codegen/impl/ToolCodegenSQLParserTest.java
| 1 | package cn.iocoder.dashboard.modules.tool.service.codegen.impl; | 1 | package cn.iocoder.dashboard.modules.tool.service.codegen.impl; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.BaseSpringBootUnitTest; | 3 | +import cn.iocoder.dashboard.BaseDbUnitTest; |
| 4 | import org.junit.jupiter.api.Test; | 4 | import org.junit.jupiter.api.Test; |
| 5 | 5 | ||
| 6 | -public class ToolCodegenSQLParserTest extends BaseSpringBootUnitTest { | 6 | +public class ToolCodegenSQLParserTest extends BaseDbUnitTest { |
| 7 | 7 | ||
| 8 | @Test | 8 | @Test |
| 9 | public void testParse() { | 9 | public void testParse() { |
src/test/java/cn/iocoder/dashboard/modules/tool/service/codegen/impl/ToolCodegenServiceImplTest.java
| 1 | package cn.iocoder.dashboard.modules.tool.service.codegen.impl; | 1 | package cn.iocoder.dashboard.modules.tool.service.codegen.impl; |
| 2 | 2 | ||
| 3 | -import cn.iocoder.dashboard.BaseSpringBootUnitTest; | 3 | +import cn.iocoder.dashboard.BaseDbUnitTest; |
| 4 | import org.junit.jupiter.api.Test; | 4 | import org.junit.jupiter.api.Test; |
| 5 | -import org.springframework.boot.test.context.SpringBootTest; | ||
| 6 | 5 | ||
| 7 | import javax.annotation.Resource; | 6 | import javax.annotation.Resource; |
| 8 | 7 | ||
| 9 | -class ToolCodegenServiceImplTest extends BaseSpringBootUnitTest { | 8 | +class ToolCodegenServiceImplTest extends BaseDbUnitTest { |
| 10 | 9 | ||
| 11 | @Resource | 10 | @Resource |
| 12 | private ToolCodegenServiceImpl toolCodegenService; | 11 | private ToolCodegenServiceImpl toolCodegenService; |
src/test/resources/sql/create_tables.sql
| @@ -113,7 +113,7 @@ CREATE TABLE IF NOT EXISTS "sys_menu" ( | @@ -113,7 +113,7 @@ CREATE TABLE IF NOT EXISTS "sys_menu" ( | ||
| 113 | PRIMARY KEY ("id") | 113 | PRIMARY KEY ("id") |
| 114 | ) COMMENT '菜单权限表'; | 114 | ) COMMENT '菜单权限表'; |
| 115 | 115 | ||
| 116 | -CREATE TABLE "sys_dict_type" ( | 116 | +CREATE TABLE IF NOT EXISTS "sys_dict_type" ( |
| 117 | "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, | 117 | "id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
| 118 | "name" varchar(100) NOT NULL DEFAULT '', | 118 | "name" varchar(100) NOT NULL DEFAULT '', |
| 119 | "type" varchar(100) NOT NULL DEFAULT '', | 119 | "type" varchar(100) NOT NULL DEFAULT '', |
| @@ -127,7 +127,7 @@ CREATE TABLE "sys_dict_type" ( | @@ -127,7 +127,7 @@ CREATE TABLE "sys_dict_type" ( | ||
| 127 | PRIMARY KEY ("id") | 127 | PRIMARY KEY ("id") |
| 128 | ) COMMENT '字典类型表'; | 128 | ) COMMENT '字典类型表'; |
| 129 | 129 | ||
| 130 | -CREATE TABLE `sys_user_session` ( | 130 | +CREATE TABLE IF NOT EXISTS `sys_user_session` ( |
| 131 | `id` varchar(32) NOT NULL, | 131 | `id` varchar(32) NOT NULL, |
| 132 | `user_id` bigint DEFAULT NULL, | 132 | `user_id` bigint DEFAULT NULL, |
| 133 | `username` varchar(50) NOT NULL DEFAULT '', | 133 | `username` varchar(50) NOT NULL DEFAULT '', |
| @@ -191,7 +191,7 @@ CREATE TABLE IF NOT EXISTS `sys_login_log` ( | @@ -191,7 +191,7 @@ CREATE TABLE IF NOT EXISTS `sys_login_log` ( | ||
| 191 | ) COMMENT ='系统访问记录'; | 191 | ) COMMENT ='系统访问记录'; |
| 192 | 192 | ||
| 193 | 193 | ||
| 194 | -CREATE TABLE `sys_operate_log` ( | 194 | +CREATE TABLE IF NOT EXISTS `sys_operate_log` ( |
| 195 | `id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, | 195 | `id` bigint(20) NOT NULL GENERATED BY DEFAULT AS IDENTITY, |
| 196 | `trace_id` varchar(64) NOT NULL DEFAULT '', | 196 | `trace_id` varchar(64) NOT NULL DEFAULT '', |
| 197 | `user_id` bigint(20) NOT NULL, | 197 | `user_id` bigint(20) NOT NULL, |
| @@ -219,7 +219,7 @@ CREATE TABLE `sys_operate_log` ( | @@ -219,7 +219,7 @@ CREATE TABLE `sys_operate_log` ( | ||
| 219 | PRIMARY KEY (`id`) | 219 | PRIMARY KEY (`id`) |
| 220 | ) COMMENT ='操作日志记录'; | 220 | ) COMMENT ='操作日志记录'; |
| 221 | 221 | ||
| 222 | -create table "sys_user" ( | 222 | +create table IF NOT EXISTS "sys_user" ( |
| 223 | "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, | 223 | "id" bigint not null GENERATED BY DEFAULT AS IDENTITY, |
| 224 | "username" varchar(30) not null, | 224 | "username" varchar(30) not null, |
| 225 | "password" varchar(100) not null default '', | 225 | "password" varchar(100) not null default '', |