ddl-auto=update, 운영 전환 시 Flyway 권장)├─ config # CORS 등 공통 설정
├─ common/exception # 예외/전역 핸들러
├─ customer {controller, dto, entity, repository, service}
├─ meeting {controller, dto, entity, repository, service}
└─ reminder {controller, dto, entity, repository, service}
build.gradle (요지)
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-validation'
runtimeOnly 'org.mariadb.jdbc:mariadb-java-client'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.8.9'
application.properties
server.port=8080
spring.datasource.url=jdbc:mariadb://localhost:3306/crm?useUnicode=true&characterEncoding=utf8
spring.datasource.username=crm
spring.datasource.password=crm123
spring.jpa.hibernate.ddl-auto=update
spring.jpa.show-sql=true
spring.jpa.properties.hibernate.format_sql=true
spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
springdoc.api-docs.enabled=true
springdoc.swagger-ui.enabled=true
# 필요 시 UI 경로 고정
# springdoc.swagger-ui.path=/swagger-ui
id, type(COMPANY|PERSON), name, email, phone, owner, createdAt, updatedAtid, customer_id(FK), meetingAt, title, notes, createdAtid, customer_id(FK), dueDate, note, status(PENDING|DONE), doneAt, createdAtCustomers
POST /api/customers 생성GET /api/customers?q=&page=&size=&sort=updatedAt,desc 목록(검색/정렬/페이징)GET /api/customers/{id} 상세PUT /api/customers/{id} 수정DELETE /api/customers/{id} 삭제Meetings
POST /api/meetings 생성GET /api/customers/{id}/meetings?page=&size=&sort=meetingAt,descDELETE /api/meetings/{id}Reminders
POST /api/reminders 생성GET /api/customers/{id}/reminders?page=&size=GET /api/reminders/upcoming?days=7 다가올 리마인더PATCH /api/reminders/{id}/done 완료 처리PATCH /api/reminders/{id} (마감일/메모 수정)DELETE /api/reminders/{id}./gradlew bootRun
# Swagger UI
# - http://localhost:8080/swagger-ui.html
# - 또는 http://localhost:8080/swagger-ui/index.html
# OpenAPI JSON: http://localhost:8080/v3/api-docs
# 고객 생성
curl -s -X POST http://localhost:8080/api/customers \
-H "Content-Type: application/json" \
-d '{"name":"Acme Co","type":"COMPANY","email":"sales@acme.com","owner":"홍상화"}' | jq
# 리마인더 생성
curl -s -X POST http://localhost:8080/api/reminders \
-H "Content-Type: application/json" \
-d '{"customerId":1,"dueDate":"2025-09-21","note":"견적서 재전송"}' | jq
# 다가올 리마인더(7일)
curl -s "http://localhost:8080/api/reminders/upcoming?days=7" | jq
# 완료 처리
curl -s -X PATCH http://localhost:8080/api/reminders/1/done -i