将团课相关代码迁移至gym-GroupCourse模块
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
wrapperVersion=3.3.4
|
||||||
|
distributionType=only-script
|
||||||
|
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.15/apache-maven-3.9.15-bin.zip
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
|
<artifactId>gym-manage-api</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<relativePath>../pom.xml</relativePath>
|
||||||
|
</parent>
|
||||||
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
|
<artifactId>gym-groupCourse</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<name>gym-groupCourse</name>
|
||||||
|
<description>Group Course Management Module</description>
|
||||||
|
<url/>
|
||||||
|
<licenses>
|
||||||
|
<license/>
|
||||||
|
</licenses>
|
||||||
|
<developers>
|
||||||
|
<developer/>
|
||||||
|
</developers>
|
||||||
|
<scm>
|
||||||
|
<connection/>
|
||||||
|
<developerConnection/>
|
||||||
|
<tag/>
|
||||||
|
<url/>
|
||||||
|
</scm>
|
||||||
|
<properties>
|
||||||
|
<java.version>21</java.version>
|
||||||
|
</properties>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
|
<artifactId>manage-common</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
|
<artifactId>manage-db</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-webflux</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-r2dbc</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springdoc</groupId>
|
||||||
|
<artifactId>springdoc-openapi-starter-webflux-ui</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.swagger.core.v3</groupId>
|
||||||
|
<artifactId>swagger-annotations-jakarta</artifactId>
|
||||||
|
<version>2.2.43</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
</project>
|
||||||
+7
-9
@@ -1,11 +1,9 @@
|
|||||||
package cn.novalon.gym.manage.db.converter;/*
|
|
||||||
* @author:liwentao
|
package cn.novalon.gym.manage.groupcourse.converter;
|
||||||
* @date:2026/4/26-04-26-13:18
|
|
||||||
*/
|
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
import cn.novalon.gym.manage.db.entity.GroupCourseEntity;
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
import cn.novalon.gym.manage.sys.core.domain.GroupCourse;
|
import cn.novalon.gym.manage.groupcourse.entity.GroupCourseEntity;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
@@ -44,11 +42,11 @@ public class GroupCourseConverter {
|
|||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<GroupCourseEntity> toEntityList(List<GroupCourse> groupCourses){
|
public List<GroupCourseEntity> toEntityList(List<GroupCourse> domains){
|
||||||
if (groupCourses == null) {
|
if (domains == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return groupCourses.stream()
|
return domains.stream()
|
||||||
.map(this::toEntity)
|
.map(this::toEntity)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
+4
-4
@@ -1,7 +1,7 @@
|
|||||||
package cn.novalon.gym.manage.db.dao;
|
|
||||||
|
|
||||||
import cn.novalon.gym.manage.db.entity.GroupCourseEntity;
|
package cn.novalon.gym.manage.groupcourse.dao;
|
||||||
import cn.novalon.gym.manage.db.entity.SysUserEntity;
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.entity.GroupCourseEntity;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
import org.springframework.data.r2dbc.repository.R2dbcRepository;
|
import org.springframework.data.r2dbc.repository.R2dbcRepository;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
@@ -9,7 +9,7 @@ import reactor.core.publisher.Flux;
|
|||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public interface GroupCourseDao extends R2dbcRepository<GroupCourseEntity, Long> {
|
public interface GroupCourseDao extends R2dbcRepository<GroupCourseEntity, Long> {
|
||||||
|
|
||||||
Mono<GroupCourseEntity> findByIdIsAndDeletedAtIsNull(Long id);
|
Mono<GroupCourseEntity> findByIdIsAndDeletedAtIsNull(Long id);
|
||||||
|
|
||||||
+4
-8
@@ -1,15 +1,11 @@
|
|||||||
package cn.novalon.gym.manage.sys.core.domain;
|
|
||||||
/**
|
|
||||||
* @author:liwentao
|
|
||||||
* @date:2026/4/26-04-26-13:20
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
package cn.novalon.gym.manage.groupcourse.domain;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.sys.core.domain.BaseDomain;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import org.springframework.data.relational.core.mapping.Column;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
|
||||||
@Schema(description = "")
|
|
||||||
public class GroupCourse extends BaseDomain{
|
public class GroupCourse extends BaseDomain{
|
||||||
|
|
||||||
//课程名称
|
//课程名称
|
||||||
+3
-7
@@ -1,15 +1,11 @@
|
|||||||
package cn.novalon.gym.manage.db.entity;
|
|
||||||
/**
|
|
||||||
* @author:liwentao
|
|
||||||
* @date:2026/4/25-04-25-17:34
|
|
||||||
* 团课表
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
package cn.novalon.gym.manage.groupcourse.entity;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.db.entity.BaseEntity;
|
||||||
import org.springframework.data.relational.core.mapping.Column;
|
import org.springframework.data.relational.core.mapping.Column;
|
||||||
import org.springframework.data.relational.core.mapping.Table;
|
import org.springframework.data.relational.core.mapping.Table;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
@Table("group_course")
|
@Table("group_course")
|
||||||
public class GroupCourseEntity extends BaseEntity {
|
public class GroupCourseEntity extends BaseEntity {
|
||||||
+10
-12
@@ -1,7 +1,8 @@
|
|||||||
package cn.novalon.gym.manage.sys.handler.groupCourse;
|
|
||||||
|
|
||||||
import cn.novalon.gym.manage.sys.core.domain.GroupCourse;
|
package cn.novalon.gym.manage.groupcourse.handler;
|
||||||
import cn.novalon.gym.manage.sys.core.service.IGroupCourseService;
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.service.IGroupCourseService;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
import jakarta.validation.Validator;
|
import jakarta.validation.Validator;
|
||||||
@@ -10,31 +11,28 @@ import org.springframework.web.reactive.function.server.ServerRequest;
|
|||||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author:liwentao
|
|
||||||
* @date:2026/4/26-04-26-14:30
|
|
||||||
*/
|
|
||||||
@Component
|
@Component
|
||||||
@Tag(name="团课管理",description = "团课相关操作")
|
@Tag(name="团课管理",description = "团课相关操作")
|
||||||
public class GroupCourseHandler {
|
public class GroupCourseHandler {
|
||||||
private final IGroupCourseService groupCourseService;
|
private final IGroupCourseService groupCourseService;
|
||||||
private final Validator validator;
|
private final Validator validator;
|
||||||
public GroupCourseHandler(IGroupCourseService groupCourseService,Validator validator){
|
|
||||||
|
public GroupCourseHandler(IGroupCourseService groupCourseService, Validator validator){
|
||||||
this.groupCourseService = groupCourseService;
|
this.groupCourseService = groupCourseService;
|
||||||
this.validator = validator;
|
this.validator = validator;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Operation(summary = "获取所有用户", description = "获取系统中所有用户列表")
|
@Operation(summary = "获取所有团课", description = "获取系统中所有团课列表")
|
||||||
public Mono<ServerResponse> getAllGroupCourse(ServerRequest request){
|
public Mono<ServerResponse> getAllGroupCourse(ServerRequest request){
|
||||||
boolean includeDeleted = Boolean.valueOf(request.queryParam("includeDeleted").orElse("false"));
|
boolean includeDeleted = Boolean.valueOf(request.queryParam("includeDeleted").orElse("false"));
|
||||||
return ServerResponse.ok()
|
return ServerResponse.ok()
|
||||||
.body(groupCourseService.findAll(includeDeleted), GroupCourse.class);
|
.body(groupCourseService.findAll(includeDeleted), GroupCourse.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Operation(summary = "根据ID获取团课", description = "根据ID获取团课详情")
|
||||||
public Mono<ServerResponse> getGroupCourseById(ServerRequest request){
|
public Mono<ServerResponse> getGroupCourseById(ServerRequest request){
|
||||||
Long id = Long.valueOf(request.pathVariable("id"));
|
Long id = Long.valueOf(request.pathVariable("id"));
|
||||||
return groupCourseService.findById(id)
|
return ServerResponse.ok()
|
||||||
.flatMap(groupCourse -> ServerResponse.ok().bodyValue(groupCourse))
|
.body(groupCourseService.findById(id), GroupCourse.class);
|
||||||
.switchIfEmpty(ServerResponse.notFound().build());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+3
-2
@@ -1,6 +1,7 @@
|
|||||||
package cn.novalon.gym.manage.sys.core.repository;
|
|
||||||
|
|
||||||
import cn.novalon.gym.manage.sys.core.domain.GroupCourse;
|
package cn.novalon.gym.manage.groupcourse.repository;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
+9
-10
@@ -1,26 +1,23 @@
|
|||||||
package cn.novalon.gym.manage.db.repository;
|
|
||||||
|
|
||||||
import cn.novalon.gym.manage.db.converter.GroupCourseConverter;
|
package cn.novalon.gym.manage.groupcourse.repository.impl;
|
||||||
import cn.novalon.gym.manage.db.dao.GroupCourseDao;
|
|
||||||
import cn.novalon.gym.manage.sys.core.domain.GroupCourse;
|
import cn.novalon.gym.manage.groupcourse.converter.GroupCourseConverter;
|
||||||
import cn.novalon.gym.manage.sys.core.repository.IGroupCourseRepository;
|
import cn.novalon.gym.manage.groupcourse.dao.GroupCourseDao;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.repository.IGroupCourseRepository;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
import org.springframework.data.r2dbc.core.R2dbcEntityTemplate;
|
import org.springframework.data.r2dbc.core.R2dbcEntityTemplate;
|
||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author:liwentao
|
|
||||||
* @date:2026/4/26-04-26-14:16
|
|
||||||
*/
|
|
||||||
@Repository
|
@Repository
|
||||||
public class GroupCourseRepository implements IGroupCourseRepository {
|
public class GroupCourseRepository implements IGroupCourseRepository {
|
||||||
private final GroupCourseDao groupCourseDao;
|
private final GroupCourseDao groupCourseDao;
|
||||||
private final GroupCourseConverter groupCourseConverter;
|
private final GroupCourseConverter groupCourseConverter;
|
||||||
private final R2dbcEntityTemplate r2dbcEntityTemplate;
|
private final R2dbcEntityTemplate r2dbcEntityTemplate;
|
||||||
|
|
||||||
public GroupCourseRepository(GroupCourseDao groupCourseDao,GroupCourseConverter groupCourseConverter,
|
public GroupCourseRepository(GroupCourseDao groupCourseDao, GroupCourseConverter groupCourseConverter,
|
||||||
R2dbcEntityTemplate r2dbcEntityTemplate){
|
R2dbcEntityTemplate r2dbcEntityTemplate){
|
||||||
this.groupCourseDao = groupCourseDao;
|
this.groupCourseDao = groupCourseDao;
|
||||||
this.groupCourseConverter = groupCourseConverter;
|
this.groupCourseConverter = groupCourseConverter;
|
||||||
@@ -39,6 +36,7 @@ public class GroupCourseRepository implements IGroupCourseRepository {
|
|||||||
.map(groupCourseConverter::toDomain);
|
.map(groupCourseConverter::toDomain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Flux<GroupCourse> findAll(Sort sort) {
|
public Flux<GroupCourse> findAll(Sort sort) {
|
||||||
return groupCourseDao.findAll(sort)
|
return groupCourseDao.findAll(sort)
|
||||||
.map(groupCourseConverter::toDomain);
|
.map(groupCourseConverter::toDomain);
|
||||||
@@ -50,6 +48,7 @@ public class GroupCourseRepository implements IGroupCourseRepository {
|
|||||||
.map(groupCourseConverter::toDomain);
|
.map(groupCourseConverter::toDomain);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Flux<GroupCourse> findByDeletedAtIsNull(Sort sort) {
|
public Flux<GroupCourse> findByDeletedAtIsNull(Sort sort) {
|
||||||
return groupCourseDao.findAllByDeletedAtIsNull(sort)
|
return groupCourseDao.findAllByDeletedAtIsNull(sort)
|
||||||
.map(groupCourseConverter::toDomain);
|
.map(groupCourseConverter::toDomain);
|
||||||
+3
-2
@@ -1,6 +1,7 @@
|
|||||||
package cn.novalon.gym.manage.sys.core.service;
|
|
||||||
|
|
||||||
import cn.novalon.gym.manage.sys.core.domain.GroupCourse;
|
package cn.novalon.gym.manage.groupcourse.service;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
+7
-12
@@ -1,24 +1,19 @@
|
|||||||
package cn.novalon.gym.manage.sys.core.service.impl;
|
|
||||||
|
|
||||||
import cn.novalon.gym.manage.sys.audit.service.IAuditLogService;
|
package cn.novalon.gym.manage.groupcourse.service.impl;
|
||||||
import cn.novalon.gym.manage.sys.core.domain.GroupCourse;
|
|
||||||
import cn.novalon.gym.manage.sys.core.repository.IGroupCourseRepository;
|
import cn.novalon.gym.manage.groupcourse.domain.GroupCourse;
|
||||||
import cn.novalon.gym.manage.sys.core.service.IGroupCourseService;
|
import cn.novalon.gym.manage.groupcourse.repository.IGroupCourseRepository;
|
||||||
|
import cn.novalon.gym.manage.groupcourse.service.IGroupCourseService;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author:liwentao
|
|
||||||
* @date:2026/4/26-04-26-14:12
|
|
||||||
*/
|
|
||||||
@Service
|
@Service
|
||||||
public class GroupCourseService implements IGroupCourseService {
|
public class GroupCourseService implements IGroupCourseService {
|
||||||
private final IGroupCourseRepository groupCourseRepository;
|
private final IGroupCourseRepository groupCourseRepository;
|
||||||
private final IAuditLogService auditLogService;
|
|
||||||
public GroupCourseService(IGroupCourseRepository groupCourseRepository, IAuditLogService auditLogService){
|
public GroupCourseService(IGroupCourseRepository groupCourseRepository){
|
||||||
this.groupCourseRepository = groupCourseRepository;
|
this.groupCourseRepository = groupCourseRepository;
|
||||||
this.auditLogService = auditLogService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
spring:
|
||||||
|
application:
|
||||||
|
name: gym-groupCourse
|
||||||
+13
@@ -0,0 +1,13 @@
|
|||||||
|
package cn.novalon.gym.manage.groupcourse;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
@SpringBootTest
|
||||||
|
class GymGroupCourseApplicationTests {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void contextLoads() {
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -18,6 +18,11 @@
|
|||||||
<description>Application module for Novalon Manage API</description>
|
<description>Application module for Novalon Manage API</description>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
|
<artifactId>gym-groupCourse</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.novalon.gym.manage</groupId>
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
<artifactId>manage-sys</artifactId>
|
<artifactId>manage-sys</artifactId>
|
||||||
@@ -133,6 +138,12 @@
|
|||||||
<groupId>org.springdoc</groupId>
|
<groupId>org.springdoc</groupId>
|
||||||
<artifactId>springdoc-openapi-starter-webflux-ui</artifactId>
|
<artifactId>springdoc-openapi-starter-webflux-ui</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.novalon.gym.manage</groupId>
|
||||||
|
<artifactId>gym-groupCourse</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|||||||
+2
-2
@@ -15,10 +15,10 @@ import org.springframework.web.server.WebFilter;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@SpringBootApplication(scanBasePackages = "cn.novalon.gym.manage", exclude = {
|
@SpringBootApplication(scanBasePackages = {"cn.novalon.gym.manage", "cn.novalon.gym.manage.groupcourse"}, exclude = {
|
||||||
ReactiveUserDetailsServiceAutoConfiguration.class })
|
ReactiveUserDetailsServiceAutoConfiguration.class })
|
||||||
@EnableR2dbcRepositories(basePackages = { "cn.novalon.gym.manage.db.dao",
|
@EnableR2dbcRepositories(basePackages = { "cn.novalon.gym.manage.db.dao",
|
||||||
"cn.novalon.gym.manage.sys.audit.repository" })
|
"cn.novalon.gym.manage.sys.audit.repository", "cn.novalon.gym.manage.groupcourse.dao" })
|
||||||
public class ManageApplication {
|
public class ManageApplication {
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ManageApplication.class);
|
private static final Logger logger = LoggerFactory.getLogger(ManageApplication.class);
|
||||||
|
|||||||
+22
-21
@@ -1,11 +1,12 @@
|
|||||||
package cn.novalon.gym.manage.app.config;
|
package cn.novalon.gym.manage.app.config;
|
||||||
|
|
||||||
|
import cn.novalon.gym.manage.groupcourse.handler.GroupCourseHandler;
|
||||||
import cn.novalon.gym.manage.sys.handler.auth.SysAuthHandler;
|
import cn.novalon.gym.manage.sys.handler.auth.SysAuthHandler;
|
||||||
import cn.novalon.gym.manage.sys.handler.auth.PasswordDiagnosticHandler;
|
import cn.novalon.gym.manage.sys.handler.auth.PasswordDiagnosticHandler;
|
||||||
import cn.novalon.gym.manage.sys.handler.config.SysConfigHandler;
|
import cn.novalon.gym.manage.sys.handler.config.SysConfigHandler;
|
||||||
import cn.novalon.gym.manage.sys.handler.dictionary.DictionaryHandler;
|
import cn.novalon.gym.manage.sys.handler.dictionary.DictionaryHandler;
|
||||||
import cn.novalon.gym.manage.sys.handler.dict.SysDictHandler;
|
import cn.novalon.gym.manage.sys.handler.dict.SysDictHandler;
|
||||||
import cn.novalon.gym.manage.sys.handler.groupCourse.GroupCourseHandler;
|
|
||||||
import cn.novalon.gym.manage.sys.handler.log.SysLogHandler;
|
import cn.novalon.gym.manage.sys.handler.log.SysLogHandler;
|
||||||
import cn.novalon.gym.manage.sys.handler.log.OperationLogHandler;
|
import cn.novalon.gym.manage.sys.handler.log.OperationLogHandler;
|
||||||
import cn.novalon.gym.manage.sys.handler.menu.MenuHandler;
|
import cn.novalon.gym.manage.sys.handler.menu.MenuHandler;
|
||||||
@@ -25,19 +26,19 @@ import static org.springframework.web.reactive.function.server.RouterFunctions.r
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统路由配置类
|
* 系统路由配置类
|
||||||
*
|
*
|
||||||
* 文件定义:配置WebFlux函数式路由,将HTTP请求映射到对应的Handler方法
|
* 文件定义:配置WebFlux函数式路由,将HTTP请求映射到对应的Handler方法
|
||||||
* 涉及业务:用户、角色、字典、菜单、公告、文件等所有RESTful API路由
|
* 涉及业务:用户、角色、字典、菜单、公告、文件等所有RESTful API路由
|
||||||
* 算法:使用RouterFunctions.route()构建函数式路由规则
|
* 算法:使用RouterFunctions.route()构建函数式路由规则
|
||||||
*
|
*
|
||||||
* @author 张翔
|
* @author 张翔
|
||||||
* @date 2026-03-13
|
* @date 2026-03-13
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
public class SystemRouter {
|
public class SystemRouter {
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public RouterFunction<ServerResponse> systemRoutes(
|
public RouterFunction<ServerResponse> systemRoutes(
|
||||||
|
GroupCourseHandler groupCourseHandler,
|
||||||
DictionaryHandler dictionaryHandler,
|
DictionaryHandler dictionaryHandler,
|
||||||
SysUserHandler userHandler,
|
SysUserHandler userHandler,
|
||||||
MenuHandler menuHandler,
|
MenuHandler menuHandler,
|
||||||
@@ -52,13 +53,12 @@ public class SystemRouter {
|
|||||||
SysUserMessageHandler messageHandler,
|
SysUserMessageHandler messageHandler,
|
||||||
SysFileHandler fileHandler,
|
SysFileHandler fileHandler,
|
||||||
SysPermissionHandler permissionHandler,
|
SysPermissionHandler permissionHandler,
|
||||||
PasswordDiagnosticHandler passwordDiagnosticHandler,
|
PasswordDiagnosticHandler passwordDiagnosticHandler) {
|
||||||
GroupCourseHandler groupCourseHandler) {
|
|
||||||
|
|
||||||
return route()
|
return route()
|
||||||
// ========== 诊断路由 ==========
|
// ========== 诊断路由 ==========
|
||||||
.GET("/api/diagnostic/password", passwordDiagnosticHandler::diagnose)
|
.GET("/api/diagnostic/password", passwordDiagnosticHandler::diagnose)
|
||||||
|
|
||||||
// ========== 字典路由 ==========
|
// ========== 字典路由 ==========
|
||||||
.GET("/api/dictionaries", dictionaryHandler::getAllDictionaries)
|
.GET("/api/dictionaries", dictionaryHandler::getAllDictionaries)
|
||||||
.GET("/api/dictionaries/{id}", dictionaryHandler::getDictionaryById)
|
.GET("/api/dictionaries/{id}", dictionaryHandler::getDictionaryById)
|
||||||
@@ -67,7 +67,7 @@ public class SystemRouter {
|
|||||||
.POST("/api/dictionaries", dictionaryHandler::createDictionary)
|
.POST("/api/dictionaries", dictionaryHandler::createDictionary)
|
||||||
.PUT("/api/dictionaries/{id}", dictionaryHandler::updateDictionary)
|
.PUT("/api/dictionaries/{id}", dictionaryHandler::updateDictionary)
|
||||||
.DELETE("/api/dictionaries/{id}", dictionaryHandler::deleteDictionary)
|
.DELETE("/api/dictionaries/{id}", dictionaryHandler::deleteDictionary)
|
||||||
|
|
||||||
// ========== 用户路由 ==========
|
// ========== 用户路由 ==========
|
||||||
.GET("/api/users", userHandler::getAllUsers)
|
.GET("/api/users", userHandler::getAllUsers)
|
||||||
.GET("/api/users/page", userHandler::getUsersByPage)
|
.GET("/api/users/page", userHandler::getUsersByPage)
|
||||||
@@ -86,7 +86,7 @@ public class SystemRouter {
|
|||||||
.POST("/api/users/{id}/action/restore", userHandler::restoreUser)
|
.POST("/api/users/{id}/action/restore", userHandler::restoreUser)
|
||||||
.GET("/api/users/{id}/roles", userHandler::getUserRoles)
|
.GET("/api/users/{id}/roles", userHandler::getUserRoles)
|
||||||
.POST("/api/users/{id}/roles", userHandler::assignRoles)
|
.POST("/api/users/{id}/roles", userHandler::assignRoles)
|
||||||
|
|
||||||
// ========== 菜单路由 ==========
|
// ========== 菜单路由 ==========
|
||||||
.GET("/api/menus", menuHandler::getAllMenus)
|
.GET("/api/menus", menuHandler::getAllMenus)
|
||||||
.GET("/api/menus/tree", menuHandler::getMenuTree)
|
.GET("/api/menus/tree", menuHandler::getMenuTree)
|
||||||
@@ -94,7 +94,7 @@ public class SystemRouter {
|
|||||||
.POST("/api/menus", menuHandler::createMenu)
|
.POST("/api/menus", menuHandler::createMenu)
|
||||||
.PUT("/api/menus/{id}", menuHandler::updateMenu)
|
.PUT("/api/menus/{id}", menuHandler::updateMenu)
|
||||||
.DELETE("/api/menus/{id}", menuHandler::deleteMenu)
|
.DELETE("/api/menus/{id}", menuHandler::deleteMenu)
|
||||||
|
|
||||||
// ========== 角色路由 ==========
|
// ========== 角色路由 ==========
|
||||||
.GET("/api/roles", roleHandler::getAllRoles)
|
.GET("/api/roles", roleHandler::getAllRoles)
|
||||||
.GET("/api/roles/page", roleHandler::getRolesByPage)
|
.GET("/api/roles/page", roleHandler::getRolesByPage)
|
||||||
@@ -108,7 +108,7 @@ public class SystemRouter {
|
|||||||
.POST("/api/roles/{id}/restore", roleHandler::restoreRole)
|
.POST("/api/roles/{id}/restore", roleHandler::restoreRole)
|
||||||
.GET("/api/roles/{id}/permissions", permissionHandler::getPermissionsByRoleId)
|
.GET("/api/roles/{id}/permissions", permissionHandler::getPermissionsByRoleId)
|
||||||
.POST("/api/roles/{id}/permissions", permissionHandler::assignPermissionsToRole)
|
.POST("/api/roles/{id}/permissions", permissionHandler::assignPermissionsToRole)
|
||||||
|
|
||||||
// ========== 配置路由 ==========
|
// ========== 配置路由 ==========
|
||||||
.GET("/api/config", configHandler::getAllConfigs)
|
.GET("/api/config", configHandler::getAllConfigs)
|
||||||
.GET("/api/config/{id}", configHandler::getConfigById)
|
.GET("/api/config/{id}", configHandler::getConfigById)
|
||||||
@@ -116,7 +116,7 @@ public class SystemRouter {
|
|||||||
.POST("/api/config", configHandler::createConfig)
|
.POST("/api/config", configHandler::createConfig)
|
||||||
.PUT("/api/config/{id}", configHandler::updateConfig)
|
.PUT("/api/config/{id}", configHandler::updateConfig)
|
||||||
.DELETE("/api/config/{id}", configHandler::deleteConfig)
|
.DELETE("/api/config/{id}", configHandler::deleteConfig)
|
||||||
|
|
||||||
// ========== 日志路由 ==========
|
// ========== 日志路由 ==========
|
||||||
.GET("/api/logs/login", logHandler::getAllLoginLogs)
|
.GET("/api/logs/login", logHandler::getAllLoginLogs)
|
||||||
.GET("/api/logs/login/page", logHandler::getLoginLogsByPage)
|
.GET("/api/logs/login/page", logHandler::getLoginLogsByPage)
|
||||||
@@ -136,15 +136,15 @@ public class SystemRouter {
|
|||||||
.GET("/api/logs/operation/count", operationLogHandler::getOperationLogCount)
|
.GET("/api/logs/operation/count", operationLogHandler::getOperationLogCount)
|
||||||
.GET("/api/logs/operation/{id}", operationLogHandler::getOperationLogById)
|
.GET("/api/logs/operation/{id}", operationLogHandler::getOperationLogById)
|
||||||
.POST("/api/logs/operation", operationLogHandler::createOperationLog)
|
.POST("/api/logs/operation", operationLogHandler::createOperationLog)
|
||||||
|
|
||||||
// ========== 认证路由 ==========
|
// ========== 认证路由 ==========
|
||||||
.POST("/api/auth/login", authHandler::login)
|
.POST("/api/auth/login", authHandler::login)
|
||||||
.POST("/api/auth/register", authHandler::register)
|
.POST("/api/auth/register", authHandler::register)
|
||||||
.POST("/api/auth/logout", authHandler::logout)
|
.POST("/api/auth/logout", authHandler::logout)
|
||||||
|
|
||||||
// ========== 统计路由 ==========
|
// ========== 统计路由 ==========
|
||||||
.GET("/api/stats/overview", statsHandler::getOverview)
|
.GET("/api/stats/overview", statsHandler::getOverview)
|
||||||
|
|
||||||
// ========== 数据字典路由 ==========
|
// ========== 数据字典路由 ==========
|
||||||
.GET("/api/dict/types", dictHandler::getAllDictTypes)
|
.GET("/api/dict/types", dictHandler::getAllDictTypes)
|
||||||
.GET("/api/dict/types/{id}", dictHandler::getDictTypeById)
|
.GET("/api/dict/types/{id}", dictHandler::getDictTypeById)
|
||||||
@@ -158,7 +158,7 @@ public class SystemRouter {
|
|||||||
.POST("/api/dict/data", dictHandler::createDictData)
|
.POST("/api/dict/data", dictHandler::createDictData)
|
||||||
.PUT("/api/dict/data/{id}", dictHandler::updateDictData)
|
.PUT("/api/dict/data/{id}", dictHandler::updateDictData)
|
||||||
.DELETE("/api/dict/data/{id}", dictHandler::deleteDictData)
|
.DELETE("/api/dict/data/{id}", dictHandler::deleteDictData)
|
||||||
|
|
||||||
// ========== 公告路由 ==========
|
// ========== 公告路由 ==========
|
||||||
.GET("/api/notices", noticeHandler::getAllNotices)
|
.GET("/api/notices", noticeHandler::getAllNotices)
|
||||||
.GET("/api/notices/{id}", noticeHandler::getNoticeById)
|
.GET("/api/notices/{id}", noticeHandler::getNoticeById)
|
||||||
@@ -166,7 +166,7 @@ public class SystemRouter {
|
|||||||
.POST("/api/notices", noticeHandler::createNotice)
|
.POST("/api/notices", noticeHandler::createNotice)
|
||||||
.PUT("/api/notices/{id}", noticeHandler::updateNotice)
|
.PUT("/api/notices/{id}", noticeHandler::updateNotice)
|
||||||
.DELETE("/api/notices/{id}", noticeHandler::deleteNotice)
|
.DELETE("/api/notices/{id}", noticeHandler::deleteNotice)
|
||||||
|
|
||||||
// ========== 消息路由 ==========
|
// ========== 消息路由 ==========
|
||||||
.GET("/api/messages/user/{userId}", messageHandler::getMessagesByUser)
|
.GET("/api/messages/user/{userId}", messageHandler::getMessagesByUser)
|
||||||
.GET("/api/messages/user/{userId}/unread", messageHandler::getUnreadCount)
|
.GET("/api/messages/user/{userId}/unread", messageHandler::getUnreadCount)
|
||||||
@@ -174,7 +174,7 @@ public class SystemRouter {
|
|||||||
.POST("/api/messages", messageHandler::createMessage)
|
.POST("/api/messages", messageHandler::createMessage)
|
||||||
.PUT("/api/messages/{id}/read", messageHandler::markAsRead)
|
.PUT("/api/messages/{id}/read", messageHandler::markAsRead)
|
||||||
.DELETE("/api/messages/{id}", messageHandler::deleteMessage)
|
.DELETE("/api/messages/{id}", messageHandler::deleteMessage)
|
||||||
|
|
||||||
// ========== 文件路由 ==========
|
// ========== 文件路由 ==========
|
||||||
.GET("/api/files", fileHandler::getAllFiles)
|
.GET("/api/files", fileHandler::getAllFiles)
|
||||||
.GET("/api/files/{id}", fileHandler::getFileById)
|
.GET("/api/files/{id}", fileHandler::getFileById)
|
||||||
@@ -184,7 +184,7 @@ public class SystemRouter {
|
|||||||
.GET("/api/files/{id}/preview", fileHandler::previewFile)
|
.GET("/api/files/{id}/preview", fileHandler::previewFile)
|
||||||
.GET("/api/files/preview/{fileName}", fileHandler::previewFileByName)
|
.GET("/api/files/preview/{fileName}", fileHandler::previewFileByName)
|
||||||
.DELETE("/api/files/{id}", fileHandler::deleteFile)
|
.DELETE("/api/files/{id}", fileHandler::deleteFile)
|
||||||
|
|
||||||
// ========== 权限路由 ==========
|
// ========== 权限路由 ==========
|
||||||
.GET("/api/permissions", permissionHandler::getAllPermissions)
|
.GET("/api/permissions", permissionHandler::getAllPermissions)
|
||||||
.GET("/api/permissions/{id}", permissionHandler::getPermissionById)
|
.GET("/api/permissions/{id}", permissionHandler::getPermissionById)
|
||||||
@@ -197,7 +197,8 @@ public class SystemRouter {
|
|||||||
|
|
||||||
// ========== 团课路由 ==========
|
// ========== 团课路由 ==========
|
||||||
.GET("/api/groupCourse", groupCourseHandler::getAllGroupCourse)
|
.GET("/api/groupCourse", groupCourseHandler::getAllGroupCourse)
|
||||||
|
.GET("/api/groupCourse/{id}", groupCourseHandler::getGroupCourseById)
|
||||||
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
-75
@@ -1,75 +0,0 @@
|
|||||||
package cn.novalon.gym.manage.db.entity;
|
|
||||||
|
|
||||||
import org.springframework.data.relational.core.mapping.Column;
|
|
||||||
import org.springframework.data.relational.core.mapping.Table;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author:liwentao
|
|
||||||
* @date:2026/4/25-04-25-17:50
|
|
||||||
* 团课预约记录表
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Table("group_course_booking")
|
|
||||||
public class GroupCourseBookingEntity extends BaseEntity {
|
|
||||||
|
|
||||||
//团课id
|
|
||||||
@Column("course_id")
|
|
||||||
private Long courseId;
|
|
||||||
|
|
||||||
//用户id
|
|
||||||
@Column("user_id")
|
|
||||||
private Long userId;
|
|
||||||
|
|
||||||
//预约时间
|
|
||||||
@Column("booking_time")
|
|
||||||
private Date bookingTime;
|
|
||||||
|
|
||||||
//状态:0-已预约,1-已取消,2-已出席,3-缺席
|
|
||||||
@Column("status")
|
|
||||||
private Long status;
|
|
||||||
//取消时间
|
|
||||||
@Column("cancel_time")
|
|
||||||
private Date cancelTime;
|
|
||||||
|
|
||||||
public Long getCourseId() {
|
|
||||||
return courseId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCourseId(Long courseId) {
|
|
||||||
this.courseId = courseId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getUserId() {
|
|
||||||
return userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUserId(Long userId) {
|
|
||||||
this.userId = userId;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getBookingTime() {
|
|
||||||
return bookingTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBookingTime(Date bookingTime) {
|
|
||||||
this.bookingTime = bookingTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Long getStatus() {
|
|
||||||
return status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setStatus(Long status) {
|
|
||||||
this.status = status;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Date getCancelTime() {
|
|
||||||
return cancelTime;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCancelTime(Date cancelTime) {
|
|
||||||
this.cancelTime = cancelTime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -42,6 +42,7 @@
|
|||||||
<module>manage-audit</module>
|
<module>manage-audit</module>
|
||||||
<module>manage-notify</module>
|
<module>manage-notify</module>
|
||||||
<module>manage-file</module>
|
<module>manage-file</module>
|
||||||
|
<module>gym-groupCourse</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
|||||||
Reference in New Issue
Block a user