feat(i18n): 新增国际化消息实体与Mapper支持
新增 I18nMessage 实体、Mapper 接口及 XML 映射文件,移除 MyApplication 类上的 @MapperScan 注解,升级 MyBatis-Plus 与 MyBatis 版本至 3.0.3/3.5.5,为后续多语言功能提供数据层基础。
This commit is contained in:
4
pom.xml
4
pom.xml
@@ -143,12 +143,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mybatis.spring.boot</groupId>
|
<groupId>org.mybatis.spring.boot</groupId>
|
||||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||||
<version>2.2.2</version>
|
<version>3.0.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.baomidou</groupId>
|
<groupId>com.baomidou</groupId>
|
||||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
<version>3.5.1</version>
|
<version>3.5.5</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
|
|||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@MapperScan("com.yolo.keyborad.mapper")
|
|
||||||
@EnableConfigurationProperties(AppleAppStoreProperties.class)
|
@EnableConfigurationProperties(AppleAppStoreProperties.class)
|
||||||
public class MyApplication {
|
public class MyApplication {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
16
src/main/resources/mapper/I18nMessageMapper.xml
Normal file
16
src/main/resources/mapper/I18nMessageMapper.xml
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.yolo.keyborad.mapper.I18nMessageMapper">
|
||||||
|
<resultMap id="BaseResultMap" type="com.yolo.keyborad.model.entity.I18nMessage">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
<!--@Table i18n_message-->
|
||||||
|
<id column="id" jdbcType="BIGINT" property="id" />
|
||||||
|
<result column="code" jdbcType="VARCHAR" property="code" />
|
||||||
|
<result column="locale" jdbcType="VARCHAR" property="locale" />
|
||||||
|
<result column="message" jdbcType="VARCHAR" property="message" />
|
||||||
|
</resultMap>
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
<!--@mbg.generated-->
|
||||||
|
id, code, "locale", message
|
||||||
|
</sql>
|
||||||
|
</mapper>
|
||||||
Reference in New Issue
Block a user