addd
This commit is contained in:
31
.gitignore
vendored
Normal file
31
.gitignore
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
# Node / Frontend
|
||||
frontend/node_modules/
|
||||
frontend/dist/
|
||||
frontend/.vite/
|
||||
frontend/.npm/
|
||||
frontend/*.log
|
||||
frontend/.env
|
||||
frontend/.env.*
|
||||
|
||||
# Java / Backend
|
||||
backend/target/
|
||||
backend/.classpath
|
||||
backend/.project
|
||||
backend/.settings/
|
||||
backend/*.log
|
||||
|
||||
# OS
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
# IDE
|
||||
.vscode/
|
||||
.idea/
|
||||
*.iml
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
|
||||
# Misc
|
||||
*.tmp
|
||||
*.swp
|
||||
57
README.md
57
README.md
@@ -0,0 +1,57 @@
|
||||
# 社区节气文化活动发布与报名系统
|
||||
|
||||
## 后端技术栈
|
||||
- Spring Boot 3 + MyBatis + Sa-Token
|
||||
- MySQL 8
|
||||
|
||||
## 前端技术栈
|
||||
- Vue 3 + Vite
|
||||
- Axios
|
||||
- Arco Design Vue
|
||||
|
||||
## 本地运行
|
||||
|
||||
### 1. 初始化数据库
|
||||
|
||||
1) 创建数据库并导入表结构:
|
||||
|
||||
```
|
||||
mysql -u root -p < backend/schema.sql
|
||||
```
|
||||
|
||||
2) 修改 `backend/src/main/resources/application.yml` 中的数据库账号与密码。
|
||||
|
||||
### 2. 启动后端
|
||||
|
||||
```
|
||||
cd backend
|
||||
mvn spring-boot:run
|
||||
```
|
||||
|
||||
### 3. 启动前端
|
||||
|
||||
```
|
||||
cd frontend
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
前端地址:`http://localhost:5173`
|
||||
后端地址:`http://localhost:8080`
|
||||
|
||||
## 角色说明
|
||||
|
||||
- 普通用户注册后默认角色为 `user`。
|
||||
- 管理员功能需要角色为 `admin` 的账号。可以在数据库中手动修改:
|
||||
|
||||
```
|
||||
update sys_user set role = 'admin' where username = '你的用户名';
|
||||
```
|
||||
|
||||
## 功能概览
|
||||
|
||||
- 活动发布与管理:创建、编辑、发布、结束活动
|
||||
- 活动报名与名额控制:报名、取消、签到
|
||||
- 用户端:活动广场、活动详情、我的报名
|
||||
- 管理端:报名名单与签到
|
||||
|
||||
|
||||
66
backend/pom.xml
Normal file
66
backend/pom.xml
Normal file
@@ -0,0 +1,66 @@
|
||||
<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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.3.2</version>
|
||||
<relativePath/>
|
||||
</parent>
|
||||
<groupId>com.community</groupId>
|
||||
<artifactId>community-activities</artifactId>
|
||||
<version>0.0.1-SNAPSHOT</version>
|
||||
<name>community-activities</name>
|
||||
<description>Community solar-term activity system</description>
|
||||
<properties>
|
||||
<java.version>17</java.version>
|
||||
<maven.compiler.release>17</maven.compiler.release>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-validation</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
<artifactId>mybatis-spring-boot-starter</artifactId>
|
||||
<version>3.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.mysql</groupId>
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.dev33</groupId>
|
||||
<artifactId>sa-token-spring-boot3-starter</artifactId>
|
||||
<version>1.38.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-crypto</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
48
backend/schema.sql
Normal file
48
backend/schema.sql
Normal file
@@ -0,0 +1,48 @@
|
||||
create database if not exists community_activity default character set utf8mb4 collate utf8mb4_general_ci;
|
||||
use community_activity;
|
||||
|
||||
create table if not exists sys_user (
|
||||
id bigint primary key auto_increment,
|
||||
username varchar(64) not null unique,
|
||||
password_hash varchar(255) not null,
|
||||
nickname varchar(64) not null,
|
||||
phone varchar(32),
|
||||
role varchar(32) not null default 'user',
|
||||
created_at datetime not null,
|
||||
updated_at datetime not null
|
||||
);
|
||||
|
||||
create table if not exists activity (
|
||||
id bigint primary key auto_increment,
|
||||
title varchar(255) not null,
|
||||
term varchar(64) not null,
|
||||
summary varchar(255),
|
||||
content text,
|
||||
location varchar(255) not null,
|
||||
start_time datetime not null,
|
||||
end_time datetime not null,
|
||||
signup_start datetime not null,
|
||||
signup_end datetime not null,
|
||||
quota int not null,
|
||||
status varchar(32) not null,
|
||||
cover_url varchar(255),
|
||||
created_by bigint,
|
||||
created_at datetime not null,
|
||||
updated_at datetime not null,
|
||||
index idx_activity_status (status),
|
||||
index idx_activity_time (start_time)
|
||||
);
|
||||
|
||||
create table if not exists activity_signup (
|
||||
id bigint primary key auto_increment,
|
||||
activity_id bigint not null,
|
||||
user_id bigint not null,
|
||||
status varchar(32) not null,
|
||||
checkin_status varchar(32) not null,
|
||||
signed_at datetime not null,
|
||||
canceled_at datetime,
|
||||
checkin_at datetime,
|
||||
unique key uk_activity_user (activity_id, user_id),
|
||||
index idx_activity (activity_id),
|
||||
index idx_user (user_id)
|
||||
);
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.community.app;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.community.app.mapper")
|
||||
public class CommunityApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(CommunityApplication.class, args);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.community.app.config;
|
||||
|
||||
import com.community.app.dto.ApiResponse;
|
||||
import cn.dev33.satoken.exception.NotLoginException;
|
||||
import org.springframework.web.bind.MethodArgumentNotValidException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
@RestControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
@ExceptionHandler(IllegalStateException.class)
|
||||
public ApiResponse<Void> handleIllegalState(IllegalStateException ex) {
|
||||
return ApiResponse.fail(ex.getMessage());
|
||||
}
|
||||
|
||||
@ExceptionHandler(MethodArgumentNotValidException.class)
|
||||
public ApiResponse<Void> handleValidation(MethodArgumentNotValidException ex) {
|
||||
String message = ex.getBindingResult().getFieldErrors().isEmpty()
|
||||
? "参数错误"
|
||||
: ex.getBindingResult().getFieldErrors().get(0).getDefaultMessage();
|
||||
return ApiResponse.fail(message);
|
||||
}
|
||||
|
||||
@ExceptionHandler(NotLoginException.class)
|
||||
public ApiResponse<Void> handleNotLogin(NotLoginException ex) {
|
||||
return ApiResponse.fail("未登录或登录已失效");
|
||||
}
|
||||
|
||||
@ExceptionHandler(Exception.class)
|
||||
public ApiResponse<Void> handleOther(Exception ex) {
|
||||
return ApiResponse.fail("服务器异常");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.community.app.config;
|
||||
|
||||
import cn.dev33.satoken.stp.StpInterface;
|
||||
import com.community.app.entity.User;
|
||||
import com.community.app.service.UserService;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Configuration
|
||||
public class SaTokenConfig {
|
||||
@Bean
|
||||
public StpInterface stpInterface(UserService userService) {
|
||||
return new StpInterface() {
|
||||
@Override
|
||||
public List<String> getPermissionList(Object loginId, String loginType) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getRoleList(Object loginId, String loginType) {
|
||||
User user = userService.findById(Long.valueOf(loginId.toString()));
|
||||
if (user == null) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
return Collections.singletonList(user.getRole());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.community.app.config;
|
||||
|
||||
import cn.dev33.satoken.interceptor.SaInterceptor;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import cn.dev33.satoken.context.SaHolder;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.CorsRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration
|
||||
public class WebConfig implements WebMvcConfigurer {
|
||||
@Override
|
||||
public void addCorsMappings(CorsRegistry registry) {
|
||||
registry.addMapping("/**")
|
||||
.allowedOrigins("*")
|
||||
.allowedMethods("GET", "POST", "PUT", "DELETE", "OPTIONS")
|
||||
.allowedHeaders("*")
|
||||
.allowCredentials(false)
|
||||
.maxAge(3600);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new SaInterceptor(handle -> {
|
||||
String method = SaHolder.getRequest().getMethod();
|
||||
if ("OPTIONS".equalsIgnoreCase(method)) {
|
||||
return;
|
||||
}
|
||||
StpUtil.checkLogin();
|
||||
}))
|
||||
.addPathPatterns("/api/**")
|
||||
.excludePathPatterns("/api/auth/**", "/api/public/**");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.community.app.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckRole;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.community.app.dto.ActivityRequest;
|
||||
import com.community.app.dto.ActivityView;
|
||||
import com.community.app.dto.ApiResponse;
|
||||
import com.community.app.entity.User;
|
||||
import com.community.app.service.ActivityService;
|
||||
import com.community.app.service.SignupService;
|
||||
import com.community.app.service.UserService;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/activities")
|
||||
public class ActivityController {
|
||||
private final ActivityService activityService;
|
||||
private final SignupService signupService;
|
||||
private final UserService userService;
|
||||
|
||||
public ActivityController(ActivityService activityService, SignupService signupService, UserService userService) {
|
||||
this.activityService = activityService;
|
||||
this.signupService = signupService;
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public ApiResponse<List<ActivityView>> list(@RequestParam(required = false) String status,
|
||||
@RequestParam(required = false) String keyword) {
|
||||
User user = currentUser();
|
||||
if (user == null || !"admin".equals(user.getRole())) {
|
||||
status = "published";
|
||||
}
|
||||
return ApiResponse.ok(activityService.list(status, keyword));
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
public ApiResponse<ActivityView> detail(@PathVariable Long id) {
|
||||
ActivityView view = activityService.getView(id);
|
||||
if (view == null) {
|
||||
return ApiResponse.fail("活动不存在");
|
||||
}
|
||||
User user = currentUser();
|
||||
if (user == null || !"admin".equals(user.getRole())) {
|
||||
if (!"published".equals(view.getStatus())) {
|
||||
return ApiResponse.fail("活动未发布");
|
||||
}
|
||||
}
|
||||
return ApiResponse.ok(view);
|
||||
}
|
||||
|
||||
@SaCheckRole("admin")
|
||||
@PostMapping
|
||||
public ApiResponse<Void> create(@Valid @RequestBody ActivityRequest request) {
|
||||
Long userId = Long.valueOf(StpUtil.getLoginId().toString());
|
||||
activityService.create(request, userId);
|
||||
return ApiResponse.ok("创建成功", null);
|
||||
}
|
||||
|
||||
@SaCheckRole("admin")
|
||||
@PutMapping("/{id}")
|
||||
public ApiResponse<Void> update(@PathVariable Long id, @Valid @RequestBody ActivityRequest request) {
|
||||
activityService.update(id, request);
|
||||
return ApiResponse.ok("更新成功", null);
|
||||
}
|
||||
|
||||
@SaCheckRole("admin")
|
||||
@PostMapping("/{id}/publish")
|
||||
public ApiResponse<Void> publish(@PathVariable Long id) {
|
||||
activityService.publish(id);
|
||||
return ApiResponse.ok("已发布", null);
|
||||
}
|
||||
|
||||
@SaCheckRole("admin")
|
||||
@PostMapping("/{id}/close")
|
||||
public ApiResponse<Void> close(@PathVariable Long id) {
|
||||
activityService.close(id);
|
||||
return ApiResponse.ok("已结束", null);
|
||||
}
|
||||
|
||||
@PostMapping("/{id}/signup")
|
||||
public ApiResponse<Void> signup(@PathVariable Long id) {
|
||||
Long userId = Long.valueOf(StpUtil.getLoginId().toString());
|
||||
signupService.signup(id, userId);
|
||||
return ApiResponse.ok("报名成功", null);
|
||||
}
|
||||
|
||||
@PostMapping("/{id}/cancel")
|
||||
public ApiResponse<Void> cancel(@PathVariable Long id) {
|
||||
Long userId = Long.valueOf(StpUtil.getLoginId().toString());
|
||||
signupService.cancel(id, userId);
|
||||
return ApiResponse.ok("已取消报名", null);
|
||||
}
|
||||
|
||||
private User currentUser() {
|
||||
if (!StpUtil.isLogin()) {
|
||||
return null;
|
||||
}
|
||||
Long userId = Long.valueOf(StpUtil.getLoginId().toString());
|
||||
return userService.findById(userId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.community.app.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckRole;
|
||||
import com.community.app.dto.AdminSignupView;
|
||||
import com.community.app.dto.ApiResponse;
|
||||
import com.community.app.entity.User;
|
||||
import com.community.app.service.SignupService;
|
||||
import com.community.app.service.UserService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/admin")
|
||||
@SaCheckRole("admin")
|
||||
public class AdminController {
|
||||
private final SignupService signupService;
|
||||
private final UserService userService;
|
||||
|
||||
public AdminController(SignupService signupService, UserService userService) {
|
||||
this.signupService = signupService;
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
@GetMapping("/activities/{id}/signups")
|
||||
public ApiResponse<List<AdminSignupView>> listSignups(@PathVariable Long id) {
|
||||
return ApiResponse.ok(signupService.listByActivity(id));
|
||||
}
|
||||
|
||||
@PostMapping("/signups/{id}/checkin")
|
||||
public ApiResponse<Void> checkin(@PathVariable Long id) {
|
||||
signupService.checkin(id);
|
||||
return ApiResponse.ok("签到成功", null);
|
||||
}
|
||||
|
||||
@GetMapping("/users")
|
||||
public ApiResponse<List<User>> listUsers() {
|
||||
return ApiResponse.ok(userService.listAll());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.community.app.controller;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.community.app.dto.ApiResponse;
|
||||
import com.community.app.dto.AuthRequest;
|
||||
import com.community.app.dto.AuthResponse;
|
||||
import com.community.app.dto.RegisterRequest;
|
||||
import com.community.app.entity.User;
|
||||
import com.community.app.service.UserService;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/auth")
|
||||
public class AuthController {
|
||||
private final UserService userService;
|
||||
|
||||
public AuthController(UserService userService) {
|
||||
this.userService = userService;
|
||||
}
|
||||
|
||||
@PostMapping("/login")
|
||||
public ApiResponse<AuthResponse> login(@Valid @RequestBody AuthRequest request) {
|
||||
User user = userService.findByUsername(request.getUsername());
|
||||
if (user == null || !userService.verifyPassword(user, request.getPassword())) {
|
||||
return ApiResponse.fail("用户名或密码错误");
|
||||
}
|
||||
StpUtil.login(user.getId());
|
||||
AuthResponse response = new AuthResponse();
|
||||
response.setToken(StpUtil.getTokenValue());
|
||||
response.setUserId(user.getId());
|
||||
response.setUsername(user.getUsername());
|
||||
response.setNickname(user.getNickname());
|
||||
response.setRole(user.getRole());
|
||||
return ApiResponse.ok("登录成功", response);
|
||||
}
|
||||
|
||||
@PostMapping("/register")
|
||||
public ApiResponse<AuthResponse> register(@Valid @RequestBody RegisterRequest request) {
|
||||
User user = userService.register(request.getUsername(), request.getPassword(), request.getNickname(), request.getPhone());
|
||||
StpUtil.login(user.getId());
|
||||
AuthResponse response = new AuthResponse();
|
||||
response.setToken(StpUtil.getTokenValue());
|
||||
response.setUserId(user.getId());
|
||||
response.setUsername(user.getUsername());
|
||||
response.setNickname(user.getNickname());
|
||||
response.setRole(user.getRole());
|
||||
return ApiResponse.ok("注册成功", response);
|
||||
}
|
||||
|
||||
@PostMapping("/logout")
|
||||
public ApiResponse<Void> logout() {
|
||||
StpUtil.logout();
|
||||
return ApiResponse.ok("已退出", null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.community.app.controller;
|
||||
|
||||
import com.community.app.dto.ActivityView;
|
||||
import com.community.app.dto.ApiResponse;
|
||||
import com.community.app.service.ActivityService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/public")
|
||||
public class PublicController {
|
||||
private final ActivityService activityService;
|
||||
|
||||
public PublicController(ActivityService activityService) {
|
||||
this.activityService = activityService;
|
||||
}
|
||||
|
||||
@GetMapping("/activities")
|
||||
public ApiResponse<List<ActivityView>> list(@RequestParam(required = false) String keyword) {
|
||||
return ApiResponse.ok(activityService.list("published", keyword));
|
||||
}
|
||||
|
||||
@GetMapping("/activities/{id}")
|
||||
public ApiResponse<ActivityView> detail(@PathVariable Long id) {
|
||||
ActivityView view = activityService.getView(id);
|
||||
if (view == null || !"published".equals(view.getStatus())) {
|
||||
return ApiResponse.fail("活动不存在或未发布");
|
||||
}
|
||||
return ApiResponse.ok(view);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.community.app.controller;
|
||||
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import com.community.app.dto.ApiResponse;
|
||||
import com.community.app.dto.SignupView;
|
||||
import com.community.app.entity.User;
|
||||
import com.community.app.service.SignupService;
|
||||
import com.community.app.service.UserService;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/me")
|
||||
public class UserController {
|
||||
private final UserService userService;
|
||||
private final SignupService signupService;
|
||||
|
||||
public UserController(UserService userService, SignupService signupService) {
|
||||
this.userService = userService;
|
||||
this.signupService = signupService;
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
public ApiResponse<User> me() {
|
||||
Long userId = Long.valueOf(StpUtil.getLoginId().toString());
|
||||
return ApiResponse.ok(userService.findById(userId));
|
||||
}
|
||||
|
||||
@GetMapping("/signups")
|
||||
public ApiResponse<List<SignupView>> mySignups() {
|
||||
Long userId = Long.valueOf(StpUtil.getLoginId().toString());
|
||||
return ApiResponse.ok(signupService.listByUser(userId));
|
||||
}
|
||||
}
|
||||
124
backend/src/main/java/com/community/app/dto/ActivityRequest.java
Normal file
124
backend/src/main/java/com/community/app/dto/ActivityRequest.java
Normal file
@@ -0,0 +1,124 @@
|
||||
package com.community.app.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class ActivityRequest {
|
||||
@NotBlank
|
||||
private String title;
|
||||
@NotBlank
|
||||
private String term;
|
||||
private String summary;
|
||||
private String content;
|
||||
@NotBlank
|
||||
private String location;
|
||||
@NotNull
|
||||
private LocalDateTime startTime;
|
||||
@NotNull
|
||||
private LocalDateTime endTime;
|
||||
@NotNull
|
||||
private LocalDateTime signupStart;
|
||||
@NotNull
|
||||
private LocalDateTime signupEnd;
|
||||
@NotNull
|
||||
private Integer quota;
|
||||
private String status;
|
||||
private String coverUrl;
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTerm() {
|
||||
return term;
|
||||
}
|
||||
|
||||
public void setTerm(String term) {
|
||||
this.term = term;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public LocalDateTime getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(LocalDateTime startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(LocalDateTime endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getSignupStart() {
|
||||
return signupStart;
|
||||
}
|
||||
|
||||
public void setSignupStart(LocalDateTime signupStart) {
|
||||
this.signupStart = signupStart;
|
||||
}
|
||||
|
||||
public LocalDateTime getSignupEnd() {
|
||||
return signupEnd;
|
||||
}
|
||||
|
||||
public void setSignupEnd(LocalDateTime signupEnd) {
|
||||
this.signupEnd = signupEnd;
|
||||
}
|
||||
|
||||
public Integer getQuota() {
|
||||
return quota;
|
||||
}
|
||||
|
||||
public void setQuota(Integer quota) {
|
||||
this.quota = quota;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCoverUrl() {
|
||||
return coverUrl;
|
||||
}
|
||||
|
||||
public void setCoverUrl(String coverUrl) {
|
||||
this.coverUrl = coverUrl;
|
||||
}
|
||||
}
|
||||
132
backend/src/main/java/com/community/app/dto/ActivityView.java
Normal file
132
backend/src/main/java/com/community/app/dto/ActivityView.java
Normal file
@@ -0,0 +1,132 @@
|
||||
package com.community.app.dto;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class ActivityView {
|
||||
private Long id;
|
||||
private String title;
|
||||
private String term;
|
||||
private String summary;
|
||||
private String content;
|
||||
private String location;
|
||||
private LocalDateTime startTime;
|
||||
private LocalDateTime endTime;
|
||||
private LocalDateTime signupStart;
|
||||
private LocalDateTime signupEnd;
|
||||
private Integer quota;
|
||||
private String status;
|
||||
private String coverUrl;
|
||||
private Long signupCount;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTerm() {
|
||||
return term;
|
||||
}
|
||||
|
||||
public void setTerm(String term) {
|
||||
this.term = term;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public LocalDateTime getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(LocalDateTime startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(LocalDateTime endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getSignupStart() {
|
||||
return signupStart;
|
||||
}
|
||||
|
||||
public void setSignupStart(LocalDateTime signupStart) {
|
||||
this.signupStart = signupStart;
|
||||
}
|
||||
|
||||
public LocalDateTime getSignupEnd() {
|
||||
return signupEnd;
|
||||
}
|
||||
|
||||
public void setSignupEnd(LocalDateTime signupEnd) {
|
||||
this.signupEnd = signupEnd;
|
||||
}
|
||||
|
||||
public Integer getQuota() {
|
||||
return quota;
|
||||
}
|
||||
|
||||
public void setQuota(Integer quota) {
|
||||
this.quota = quota;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCoverUrl() {
|
||||
return coverUrl;
|
||||
}
|
||||
|
||||
public void setCoverUrl(String coverUrl) {
|
||||
this.coverUrl = coverUrl;
|
||||
}
|
||||
|
||||
public Long getSignupCount() {
|
||||
return signupCount;
|
||||
}
|
||||
|
||||
public void setSignupCount(Long signupCount) {
|
||||
this.signupCount = signupCount;
|
||||
}
|
||||
}
|
||||
105
backend/src/main/java/com/community/app/dto/AdminSignupView.java
Normal file
105
backend/src/main/java/com/community/app/dto/AdminSignupView.java
Normal file
@@ -0,0 +1,105 @@
|
||||
package com.community.app.dto;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class AdminSignupView {
|
||||
private Long id;
|
||||
private Long activityId;
|
||||
private Long userId;
|
||||
private String username;
|
||||
private String nickname;
|
||||
private String phone;
|
||||
private String status;
|
||||
private String checkinStatus;
|
||||
private LocalDateTime signedAt;
|
||||
private LocalDateTime canceledAt;
|
||||
private LocalDateTime checkinAt;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
public void setActivityId(Long activityId) {
|
||||
this.activityId = activityId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setNickname(String nickname) {
|
||||
this.nickname = nickname;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCheckinStatus() {
|
||||
return checkinStatus;
|
||||
}
|
||||
|
||||
public void setCheckinStatus(String checkinStatus) {
|
||||
this.checkinStatus = checkinStatus;
|
||||
}
|
||||
|
||||
public LocalDateTime getSignedAt() {
|
||||
return signedAt;
|
||||
}
|
||||
|
||||
public void setSignedAt(LocalDateTime signedAt) {
|
||||
this.signedAt = signedAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getCanceledAt() {
|
||||
return canceledAt;
|
||||
}
|
||||
|
||||
public void setCanceledAt(LocalDateTime canceledAt) {
|
||||
this.canceledAt = canceledAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getCheckinAt() {
|
||||
return checkinAt;
|
||||
}
|
||||
|
||||
public void setCheckinAt(LocalDateTime checkinAt) {
|
||||
this.checkinAt = checkinAt;
|
||||
}
|
||||
}
|
||||
52
backend/src/main/java/com/community/app/dto/ApiResponse.java
Normal file
52
backend/src/main/java/com/community/app/dto/ApiResponse.java
Normal file
@@ -0,0 +1,52 @@
|
||||
package com.community.app.dto;
|
||||
|
||||
public class ApiResponse<T> {
|
||||
private boolean success;
|
||||
private String message;
|
||||
private T data;
|
||||
|
||||
public ApiResponse() {
|
||||
}
|
||||
|
||||
public ApiResponse(boolean success, String message, T data) {
|
||||
this.success = success;
|
||||
this.message = message;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public static <T> ApiResponse<T> ok(T data) {
|
||||
return new ApiResponse<>(true, "success", data);
|
||||
}
|
||||
|
||||
public static <T> ApiResponse<T> ok(String message, T data) {
|
||||
return new ApiResponse<>(true, message, data);
|
||||
}
|
||||
|
||||
public static <T> ApiResponse<T> fail(String message) {
|
||||
return new ApiResponse<>(false, message, null);
|
||||
}
|
||||
|
||||
public boolean isSuccess() {
|
||||
return success;
|
||||
}
|
||||
|
||||
public void setSuccess(boolean success) {
|
||||
this.success = success;
|
||||
}
|
||||
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public void setMessage(String message) {
|
||||
this.message = message;
|
||||
}
|
||||
|
||||
public T getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(T data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
||||
26
backend/src/main/java/com/community/app/dto/AuthRequest.java
Normal file
26
backend/src/main/java/com/community/app/dto/AuthRequest.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.community.app.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
public class AuthRequest {
|
||||
@NotBlank
|
||||
private String username;
|
||||
@NotBlank
|
||||
private String password;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.community.app.dto;
|
||||
|
||||
public class AuthResponse {
|
||||
private String token;
|
||||
private Long userId;
|
||||
private String username;
|
||||
private String nickname;
|
||||
private String role;
|
||||
|
||||
public String getToken() {
|
||||
return token;
|
||||
}
|
||||
|
||||
public void setToken(String token) {
|
||||
this.token = token;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setNickname(String nickname) {
|
||||
this.nickname = nickname;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.community.app.dto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class PageResponse<T> {
|
||||
private long total;
|
||||
private List<T> list;
|
||||
|
||||
public PageResponse() {
|
||||
}
|
||||
|
||||
public PageResponse(long total, List<T> list) {
|
||||
this.total = total;
|
||||
this.list = list;
|
||||
}
|
||||
|
||||
public long getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
||||
public void setTotal(long total) {
|
||||
this.total = total;
|
||||
}
|
||||
|
||||
public List<T> getList() {
|
||||
return list;
|
||||
}
|
||||
|
||||
public void setList(List<T> list) {
|
||||
this.list = list;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.community.app.dto;
|
||||
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
|
||||
public class RegisterRequest {
|
||||
@NotBlank
|
||||
private String username;
|
||||
@NotBlank
|
||||
private String password;
|
||||
@NotBlank
|
||||
private String nickname;
|
||||
private String phone;
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setNickname(String nickname) {
|
||||
this.nickname = nickname;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
}
|
||||
114
backend/src/main/java/com/community/app/dto/SignupView.java
Normal file
114
backend/src/main/java/com/community/app/dto/SignupView.java
Normal file
@@ -0,0 +1,114 @@
|
||||
package com.community.app.dto;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class SignupView {
|
||||
private Long id;
|
||||
private Long activityId;
|
||||
private String activityTitle;
|
||||
private String term;
|
||||
private String location;
|
||||
private LocalDateTime startTime;
|
||||
private LocalDateTime endTime;
|
||||
private String status;
|
||||
private String checkinStatus;
|
||||
private LocalDateTime signedAt;
|
||||
private LocalDateTime canceledAt;
|
||||
private LocalDateTime checkinAt;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
public void setActivityId(Long activityId) {
|
||||
this.activityId = activityId;
|
||||
}
|
||||
|
||||
public String getActivityTitle() {
|
||||
return activityTitle;
|
||||
}
|
||||
|
||||
public void setActivityTitle(String activityTitle) {
|
||||
this.activityTitle = activityTitle;
|
||||
}
|
||||
|
||||
public String getTerm() {
|
||||
return term;
|
||||
}
|
||||
|
||||
public void setTerm(String term) {
|
||||
this.term = term;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public LocalDateTime getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(LocalDateTime startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(LocalDateTime endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCheckinStatus() {
|
||||
return checkinStatus;
|
||||
}
|
||||
|
||||
public void setCheckinStatus(String checkinStatus) {
|
||||
this.checkinStatus = checkinStatus;
|
||||
}
|
||||
|
||||
public LocalDateTime getSignedAt() {
|
||||
return signedAt;
|
||||
}
|
||||
|
||||
public void setSignedAt(LocalDateTime signedAt) {
|
||||
this.signedAt = signedAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getCanceledAt() {
|
||||
return canceledAt;
|
||||
}
|
||||
|
||||
public void setCanceledAt(LocalDateTime canceledAt) {
|
||||
this.canceledAt = canceledAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getCheckinAt() {
|
||||
return checkinAt;
|
||||
}
|
||||
|
||||
public void setCheckinAt(LocalDateTime checkinAt) {
|
||||
this.checkinAt = checkinAt;
|
||||
}
|
||||
}
|
||||
150
backend/src/main/java/com/community/app/entity/Activity.java
Normal file
150
backend/src/main/java/com/community/app/entity/Activity.java
Normal file
@@ -0,0 +1,150 @@
|
||||
package com.community.app.entity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class Activity {
|
||||
private Long id;
|
||||
private String title;
|
||||
private String term;
|
||||
private String summary;
|
||||
private String content;
|
||||
private String location;
|
||||
private LocalDateTime startTime;
|
||||
private LocalDateTime endTime;
|
||||
private LocalDateTime signupStart;
|
||||
private LocalDateTime signupEnd;
|
||||
private Integer quota;
|
||||
private String status;
|
||||
private String coverUrl;
|
||||
private Long createdBy;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTerm() {
|
||||
return term;
|
||||
}
|
||||
|
||||
public void setTerm(String term) {
|
||||
this.term = term;
|
||||
}
|
||||
|
||||
public String getSummary() {
|
||||
return summary;
|
||||
}
|
||||
|
||||
public void setSummary(String summary) {
|
||||
this.summary = summary;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public String getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
public void setLocation(String location) {
|
||||
this.location = location;
|
||||
}
|
||||
|
||||
public LocalDateTime getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public void setStartTime(LocalDateTime startTime) {
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(LocalDateTime endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public LocalDateTime getSignupStart() {
|
||||
return signupStart;
|
||||
}
|
||||
|
||||
public void setSignupStart(LocalDateTime signupStart) {
|
||||
this.signupStart = signupStart;
|
||||
}
|
||||
|
||||
public LocalDateTime getSignupEnd() {
|
||||
return signupEnd;
|
||||
}
|
||||
|
||||
public void setSignupEnd(LocalDateTime signupEnd) {
|
||||
this.signupEnd = signupEnd;
|
||||
}
|
||||
|
||||
public Integer getQuota() {
|
||||
return quota;
|
||||
}
|
||||
|
||||
public void setQuota(Integer quota) {
|
||||
this.quota = quota;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCoverUrl() {
|
||||
return coverUrl;
|
||||
}
|
||||
|
||||
public void setCoverUrl(String coverUrl) {
|
||||
this.coverUrl = coverUrl;
|
||||
}
|
||||
|
||||
public Long getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
public void setCreatedBy(Long createdBy) {
|
||||
this.createdBy = createdBy;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(LocalDateTime createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(LocalDateTime updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.community.app.entity;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class ActivitySignup {
|
||||
private Long id;
|
||||
private Long activityId;
|
||||
private Long userId;
|
||||
private String status;
|
||||
private String checkinStatus;
|
||||
private LocalDateTime signedAt;
|
||||
private LocalDateTime canceledAt;
|
||||
private LocalDateTime checkinAt;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Long getActivityId() {
|
||||
return activityId;
|
||||
}
|
||||
|
||||
public void setActivityId(Long activityId) {
|
||||
this.activityId = activityId;
|
||||
}
|
||||
|
||||
public Long getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(Long userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(String status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getCheckinStatus() {
|
||||
return checkinStatus;
|
||||
}
|
||||
|
||||
public void setCheckinStatus(String checkinStatus) {
|
||||
this.checkinStatus = checkinStatus;
|
||||
}
|
||||
|
||||
public LocalDateTime getSignedAt() {
|
||||
return signedAt;
|
||||
}
|
||||
|
||||
public void setSignedAt(LocalDateTime signedAt) {
|
||||
this.signedAt = signedAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getCanceledAt() {
|
||||
return canceledAt;
|
||||
}
|
||||
|
||||
public void setCanceledAt(LocalDateTime canceledAt) {
|
||||
this.canceledAt = canceledAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getCheckinAt() {
|
||||
return checkinAt;
|
||||
}
|
||||
|
||||
public void setCheckinAt(LocalDateTime checkinAt) {
|
||||
this.checkinAt = checkinAt;
|
||||
}
|
||||
}
|
||||
80
backend/src/main/java/com/community/app/entity/User.java
Normal file
80
backend/src/main/java/com/community/app/entity/User.java
Normal file
@@ -0,0 +1,80 @@
|
||||
package com.community.app.entity;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class User {
|
||||
private Long id;
|
||||
private String username;
|
||||
@JsonIgnore
|
||||
private String passwordHash;
|
||||
private String nickname;
|
||||
private String phone;
|
||||
private String role;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
|
||||
public String getPasswordHash() {
|
||||
return passwordHash;
|
||||
}
|
||||
|
||||
public void setPasswordHash(String passwordHash) {
|
||||
this.passwordHash = passwordHash;
|
||||
}
|
||||
|
||||
public String getNickname() {
|
||||
return nickname;
|
||||
}
|
||||
|
||||
public void setNickname(String nickname) {
|
||||
this.nickname = nickname;
|
||||
}
|
||||
|
||||
public String getPhone() {
|
||||
return phone;
|
||||
}
|
||||
|
||||
public void setPhone(String phone) {
|
||||
this.phone = phone;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return role;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(LocalDateTime createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(LocalDateTime updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.community.app.mapper;
|
||||
|
||||
import com.community.app.dto.ActivityView;
|
||||
import com.community.app.entity.Activity;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ActivityMapper {
|
||||
int insert(Activity activity);
|
||||
|
||||
int update(Activity activity);
|
||||
|
||||
Activity findById(@Param("id") Long id);
|
||||
|
||||
ActivityView findViewById(@Param("id") Long id);
|
||||
|
||||
List<ActivityView> list(@Param("status") String status, @Param("keyword") String keyword);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.community.app.mapper;
|
||||
|
||||
import com.community.app.dto.AdminSignupView;
|
||||
import com.community.app.dto.SignupView;
|
||||
import com.community.app.entity.ActivitySignup;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface SignupMapper {
|
||||
ActivitySignup findByActivityAndUser(@Param("activityId") Long activityId, @Param("userId") Long userId);
|
||||
|
||||
ActivitySignup findById(@Param("id") Long id);
|
||||
|
||||
int insert(ActivitySignup signup);
|
||||
|
||||
int updateStatus(@Param("id") Long id, @Param("status") String status, @Param("canceledAt") java.time.LocalDateTime canceledAt);
|
||||
|
||||
int resign(@Param("id") Long id, @Param("status") String status, @Param("signedAt") java.time.LocalDateTime signedAt);
|
||||
|
||||
int checkin(@Param("id") Long id, @Param("checkinStatus") String checkinStatus, @Param("checkinAt") java.time.LocalDateTime checkinAt);
|
||||
|
||||
long countSignedByActivity(@Param("activityId") Long activityId);
|
||||
|
||||
List<SignupView> listByUser(@Param("userId") Long userId);
|
||||
|
||||
List<AdminSignupView> listByActivity(@Param("activityId") Long activityId);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.community.app.mapper;
|
||||
|
||||
import com.community.app.entity.User;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UserMapper {
|
||||
User findById(@Param("id") Long id);
|
||||
|
||||
User findByUsername(@Param("username") String username);
|
||||
|
||||
int insert(User user);
|
||||
|
||||
List<User> listAll();
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
package com.community.app.service;
|
||||
|
||||
import com.community.app.dto.ActivityRequest;
|
||||
import com.community.app.dto.ActivityView;
|
||||
import com.community.app.entity.Activity;
|
||||
import com.community.app.mapper.ActivityMapper;
|
||||
import com.community.app.mapper.SignupMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ActivityService {
|
||||
private final ActivityMapper activityMapper;
|
||||
private final SignupMapper signupMapper;
|
||||
|
||||
public ActivityService(ActivityMapper activityMapper, SignupMapper signupMapper) {
|
||||
this.activityMapper = activityMapper;
|
||||
this.signupMapper = signupMapper;
|
||||
}
|
||||
|
||||
public ActivityView getView(Long id) {
|
||||
return activityMapper.findViewById(id);
|
||||
}
|
||||
|
||||
public Activity getEntity(Long id) {
|
||||
return activityMapper.findById(id);
|
||||
}
|
||||
|
||||
public List<ActivityView> list(String status, String keyword) {
|
||||
return activityMapper.list(status, keyword);
|
||||
}
|
||||
|
||||
public Activity create(ActivityRequest request, Long creatorId) {
|
||||
validateTimes(request);
|
||||
Activity activity = new Activity();
|
||||
applyRequest(activity, request);
|
||||
activity.setCreatedBy(creatorId);
|
||||
if (activity.getStatus() == null || activity.getStatus().isEmpty()) {
|
||||
activity.setStatus("draft");
|
||||
}
|
||||
activityMapper.insert(activity);
|
||||
return activity;
|
||||
}
|
||||
|
||||
public void update(Long id, ActivityRequest request) {
|
||||
validateTimes(request);
|
||||
Activity activity = activityMapper.findById(id);
|
||||
if (activity == null) {
|
||||
throw new IllegalStateException("活动不存在");
|
||||
}
|
||||
activity.setId(id);
|
||||
applyRequest(activity, request);
|
||||
if (activity.getStatus() == null || activity.getStatus().isEmpty()) {
|
||||
activity.setStatus("draft");
|
||||
}
|
||||
activityMapper.update(activity);
|
||||
}
|
||||
|
||||
public void publish(Long id) {
|
||||
Activity activity = activityMapper.findById(id);
|
||||
if (activity == null) {
|
||||
throw new IllegalStateException("活动不存在");
|
||||
}
|
||||
activity.setStatus("published");
|
||||
activityMapper.update(activity);
|
||||
}
|
||||
|
||||
public void close(Long id) {
|
||||
Activity activity = activityMapper.findById(id);
|
||||
if (activity == null) {
|
||||
throw new IllegalStateException("活动不存在");
|
||||
}
|
||||
activity.setStatus("closed");
|
||||
activityMapper.update(activity);
|
||||
}
|
||||
|
||||
public long countSigned(Long activityId) {
|
||||
return signupMapper.countSignedByActivity(activityId);
|
||||
}
|
||||
|
||||
private void validateTimes(ActivityRequest request) {
|
||||
LocalDateTime start = request.getStartTime();
|
||||
LocalDateTime end = request.getEndTime();
|
||||
LocalDateTime signupStart = request.getSignupStart();
|
||||
LocalDateTime signupEnd = request.getSignupEnd();
|
||||
if (start != null && end != null && end.isBefore(start)) {
|
||||
throw new IllegalStateException("活动结束时间不能早于开始时间");
|
||||
}
|
||||
if (signupStart != null && signupEnd != null && signupEnd.isBefore(signupStart)) {
|
||||
throw new IllegalStateException("报名结束时间不能早于开始时间");
|
||||
}
|
||||
}
|
||||
|
||||
private void applyRequest(Activity activity, ActivityRequest request) {
|
||||
activity.setTitle(request.getTitle());
|
||||
activity.setTerm(request.getTerm());
|
||||
activity.setSummary(request.getSummary());
|
||||
activity.setContent(request.getContent());
|
||||
activity.setLocation(request.getLocation());
|
||||
activity.setStartTime(request.getStartTime());
|
||||
activity.setEndTime(request.getEndTime());
|
||||
activity.setSignupStart(request.getSignupStart());
|
||||
activity.setSignupEnd(request.getSignupEnd());
|
||||
activity.setQuota(request.getQuota());
|
||||
activity.setStatus(request.getStatus());
|
||||
activity.setCoverUrl(request.getCoverUrl());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.community.app.service;
|
||||
|
||||
import com.community.app.dto.AdminSignupView;
|
||||
import com.community.app.dto.SignupView;
|
||||
import com.community.app.entity.Activity;
|
||||
import com.community.app.entity.ActivitySignup;
|
||||
import com.community.app.mapper.ActivityMapper;
|
||||
import com.community.app.mapper.SignupMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class SignupService {
|
||||
private final SignupMapper signupMapper;
|
||||
private final ActivityMapper activityMapper;
|
||||
|
||||
public SignupService(SignupMapper signupMapper, ActivityMapper activityMapper) {
|
||||
this.signupMapper = signupMapper;
|
||||
this.activityMapper = activityMapper;
|
||||
}
|
||||
|
||||
public void signup(Long activityId, Long userId) {
|
||||
Activity activity = activityMapper.findById(activityId);
|
||||
if (activity == null) {
|
||||
throw new IllegalStateException("活动不存在");
|
||||
}
|
||||
if (!"published".equals(activity.getStatus())) {
|
||||
throw new IllegalStateException("活动未发布或已结束");
|
||||
}
|
||||
LocalDateTime now = LocalDateTime.now();
|
||||
if (activity.getSignupStart() != null && now.isBefore(activity.getSignupStart())) {
|
||||
throw new IllegalStateException("报名尚未开始");
|
||||
}
|
||||
if (activity.getSignupEnd() != null && now.isAfter(activity.getSignupEnd())) {
|
||||
throw new IllegalStateException("报名已结束");
|
||||
}
|
||||
long count = signupMapper.countSignedByActivity(activityId);
|
||||
if (activity.getQuota() != null && count >= activity.getQuota()) {
|
||||
throw new IllegalStateException("报名名额已满");
|
||||
}
|
||||
|
||||
ActivitySignup existing = signupMapper.findByActivityAndUser(activityId, userId);
|
||||
if (existing == null) {
|
||||
ActivitySignup signup = new ActivitySignup();
|
||||
signup.setActivityId(activityId);
|
||||
signup.setUserId(userId);
|
||||
signup.setStatus("SIGNED");
|
||||
signup.setCheckinStatus("NOT");
|
||||
signup.setSignedAt(now);
|
||||
signupMapper.insert(signup);
|
||||
return;
|
||||
}
|
||||
if ("SIGNED".equals(existing.getStatus())) {
|
||||
throw new IllegalStateException("已报名该活动");
|
||||
}
|
||||
signupMapper.resign(existing.getId(), "SIGNED", now);
|
||||
}
|
||||
|
||||
public void cancel(Long activityId, Long userId) {
|
||||
ActivitySignup existing = signupMapper.findByActivityAndUser(activityId, userId);
|
||||
if (existing == null || !"SIGNED".equals(existing.getStatus())) {
|
||||
throw new IllegalStateException("未找到可取消的报名");
|
||||
}
|
||||
if ("CHECKED".equals(existing.getCheckinStatus())) {
|
||||
throw new IllegalStateException("已签到的报名不可取消");
|
||||
}
|
||||
signupMapper.updateStatus(existing.getId(), "CANCELED", LocalDateTime.now());
|
||||
}
|
||||
|
||||
public void checkin(Long signupId) {
|
||||
ActivitySignup existing = signupMapper.findById(signupId);
|
||||
if (existing == null) {
|
||||
throw new IllegalStateException("报名记录不存在");
|
||||
}
|
||||
if (!"SIGNED".equals(existing.getStatus())) {
|
||||
throw new IllegalStateException("该报名已取消,无法签到");
|
||||
}
|
||||
if ("CHECKED".equals(existing.getCheckinStatus())) {
|
||||
throw new IllegalStateException("已完成签到");
|
||||
}
|
||||
signupMapper.checkin(signupId, "CHECKED", LocalDateTime.now());
|
||||
}
|
||||
|
||||
public List<SignupView> listByUser(Long userId) {
|
||||
return signupMapper.listByUser(userId);
|
||||
}
|
||||
|
||||
public List<AdminSignupView> listByActivity(Long activityId) {
|
||||
return signupMapper.listByActivity(activityId);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.community.app.service;
|
||||
|
||||
import com.community.app.entity.User;
|
||||
import com.community.app.mapper.UserMapper;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class UserService {
|
||||
private final UserMapper userMapper;
|
||||
private final BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
|
||||
|
||||
public UserService(UserMapper userMapper) {
|
||||
this.userMapper = userMapper;
|
||||
}
|
||||
|
||||
public User findById(Long id) {
|
||||
return userMapper.findById(id);
|
||||
}
|
||||
|
||||
public User findByUsername(String username) {
|
||||
return userMapper.findByUsername(username);
|
||||
}
|
||||
|
||||
public User register(String username, String rawPassword, String nickname, String phone) {
|
||||
if (userMapper.findByUsername(username) != null) {
|
||||
throw new IllegalStateException("用户名已存在");
|
||||
}
|
||||
User user = new User();
|
||||
user.setUsername(username);
|
||||
user.setPasswordHash(encoder.encode(rawPassword));
|
||||
user.setNickname(nickname);
|
||||
user.setPhone(phone);
|
||||
user.setRole("user");
|
||||
userMapper.insert(user);
|
||||
return user;
|
||||
}
|
||||
|
||||
public boolean verifyPassword(User user, String rawPassword) {
|
||||
return encoder.matches(rawPassword, user.getPasswordHash());
|
||||
}
|
||||
|
||||
public List<User> listAll() {
|
||||
return userMapper.listAll();
|
||||
}
|
||||
}
|
||||
25
backend/src/main/resources/application.yml
Normal file
25
backend/src/main/resources/application.yml
Normal file
@@ -0,0 +1,25 @@
|
||||
server:
|
||||
port: 8080
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3307/community_activity?useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
|
||||
username: root
|
||||
password: qq5211314
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
jackson:
|
||||
time-zone: Asia/Shanghai
|
||||
date-format: yyyy-MM-dd HH:mm:ss
|
||||
|
||||
mybatis:
|
||||
mapper-locations: classpath:mapper/*.xml
|
||||
configuration:
|
||||
map-underscore-to-camel-case: true
|
||||
|
||||
sa-token:
|
||||
token-name: satoken
|
||||
timeout: 2592000
|
||||
is-concurrent: true
|
||||
is-share: true
|
||||
token-style: uuid
|
||||
active-timeout: 1800
|
||||
92
backend/src/main/resources/mapper/ActivityMapper.xml
Normal file
92
backend/src/main/resources/mapper/ActivityMapper.xml
Normal file
@@ -0,0 +1,92 @@
|
||||
<?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.community.app.mapper.ActivityMapper">
|
||||
<resultMap id="ActivityMap" type="com.community.app.entity.Activity">
|
||||
<id column="id" property="id"/>
|
||||
<result column="title" property="title"/>
|
||||
<result column="term" property="term"/>
|
||||
<result column="summary" property="summary"/>
|
||||
<result column="content" property="content"/>
|
||||
<result column="content" property="content"/>
|
||||
<result column="location" property="location"/>
|
||||
<result column="start_time" property="startTime"/>
|
||||
<result column="end_time" property="endTime"/>
|
||||
<result column="signup_start" property="signupStart"/>
|
||||
<result column="signup_end" property="signupEnd"/>
|
||||
<result column="quota" property="quota"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="cover_url" property="coverUrl"/>
|
||||
<result column="created_by" property="createdBy"/>
|
||||
<result column="created_at" property="createdAt"/>
|
||||
<result column="updated_at" property="updatedAt"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="ActivityViewMap" type="com.community.app.dto.ActivityView">
|
||||
<id column="id" property="id"/>
|
||||
<result column="title" property="title"/>
|
||||
<result column="term" property="term"/>
|
||||
<result column="summary" property="summary"/>
|
||||
<result column="location" property="location"/>
|
||||
<result column="start_time" property="startTime"/>
|
||||
<result column="end_time" property="endTime"/>
|
||||
<result column="signup_start" property="signupStart"/>
|
||||
<result column="signup_end" property="signupEnd"/>
|
||||
<result column="quota" property="quota"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="cover_url" property="coverUrl"/>
|
||||
<result column="signup_count" property="signupCount"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into activity (title, term, summary, content, location, start_time, end_time,
|
||||
signup_start, signup_end, quota, status, cover_url, created_by, created_at, updated_at)
|
||||
values (#{title}, #{term}, #{summary}, #{content}, #{location}, #{startTime}, #{endTime},
|
||||
#{signupStart}, #{signupEnd}, #{quota}, #{status}, #{coverUrl}, #{createdBy}, now(), now())
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
update activity
|
||||
set title = #{title},
|
||||
term = #{term},
|
||||
summary = #{summary},
|
||||
content = #{content},
|
||||
location = #{location},
|
||||
start_time = #{startTime},
|
||||
end_time = #{endTime},
|
||||
signup_start = #{signupStart},
|
||||
signup_end = #{signupEnd},
|
||||
quota = #{quota},
|
||||
status = #{status},
|
||||
cover_url = #{coverUrl},
|
||||
updated_at = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="findById" resultMap="ActivityMap">
|
||||
select * from activity where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="findViewById" resultMap="ActivityViewMap">
|
||||
select a.*, coalesce(sum(case when s.status = 'SIGNED' then 1 else 0 end), 0) as signup_count
|
||||
from activity a
|
||||
left join activity_signup s on a.id = s.activity_id
|
||||
where a.id = #{id}
|
||||
group by a.id
|
||||
</select>
|
||||
|
||||
<select id="list" resultMap="ActivityViewMap">
|
||||
select a.*, coalesce(sum(case when s.status = 'SIGNED' then 1 else 0 end), 0) as signup_count
|
||||
from activity a
|
||||
left join activity_signup s on a.id = s.activity_id
|
||||
<where>
|
||||
<if test="status != null and status != ''">
|
||||
a.status = #{status}
|
||||
</if>
|
||||
<if test="keyword != null and keyword != ''">
|
||||
and (a.title like concat('%', #{keyword}, '%') or a.term like concat('%', #{keyword}, '%'))
|
||||
</if>
|
||||
</where>
|
||||
group by a.id
|
||||
order by a.start_time desc
|
||||
</select>
|
||||
</mapper>
|
||||
92
backend/src/main/resources/mapper/SignupMapper.xml
Normal file
92
backend/src/main/resources/mapper/SignupMapper.xml
Normal file
@@ -0,0 +1,92 @@
|
||||
<?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.community.app.mapper.SignupMapper">
|
||||
<resultMap id="SignupMap" type="com.community.app.entity.ActivitySignup">
|
||||
<id column="id" property="id"/>
|
||||
<result column="activity_id" property="activityId"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="checkin_status" property="checkinStatus"/>
|
||||
<result column="signed_at" property="signedAt"/>
|
||||
<result column="canceled_at" property="canceledAt"/>
|
||||
<result column="checkin_at" property="checkinAt"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="SignupViewMap" type="com.community.app.dto.SignupView">
|
||||
<id column="id" property="id"/>
|
||||
<result column="activity_id" property="activityId"/>
|
||||
<result column="activity_title" property="activityTitle"/>
|
||||
<result column="term" property="term"/>
|
||||
<result column="location" property="location"/>
|
||||
<result column="start_time" property="startTime"/>
|
||||
<result column="end_time" property="endTime"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="checkin_status" property="checkinStatus"/>
|
||||
<result column="signed_at" property="signedAt"/>
|
||||
<result column="canceled_at" property="canceledAt"/>
|
||||
<result column="checkin_at" property="checkinAt"/>
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="AdminSignupViewMap" type="com.community.app.dto.AdminSignupView">
|
||||
<id column="id" property="id"/>
|
||||
<result column="activity_id" property="activityId"/>
|
||||
<result column="user_id" property="userId"/>
|
||||
<result column="username" property="username"/>
|
||||
<result column="nickname" property="nickname"/>
|
||||
<result column="phone" property="phone"/>
|
||||
<result column="status" property="status"/>
|
||||
<result column="checkin_status" property="checkinStatus"/>
|
||||
<result column="signed_at" property="signedAt"/>
|
||||
<result column="canceled_at" property="canceledAt"/>
|
||||
<result column="checkin_at" property="checkinAt"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="findByActivityAndUser" resultMap="SignupMap">
|
||||
select * from activity_signup where activity_id = #{activityId} and user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="findById" resultMap="SignupMap">
|
||||
select * from activity_signup where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into activity_signup (activity_id, user_id, status, checkin_status, signed_at)
|
||||
values (#{activityId}, #{userId}, #{status}, #{checkinStatus}, #{signedAt})
|
||||
</insert>
|
||||
|
||||
<update id="updateStatus">
|
||||
update activity_signup set status = #{status}, canceled_at = #{canceledAt} where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="resign">
|
||||
update activity_signup set status = #{status}, signed_at = #{signedAt}, canceled_at = null
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<update id="checkin">
|
||||
update activity_signup set checkin_status = #{checkinStatus}, checkin_at = #{checkinAt}
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<select id="countSignedByActivity" resultType="long">
|
||||
select count(1) from activity_signup where activity_id = #{activityId} and status = 'SIGNED'
|
||||
</select>
|
||||
|
||||
<select id="listByUser" resultMap="SignupViewMap">
|
||||
select s.id, s.activity_id, a.title as activity_title, a.term, a.location, a.start_time, a.end_time,
|
||||
s.status, s.checkin_status, s.signed_at, s.canceled_at, s.checkin_at
|
||||
from activity_signup s
|
||||
join activity a on s.activity_id = a.id
|
||||
where s.user_id = #{userId}
|
||||
order by s.signed_at desc
|
||||
</select>
|
||||
|
||||
<select id="listByActivity" resultMap="AdminSignupViewMap">
|
||||
select s.id, s.activity_id, s.user_id, u.username, u.nickname, u.phone,
|
||||
s.status, s.checkin_status, s.signed_at, s.canceled_at, s.checkin_at
|
||||
from activity_signup s
|
||||
join sys_user u on s.user_id = u.id
|
||||
where s.activity_id = #{activityId}
|
||||
order by s.signed_at desc
|
||||
</select>
|
||||
</mapper>
|
||||
31
backend/src/main/resources/mapper/UserMapper.xml
Normal file
31
backend/src/main/resources/mapper/UserMapper.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?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.community.app.mapper.UserMapper">
|
||||
<resultMap id="UserMap" type="com.community.app.entity.User">
|
||||
<id column="id" property="id"/>
|
||||
<result column="username" property="username"/>
|
||||
<result column="password_hash" property="passwordHash"/>
|
||||
<result column="nickname" property="nickname"/>
|
||||
<result column="phone" property="phone"/>
|
||||
<result column="role" property="role"/>
|
||||
<result column="created_at" property="createdAt"/>
|
||||
<result column="updated_at" property="updatedAt"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="findById" resultMap="UserMap">
|
||||
select * from sys_user where id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="findByUsername" resultMap="UserMap">
|
||||
select * from sys_user where username = #{username}
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into sys_user (username, password_hash, nickname, phone, role, created_at, updated_at)
|
||||
values (#{username}, #{passwordHash}, #{nickname}, #{phone}, #{role}, now(), now())
|
||||
</insert>
|
||||
|
||||
<select id="listAll" resultMap="UserMap">
|
||||
select * from sys_user order by id desc
|
||||
</select>
|
||||
</mapper>
|
||||
12
frontend/index.html
Normal file
12
frontend/index.html
Normal file
@@ -0,0 +1,12 @@
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>社区节气活动系统</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
23
frontend/package.json
Normal file
23
frontend/package.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "community-activities-frontend",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"preview": "vite preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@arco-design/web-vue": "^2.55.1",
|
||||
"axios": "^1.7.2",
|
||||
"lunar-javascript": "^1.6.13",
|
||||
"pinia": "^2.1.7",
|
||||
"vue": "^3.4.29",
|
||||
"vue-router": "^4.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-vue": "^5.0.5",
|
||||
"vite": "^5.3.5"
|
||||
}
|
||||
}
|
||||
1160
frontend/pnpm-lock.yaml
generated
Normal file
1160
frontend/pnpm-lock.yaml
generated
Normal file
File diff suppressed because it is too large
Load Diff
110
frontend/src/App.vue
Normal file
110
frontend/src/App.vue
Normal file
@@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<div>
|
||||
<a-layout class="app-layout">
|
||||
<a-layout-header class="app-header">
|
||||
<div class="brand">
|
||||
<div class="brand-mark">节气社区</div>
|
||||
<div class="brand-sub">传统文化活动发布与报名系统</div>
|
||||
</div>
|
||||
<a-menu mode="horizontal" :selected-keys="selectedKeys" @menu-item-click="handleMenu">
|
||||
<a-menu-item key="/activities">活动广场</a-menu-item>
|
||||
<a-menu-item key="/me/signups">我的报名</a-menu-item>
|
||||
<a-menu-item v-if="isAdmin" key="/admin/activities">管理后台</a-menu-item>
|
||||
</a-menu>
|
||||
<div class="user-block">
|
||||
<span v-if="user" class="user-name">你好,{{ user.nickname }}</span>
|
||||
<a-button v-if="user" size="small" @click="handleLogout">退出</a-button>
|
||||
<a-space v-else>
|
||||
<a-button size="small" type="primary" @click="go('/login')">登录</a-button>
|
||||
<a-button size="small" @click="go('/register')">注册</a-button>
|
||||
</a-space>
|
||||
</div>
|
||||
</a-layout-header>
|
||||
<a-layout-content>
|
||||
<router-view />
|
||||
</a-layout-content>
|
||||
</a-layout>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { logout } from './api/auth';
|
||||
import { useAuthStore } from './store/auth';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
const auth = useAuthStore();
|
||||
const selectedKeys = computed(() => [route.path]);
|
||||
const user = computed(() => auth.user);
|
||||
const isAdmin = computed(() => auth.isAdmin);
|
||||
|
||||
const handleMenu = (key) => {
|
||||
router.push(key);
|
||||
};
|
||||
|
||||
const go = (path) => {
|
||||
router.push(path);
|
||||
};
|
||||
|
||||
const handleLogout = async () => {
|
||||
try {
|
||||
await logout();
|
||||
} catch (err) {
|
||||
// ignore
|
||||
}
|
||||
auth.logout();
|
||||
Message.success('已退出登录');
|
||||
router.push('/activities');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.app-layout {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.app-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 24px;
|
||||
padding: 16px 32px;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
backdrop-filter: blur(12px);
|
||||
border-bottom: 1px solid rgba(15, 76, 92, 0.12);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 20;
|
||||
}
|
||||
|
||||
.brand {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 180px;
|
||||
}
|
||||
|
||||
.brand-mark {
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 2px;
|
||||
}
|
||||
|
||||
.brand-sub {
|
||||
font-size: 12px;
|
||||
color: rgba(26, 27, 36, 0.7);
|
||||
}
|
||||
|
||||
.user-block {
|
||||
margin-left: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.user-name {
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
12
frontend/src/api/activities.js
Normal file
12
frontend/src/api/activities.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import http from './http';
|
||||
|
||||
export const listActivities = (params) => http.get('/api/public/activities', { params });
|
||||
export const getActivity = (id) => http.get(`/api/public/activities/${id}`);
|
||||
export const listActivitiesAdmin = (params) => http.get('/api/activities', { params });
|
||||
export const getActivityAdmin = (id) => http.get(`/api/activities/${id}`);
|
||||
export const createActivity = (data) => http.post('/api/activities', data);
|
||||
export const updateActivity = (id, data) => http.put(`/api/activities/${id}`, data);
|
||||
export const publishActivity = (id) => http.post(`/api/activities/${id}/publish`);
|
||||
export const closeActivity = (id) => http.post(`/api/activities/${id}/close`);
|
||||
export const signupActivity = (id) => http.post(`/api/activities/${id}/signup`);
|
||||
export const cancelSignup = (id) => http.post(`/api/activities/${id}/cancel`);
|
||||
5
frontend/src/api/admin.js
Normal file
5
frontend/src/api/admin.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import http from './http';
|
||||
|
||||
export const listSignupsByActivity = (id) => http.get(`/api/admin/activities/${id}/signups`);
|
||||
export const checkinSignup = (id) => http.post(`/api/admin/signups/${id}/checkin`);
|
||||
export const listUsers = () => http.get('/api/admin/users');
|
||||
6
frontend/src/api/auth.js
Normal file
6
frontend/src/api/auth.js
Normal file
@@ -0,0 +1,6 @@
|
||||
import http from './http';
|
||||
|
||||
export const login = (data) => http.post('/api/auth/login', data);
|
||||
export const register = (data) => http.post('/api/auth/register', data);
|
||||
export const logout = () => http.post('/api/auth/logout');
|
||||
export const me = () => http.get('/api/me');
|
||||
32
frontend/src/api/http.js
Normal file
32
frontend/src/api/http.js
Normal file
@@ -0,0 +1,32 @@
|
||||
import axios from 'axios';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
|
||||
const http = axios.create({
|
||||
baseURL: 'http://localhost:8080',
|
||||
timeout: 10000
|
||||
});
|
||||
|
||||
http.interceptors.request.use((config) => {
|
||||
const token = localStorage.getItem('token');
|
||||
if (token) {
|
||||
config.headers.satoken = token;
|
||||
}
|
||||
return config;
|
||||
});
|
||||
|
||||
http.interceptors.response.use(
|
||||
(response) => {
|
||||
const payload = response.data;
|
||||
if (payload && payload.success === false) {
|
||||
Message.error(payload.message || '请求失败');
|
||||
return Promise.reject(payload);
|
||||
}
|
||||
return payload;
|
||||
},
|
||||
(error) => {
|
||||
Message.error('网络或服务器异常');
|
||||
return Promise.reject(error);
|
||||
}
|
||||
);
|
||||
|
||||
export default http;
|
||||
3
frontend/src/api/me.js
Normal file
3
frontend/src/api/me.js
Normal file
@@ -0,0 +1,3 @@
|
||||
import http from './http';
|
||||
|
||||
export const mySignups = () => http.get('/api/me/signups');
|
||||
16
frontend/src/main.js
Normal file
16
frontend/src/main.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { createApp } from 'vue';
|
||||
import ArcoVue from '@arco-design/web-vue';
|
||||
import ArcoVueIcon from '@arco-design/web-vue/es/icon';
|
||||
import zhCN from '@arco-design/web-vue/es/locale/lang/zh-cn';
|
||||
import App from './App.vue';
|
||||
import router from './router';
|
||||
import pinia from './store';
|
||||
import './styles/base.css';
|
||||
import '@arco-design/web-vue/dist/arco.css';
|
||||
|
||||
const app = createApp(App);
|
||||
app.use(ArcoVue, { locale: zhCN });
|
||||
app.use(ArcoVueIcon);
|
||||
app.use(pinia);
|
||||
app.use(router);
|
||||
app.mount('#app');
|
||||
41
frontend/src/router/index.js
Normal file
41
frontend/src/router/index.js
Normal file
@@ -0,0 +1,41 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router';
|
||||
import LoginView from '../views/LoginView.vue';
|
||||
import RegisterView from '../views/RegisterView.vue';
|
||||
import ActivityList from '../views/ActivityList.vue';
|
||||
import ActivityDetail from '../views/ActivityDetail.vue';
|
||||
import MySignups from '../views/MySignups.vue';
|
||||
import AdminActivities from '../views/AdminActivities.vue';
|
||||
import AdminSignups from '../views/AdminSignups.vue';
|
||||
import pinia from '../store';
|
||||
import { useAuthStore } from '../store/auth';
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(),
|
||||
routes: [
|
||||
{ path: '/', redirect: '/activities' },
|
||||
{ path: '/login', component: LoginView },
|
||||
{ path: '/register', component: RegisterView },
|
||||
{ path: '/activities', component: ActivityList },
|
||||
{ path: '/activities/:id', component: ActivityDetail },
|
||||
{ path: '/me/signups', component: MySignups },
|
||||
{ path: '/admin/activities', component: AdminActivities },
|
||||
{ path: '/admin/activities/:id/signups', component: AdminSignups }
|
||||
]
|
||||
});
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
const auth = useAuthStore(pinia);
|
||||
const token = auth.token;
|
||||
if (to.path.startsWith('/login') || to.path.startsWith('/register')) {
|
||||
return next();
|
||||
}
|
||||
if (!token && to.path !== '/activities') {
|
||||
return next('/login');
|
||||
}
|
||||
if (to.path.startsWith('/admin') && !auth.isAdmin) {
|
||||
return next('/activities');
|
||||
}
|
||||
return next();
|
||||
});
|
||||
|
||||
export default router;
|
||||
37
frontend/src/store/auth.js
Normal file
37
frontend/src/store/auth.js
Normal file
@@ -0,0 +1,37 @@
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
const STORAGE_TOKEN = 'token';
|
||||
const STORAGE_USER = 'user';
|
||||
|
||||
export const useAuthStore = defineStore('auth', {
|
||||
state: () => ({
|
||||
token: localStorage.getItem(STORAGE_TOKEN) || '',
|
||||
user: (() => {
|
||||
const raw = localStorage.getItem(STORAGE_USER);
|
||||
return raw ? JSON.parse(raw) : null;
|
||||
})()
|
||||
}),
|
||||
getters: {
|
||||
isLogin: (state) => Boolean(state.token),
|
||||
isAdmin: (state) => state.user && state.user.role === 'admin'
|
||||
},
|
||||
actions: {
|
||||
setAuth(token, user) {
|
||||
this.token = token || '';
|
||||
this.user = user || null;
|
||||
if (this.token) {
|
||||
localStorage.setItem(STORAGE_TOKEN, this.token);
|
||||
} else {
|
||||
localStorage.removeItem(STORAGE_TOKEN);
|
||||
}
|
||||
if (this.user) {
|
||||
localStorage.setItem(STORAGE_USER, JSON.stringify(this.user));
|
||||
} else {
|
||||
localStorage.removeItem(STORAGE_USER);
|
||||
}
|
||||
},
|
||||
logout() {
|
||||
this.setAuth('', null);
|
||||
}
|
||||
}
|
||||
});
|
||||
5
frontend/src/store/index.js
Normal file
5
frontend/src/store/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import { createPinia } from 'pinia';
|
||||
|
||||
const pinia = createPinia();
|
||||
|
||||
export default pinia;
|
||||
90
frontend/src/styles/base.css
Normal file
90
frontend/src/styles/base.css
Normal file
@@ -0,0 +1,90 @@
|
||||
@import url('https://fonts.googleapis.com/css2?family=ZCOOL+XiaoWei&family=Noto+Serif+SC:wght@400;600;700&display=swap');
|
||||
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--brand-ink: #1a1b24;
|
||||
--brand-ember: #e24a2d;
|
||||
--brand-ocean: #0f4c5c;
|
||||
--brand-sand: #f6efe6;
|
||||
--brand-mist: #e5eff1;
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Noto Serif SC', 'ZCOOL XiaoWei', serif;
|
||||
color: var(--brand-ink);
|
||||
background:
|
||||
radial-gradient(1200px circle at 10% 10%, rgba(226, 74, 45, 0.15), transparent 50%),
|
||||
radial-gradient(900px circle at 90% 20%, rgba(15, 76, 92, 0.18), transparent 50%),
|
||||
linear-gradient(180deg, #fffdfb 0%, #f6efe6 45%, #eef5f6 100%);
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
#app {
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.page-shell {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 32px 20px 64px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 28px;
|
||||
font-weight: 700;
|
||||
margin: 0 0 12px;
|
||||
letter-spacing: 1px;
|
||||
}
|
||||
|
||||
.section-subtitle {
|
||||
margin: 0 0 24px;
|
||||
color: rgba(26, 27, 36, 0.7);
|
||||
}
|
||||
|
||||
.hero-panel {
|
||||
background: linear-gradient(135deg, rgba(15, 76, 92, 0.9), rgba(226, 74, 45, 0.85));
|
||||
color: #fff;
|
||||
border-radius: 20px;
|
||||
padding: 28px;
|
||||
box-shadow: 0 20px 40px rgba(26, 27, 36, 0.18);
|
||||
}
|
||||
|
||||
.hero-panel h1 {
|
||||
margin: 0 0 8px;
|
||||
font-size: 32px;
|
||||
}
|
||||
|
||||
.hero-panel p {
|
||||
margin: 0;
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
.card-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.fade-in {
|
||||
animation: fadeInUp 0.6s ease both;
|
||||
}
|
||||
|
||||
@keyframes fadeInUp {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(16px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
83
frontend/src/styles/fullcalendar.css
Normal file
83
frontend/src/styles/fullcalendar.css
Normal file
@@ -0,0 +1,83 @@
|
||||
/* Minimal FullCalendar daygrid styles for offline usage */
|
||||
.fc {
|
||||
--fc-border-color: rgba(26, 27, 36, 0.12);
|
||||
--fc-page-bg-color: transparent;
|
||||
--fc-today-bg-color: rgba(226, 74, 45, 0.08);
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.fc .fc-toolbar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.fc .fc-toolbar-title {
|
||||
font-weight: 700;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.fc .fc-button {
|
||||
border: 1px solid rgba(26, 27, 36, 0.18);
|
||||
background: #fff;
|
||||
color: #1a1b24;
|
||||
padding: 4px 10px;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.fc .fc-button:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.fc .fc-daygrid {
|
||||
border: 1px solid var(--fc-border-color);
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fc .fc-scrollgrid,
|
||||
.fc .fc-scrollgrid table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.fc .fc-scrollgrid-section > td {
|
||||
border: none;
|
||||
}
|
||||
|
||||
.fc .fc-col-header-cell {
|
||||
background: rgba(246, 239, 230, 0.6);
|
||||
padding: 6px 0;
|
||||
border-bottom: 1px solid var(--fc-border-color);
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.fc .fc-daygrid-day {
|
||||
border-right: 1px solid var(--fc-border-color);
|
||||
border-bottom: 1px solid var(--fc-border-color);
|
||||
min-height: 82px;
|
||||
}
|
||||
|
||||
.fc .fc-daygrid-day:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
|
||||
.fc .fc-daygrid-day-frame {
|
||||
padding: 8px 6px;
|
||||
}
|
||||
|
||||
.fc .fc-day-today {
|
||||
background: var(--fc-today-bg-color);
|
||||
}
|
||||
|
||||
.fc .fc-day-other {
|
||||
color: rgba(26, 27, 36, 0.35);
|
||||
}
|
||||
|
||||
.fc .fc-daygrid-day-number {
|
||||
display: none;
|
||||
}
|
||||
139
frontend/src/views/ActivityDetail.vue
Normal file
139
frontend/src/views/ActivityDetail.vue
Normal file
@@ -0,0 +1,139 @@
|
||||
<template>
|
||||
<div class="page-shell">
|
||||
<a-button type="text" @click="goBack">← 返回活动广场</a-button>
|
||||
<a-card class="detail-card fade-in">
|
||||
<div class="detail-header">
|
||||
<div>
|
||||
<div class="section-title">{{ detail.title }}</div>
|
||||
<div class="section-subtitle">{{ detail.term }} · {{ detail.location }}</div>
|
||||
</div>
|
||||
<a-tag color="orange">{{ detail.status === 'published' ? '已发布' : '未发布' }}</a-tag>
|
||||
</div>
|
||||
|
||||
<a-descriptions :column="2" layout="inline" bordered>
|
||||
<a-descriptions-item label="活动时间">{{ formatDate(detail.startTime) }} - {{ formatDate(detail.endTime) }}</a-descriptions-item>
|
||||
<a-descriptions-item label="报名时间">{{ formatDate(detail.signupStart) }} - {{ formatDate(detail.signupEnd) }}</a-descriptions-item>
|
||||
<a-descriptions-item label="报名名额">{{ detail.quota }} 人</a-descriptions-item>
|
||||
<a-descriptions-item label="已报名">{{ detail.signupCount }} 人</a-descriptions-item>
|
||||
</a-descriptions>
|
||||
|
||||
<div class="content-block">
|
||||
<div class="block-title">活动简介</div>
|
||||
<div class="block-text">{{ detail.summary || '暂无简介' }}</div>
|
||||
</div>
|
||||
|
||||
<div class="content-block">
|
||||
<div class="block-title">活动详情</div>
|
||||
<div class="block-text" v-if="detail.content">{{ detail.content }}</div>
|
||||
<div class="block-text" v-else>暂无详细介绍</div>
|
||||
</div>
|
||||
|
||||
<div class="actions">
|
||||
<a-button type="primary" @click="handleSignup" :disabled="!canSignup">
|
||||
{{ buttonText }}
|
||||
</a-button>
|
||||
<span v-if="!token" class="hint">请先登录后报名</span>
|
||||
</div>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { getActivity, signupActivity } from '../api/activities';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const detail = ref({});
|
||||
const token = localStorage.getItem('token');
|
||||
|
||||
const fetchDetail = async () => {
|
||||
const res = await getActivity(route.params.id);
|
||||
detail.value = res.data || {};
|
||||
};
|
||||
|
||||
const formatDate = (value) => {
|
||||
if (!value) return '-';
|
||||
return value.replace('T', ' ');
|
||||
};
|
||||
|
||||
const canSignup = computed(() => {
|
||||
if (!token) return false;
|
||||
if (!detail.value.signupStart) return false;
|
||||
const now = new Date();
|
||||
const start = new Date(detail.value.signupStart);
|
||||
const end = new Date(detail.value.signupEnd);
|
||||
if (now < start || now > end) return false;
|
||||
return detail.value.signupCount < detail.value.quota;
|
||||
});
|
||||
|
||||
const buttonText = computed(() => {
|
||||
if (!token) return '登录后报名';
|
||||
if (!detail.value.signupStart) return '报名未开放';
|
||||
const now = new Date();
|
||||
const start = new Date(detail.value.signupStart);
|
||||
const end = new Date(detail.value.signupEnd);
|
||||
if (now < start) return '报名未开始';
|
||||
if (now > end) return '报名已结束';
|
||||
if (detail.value.signupCount >= detail.value.quota) return '名额已满';
|
||||
return '立即报名';
|
||||
});
|
||||
|
||||
const handleSignup = async () => {
|
||||
if (!token) {
|
||||
router.push('/login');
|
||||
return;
|
||||
}
|
||||
await signupActivity(route.params.id);
|
||||
Message.success('报名成功');
|
||||
await fetchDetail();
|
||||
};
|
||||
|
||||
const goBack = () => {
|
||||
router.push('/activities');
|
||||
};
|
||||
|
||||
onMounted(fetchDetail);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.detail-card {
|
||||
margin-top: 16px;
|
||||
border-radius: 20px;
|
||||
background: rgba(255, 255, 255, 0.96);
|
||||
}
|
||||
|
||||
.detail-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 18px;
|
||||
}
|
||||
|
||||
.content-block {
|
||||
margin-top: 18px;
|
||||
}
|
||||
|
||||
.block-title {
|
||||
font-weight: 700;
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
.block-text {
|
||||
color: rgba(26, 27, 36, 0.75);
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.actions {
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.hint {
|
||||
color: rgba(26, 27, 36, 0.6);
|
||||
}
|
||||
</style>
|
||||
131
frontend/src/views/ActivityList.vue
Normal file
131
frontend/src/views/ActivityList.vue
Normal file
@@ -0,0 +1,131 @@
|
||||
<template>
|
||||
<div class="page-shell">
|
||||
<div class="hero-panel fade-in">
|
||||
<h1>节气活动广场</h1>
|
||||
<p>二十四节气文化活动,等你来参与。</p>
|
||||
</div>
|
||||
|
||||
<a-card class="search-card fade-in">
|
||||
<div class="search-left">
|
||||
<a-input v-model="keyword" placeholder="搜索节气或活动主题" allow-clear />
|
||||
<a-button type="primary" @click="fetchList">搜索</a-button>
|
||||
</div>
|
||||
<a-button v-if="isAdmin" type="primary" @click="goAdmin">进入管理后台</a-button>
|
||||
</a-card>
|
||||
|
||||
<div class="card-grid">
|
||||
<a-card v-for="(item, idx) in list" :key="item.id" class="activity-card fade-in" :style="{ animationDelay: `${idx * 60}ms` }">
|
||||
<template #title>
|
||||
<div class="card-title">{{ item.title }}</div>
|
||||
</template>
|
||||
<template #extra>
|
||||
<a-tag color="arcoblue">{{ item.term }}</a-tag>
|
||||
</template>
|
||||
<div class="card-body">
|
||||
<div class="summary">{{ item.summary || '暂无简介' }}</div>
|
||||
<div class="meta">地点:{{ item.location }}</div>
|
||||
<div class="meta">时间:{{ formatDate(item.startTime) }} - {{ formatDate(item.endTime) }}</div>
|
||||
<div class="meta">报名:{{ formatDate(item.signupStart) }} - {{ formatDate(item.signupEnd) }}</div>
|
||||
<div class="meta">名额:{{ item.quota }} 人 | 已报:{{ item.signupCount }} 人 | 剩余:{{ remaining(item) }} 人</div>
|
||||
<div class="meta status">状态:{{ signupStatus(item) }}</div>
|
||||
</div>
|
||||
<a-button type="primary" @click="goDetail(item.id)">查看详情</a-button>
|
||||
</a-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { computed, onMounted, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { listActivities } from '../api/activities';
|
||||
import { useAuthStore } from '../store/auth';
|
||||
|
||||
const router = useRouter();
|
||||
const authStore = useAuthStore();
|
||||
const list = ref([]);
|
||||
const keyword = ref('');
|
||||
const isAdmin = computed(() => authStore.isAdmin);
|
||||
|
||||
const fetchList = async () => {
|
||||
const res = await listActivities({ keyword: keyword.value });
|
||||
list.value = res.data || [];
|
||||
};
|
||||
|
||||
const goDetail = (id) => {
|
||||
router.push(`/activities/${id}`);
|
||||
};
|
||||
|
||||
const goAdmin = () => {
|
||||
router.push('/admin/activities');
|
||||
};
|
||||
|
||||
const formatDate = (value) => {
|
||||
if (!value) return '-';
|
||||
return value.replace('T', ' ');
|
||||
};
|
||||
|
||||
const remaining = (item) => {
|
||||
return Math.max(item.quota - item.signupCount, 0);
|
||||
};
|
||||
|
||||
const signupStatus = (item) => {
|
||||
const now = new Date();
|
||||
const start = new Date(item.signupStart);
|
||||
const end = new Date(item.signupEnd);
|
||||
if (now < start) return '未开始报名';
|
||||
if (now > end) return '报名已结束';
|
||||
if (remaining(item) === 0) return '名额已满';
|
||||
return '报名中';
|
||||
};
|
||||
|
||||
onMounted(fetchList);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.search-card {
|
||||
margin: 18px 0 24px;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
border-radius: 16px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.search-left {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.activity-card {
|
||||
border-radius: 18px;
|
||||
background: rgba(255, 255, 255, 0.95);
|
||||
box-shadow: 0 14px 28px rgba(15, 76, 92, 0.08);
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.card-body {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.summary {
|
||||
margin: 8px 0;
|
||||
color: rgba(26, 27, 36, 0.8);
|
||||
}
|
||||
|
||||
.meta {
|
||||
font-size: 13px;
|
||||
color: rgba(26, 27, 36, 0.7);
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.status {
|
||||
font-weight: 600;
|
||||
color: var(--brand-ember);
|
||||
}
|
||||
</style>
|
||||
534
frontend/src/views/AdminActivities.vue
Normal file
534
frontend/src/views/AdminActivities.vue
Normal file
@@ -0,0 +1,534 @@
|
||||
<template>
|
||||
<div class="page-shell">
|
||||
<div class="section-title">活动管理</div>
|
||||
<div class="section-subtitle">发布节气文化活动、管理报名名额与状态</div>
|
||||
|
||||
<a-card class="search-card">
|
||||
<div class="filter-group">
|
||||
<a-select v-model="status" placeholder="筛选状态" allow-clear style="width: 160px;">
|
||||
<a-option value="draft">草稿</a-option>
|
||||
<a-option value="published">已发布</a-option>
|
||||
<a-option value="closed">已结束</a-option>
|
||||
</a-select>
|
||||
<a-input v-model="keyword" placeholder="搜索活动主题" allow-clear />
|
||||
<a-button type="primary" @click="fetchList">查询</a-button>
|
||||
</div>
|
||||
<div class="action-group">
|
||||
<a-button type="primary" @click="openCreate">新建活动</a-button>
|
||||
</div>
|
||||
</a-card>
|
||||
|
||||
<a-table class="table-shell" :columns="columns" :data="rows" row-key="id" :pagination="false">
|
||||
<template #status="{ record }">
|
||||
<a-tag :color="statusColor(record.status)">{{ statusText(record.status) }}</a-tag>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<a-space>
|
||||
<a-button size="mini" type="text" @click="openEdit(record)">编辑</a-button>
|
||||
<a-button size="mini" type="text" @click="publish(record.id)" v-if="record.status !== 'published'">发布</a-button>
|
||||
<a-button size="mini" type="text" @click="close(record.id)" v-if="record.status === 'published'">结束</a-button>
|
||||
<a-button size="mini" type="text" @click="goSignups(record)">报名名单</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
</a-table>
|
||||
|
||||
<a-modal v-model:visible="visible" :title="modalTitle" @ok="handleSave" :ok-text="isEdit ? '保存' : '创建'" width="1100px">
|
||||
<div class="modal-body">
|
||||
<div class="calendar-panel">
|
||||
<div class="calendar-head">
|
||||
<div>
|
||||
<div class="calendar-title">节气日历</div>
|
||||
<div class="calendar-tip">点击有节气的日期,一键生成活动草稿</div>
|
||||
</div>
|
||||
<div class="calendar-actions">
|
||||
<a-button size="mini" @click="prevMonth">上个月</a-button>
|
||||
<a-button size="mini" @click="goToday">本月</a-button>
|
||||
<a-button size="mini" @click="nextMonth">下个月</a-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="calendar-month">{{ monthLabel }}</div>
|
||||
<div class="calendar-grid">
|
||||
<div class="calendar-week" v-for="(week, wIndex) in calendarDays" :key="wIndex">
|
||||
<div class="calendar-cell" v-for="day in week" :key="day.key" :class="dayClass(day)" @click="selectDay(day)">
|
||||
<span class="cell-day">{{ day.date }}</span>
|
||||
<span v-if="day.term" class="term-chip">{{ day.term }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-panel">
|
||||
<a-form :model="form" layout="vertical" class="form-shell">
|
||||
<div class="form-title">活动信息</div>
|
||||
<a-form-item label="活动标题" required>
|
||||
<a-input v-model="form.title" placeholder="请输入活动标题" />
|
||||
</a-form-item>
|
||||
<a-form-item label="节气" required>
|
||||
<a-select v-model="form.term" placeholder="请选择节气">
|
||||
<a-option v-for="item in terms" :key="item" :value="item">{{ item }}</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="活动简介">
|
||||
<a-input v-model="form.summary" placeholder="一句话描述活动" />
|
||||
</a-form-item>
|
||||
<a-form-item label="活动详情">
|
||||
<a-textarea v-model="form.content" placeholder="详细介绍活动内容" :auto-size="{ minRows: 3 }" />
|
||||
</a-form-item>
|
||||
<a-form-item label="地点" required>
|
||||
<a-input v-model="form.location" placeholder="活动地点" />
|
||||
</a-form-item>
|
||||
<a-form-item label="活动时间" required>
|
||||
<a-range-picker v-model="form.activityTime" show-time format="YYYY-MM-DD HH:mm" value-format="YYYY-MM-DDTHH:mm:ss" />
|
||||
</a-form-item>
|
||||
<a-form-item label="报名时间" required>
|
||||
<a-range-picker v-model="form.signupTime" show-time format="YYYY-MM-DD HH:mm" value-format="YYYY-MM-DDTHH:mm:ss" />
|
||||
</a-form-item>
|
||||
<a-form-item label="报名名额" required>
|
||||
<a-input-number v-model="form.quota" :min="1" />
|
||||
</a-form-item>
|
||||
<a-form-item label="封面图链接">
|
||||
<a-input v-model="form.coverUrl" placeholder="选填" />
|
||||
</a-form-item>
|
||||
<a-form-item label="状态">
|
||||
<a-select v-model="form.status" placeholder="默认草稿">
|
||||
<a-option value="draft">草稿</a-option>
|
||||
<a-option value="published">已发布</a-option>
|
||||
<a-option value="closed">已结束</a-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, reactive, ref, computed } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { listActivitiesAdmin, getActivityAdmin, createActivity, updateActivity, publishActivity, closeActivity } from '../api/activities';
|
||||
import { Solar } from 'lunar-javascript';
|
||||
|
||||
const router = useRouter();
|
||||
const rows = ref([]);
|
||||
const status = ref('');
|
||||
const keyword = ref('');
|
||||
const visible = ref(false);
|
||||
const isEdit = ref(false);
|
||||
const currentId = ref(null);
|
||||
const calendarBase = ref(new Date());
|
||||
|
||||
const form = reactive({
|
||||
title: '',
|
||||
term: '',
|
||||
summary: '',
|
||||
content: '',
|
||||
location: '',
|
||||
activityTime: [],
|
||||
signupTime: [],
|
||||
quota: 20,
|
||||
coverUrl: '',
|
||||
status: 'draft'
|
||||
});
|
||||
|
||||
const terms = [
|
||||
'立春', '雨水', '惊蛰', '春分', '清明', '谷雨',
|
||||
'立夏', '小满', '芒种', '夏至', '小暑', '大暑',
|
||||
'立秋', '处暑', '白露', '秋分', '寒露', '霜降',
|
||||
'立冬', '小雪', '大雪', '冬至', '小寒', '大寒'
|
||||
];
|
||||
|
||||
const columns = [
|
||||
{ title: '活动标题', dataIndex: 'title' },
|
||||
{ title: '节气', dataIndex: 'term' },
|
||||
{ title: '地点', dataIndex: 'location' },
|
||||
{ title: '开始时间', dataIndex: 'startTime' },
|
||||
{ title: '名额', dataIndex: 'quota' },
|
||||
{ title: '已报名', dataIndex: 'signupCount' },
|
||||
{ title: '状态', slotName: 'status' },
|
||||
{ title: '操作', slotName: 'action' }
|
||||
];
|
||||
|
||||
const modalTitle = computed(() => (isEdit.value ? '编辑活动' : '新建活动'));
|
||||
|
||||
const fetchList = async () => {
|
||||
const res = await listActivitiesAdmin({ status: status.value, keyword: keyword.value });
|
||||
rows.value = res.data || [];
|
||||
};
|
||||
|
||||
const resetForm = () => {
|
||||
form.title = '';
|
||||
form.term = '';
|
||||
form.summary = '';
|
||||
form.content = '';
|
||||
form.location = '';
|
||||
form.activityTime = [];
|
||||
form.signupTime = [];
|
||||
form.quota = 20;
|
||||
form.coverUrl = '';
|
||||
form.status = 'draft';
|
||||
};
|
||||
|
||||
const termCache = new Map();
|
||||
|
||||
const termForDate = (date) => {
|
||||
try {
|
||||
if (!date) return '';
|
||||
const key = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
|
||||
if (termCache.has(key)) {
|
||||
return termCache.get(key);
|
||||
}
|
||||
const solar = Solar.fromDate(date);
|
||||
const term = solar.getLunar().getJieQi() || '';
|
||||
termCache.set(key, term);
|
||||
return term;
|
||||
} catch (err) {
|
||||
return '';
|
||||
}
|
||||
};
|
||||
|
||||
const buildCalendar = (baseDate) => {
|
||||
const year = baseDate.getFullYear();
|
||||
const month = baseDate.getMonth();
|
||||
const first = new Date(year, month, 1);
|
||||
const startOffset = first.getDay();
|
||||
const startDate = new Date(year, month, 1 - startOffset);
|
||||
const weeks = [];
|
||||
for (let w = 0; w < 6; w += 1) {
|
||||
const row = [];
|
||||
for (let d = 0; d < 7; d += 1) {
|
||||
const current = new Date(startDate);
|
||||
current.setDate(startDate.getDate() + w * 7 + d);
|
||||
const term = termForDate(current);
|
||||
row.push({
|
||||
key: `${current.getFullYear()}-${current.getMonth() + 1}-${current.getDate()}`,
|
||||
date: current.getDate(),
|
||||
fullDate: current,
|
||||
term,
|
||||
isCurrentMonth: current.getMonth() === month
|
||||
});
|
||||
}
|
||||
weeks.push(row);
|
||||
}
|
||||
return weeks;
|
||||
};
|
||||
|
||||
const calendarDays = computed(() => buildCalendar(calendarBase.value));
|
||||
|
||||
const monthLabel = computed(() => {
|
||||
const year = calendarBase.value.getFullYear();
|
||||
const month = calendarBase.value.getMonth() + 1;
|
||||
return `${year}年${month}月`;
|
||||
});
|
||||
|
||||
const prevMonth = () => {
|
||||
const date = new Date(calendarBase.value);
|
||||
date.setMonth(date.getMonth() - 1);
|
||||
calendarBase.value = date;
|
||||
};
|
||||
|
||||
const nextMonth = () => {
|
||||
const date = new Date(calendarBase.value);
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
calendarBase.value = date;
|
||||
};
|
||||
|
||||
const goToday = () => {
|
||||
calendarBase.value = new Date();
|
||||
};
|
||||
|
||||
const dayClass = (day) => ({
|
||||
'is-other': !day.isCurrentMonth,
|
||||
'is-term': Boolean(day.term)
|
||||
});
|
||||
|
||||
const formatDateTime = (date, time = '09:00:00') => {
|
||||
const pad = (val) => String(val).padStart(2, '0');
|
||||
const year = date.getFullYear();
|
||||
const month = pad(date.getMonth() + 1);
|
||||
const day = pad(date.getDate());
|
||||
return `${year}-${month}-${day}T${time}`;
|
||||
};
|
||||
|
||||
const addDays = (date, days) => {
|
||||
const next = new Date(date);
|
||||
next.setDate(next.getDate() + days);
|
||||
return next;
|
||||
};
|
||||
|
||||
const selectDay = (day) => {
|
||||
if (!day.term) {
|
||||
Message.warning('这一天不是节气日,可手动填写活动信息');
|
||||
return;
|
||||
}
|
||||
const date = day.fullDate;
|
||||
form.term = day.term;
|
||||
form.title = `${day.term}节气文化活动`;
|
||||
form.summary = `围绕${day.term}开展的社区传统文化活动。`;
|
||||
form.content = `本次活动以${day.term}为主题,包含节气科普、互动体验与邻里交流等内容。`;
|
||||
form.activityTime = [formatDateTime(date, '09:00:00'), formatDateTime(date, '11:00:00')];
|
||||
form.signupTime = [
|
||||
formatDateTime(addDays(date, -7), '00:00:00'),
|
||||
formatDateTime(addDays(date, -1), '23:59:59')
|
||||
];
|
||||
form.status = 'draft';
|
||||
Message.success(`已根据${day.term}生成活动草稿`);
|
||||
};
|
||||
|
||||
const openCreate = () => {
|
||||
resetForm();
|
||||
isEdit.value = false;
|
||||
currentId.value = null;
|
||||
calendarBase.value = new Date();
|
||||
visible.value = true;
|
||||
};
|
||||
|
||||
const openEdit = async (record) => {
|
||||
isEdit.value = true;
|
||||
currentId.value = record.id;
|
||||
const res = await getActivityAdmin(record.id);
|
||||
const data = res.data || record;
|
||||
form.title = data.title;
|
||||
form.term = data.term;
|
||||
form.summary = data.summary || '';
|
||||
form.content = data.content || '';
|
||||
form.location = data.location;
|
||||
form.activityTime = [data.startTime, data.endTime];
|
||||
form.signupTime = [data.signupStart, data.signupEnd];
|
||||
form.quota = data.quota;
|
||||
form.coverUrl = data.coverUrl || '';
|
||||
form.status = data.status;
|
||||
calendarBase.value = new Date(data.startTime);
|
||||
visible.value = true;
|
||||
};
|
||||
|
||||
const handleSave = async () => {
|
||||
if (!form.title || !form.term || !form.location || form.activityTime.length !== 2 || form.signupTime.length !== 2) {
|
||||
Message.warning('请填写完整的活动信息');
|
||||
return;
|
||||
}
|
||||
const payload = {
|
||||
title: form.title,
|
||||
term: form.term,
|
||||
summary: form.summary,
|
||||
content: form.content,
|
||||
location: form.location,
|
||||
startTime: form.activityTime[0],
|
||||
endTime: form.activityTime[1],
|
||||
signupStart: form.signupTime[0],
|
||||
signupEnd: form.signupTime[1],
|
||||
quota: form.quota,
|
||||
status: form.status,
|
||||
coverUrl: form.coverUrl
|
||||
};
|
||||
if (isEdit.value) {
|
||||
await updateActivity(currentId.value, payload);
|
||||
Message.success('活动已更新');
|
||||
} else {
|
||||
await createActivity(payload);
|
||||
Message.success('活动已创建');
|
||||
}
|
||||
visible.value = false;
|
||||
await fetchList();
|
||||
};
|
||||
|
||||
const publish = async (id) => {
|
||||
await publishActivity(id);
|
||||
Message.success('活动已发布');
|
||||
await fetchList();
|
||||
};
|
||||
|
||||
const close = async (id) => {
|
||||
await closeActivity(id);
|
||||
Message.success('活动已结束');
|
||||
await fetchList();
|
||||
};
|
||||
|
||||
const goSignups = (record) => {
|
||||
router.push(`/admin/activities/${record.id}/signups`);
|
||||
};
|
||||
|
||||
const statusText = (value) => {
|
||||
if (value === 'published') return '已发布';
|
||||
if (value === 'closed') return '已结束';
|
||||
return '草稿';
|
||||
};
|
||||
|
||||
const statusColor = (value) => {
|
||||
if (value === 'published') return 'green';
|
||||
if (value === 'closed') return 'gray';
|
||||
return 'orange';
|
||||
};
|
||||
|
||||
onMounted(fetchList);
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.search-card {
|
||||
margin-bottom: 18px;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
border-radius: 16px;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
box-shadow: 0 12px 24px rgba(15, 76, 92, 0.08);
|
||||
padding: 18px;
|
||||
gap: 16px;
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.filter-group {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: nowrap;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.action-group {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-left: 8px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.filter-group :deep(.arco-input-wrapper) {
|
||||
width: 260px;
|
||||
}
|
||||
|
||||
.table-shell :deep(.arco-table) {
|
||||
border-radius: 16px;
|
||||
overflow: hidden;
|
||||
background: rgba(255, 255, 255, 0.94);
|
||||
box-shadow: 0 18px 40px rgba(15, 76, 92, 0.08);
|
||||
}
|
||||
|
||||
.modal-body {
|
||||
display: grid;
|
||||
grid-template-columns: 1.1fr 1fr;
|
||||
gap: 18px;
|
||||
}
|
||||
|
||||
.calendar-panel {
|
||||
background: linear-gradient(180deg, rgba(246, 239, 230, 0.9), rgba(238, 245, 246, 0.9));
|
||||
border-radius: 16px;
|
||||
padding: 16px;
|
||||
border: 1px solid rgba(226, 74, 45, 0.15);
|
||||
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
|
||||
.calendar-head {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
.calendar-actions {
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.calendar-title {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.calendar-tip {
|
||||
font-size: 12px;
|
||||
color: rgba(26, 27, 36, 0.7);
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.calendar-month {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
margin: 10px 0 12px;
|
||||
color: #0f4c5c;
|
||||
}
|
||||
|
||||
.calendar-grid {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.calendar-week {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, 1fr);
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.calendar-cell {
|
||||
background: rgba(255, 255, 255, 0.96);
|
||||
border-radius: 12px;
|
||||
padding: 8px;
|
||||
min-height: 88px;
|
||||
cursor: pointer;
|
||||
border: 1px solid rgba(26, 27, 36, 0.08);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
transition: transform 0.2s ease, box-shadow 0.2s ease;
|
||||
}
|
||||
|
||||
.calendar-cell:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 10px 20px rgba(26, 27, 36, 0.12);
|
||||
}
|
||||
|
||||
.calendar-cell.is-other {
|
||||
opacity: 0.45;
|
||||
}
|
||||
|
||||
.calendar-cell.is-term {
|
||||
border-color: rgba(226, 74, 45, 0.4);
|
||||
background: rgba(255, 249, 245, 0.9);
|
||||
}
|
||||
|
||||
.cell-day {
|
||||
font-weight: 700;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.term-chip {
|
||||
font-size: 11px;
|
||||
padding: 2px 6px;
|
||||
border-radius: 10px;
|
||||
background: rgba(226, 74, 45, 0.18);
|
||||
color: #c23b22;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
.form-panel {
|
||||
padding: 8px 12px;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
border-radius: 16px;
|
||||
box-shadow: 0 12px 28px rgba(15, 76, 92, 0.08);
|
||||
border: 1px solid rgba(15, 76, 92, 0.08);
|
||||
}
|
||||
|
||||
.form-shell {
|
||||
padding: 4px 6px;
|
||||
}
|
||||
|
||||
.form-title {
|
||||
font-size: 16px;
|
||||
font-weight: 700;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
@media (max-width: 960px) {
|
||||
.modal-body {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.search-card {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.filter-group {
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
63
frontend/src/views/AdminSignups.vue
Normal file
63
frontend/src/views/AdminSignups.vue
Normal file
@@ -0,0 +1,63 @@
|
||||
<template>
|
||||
<div class="page-shell">
|
||||
<a-button type="text" @click="goBack">← 返回活动管理</a-button>
|
||||
<div class="section-title">报名名单</div>
|
||||
<div class="section-subtitle">核对居民报名与签到情况</div>
|
||||
|
||||
<a-table :columns="columns" :data="rows" row-key="id" :pagination="false">
|
||||
<template #status="{ record }">
|
||||
<a-tag :color="record.status === 'SIGNED' ? 'green' : 'gray'">
|
||||
{{ record.status === 'SIGNED' ? '已报名' : '已取消' }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template #checkin="{ record }">
|
||||
<a-tag :color="record.checkinStatus === 'CHECKED' ? 'green' : 'gray'">
|
||||
{{ record.checkinStatus === 'CHECKED' ? '已签到' : '未签到' }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<a-button size="mini" type="primary" v-if="record.status === 'SIGNED' && record.checkinStatus !== 'CHECKED'" @click="checkin(record.id)">
|
||||
现场签到
|
||||
</a-button>
|
||||
<span v-else>—</span>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { listSignupsByActivity, checkinSignup } from '../api/admin';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const rows = ref([]);
|
||||
|
||||
const columns = [
|
||||
{ title: '用户名', dataIndex: 'username' },
|
||||
{ title: '昵称', dataIndex: 'nickname' },
|
||||
{ title: '电话', dataIndex: 'phone' },
|
||||
{ title: '报名状态', slotName: 'status' },
|
||||
{ title: '签到状态', slotName: 'checkin' },
|
||||
{ title: '操作', slotName: 'action' }
|
||||
];
|
||||
|
||||
const fetchList = async () => {
|
||||
const res = await listSignupsByActivity(route.params.id);
|
||||
rows.value = res.data || [];
|
||||
};
|
||||
|
||||
const checkin = async (id) => {
|
||||
await checkinSignup(id);
|
||||
Message.success('签到完成');
|
||||
await fetchList();
|
||||
};
|
||||
|
||||
const goBack = () => {
|
||||
router.push('/admin/activities');
|
||||
};
|
||||
|
||||
onMounted(fetchList);
|
||||
</script>
|
||||
68
frontend/src/views/LoginView.vue
Normal file
68
frontend/src/views/LoginView.vue
Normal file
@@ -0,0 +1,68 @@
|
||||
<template>
|
||||
<div class="page-shell">
|
||||
<div class="hero-panel fade-in">
|
||||
<h1>欢迎回到节气社区</h1>
|
||||
<p>在这里发布、报名并参与二十四节气主题活动。</p>
|
||||
</div>
|
||||
|
||||
<a-card class="login-card fade-in">
|
||||
<div class="section-title">用户登录</div>
|
||||
<a-form :model="form" layout="vertical">
|
||||
<a-form-item label="用户名" field="username" required>
|
||||
<a-input v-model="form.username" placeholder="请输入用户名" />
|
||||
</a-form-item>
|
||||
<a-form-item label="密码" field="password" required>
|
||||
<a-input-password v-model="form.password" placeholder="请输入密码" />
|
||||
</a-form-item>
|
||||
<a-space>
|
||||
<a-button type="primary" @click="handleSubmit">登录</a-button>
|
||||
<a-button type="text" @click="goRegister">没有账号?去注册</a-button>
|
||||
</a-space>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { login } from '../api/auth';
|
||||
import { useAuthStore } from '../store/auth';
|
||||
|
||||
const router = useRouter();
|
||||
const authStore = useAuthStore();
|
||||
const form = reactive({
|
||||
username: '',
|
||||
password: ''
|
||||
});
|
||||
|
||||
const handleSubmit = async () => {
|
||||
if (!form.username || !form.password) {
|
||||
Message.warning('请填写完整登录信息');
|
||||
return;
|
||||
}
|
||||
const res = await login(form);
|
||||
authStore.setAuth(res.data.token, {
|
||||
userId: res.data.userId,
|
||||
username: res.data.username,
|
||||
nickname: res.data.nickname,
|
||||
role: res.data.role
|
||||
});
|
||||
Message.success('登录成功');
|
||||
router.push('/activities');
|
||||
};
|
||||
|
||||
const goRegister = () => {
|
||||
router.push('/register');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.login-card {
|
||||
margin-top: 24px;
|
||||
max-width: 420px;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
border-radius: 18px;
|
||||
}
|
||||
</style>
|
||||
61
frontend/src/views/MySignups.vue
Normal file
61
frontend/src/views/MySignups.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<div class="page-shell">
|
||||
<div class="section-title">我的报名</div>
|
||||
<div class="section-subtitle">查看报名状态与签到情况</div>
|
||||
|
||||
<a-table :columns="columns" :data="rows" row-key="id" :pagination="false">
|
||||
<template #status="{ record }">
|
||||
<a-tag :color="statusColor(record.status)">{{ statusText(record.status) }}</a-tag>
|
||||
</template>
|
||||
<template #checkinStatus="{ record }">
|
||||
<a-tag :color="record.checkinStatus === 'CHECKED' ? 'green' : 'gray'">
|
||||
{{ record.checkinStatus === 'CHECKED' ? '已签到' : '未签到' }}
|
||||
</a-tag>
|
||||
</template>
|
||||
<template #action="{ record }">
|
||||
<a-button size="mini" type="text" v-if="record.status === 'SIGNED'" @click="cancel(record.activityId)">取消报名</a-button>
|
||||
<span v-else>—</span>
|
||||
</template>
|
||||
</a-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { mySignups } from '../api/me';
|
||||
import { cancelSignup } from '../api/activities';
|
||||
|
||||
const rows = ref([]);
|
||||
|
||||
const columns = [
|
||||
{ title: '活动名称', dataIndex: 'activityTitle' },
|
||||
{ title: '节气', dataIndex: 'term' },
|
||||
{ title: '地点', dataIndex: 'location' },
|
||||
{ title: '活动时间', dataIndex: 'startTime' },
|
||||
{ title: '报名状态', slotName: 'status' },
|
||||
{ title: '签到状态', slotName: 'checkinStatus' },
|
||||
{ title: '操作', slotName: 'action' }
|
||||
];
|
||||
|
||||
const fetchList = async () => {
|
||||
const res = await mySignups();
|
||||
rows.value = res.data || [];
|
||||
};
|
||||
|
||||
const statusText = (value) => {
|
||||
return value === 'SIGNED' ? '已报名' : '已取消';
|
||||
};
|
||||
|
||||
const statusColor = (value) => {
|
||||
return value === 'SIGNED' ? 'green' : 'gray';
|
||||
};
|
||||
|
||||
const cancel = async (activityId) => {
|
||||
await cancelSignup(activityId);
|
||||
Message.success('已取消报名');
|
||||
await fetchList();
|
||||
};
|
||||
|
||||
onMounted(fetchList);
|
||||
</script>
|
||||
76
frontend/src/views/RegisterView.vue
Normal file
76
frontend/src/views/RegisterView.vue
Normal file
@@ -0,0 +1,76 @@
|
||||
<template>
|
||||
<div class="page-shell">
|
||||
<div class="hero-panel fade-in">
|
||||
<h1>加入节气社区</h1>
|
||||
<p>用节气活动连接邻里,共建和谐社区。</p>
|
||||
</div>
|
||||
|
||||
<a-card class="login-card fade-in">
|
||||
<div class="section-title">用户注册</div>
|
||||
<a-form :model="form" layout="vertical">
|
||||
<a-form-item label="用户名" field="username" required>
|
||||
<a-input v-model="form.username" placeholder="请输入用户名" />
|
||||
</a-form-item>
|
||||
<a-form-item label="密码" field="password" required>
|
||||
<a-input-password v-model="form.password" placeholder="请输入密码" />
|
||||
</a-form-item>
|
||||
<a-form-item label="昵称" field="nickname" required>
|
||||
<a-input v-model="form.nickname" placeholder="请输入昵称" />
|
||||
</a-form-item>
|
||||
<a-form-item label="联系电话" field="phone">
|
||||
<a-input v-model="form.phone" placeholder="选填" />
|
||||
</a-form-item>
|
||||
<a-space>
|
||||
<a-button type="primary" @click="handleSubmit">注册并登录</a-button>
|
||||
<a-button type="text" @click="goLogin">已有账号?去登录</a-button>
|
||||
</a-space>
|
||||
</a-form>
|
||||
</a-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { reactive } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import { register } from '../api/auth';
|
||||
import { useAuthStore } from '../store/auth';
|
||||
|
||||
const router = useRouter();
|
||||
const authStore = useAuthStore();
|
||||
const form = reactive({
|
||||
username: '',
|
||||
password: '',
|
||||
nickname: '',
|
||||
phone: ''
|
||||
});
|
||||
|
||||
const handleSubmit = async () => {
|
||||
if (!form.username || !form.password || !form.nickname) {
|
||||
Message.warning('请填写完整注册信息');
|
||||
return;
|
||||
}
|
||||
const res = await register(form);
|
||||
authStore.setAuth(res.data.token, {
|
||||
userId: res.data.userId,
|
||||
username: res.data.username,
|
||||
nickname: res.data.nickname,
|
||||
role: res.data.role
|
||||
});
|
||||
Message.success('注册成功');
|
||||
router.push('/activities');
|
||||
};
|
||||
|
||||
const goLogin = () => {
|
||||
router.push('/login');
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.login-card {
|
||||
margin-top: 24px;
|
||||
max-width: 420px;
|
||||
background: rgba(255, 255, 255, 0.92);
|
||||
border-radius: 18px;
|
||||
}
|
||||
</style>
|
||||
9
frontend/vite.config.js
Normal file
9
frontend/vite.config.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue()],
|
||||
server: {
|
||||
port: 5173
|
||||
}
|
||||
});
|
||||
23
张家贝-开题报告.md
Normal file
23
张家贝-开题报告.md
Normal file
@@ -0,0 +1,23 @@
|
||||
# 河南开封科技传媒学院2026届本科生毕业论文(设计)
|
||||
|
||||
# 开题报告
|
||||
|
||||
<table><tr><td>论文(设计)题目</td><td colspan="3">面向社区的传统节气文化活动发布与报名系统的设计与实现</td></tr><tr><td>学院</td><td>信息工程学院</td><td>专业</td><td>数据科学与大数据技术</td></tr><tr><td>姓名</td><td>张家贝</td><td>学号</td><td>2236091064</td></tr><tr><td colspan="4">一、本课题研究意义
|
||||
助力中华优秀传统文化的传承与创新:通过数字化手段,将深奥的节气知识转化为社区居民可参与的互动活动(例如:春分立蛋、冬至包饺子),使传统文化在现代都市生活中活跃起来。
|
||||
提升社区数字化治理与管理效率:传统的社区活动通知往往通过微信群或线下告示栏,信息容易被覆盖而且报名统计繁琐。该系统提供了文化活动的发布平台和报名统计等功能,降低社区工作人员的管理成本。
|
||||
构建和谐社区与增强居民社交联结:以节气活动为纽带,吸引不同年龄段的居民(如年轻人带小孩参加科普,老人参加民俗制作)走出家门。</td></tr><tr><td colspan="4">二、国内外有关本课题的研究动态
|
||||
国内研究现状:国内目前存在大量智慧社区相关的平台,这些平台目前已经实现了智慧社区相关的一部分基础功能,但是在文化活动管理,尤其是传统文化和社区活动相结合的系统比较少见,另外,目前二十四节气文化,以及社区相关活动的信息发布,多依赖于日常聊天工具(如:微信),缺乏一个科普-发布-报名为一体的闭环管理系统。</td></tr><tr><td colspan="4">国外研究现状:国外并没有二十四节气的概念,但是也存在一部分活动管理系统,国外拥有如 Eventbrite、Meetup 等一系列比较成熟的的活动发布与报名的平台,尤其是在用户体验、自动化通知提醒方面具有比较高的研究程度。
|
||||
总结:目前国内外存在的不足之处基本为通用性过强,缺乏一些专业性,系统无法承载二十四节气的文化内涵。</td></tr><tr><td colspan="4">三、本课题研究的基本内容
|
||||
本课题重点研究如何将传统的二十四节气文化与现代社区治理相结合。通过构建一套基于 SpringBoot 的后台支撑系统,实现活动名额的精确控制与居民报名的数字化处理。同时,利用 Vue 框架研究界面的时令化动态渲染技术,旨在解决社区活动管理混乱、文化传播碎片化的问题,最终交付一个具备高易用性、高稳定性的数字化社区服务平台。</td></tr><tr><td colspan="4">四、本课题拟解决的主要问题
|
||||
解决社区文化活动信息“碎片化”与“不对称”的问题:目前社区活动信息散落在微信群、朋友圈或线下公示栏,居民容易错过报名时间,信息查阅不便。
|
||||
解决传统报名方式流程相对繁琐以及信息统计低效的问题:传统的纸质登记或简单的在线收集表缺乏名额限制、撤销报名、签到统计等逻辑,导致社区工作人员在后台整理 Excel 时工作量极大。
|
||||
解决传统文化教育脱离生活的问题:很多居民对二十四节气的了解仅停留在课本上,缺乏实践参与感。</td></tr><tr><td colspan="4">五、研究方法
|
||||
文献研究法:首先通过阅读知网、维基百科相关文献,聚焦于技术栈的底层调研与业务域驱动建模,对当前主流的前后端分离架构进行比对,评估 SpringBoot 框架的生态优势,以及Vue.js 在构建交互界面时的优点。</td></tr><tr><td colspan="4">面向对象分析与设计法:在系统开发阶段,采用面向对象的软件开发思想。利用UML建模工具,针对社区管理人员与普通居民的不同需求,绘制用例图、时序图与类图。基于SpringBoot框架的特性,对系统进行模块化拆解,将复杂的活动报名逻辑抽象为具体的对象与服务。</td></tr><tr><td colspan="4">六、主要创新点
|
||||
在技术实现层面,本系统的核心创新在于采用了完全解耦的前后端分离架构。通过将后端SpringBoot逻辑与前端Vue表现层彻底切分,利用RESTful API建立了数据交互链路。这种架构设计降低了系统模块间的耦合度,还允许前后端独立进行版本更替与性能优化。
|
||||
在业务逻辑方面,本系统的创新点在于构建社区服务新模式。与市面上功能单一的管理系统不同,本系统通过将传统民俗知识与社区实际活动挂钩,嵌入“文化科普—实地参与—互动反馈”的完整闭环,让居民在数字化的交互中产生实时的文化共鸣,并解决传统报名方式流程相对繁琐以及信息统计低效的问题,</td></tr><tr><td colspan="4">七、主要参考文献
|
||||
[1]栗梁.基于SSM框架的汽车租赁管理系统设计与实现[J].电脑编程技巧与维护,2024,32(1):43-45,52.
|
||||
[2]武卫翔,吴雪宁,童欣,秦睿,陈海燕.基于Java的第三方物流协同订单管理系统的设计与实现[J].物流科技,2024,42(12):77-81.
|
||||
[3]丁禹钧,朱一龙,王雪静.基于SpringBoot和Vue的高校学生社团管理系统[J].电脑编程技巧与维护,2025,(9):110-112,165.
|
||||
[4]丁子木,刘美彤,韩梦杰,曹严,赵礼扬.Vue框架中的MVVM思想的实践与优化[J].电脑编程技巧与维护,2025,(4):76-78.</td></tr><tr><td colspan="4">[5]柳伟卫.Vue.js+Spring Boot全栈开发实战[M].人民邮电出版社,2023.</td></tr><tr><td colspan="4">[6]刘靓丽 HTML5与CSS3在网页前端设计优化中的应用研究[J].电脑知识与技术,2025,21(22),51-53.</td></tr><tr><td colspan="4">[7]翟宝峰,邓明亮 HTML5+CSS3网页设计基础与实战[M].人民邮电出版社,2024,250.</td></tr><tr><td colspan="4">[8]张晓颖,石磊.Web交互界面设计与制作[M].人民邮电出版社:2024,449.</td></tr><tr><td colspan="4">[9]Shangguan S ,Chen W .HTML5-Powered Causal Explanations: Fueling D eep Science Learning[J].World Journal of Innovation and Modern Technology, 2025,12.</td></tr><tr><td colspan="4">[10]K. Nandhini. Veterinary Hospital Management System Using AI Integra
|
||||
ted Advisory[J]. International Journal of Science, Engineering and Technolog
|
||||
y, 2025, 13(2).</td></tr><tr><td colspan="4">具体时间及写作进度安排</td></tr><tr><td>起止日期</td><td colspan="3">主要工作内容</td></tr><tr><td></td><td colspan="3"></td></tr><tr><td></td><td colspan="3"></td></tr><tr><td></td><td colspan="3"></td></tr><tr><td colspan="4">指导教师对开题报告的意见</td></tr><tr><td colspan="4">指导教师签名: 年月日</td></tr><tr><td colspan="4">系部对本课题开题的意见</td></tr></table>
|
||||
Reference in New Issue
Block a user