3 Commits

Author SHA1 Message Date
b34636baae [nginx gitignore 추가] 2025-08-13 15:38:54 +09:00
a2c6c83ed7 [Window 버전으로 변경] 2025-08-13 15:38:09 +09:00
6a4388f513 [Swagger 적용] 2025-08-13 15:23:59 +09:00
3 changed files with 43 additions and 19 deletions

3
.gitignore vendored
View File

@@ -42,4 +42,5 @@ bin/
# Temporary files created by the OS # Temporary files created by the OS
.DS_Store .DS_Store
Thumbs.db Thumbs.db
/nginx-1.28.0/logs/nginx.pid

View File

@@ -1,38 +1,48 @@
# ./nginx/nginx.conf
# 이벤트 블록은 Nginx가 어떻게 연결을 처리할지 정의합니다.
events { events {
worker_connections 1024; worker_connections 1024;
} }
# HTTP 블록은 웹 서버의 동작을 정의합니다.
http { http {
# MIME 타입 파일을 포함하여 파일 확장자에 따라 콘텐츠 타입을 결정합니다. include mime.types;
include /etc/nginx/mime.types; default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
# (선택) 로그 위치
access_log logs/access.log;
error_log logs/error.log warn;
# 웹소켓용
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# 기본 서버 설정을 정의합니다.
server { server {
# 80번 포트에서 요청을 받습니다.
listen 80; listen 80;
server_name localhost; # 서버 이름을 localhost로 설정 server_name localhost;
# 루트 경로(/)로 들어오는 모든 요청을 처리합니다. # Nuxt(개발서버 3000)
location / { location / {
# 요청을 다른 서버(여기서는 Nuxt.js)로 전달합니다.
proxy_pass http://localhost:3000; proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
# 프록시 헤더를 설정하여 원본 요청 정보를 유지합니다. # Spring Boot(8080) — /service 접두어 제거
location /service/ {
proxy_pass http://localhost:8080; # 끝에 슬래시 넣으면 /service가 제거됨
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} }
# /api/ 경로로 들어오는 요청을 처리합니다. (Spring Boot 컨테이너를 가리킨다고 가정) # (선택) 업로드 크게 받을 때
location /service { # client_max_body_size 50m;
proxy_pass http://localhost:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
} }
} }

View File

@@ -1,5 +1,6 @@
package com.bio.bio_backend.domain.user.member.controller; package com.bio.bio_backend.domain.user.member.controller;
import com.bio.bio_backend.global.dto.CustomApiResponse;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
@@ -16,6 +17,12 @@ import com.bio.bio_backend.domain.user.member.service.MemberService;
import com.bio.bio_backend.domain.user.member.mapper.MemberMapper; import com.bio.bio_backend.domain.user.member.mapper.MemberMapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.media.Content;
import io.swagger.v3.oas.annotations.media.Schema;
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@@ -26,6 +33,12 @@ public class MemberController {
private final MemberMapper memberMapper; private final MemberMapper memberMapper;
private final BCryptPasswordEncoder bCryptPasswordEncoder; private final BCryptPasswordEncoder bCryptPasswordEncoder;
@Operation(summary = "회원 가입", description = "새로운 회원을 등록합니다.", tags = {"Member"})
@ApiResponses({
@ApiResponse(responseCode = "201", description = "회원 가입 성공", content = @Content(schema = @Schema(implementation = CreateMemberResponseDto.class))),
@ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content(schema = @Schema(implementation = CustomApiResponse.class))),
@ApiResponse(responseCode = "409", description = "중복된 사용자 정보", content = @Content(schema = @Schema(implementation = CustomApiResponse.class)))
})
@PostMapping("/members") @PostMapping("/members")
public ResponseEntity<CreateMemberResponseDto> createMember(@RequestBody @Valid CreateMemberRequestDto requestDto) { public ResponseEntity<CreateMemberResponseDto> createMember(@RequestBody @Valid CreateMemberRequestDto requestDto) {
MemberDto member = memberMapper.toMemberDto(requestDto); MemberDto member = memberMapper.toMemberDto(requestDto);