Compare commits

..

4 Commits
dev ... main

Author SHA1 Message Date
孙小云 f38d059212 添加flyway数据库版本控制 2026-02-24 17:14:49 +08:00
高大 acbb57fd9d fit:增加数据字典对外接口 2026-01-29 16:44:59 +08:00
孙小云 1d250e979a xx 2026-01-26 17:03:12 +08:00
孙小云 e7bd6688a4 xx 2026-01-26 17:02:46 +08:00
7 changed files with 72 additions and 2 deletions

12
pom.xml
View File

@ -71,6 +71,18 @@
<artifactId>ruoyi-common-swagger</artifactId>
</dependency>
<!-- Flyway Database Migration -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
</dependency>
<!-- Flyway MySQL Support -->
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-mysql</artifactId>
</dependency>
</dependencies>
<build>

View File

@ -1 +1 @@
da
ddda

View File

@ -84,6 +84,16 @@ public class SysDictDataController extends BaseController
return success(data);
}
/**
* 根据字典类型和值获取字典标签
*/
@GetMapping(value = "/label/{dictType}/{dictValue}")
public AjaxResult dictLabel(@PathVariable String dictType, @PathVariable String dictValue)
{
String label = dictTypeService.selectDictLabel(dictType, dictValue);
return success(label);
}
/**
* 新增字典类型
*/

View File

@ -34,6 +34,15 @@ public interface ISysDictTypeService
*/
public List<SysDictData> selectDictDataByType(String dictType);
/**
* 根据字典类型和值获取字典标签
*
* @param dictType 字典类型
* @param dictValue 字典值
* @return 字典标签
*/
public String selectDictLabel(String dictType, String dictValue);
/**
* 根据字典类型ID查询信息
*

View File

@ -87,6 +87,31 @@ public class SysDictTypeServiceImpl implements ISysDictTypeService
return null;
}
/**
* 根据字典类型和值获取字典标签
*
* @param dictType 字典类型
* @param dictValue 字典值
* @return 字典标签
*/
@Override
public String selectDictLabel(String dictType, String dictValue)
{
// 从缓存查询
List<SysDictData> dictDatas = DictUtils.getDictCache(dictType);;
if (StringUtils.isNotEmpty(dictDatas))
{
for (SysDictData dictData : dictDatas)
{
if (dictValue.equals(dictData.getDictValue()))
{
return dictData.getDictLabel();
}
}
}
return dictValue;
}
/**
* 根据字典类型ID查询信息
*

View File

@ -3,13 +3,17 @@ server:
port: 9201
# Spring
spring:
spring:
application:
# 应用名称
name: ruoyi-system
profiles:
# 环境配置
active: prod
flyway:
table: flyway_system_schema_history # 自定义历史表名
baseline-on-migrate: true
baseline-version: 0
cloud:
nacos:
discovery:

View File

@ -0,0 +1,10 @@
-- Initial setup for ruoyi-system module
-- This is a placeholder migration file
-- Add your initial database schema here
-- Example:
-- CREATE TABLE IF NOT EXISTS example_table (
-- id BIGINT PRIMARY KEY AUTO_INCREMENT,
-- name VARCHAR(100) NOT NULL,
-- created_time DATETIME DEFAULT CURRENT_TIMESTAMP
-- );