From 683accca83931ed74711cab23838ebf53efaecdc Mon Sep 17 00:00:00 2001 From: ziin Date: Mon, 1 Dec 2025 20:53:44 +0800 Subject: [PATCH] =?UTF-8?q?feat(i18n):=20=E6=96=B0=E5=A2=9E=E5=9B=BD?= =?UTF-8?q?=E9=99=85=E5=8C=96=E6=B6=88=E6=81=AF=E5=AE=9E=E4=BD=93=E4=B8=8E?= =?UTF-8?q?Mapper=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 I18nMessage 实体、Mapper 接口及 XML 映射文件,移除 MyApplication 类上的 @MapperScan 注解,升级 MyBatis-Plus 与 MyBatis 版本至 3.0.3/3.5.5,为后续多语言功能提供数据层基础。 --- pom.xml | 4 +- .../java/com/yolo/keyborad/MyApplication.java | 1 - .../keyborad/mapper/I18nMessageMapper.java | 15 +++++ .../keyborad/model/entity/I18nMessage.java | 55 +++++++++++++++++++ .../resources/mapper/I18nMessageMapper.xml | 16 ++++++ 5 files changed, 88 insertions(+), 3 deletions(-) create mode 100644 src/main/java/com/yolo/keyborad/mapper/I18nMessageMapper.java create mode 100644 src/main/java/com/yolo/keyborad/model/entity/I18nMessage.java create mode 100644 src/main/resources/mapper/I18nMessageMapper.xml diff --git a/pom.xml b/pom.xml index d214bf7..a3c336d 100644 --- a/pom.xml +++ b/pom.xml @@ -143,12 +143,12 @@ org.mybatis.spring.boot mybatis-spring-boot-starter - 2.2.2 + 3.0.3 com.baomidou mybatis-plus-boot-starter - 3.5.1 + 3.5.5 org.springframework.boot diff --git a/src/main/java/com/yolo/keyborad/MyApplication.java b/src/main/java/com/yolo/keyborad/MyApplication.java index de23dc7..ee5dcbb 100644 --- a/src/main/java/com/yolo/keyborad/MyApplication.java +++ b/src/main/java/com/yolo/keyborad/MyApplication.java @@ -10,7 +10,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties @Slf4j @SpringBootApplication -@MapperScan("com.yolo.keyborad.mapper") @EnableConfigurationProperties(AppleAppStoreProperties.class) public class MyApplication { public static void main(String[] args) { diff --git a/src/main/java/com/yolo/keyborad/mapper/I18nMessageMapper.java b/src/main/java/com/yolo/keyborad/mapper/I18nMessageMapper.java new file mode 100644 index 0000000..a6f1228 --- /dev/null +++ b/src/main/java/com/yolo/keyborad/mapper/I18nMessageMapper.java @@ -0,0 +1,15 @@ +package com.yolo.keyborad.mapper; + +/* +* @author: ziin +* @date: 2025/12/1 20:40 +*/ + +import com.yolo.keyborad.model.entity.I18nMessage; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +public interface I18nMessageMapper { + +} \ No newline at end of file diff --git a/src/main/java/com/yolo/keyborad/model/entity/I18nMessage.java b/src/main/java/com/yolo/keyborad/model/entity/I18nMessage.java new file mode 100644 index 0000000..4cc187b --- /dev/null +++ b/src/main/java/com/yolo/keyborad/model/entity/I18nMessage.java @@ -0,0 +1,55 @@ +package com.yolo.keyborad.model.entity; + +import io.swagger.v3.oas.annotations.media.Schema; + +/* +* @author: ziin +* @date: 2025/12/1 20:40 +*/ + +@Schema +public class I18nMessage { + @Schema(description="") + private Long id; + + @Schema(description="") + private String code; + + @Schema(description="") + private String locale; + + @Schema(description="") + private String message; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getCode() { + return code; + } + + public void setCode(String code) { + this.code = code; + } + + public String getLocale() { + return locale; + } + + public void setLocale(String locale) { + this.locale = locale; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } +} \ No newline at end of file diff --git a/src/main/resources/mapper/I18nMessageMapper.xml b/src/main/resources/mapper/I18nMessageMapper.xml new file mode 100644 index 0000000..32a71bb --- /dev/null +++ b/src/main/resources/mapper/I18nMessageMapper.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + id, code, "locale", message + + \ No newline at end of file