Skip to content
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
21 changes: 12 additions & 9 deletions src/main/java/com/tiki/server/team/controller/TeamController.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ public SuccessResponse<TeamsGetResponse> getAllTeams(final Principal principal)
return SuccessResponse.success(SUCCESS_GET_TEAMS.getMessage(), response);
}

@Override
@ResponseStatus(HttpStatus.OK)
@GetMapping("/{teamId}/inform")
public SuccessResponse<TeamInformGetResponse> getTeamName(
@PathVariable final long teamId
) {
TeamInformGetResponse response = teamService.getTeamInform(teamId);
return SuccessResponse.success(SUCCESS_GET_TEAM_INFORM.getMessage(), response);
}

@Override
@ResponseStatus(HttpStatus.OK)
@GetMapping("/category")
Expand All @@ -75,15 +85,7 @@ public void deleteTeam(
teamService.deleteTeam(memberId, teamId);
}

@ResponseStatus(HttpStatus.OK)
@GetMapping("/{teamId}/inform")
public SuccessResponse<TeamInformGetResponse> getTeamName(
@PathVariable final long teamId
) {
TeamInformGetResponse response = teamService.getTeamInform(teamId);
return SuccessResponse.success(SUCCESS_GET_TEAM_INFORM.getMessage(), response);
}

@Override
@ResponseStatus(HttpStatus.OK)
@PatchMapping("/{teamId}/inform")
public SuccessResponse<?> updateTeamInform(
Expand All @@ -96,6 +98,7 @@ public SuccessResponse<?> updateTeamInform(
return SuccessResponse.success(SUCCESS_UPDATE_TEAM_NAME.getMessage());
}

@Override
@ResponseStatus(HttpStatus.OK)
@PatchMapping("/{teamId}/member/{targetId}/admin")
public SuccessResponse<?> alterAdmin(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

import java.security.Principal;

import com.tiki.server.team.dto.request.TeamInformUpdateRequest;
import com.tiki.server.team.dto.request.TeamInformUpdateServiceRequest;
import com.tiki.server.team.dto.response.UsageGetResponse;
import com.tiki.server.team.dto.response.CategoriesGetResponse;
import com.tiki.server.team.dto.response.TeamsGetResponse;
import com.tiki.server.team.service.dto.response.TeamInformGetResponse;

import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
Expand All @@ -26,119 +29,115 @@
public interface TeamControllerDocs {

@Operation(
summary = "팀 생성",
description = "팀을 생성한다.",
responses = {
@ApiResponse(responseCode = "201", description = "성공"),
@ApiResponse(
responseCode = "404",
description = "유효하지 않은 회원",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
summary = "팀 생성",
description = "팀을 생성한다.",
responses = {
@ApiResponse(responseCode = "201", description = "성공"),
@ApiResponse(responseCode = "404", description = "유효하지 않은 회원"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
SuccessResponse<TeamCreateResponse> createTeam(
@Parameter(hidden = true) final Principal principal,
@RequestBody final TeamCreateRequest request
@Parameter(hidden = true) final Principal principal,
@RequestBody final TeamCreateRequest request
);

@Operation(
summary = "전체 팀 조회",
description = "가입한 대학의 전체 팀을 조회한다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(
responseCode = "404",
description = "유효하지 않은 회원",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
summary = "전체 팀 조회",
description = "가입한 대학의 전체 팀을 조회한다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "404", description = "유효하지 않은 회원"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
SuccessResponse<TeamsGetResponse> getAllTeams(
@Parameter(hidden = true) final Principal principal
@Parameter(hidden = true) final Principal principal
);

@Operation(
summary = "카테고리 조회",
description = "카테고리 리스트를 조회한다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
summary = "팀 정보 조회",
description = "특정 팀의 정보를 조회한다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "404", description = "존재하지 않는 팀"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
SuccessResponse<TeamInformGetResponse> getTeamName(
@Parameter(name = "teamId", description = "팀 ID", required = true, in = ParameterIn.PATH)
@PathVariable final long teamId
);

@Operation(
summary = "카테고리 조회",
description = "카테고리 리스트를 조회한다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
SuccessResponse<CategoriesGetResponse> getCategories();

@Operation(
summary = "팀 삭제",
description = "팀을 삭제한다.",
responses = {
@ApiResponse(responseCode = "204", description = "성공"),
@ApiResponse(
responseCode = "404",
description = "유효하지 않은 회원",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
summary = "팀 삭제",
description = "팀을 삭제한다.",
responses = {
@ApiResponse(responseCode = "204", description = "성공"),
@ApiResponse(responseCode = "404", description = "유효하지 않은 회원"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
void deleteTeam(
@Parameter(hidden = true) final Principal principal,
@Parameter(
name = "teamId",
description = "팀 id",
in = ParameterIn.PATH,
required = true,
example = "1"
)
@PathVariable final long teamId
@Parameter(hidden = true) final Principal principal,
@Parameter(name = "teamId", description = "팀 ID", required = true, in = ParameterIn.PATH)
@PathVariable final long teamId
);

@Operation(
summary = "팀 정보 수정",
description = "팀 정보를 수정한다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "403", description = "권한 없음"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
SuccessResponse<?> updateTeamInform(
@Parameter(hidden = true) final Principal principal,
@Parameter(name = "teamId", description = "팀 ID", required = true, in = ParameterIn.PATH)
@PathVariable final long teamId,
@RequestBody final TeamInformUpdateRequest request
);

@Operation(
summary = "관리자 권한 변경",
description = "팀 관리자의 권한을 변경한다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "403", description = "권한 없음"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
SuccessResponse<?> alterAdmin(
@Parameter(hidden = true) final Principal principal,
@Parameter(name = "teamId", description = "팀 ID", required = true, in = ParameterIn.PATH)
@PathVariable final long teamId,
@Parameter(name = "targetId", description = "권한 변경 대상 ID", required = true, in = ParameterIn.PATH)
@PathVariable final long targetId
);

@Operation(
summary = "팀 용량 정보 조회",
description = "팀 용량 정보를 조회한다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(
responseCode = "4xx",
description = "클라이언트(요청) 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class))),
@ApiResponse(
responseCode = "500",
description = "서버 내부 오류",
content = @Content(schema = @Schema(implementation = ErrorResponse.class)))}
summary = "팀 용량 정보 조회",
description = "팀 용량 정보를 조회한다.",
responses = {
@ApiResponse(responseCode = "200", description = "성공"),
@ApiResponse(responseCode = "500", description = "서버 내부 오류")
}
)
SuccessResponse<UsageGetResponse> getCapacityInfo(
@Parameter(hidden = true) final Principal principal,
@Parameter(
name = "teamId",
description = "팀 id",
in = ParameterIn.PATH,
required = true,
example = "1"
)
@PathVariable final long teamId
@Parameter(hidden = true) final Principal principal,
@Parameter(name = "teamId", description = "팀 ID", required = true, in = ParameterIn.PATH)
@PathVariable final long teamId
);
}
}