feat(新增): 生成多语言
This commit is contained in:
parent
c82f6f2757
commit
b9263fc450
|
@ -0,0 +1,35 @@
|
||||||
|
package cn.bunny.dao.entity.i18n;
|
||||||
|
|
||||||
|
import cn.bunny.dao.entity.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 多语言表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Bunny
|
||||||
|
* @since 2024-09-28
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("sys_i18n")
|
||||||
|
@ApiModel(value = "I18n对象", description = "多语言表")
|
||||||
|
public class I18n extends BaseEntity {
|
||||||
|
|
||||||
|
@ApiModelProperty("多语言key")
|
||||||
|
private Integer keyName;
|
||||||
|
|
||||||
|
@ApiModelProperty("多语言翻译名称")
|
||||||
|
private String translation;
|
||||||
|
|
||||||
|
@ApiModelProperty("多语言类型id")
|
||||||
|
private Long typeId;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package cn.bunny.dao.entity.i18n;
|
||||||
|
|
||||||
|
import cn.bunny.dao.entity.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 多语言类型表
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Bunny
|
||||||
|
* @since 2024-09-28
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("sys_i18n_type")
|
||||||
|
@ApiModel(value = "I18nType对象", description = "多语言类型表")
|
||||||
|
public class I18nType extends BaseEntity {
|
||||||
|
|
||||||
|
@ApiModelProperty("多语言类型(比如zh,en)")
|
||||||
|
private String typeName;
|
||||||
|
|
||||||
|
@ApiModelProperty("名称解释(比如中文,英文)")
|
||||||
|
private String summary;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package cn.bunny.services.controller;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 多语言表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Bunny
|
||||||
|
* @since 2024-09-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/i18n")
|
||||||
|
public class I18nController {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package cn.bunny.services.controller;
|
||||||
|
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 多语言类型表 前端控制器
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Bunny
|
||||||
|
* @since 2024-09-28
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/i18nType")
|
||||||
|
public class I18nTypeController {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package cn.bunny.services.mapper;
|
||||||
|
|
||||||
|
import cn.bunny.dao.entity.i18n.I18n;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 多语言表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Bunny
|
||||||
|
* @since 2024-09-28
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface I18nMapper extends BaseMapper<I18n> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package cn.bunny.services.mapper;
|
||||||
|
|
||||||
|
import cn.bunny.dao.entity.i18n.I18nType;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 多语言类型表 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Bunny
|
||||||
|
* @since 2024-09-28
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface I18nTypeMapper extends BaseMapper<I18nType> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package cn.bunny.services.service;
|
||||||
|
|
||||||
|
import cn.bunny.dao.entity.i18n.I18n;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 多语言表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Bunny
|
||||||
|
* @since 2024-09-28
|
||||||
|
*/
|
||||||
|
public interface I18nService extends IService<I18n> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package cn.bunny.services.service;
|
||||||
|
|
||||||
|
import cn.bunny.dao.entity.i18n.I18nType;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 多语言类型表 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Bunny
|
||||||
|
* @since 2024-09-28
|
||||||
|
*/
|
||||||
|
public interface I18nTypeService extends IService<I18nType> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package cn.bunny.services.service.impl;
|
||||||
|
|
||||||
|
import cn.bunny.dao.entity.i18n.I18n;
|
||||||
|
import cn.bunny.services.mapper.I18nMapper;
|
||||||
|
import cn.bunny.services.service.I18nService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 多语言表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Bunny
|
||||||
|
* @since 2024-09-28
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class I18nServiceImpl extends ServiceImpl<I18nMapper, I18n> implements I18nService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package cn.bunny.services.service.impl;
|
||||||
|
|
||||||
|
import cn.bunny.dao.entity.i18n.I18nType;
|
||||||
|
import cn.bunny.services.mapper.I18nTypeMapper;
|
||||||
|
import cn.bunny.services.service.I18nTypeService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 多语言类型表 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author Bunny
|
||||||
|
* @since 2024-09-28
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class I18nTypeServiceImpl extends ServiceImpl<I18nTypeMapper, I18nType> implements I18nTypeService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?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="cn.bunny.services.mapper.I18nMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.i18n.I18n">
|
||||||
|
<id column="id" property="id"/>
|
||||||
|
<result column="key_name" property="keyName"/>
|
||||||
|
<result column="translation" property="translation"/>
|
||||||
|
<result column="type_id" property="typeId"/>
|
||||||
|
<result column="create_user" property="createUser"/>
|
||||||
|
<result column="update_user" property="updateUser"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="is_deleted" property="isDeleted"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, key_name, translation, type_id, create_user, update_user, update_time, create_time, is_deleted
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
</mapper>
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?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="cn.bunny.services.mapper.I18nTypeMapper">
|
||||||
|
|
||||||
|
<!-- 通用查询映射结果 -->
|
||||||
|
<resultMap id="BaseResultMap" type="cn.bunny.dao.entity.i18n.I18nType">
|
||||||
|
<id column="id" property="id"/>
|
||||||
|
<result column="type_name" property="typeName"/>
|
||||||
|
<result column="summary" property="summary"/>
|
||||||
|
<result column="create_user" property="createUser"/>
|
||||||
|
<result column="update_user" property="updateUser"/>
|
||||||
|
<result column="update_time" property="updateTime"/>
|
||||||
|
<result column="create_time" property="createTime"/>
|
||||||
|
<result column="is_deleted" property="isDeleted"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<!-- 通用查询结果列 -->
|
||||||
|
<sql id="Base_Column_List">
|
||||||
|
id, type_name, summary, create_user, update_user, update_time, create_time, is_deleted
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue