Compare commits

...

2 Commits

Author SHA1 Message Date
gyb 53ea05322f feat:增加通过ID获取用户名接口 2026-03-20 16:35:11 +08:00
孙小云 f38d059212 添加flyway数据库版本控制 2026-02-24 17:14:49 +08:00
4 changed files with 44 additions and 1 deletions

12
pom.xml
View File

@ -71,6 +71,18 @@
<artifactId>ruoyi-common-swagger</artifactId> <artifactId>ruoyi-common-swagger</artifactId>
</dependency> </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> </dependencies>
<build> <build>

View File

@ -137,6 +137,23 @@ public class SysUserController extends BaseController
return R.ok(sysUserVo); return R.ok(sysUserVo);
} }
/**
* 根据用户ID获取用户名称
*/
@InnerAuth
@GetMapping("/getName/{userId}")
public R<String> getName(@PathVariable("userId") Long userId)
{
SysUser sysUser = userService.selectUserById(userId);
if (StringUtils.isNull(sysUser))
{
return R.fail("用户不存在");
}
return R.ok(sysUser.getUserName());
}
/** /**
* 注册用户信息 * 注册用户信息
*/ */

View File

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