From 3538fc5cc5ac044991f486a5c0f59c83831177ea Mon Sep 17 00:00:00 2001 From: CaptainB Date: Tue, 18 Apr 2023 11:19:45 +0800 Subject: [PATCH] build: mybatis plus --- backend/app/src/main/resources/logback-spring.xml | 2 +- backend/framework/domain/pom.xml | 9 +++++++++ .../domain/src/main/java/io/metersphere/domain/User.java | 2 ++ backend/framework/sdk/pom.xml | 5 +++++ .../main/java/io/metersphere/sdk/mapper/UserMapper.java | 7 +++++++ pom.xml | 1 + 6 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 backend/framework/sdk/src/main/java/io/metersphere/sdk/mapper/UserMapper.java diff --git a/backend/app/src/main/resources/logback-spring.xml b/backend/app/src/main/resources/logback-spring.xml index 96e4cbe3ee..9a53af203c 100644 --- a/backend/app/src/main/resources/logback-spring.xml +++ b/backend/app/src/main/resources/logback-spring.xml @@ -400,7 +400,7 @@ - + diff --git a/backend/framework/domain/pom.xml b/backend/framework/domain/pom.xml index fb11bdc658..11bd171fd7 100644 --- a/backend/framework/domain/pom.xml +++ b/backend/framework/domain/pom.xml @@ -12,4 +12,13 @@ domain domain + + + com.baomidou + mybatis-plus-boot-starter + ${mybatis-plus-starter.version} + provided + + + diff --git a/backend/framework/domain/src/main/java/io/metersphere/domain/User.java b/backend/framework/domain/src/main/java/io/metersphere/domain/User.java index 94d3296cc8..e0ba975e20 100644 --- a/backend/framework/domain/src/main/java/io/metersphere/domain/User.java +++ b/backend/framework/domain/src/main/java/io/metersphere/domain/User.java @@ -1,10 +1,12 @@ package io.metersphere.domain; +import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import java.io.Serializable; @Data +@TableName(value = "user", autoResultMap = true) public class User implements Serializable { private String id; diff --git a/backend/framework/sdk/pom.xml b/backend/framework/sdk/pom.xml index d28160cffd..b263482bc4 100644 --- a/backend/framework/sdk/pom.xml +++ b/backend/framework/sdk/pom.xml @@ -114,6 +114,11 @@ mybatis-spring-boot-starter ${mybatis-starter.version} + + com.baomidou + mybatis-plus-boot-starter + ${mybatis-plus-starter.version} + com.mysql mysql-connector-j diff --git a/backend/framework/sdk/src/main/java/io/metersphere/sdk/mapper/UserMapper.java b/backend/framework/sdk/src/main/java/io/metersphere/sdk/mapper/UserMapper.java new file mode 100644 index 0000000000..b9ec019179 --- /dev/null +++ b/backend/framework/sdk/src/main/java/io/metersphere/sdk/mapper/UserMapper.java @@ -0,0 +1,7 @@ +package io.metersphere.sdk.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import io.metersphere.domain.User; + +public interface UserMapper extends BaseMapper { +} diff --git a/pom.xml b/pom.xml index cc9f19b6cb..3ebc1d6a25 100644 --- a/pom.xml +++ b/pom.xml @@ -33,6 +33,7 @@ 3.20.1 5.1.0 3.0.1 + 3.5.3.1 0.10.2 1.70 2.11.0