[api] swagger 셋팅중

- 로그인 추가
This commit is contained in:
2026-02-25 17:11:17 +09:00
parent b1d4b6a60e
commit 41b7eba619
20 changed files with 547 additions and 72 deletions
+119 -58
View File
@@ -1,93 +1,154 @@
# api
# alist API
Spring Boot 기반의 RESTful API 서버
## 프로젝트 정보
## Getting started
- **그룹**: com.alist
- **포트**: 8106
- **빌드 결과물**: `api.jar`
- **GitLab**: https://gitlab.pjt.kr/alist/api
To make it easy for you to get started with GitLab, here's a list of recommended next steps.
## 기술 스택
Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
- **Java**: 21
- **Framework**: Spring Boot 3.5.10
- **빌드 도구**: Gradle
- **데이터베이스**: MariaDB
- **ORM**: MyBatis
- **인증**: JWT (jjwt 0.11.5) + Spring Security
- **API 문서**: Swagger (springdoc-openapi 2.6.0)
- **기타**: Lombok, Validation, Actuator, log4jdbc
## Add your files
## 주요 기능
- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
- [ ] [Add files using the command line](https://docs.gitlab.com/topics/git/add_files/#add-files-to-a-git-repository) or push an existing Git repository with the following command:
- JWT 기반 인증/인가
- MyBatis XML Mapper를 통한 데이터 액세스
- 표준화된 API 응답 (`ApiResponse<T>`)
- Swagger API 문서 (HTTP Basic 인증)
- 파일 업로드/다운로드
- Actuator 헬스 체크
```
cd existing_repo
git remote add origin https://gitlab.pjt.kr/alist/api.git
git branch -M main
git push -uf origin main
## 빌드 및 실행
### 빌드
```bash
./gradlew bootJar
```
## Integrate with your tools
### 로컬 실행
```bash
./gradlew bootRun --args='--spring.profiles.active=local'
```
- [ ] [Set up project integrations](https://gitlab.pjt.kr/alist/api/-/settings/integrations)
### JAR 실행
```bash
java -jar build/libs/api.jar --spring.profiles.active=local
```
## Collaborate with your team
## 환경 설정
- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
- [ ] [Set auto-merge](https://docs.gitlab.com/user/project/merge_requests/auto_merge/)
### 프로파일
## Test and Deploy
| 프로파일 | 설명 | 설정 파일 |
|---------|------|----------|
| `local` | 로컬 개발 환경 | `application-local.yml` |
| `pjt` | 프로젝트(개발) 환경 | `application-pjt.yml` |
Use the built-in continuous integration in GitLab.
### 환경별 접속 정보
- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/)
- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
#### 로컬 (local)
- **API**: http://localhost:8106
- **Swagger**: http://localhost:8106/swagger-ui.html
***
#### 개발 서버 (pjt)
- **API**: https://api-alist.pjt.kr
- **파일**: https://file-alist.pjt.kr
- **Swagger**: https://api-alist.pjt.kr/swagger-ui/index.html
# Editing this README
## API 문서
When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
Swagger UI를 통해 API 문서를 확인할 수 있습니다.
## Suggestions for a good README
- **접속**: `/swagger-ui.html`
- **인증**: HTTP Basic (환경별 yaml에 설정된 ID/PW 사용)
Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
## 패키지 구조
## Name
Choose a self-explaining name for your project.
```
com.alist.api
├── common
│ ├── response/ # ApiResponse, ApiResponseCode
│ └── utils/ # 공통 유틸리티
├── config
│ ├── jwt/ # JWT 필터, 핸들러, Provider
│ ├── exception/ # GlobalExceptionHandler
│ ├── properties/ # JwtProperties 등
│ ├── SecurityConfig.java
│ └── OpenApiConfig.java
└── modules
└── {도메인}/ # Controller, Service, Mapper, DTO
```
## Description
Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
## 보안
## Badges
On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
### 인증 방식
- **Swagger**: HTTP Basic 인증 (InMemory)
- **API**: JWT Bearer 토큰 인증 (Stateless)
## Visuals
Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
### 공개 경로
- `/` - 루트
- `/actuator/health` - 헬스 체크
- `/auth/**` - 인증 관련 API
- `/api/user/signup` - 회원가입
## Installation
Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
## 응답 코드
## Usage
Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
API 응답은 `ApiResponseCode` enum으로 표준화되어 있습니다.
## Support
Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
### 주요 응답 코드
## Roadmap
If you have ideas for releases in the future, it is a good idea to list them in the README.
| 코드 | 메시지 | HTTP Status | 용도 |
|------|--------|-------------|------|
| `CODE_200` | 성공 | 200 OK | 일반 성공 |
| `CODE_2001` | {0} 정보 조회에 성공하였습니다. | 200 OK | 단건 조회 성공 |
| `CODE_2002` | {0} 등록 되었습니다. | 201 Created | 등록 성공 |
| `CODE_2003` | 조회된 정보가 없습니다. | 200 OK | 조회 결과 없음 |
| `CODE_2004` | 중복된 {0} 정보 입니다. | 409 Conflict | 중복 데이터 |
| `CODE_4001` | 입력값을 확인해주세요. | 400 Bad Request | Validation 오류 |
| `CODE_4003` | 필수 요청 파라미터가 누락되었습니다. | 400 Bad Request | 필수 파라미터 누락 |
## Contributing
State if you are open to contributions and what your requirements are for accepting them.
## 배포
For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
### Docker
```bash
# 이미지 빌드
docker build -t registry.pjt.kr/alist/api .
You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
# 컨테이너 실행
docker run -d -p 8106:8106 --name alist-api registry.pjt.kr/alist/api
```
## Authors and acknowledgment
Show your appreciation to those who have contributed to the project.
### CI/CD
- **Jenkins**: `Jenkinsfile.pjt`
- **Docker Registry**: registry.pjt.kr
- **배포 스크립트**: `deploy/` 디렉토리
## License
For open source projects, say how it is licensed.
## 개발 가이드
## Project status
If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
상세한 개발 가이드는 [CLAUDE.md](./CLAUDE.md)를 참고하세요.
### 코드 작성 규칙
- 응답은 `ApiResponse<T>` 래퍼 사용
- 응답 코드는 `ApiResponseCode` enum 사용
- MyBatis Mapper XML은 `src/main/resources/mapper/` 하위에 작성
- 새 모듈 추가 시: `modules/{moduleName}/` 구조로 생성
### MyBatis 규칙
- Mapper XML 위치: `src/main/resources/mapper/**/*.xml`
- 카멜케이스 자동 변환 활성화 (`map-underscore-to-camel-case: true`)
- Mapper 인터페이스와 XML의 namespace, id 일치 필수
## 라이선스
Proprietary