Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Docs/37] swagger에서 확인할 수 있는 문구 추가 #38

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.nexters.bottles.bottle.controller
import com.nexters.bottles.bottle.facade.BottleFacade
import com.nexters.bottles.bottle.facade.dto.BottleDetailResponseDto
import com.nexters.bottles.bottle.facade.dto.BottleListResponseDto
import io.swagger.annotations.ApiOperation
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
Expand All @@ -15,16 +16,19 @@ class BottleController(
private val bottleFacade: BottleFacade
) {

@ApiOperation("홈 - 받은 보틀 목록 조회하기")
@GetMapping
fun getBottlesList(): BottleListResponseDto {
return bottleFacade.getBottles()
}

@ApiOperation("홈 - 보틀 상세 정보 조회하기")
@GetMapping("/{bottleId}")
fun getBottleDetail(@PathVariable bottleId: Long): BottleDetailResponseDto {
return bottleFacade.getBottle(bottleId)
}

@ApiOperation("홈 - 보틀에 내 소개 보내기(수락하기)")
@PostMapping("/{bottleId}/accept")
fun acceptBottle(@PathVariable bottleId: Long) {
bottleFacade.acceptBottle(bottleId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.nexters.bottles.user.facade.dto.RegisterIntroductionRequestDto
import com.nexters.bottles.user.facade.dto.RegisterProfileRequestDto
import com.nexters.bottles.user.facade.UserProfileFacade
import com.nexters.bottles.user.facade.dto.UserProfileResponseDto
import io.swagger.annotations.ApiOperation
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestBody
Expand All @@ -17,21 +18,25 @@ class UserProfileController(
private val profileFacade: UserProfileFacade,
) {

@ApiOperation("온보딩 프로필 등록하기")
@PostMapping("/choice")
fun upsertProfile(@RequestBody registerProfileRequestDto: RegisterProfileRequestDto) {
profileFacade.upsertProfile(registerProfileRequestDto)
}

@ApiOperation("온보딩 선택지 조회하기 - 지역")
@GetMapping("/choice")
fun getProfileChoiceList() : ProfileChoiceResponseDto {
return profileFacade.getProfileChoice()
}

@ApiOperation("마이페이지 자기소개 등록하기")
@PostMapping("/introduction")
fun upsertIntroduction(@RequestBody registerIntroductionRequestDto: RegisterIntroductionRequestDto) {
profileFacade.upsertIntroduction(registerIntroductionRequestDto)
}

@ApiOperation("마이페이지 내 프로필 조회하기")
@GetMapping
fun getProfile(): UserProfileResponseDto {
return profileFacade.getProfile()
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/sql/table_query.sql
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE TABLE User (
CREATE TABLE user (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) DEFAULT NULL,
birthdate DATE DEFAULT NULL,
Expand Down Expand Up @@ -29,7 +29,7 @@ CREATE TABLE bottle
ping_pong_status VARCHAR(20) DEFAULT 'NONE' NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL
)
);

CREATE TABLE letter
(
Expand All @@ -41,10 +41,10 @@ CREATE TABLE letter
is_read BOOLEAN DEFAULT FALSE NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP NOT NULL,
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL
)
);

CREATE TABLE question
(
id BIGINT AUTO_INCREMENT PRIMARY KEY,
question VARCHAR(255) NOT NULL
)
);
Loading