이번에 할건 데이터 베이스 설계
그리고 유스케이스 다이어그램
배포 로직 작성
api 명세서 까지 작성하는게 목표이다
1. 데이터 베이스 설계
https://www.erdcloud.com/d/KC87aaQvuoWXSw5x3
데이터 베이스는 우선 erd 클라우드를 사용했다 이걸 자주사용해서 익혀서 이걸사용했는데 sql즉석으로 바꿔주는것도 있고 차라리 그게 sql공부하는게 나을지도 다음에 그걸 해봐야겠다
2. 유스케이스 다이어그램
유스케이스 다이어그램 처음 작성해봤는데 이렇게하는게 맞는지모르겠다
3. 배포로직 설계
배포 로직 이렇게 할것이다 배포 로직도 중간에 바꿀수있다 레디스 처리 aws 쓸지 아님 그냥 도커 컨테이너에 올리고 도커 컴포즈에 올려서 쓸지 여튼 이건 추후에 생각해봐야겠다
둘다
draw.io
Security-first diagramming for teams. Bring your storage to our online tool, or save locally with the desktop app. Describe your diagram: No login or registration required.
www.drawio.com
이걸로 작성했다
4. 백엔드 프론트 패키지구조
이제 다음으로 할건 프로젝트 구조 ,api 명세서 작성
패키지 구조
백엔드 어떤로직할지 고민하다가 다양한 로직 지피티한테 물어봤고 전에 했던 프로젝트랑 비교를 해봤습니다 이게 제일 패키지 관리하기 쉬운같아서 이걸로 선택습니다
back_end
com.kindtail.adoptmate
├── member
│ ├── controller
│ ├── service
│ ├── repository
│ ├── domain ← Member 엔티티 클래스
│ └── dto
├── comment
│ ├── controller
│ ├── service
│ ├── repository
│ ├── domain ← Comment 엔티티 클래스
│ └── dto
├── animal
│ ├── controller
│ ├── service
│ ├── repository
│ ├── domain ← Animal 엔티티 클래스
│ └── dto
├── adoption
│ ├── controller
│ ├── service
│ ├── repository
│ ├── domain ← Adoption 엔티티 클래스
│ └── dto
├── board
│ ├── controller
│ ├── service
│ ├── repository
│ ├── domain ← Board(Post) 엔티티 클래스
│ └── dto
├── config
└── Application.java
front_end
프론트엔드에 대한지식이 부족하여 지피티 +구글링해봤는데 이런 구성이 좋아보여서 이걸 선택하게되었습니다
adoptmate/
├── src/
│ ├── components/ # 재사용 가능한 UI 컴포넌트
│ ├── pages/ # 페이지 단위 컴포넌트
│ ├── hooks/ # 커스텀 훅
│ ├── utils/ # 유틸 함수
│ ├── api/ # API 호출 관련
│ ├── styles/ # 스타일링 (글로벌, 테마 등)
│ ├── context/ # React Context 전역 상태 관리
│ ├── App.js # 루트 컴포넌트
│ └── index.js # 앱 진입점
└── public/
5.API 명세서
Api 명세서
No 기능명 HTTP Method 경로 설명 요청(Request) 예시 응답(Response) 예시
1 | 동물 등록 | POST | /adoptmate/animals | 유기동물 정보 등록 (관리자) | { "species": "dog", "gender": "male", "color": "brown", "age": 3, "breed": "bulldog", "status": "available", "imgUrl": "https://storage.example.com/animal1.jpg" } | { "animalId": 1, "species": "dog", "gender": "male", "color": "brown", "age": 3, "breed": "bulldog", "status": "available", "imgUrl": "https://storage.example.com/animal1.jpg" } |
2 | 동물 전체 조회 | GET | /adoptmate/animals | 모든 유기동물 목록 조회 | 없음 | [ { "animalId": 1, "species": "dog", "age": 3, "status": "available" }, {...} ] |
3 | 동물 상세 조회 | GET | /adoptmate/animals/{id} | 특정 동물 상세 조회 | 없음 | { "animalId": 1, "species": "dog", "gender": "male", "color": "brown", "age": 3, "breed": "bulldog", "status": "available", "imgUrl": "https://storage.example.com/animal1.jpg" } |
4 | 동물 수정 | PUT | /adoptmate/animals/{id} | 동물 정보 수정 (관리자) | { "color": "black", "status": "adopted", "imgUrl": "https://storage.example.com/animal1_updated.jpg" } | { "animalId": 1, "color": "black", "status": "adopted", "imgUrl": "https://storage.example.com/animal1_updated.jpg" } |
5 | 동물 삭제 | DELETE | /adoptmate/animals/{id} | 동물 정보 삭제 (관리자) | 없음 | { "message": "Animal deleted successfully." } |
6 | 입양 신청 | POST | /adoptmate/adoptions | 사용자가 특정 동물에 입양 신청 | { "animalId": 1, "memberId": 100, "applyDate": "2025-07-01T10:00:00Z" } | { "adoptionId": 10, "status": "PENDING" } |
7 | 입양 전체 조회 | GET | /adoptmate/adoptions | 입양 신청 목록 전체 조회 (관리자) | 없음 | [ { "adoptionId": 10, "animalId": 1, "memberId": 100, "status": "PENDING" }, {...} ] |
8 | 입양 상세 조회 | GET | /adoptmate/adoptions/{id} | 특정 입양 신청 상세 조회 | 없음 | { "adoptionId": 10, "animalId": 1, "memberId": 100, "applyDate": "...", "status": "PENDING", "interview": null } |
9 | 입양 상태 변경 | PATCH | /adoptmate/adoptions/{id} | 입양 승인/거절 처리 (관리자) | { "status": "APPROVED" } | { "adoptionId": 10, "status": "APPROVED" } |
10 | 입양 신청 취소 | DELETE | /adoptmate/adoptions/{id} | 사용자가 입양 신청 취소 | 없음 | { "message": "Adoption request cancelled." } |
11 | 게시글 작성 | POST | /adoptmate/posts | 사용자가 게시글 작성 | { "title": "입양 후기", "content": "저희 강아지 잘 지내요.", "images": [ "https://storage.example.com/postimg1.jpg", "https://storage.example.com/postimg2.jpg" ] } | { "postId": 5, "title": "입양 후기", "content": "저희 강아지 잘 지내요.", "images": [ "https://storage.example.com/postimg1.jpg", "https://storage.example.com/postimg2.jpg" ], "authorId": 100, "createdAt": "2025-07-01T10:00:00Z" } |
12 | 게시글 전체 조회 | GET | /adoptmate/posts | 게시글 목록 전체 조회 | 없음 | [ { "postId": 5, "title": "입양 후기", "authorId": 100, "createdAt": "..." }, {...} ] |
13 | 게시글 상세 조회 | GET | /adoptmate/posts/{id} | 특정 게시글 상세 조회 | 없음 | { "postId": 5, "title": "입양 후기", "content": "...", "authorId": 100, "createdAt": "..." } |
14 | 게시글 수정 | PUT | /adoptmate/posts/{id} | 게시글 수정 (작성자 본인) | { "title": "수정된 제목", "content": "수정된 내용", "images": [ "https://storage.example.com/postimg1_updated.jpg" ] } | { "postId": 5, "title": "수정된 제목", "content": "수정된 내용", "images": [ "https://storage.example.com/postimg1_updated.jpg" ] } |
15 | 게시글 삭제 | DELETE | /adoptmate/posts/{id} | 게시글 삭제 (작성자 본인) | 없음 | { "message": "Post deleted successfully." } |
16 | 이미지 업로드 | POST | /adoptmate/uploads/images | 게시글용 이미지 파일 업로드 | Multipart/form-data (image 파일) | { "imageUrl": "https://storage.example.com/abc.jpg" } |
'개발 공부 > Java-Spring' 카테고리의 다른 글
개인프로젝트#4 (0) | 2025.07.06 |
---|---|
프로젝트#3 (0) | 2025.07.04 |
개인 프로젝트 #1 (0) | 2025.06.30 |
SOLID객체지향 5가지 원칙 (0) | 2025.06.27 |
객체끼리 비교할 때 무조건 equals메서드 사용할 것 (0) | 2025.06.12 |