package com.example.volunteer;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

/**
 * ============================================================================
 * VolunteerHub — 志愿者活动报名平台（Paper 2 Section D 模拟题）
 * ============================================================================
 *
 * 【题目 / Question】
 * EN — A non-profit organisation runs community volunteer events. Volunteers sign up for
 *      events; one volunteer may join many events, and one event has many volunteers.
 *      Every sign-up records when the volunteer signed up and how many hours he or she
 *      contributed.
 * 中 — 公益组织举办社区志愿活动：一个志愿者可报名多个活动，一个活动有多个志愿者；
 *      每条报名记录报名日期与服务时数。
 *
 * EN — The system is built with Spring Boot, Spring Data JPA and Thymeleaf. Controllers
 *      interact directly with the JPA repositories (no service layer in the original paper);
 *      in this reference project a Service layer is added as an exercise.
 * 中 — 系统用 Spring Boot + JPA + Thymeleaf；原卷要求 Controller 直连 Repository，
 *      本工程额外加了 Service 层作为分层练习。
 *
 * 运行 / Run:
 *   mvn spring-boot:run         →  http://localhost:8080/events
 *   报名接口 / Sign-up API:
 *     curl -i -X POST http://localhost:8080/api/events/1/signup \
 *          -H "Content-Type: application/json" \
 *          -d '{"volunteerId":1,"hours":3}'
 *     期望 / Expect: 201（成功）或 422（活动不存在 / 已满 / 重复报名）
 */
@SpringBootApplication
public class VolunteerHubApplication {

    public static void main(String[] args) {
        SpringApplication.run(VolunteerHubApplication.class, args);
    }
}
