Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e205ee1
feature: add merge tus file (#237)
rappire May 9, 2025
8b89cd7
feat: :sparkles: add counsel session status filters (#239)
jawsbaek May 10, 2025
60baa97
refactor: :recycle: refactor CounseleeConsentService to accept sessioโ€ฆ
jawsbaek May 11, 2025
5136fa3
refactor: :recycle: refactor counselsessionid
jawsbaek May 11, 2025
fc7c083
refactor: :recycle: refactor tus service (#241)
jawsbaek May 15, 2025
290fd08
fix: :bug: fix tus content type bug (#245)
jawsbaek May 23, 2025
636581b
refactor: :recycle: refactor UpdateCounseleeReq (#244)
jawsbaek May 23, 2025
7ce052f
refactor: :recycle: update counselor information handling in CounselSโ€ฆ
rappire May 23, 2025
df2b4e5
refactor: update Counselor and SelectCounselSessionRes for improved sโ€ฆ
rappire May 23, 2025
4efaed9
refactor: :bug: delete files when error happend on merging (#246)
jawsbaek May 23, 2025
20d7610
fix: :loud_sound: add log for tusService (#248)
jawsbaek May 23, 2025
fb28df3
refactor: :recycle: refactor fileid to counselsession id (#249)
jawsbaek May 23, 2025
dfe1afb
fix: :bug: declare entitymanger.flush (#250)
jawsbaek May 23, 2025
a549468
refactor: :recycle: refactor tus update status (#251)
jawsbaek May 23, 2025
d2bd99c
feat: :sparkles: ์ด์ „ ์ƒ๋‹ด ๋‚ด์—ญ ์ƒ์„ธ ์กฐํšŒ API ์ถ”๊ฐ€ ๋ฐ ์„œ๋น„์Šค ๋กœ์ง ๊ตฌํ˜„ (#254)
jawsbaek May 31, 2025
d35af34
fix :revert tus change (#255)
rappire May 31, 2025
543b1ae
feat: renew consult counsel card (#257)
rappire May 31, 2025
56f3269
feat: remove useless TestDataInitializer (#258)
rappire Jun 5, 2025
44324ad
feat: add session record and use tus in stt (#256)
rappire Jun 8, 2025
0108de2
feat: NoContentException ํด๋ž˜์Šค ๊ฐœ์„  ๋ฐ AI ์‘๋‹ต ํŒŒ์‹ฑ ์œ ํ‹ธ๋ฆฌํ‹ฐ ํด๋ž˜์Šค ์ถ”๊ฐ€ (#259)
jawsbaek Jun 8, 2025
96754f1
feat: ๋‚ด ์ •๋ณด ์—…๋ฐ์ดํŠธ ๋ฐ ๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ ๊ธฐ๋Šฅ ์ถ”๊ฐ€ (#261)
jawsbaek Jun 8, 2025
b34c5c5
refactor: ์ƒ๋‹ด์‚ฌ ์ •๋ณด ์—…๋ฐ์ดํŠธ ๋กœ์ง ๊ฐ„์†Œํ™” ๋ฐ Keycloak ์‚ฌ์šฉ์ž ์‚ญ์ œ ๋กœ์ง ๊ฐœ์„  (#262)
jawsbaek Jun 8, 2025
2be2105
refactor: ํฌ๋ก ์žก์—์„œ ์ง„ํ–‰ ์ƒํƒœ ์ƒ๋‹ด ์„ธ์…˜๋„ ์ทจ์†Œ ์ฒ˜๋ฆฌํ•˜๋„๋ก ๋ณ€๊ฒฝ (#263)
jawsbaek Jun 8, 2025
339646c
refactor: ChangePasswordReq ํด๋ž˜์Šค์—์„œ ํ˜„์žฌ ๋น„๋ฐ€๋ฒˆํ˜ธ ํ•„๋“œ ์ œ๊ฑฐ (#264)
jawsbaek Jun 16, 2025
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

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public CorsConfigurationSource corsConfigurationSource() {
configuration.setAllowCredentials(true);
configuration.setExposedHeaders(
List.of("Authorization", "Access-Token", "Uid", "Refresh-Token", "Access-Control-Expose-Headers",
"Upload-Offset, Location, Upload-Length, Tus-Version, Tus-Resumable, Tus-Max-Size, Tus-Extension, Upload-Metadata"));
"Upload-Offset", "Location", "Upload-Length", "Tus-Version", "Tus-Resumable", "Tus-Max-Size",
"Tus-Extension", "Upload-Metadata"));
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
source.registerCorsConfiguration("/**", configuration);
return source;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,26 @@

import com.springboot.api.common.message.ExceptionMessages;

/**
* ์ฝ˜ํ…์ธ ๊ฐ€ ์—†์„ ๋•Œ ๋ฐœ์ƒํ•˜๋Š” ์˜ˆ์™ธ
* ์ŠคํƒํŠธ๋ ˆ์ด์Šค๋ฅผ ์ƒ์„ฑํ•˜์ง€ ์•Š์•„ ์„ฑ๋Šฅ์„ ์ตœ์ ํ™”ํ•˜๊ณ  ์ •ํ™•ํ•œ ์ •๋ณด๋งŒ ์ „๋‹ฌํ•ฉ๋‹ˆ๋‹ค.
*/
public class NoContentException extends RuntimeException {

public NoContentException() {
super(ExceptionMessages.NO_CONTENT);
super(ExceptionMessages.NO_CONTENT, null, false, false);
}

public NoContentException(String message) {
super(message);
super(message, null, false, false);
}

/**
* ์›์ธ๊ณผ ํ•จ๊ป˜ ์˜ˆ์™ธ๋ฅผ ์ƒ์„ฑํ•˜๋Š” ์ƒ์„ฑ์ž
* @param message ์˜ˆ์™ธ ๋ฉ”์‹œ์ง€
* @param cause ์›์ธ ์˜ˆ์™ธ
*/
public NoContentException(String message, Throwable cause) {
super(message, cause, false, false);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
package com.springboot.api.common.util;

import java.util.Optional;

import org.springframework.stereotype.Component;

import com.fasterxml.jackson.databind.JsonNode;
import com.springboot.api.common.exception.NoContentException;

import lombok.extern.slf4j.Slf4j;

/**
* AI ์‘๋‹ต ํŒŒ์‹ฑ์„ ์œ„ํ•œ ์œ ํ‹ธ๋ฆฌํ‹ฐ ํด๋ž˜์Šค
* ChatResponse JSON ๊ตฌ์กฐ์—์„œ ์•ˆ์ „ํ•˜๊ฒŒ ๋ฐ์ดํ„ฐ๋ฅผ ์ถ”์ถœํ•ฉ๋‹ˆ๋‹ค.
*/
@Component
@Slf4j
public class AiResponseParseUtil {

private static final String RESULT_PATH = "result";
private static final String OUTPUT_PATH = "output";
private static final String TEXT_PATH = "text";

/**
* ChatResponse JsonNode์—์„œ ๋ถ„์„๋œ ํ…์ŠคํŠธ๋ฅผ ์•ˆ์ „ํ•˜๊ฒŒ ์ถ”์ถœํ•ฉ๋‹ˆ๋‹ค.
*
* @param taResult ChatResponse๊ฐ€ JSON์œผ๋กœ ๋ณ€ํ™˜๋œ JsonNode
* @return ๋ถ„์„๋œ ํ…์ŠคํŠธ
* @throws NoContentException taResult๊ฐ€ null์ด๊ฑฐ๋‚˜ ํ…์ŠคํŠธ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†๋Š” ๊ฒฝ์šฐ
*/
public String extractAnalysedText(JsonNode taResult) {
if (taResult == null || taResult.isNull()) {
log.warn("taResult is null or empty");
throw new NoContentException();
}

return Optional.ofNullable(taResult.get(RESULT_PATH))
.map(result -> result.get(OUTPUT_PATH))
.map(output -> output.get(TEXT_PATH))
.filter(text -> !text.isNull())
.map(JsonNode::asText)
.filter(text -> !text.trim().isEmpty())
.orElseThrow(() -> {
log.warn("Failed to extract text from taResult: missing result.output.text path");
return new NoContentException();
});
}

/**
* ChatResponse JsonNode์—์„œ ๋ถ„์„๋œ ํ…์ŠคํŠธ๋ฅผ ์•ˆ์ „ํ•˜๊ฒŒ ์ถ”์ถœํ•ฉ๋‹ˆ๋‹ค. (Optional ๋ฐ˜ํ™˜)
*
* @param taResult ChatResponse๊ฐ€ JSON์œผ๋กœ ๋ณ€ํ™˜๋œ JsonNode
* @return ๋ถ„์„๋œ ํ…์ŠคํŠธ Optional
*/
public Optional<String> extractAnalysedTextSafely(JsonNode taResult) {
try {
return Optional.of(extractAnalysedText(taResult));
} catch (NoContentException e) {
log.debug("Could not extract analysed text from taResult", e);
return Optional.empty();
}
}

/**
* JsonNode๊ฐ€ ์œ ํšจํ•œ AI ๋ถ„์„ ๊ฒฐ๊ณผ์ธ์ง€ ๊ฒ€์ฆํ•ฉ๋‹ˆ๋‹ค.
*
* @param taResult ๊ฒ€์ฆํ•  JsonNode
* @return ์œ ํšจํ•œ AI ๋ถ„์„ ๊ฒฐ๊ณผ์ธ์ง€ ์—ฌ๋ถ€
*/
public boolean isValidAiResponse(JsonNode taResult) {
if (taResult == null || taResult.isNull()) {
return false;
}

JsonNode result = taResult.get(RESULT_PATH);
if (result == null || result.isNull()) {
return false;
}

JsonNode output = result.get(OUTPUT_PATH);
if (output == null || output.isNull()) {
return false;
}

JsonNode text = output.get(TEXT_PATH);
return text != null && !text.isNull() && !text.asText().trim().isEmpty();
}
}
24 changes: 24 additions & 0 deletions src/main/java/com/springboot/api/common/util/FileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import jakarta.validation.constraints.NotNull;
import java.io.File;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.net.MalformedURLException;
import java.nio.file.Files;
import java.nio.file.Path;
Expand All @@ -14,6 +15,7 @@
import lombok.RequiredArgsConstructor;
import net.bramp.ffmpeg.FFmpeg;
import net.bramp.ffmpeg.builder.FFmpegBuilder;
import org.apache.commons.io.FileUtils;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.Resource;
import org.springframework.core.io.UrlResource;
Expand Down Expand Up @@ -121,4 +123,26 @@ public Resource getUrlResource(Path path) {
throw new RuntimeException("์ž˜๋ชป๋œ ํŒŒ์ผ ๊ฒฝ๋กœ: " + path, e);
}
}

public void deleteDirectory(String directoryPath) {
File directory = new File(directoryPath);

if (!directory.exists()) {
log.warn("์‚ญ์ œ ์‹œ๋„ํ•œ ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค: {}", directoryPath);
return;
}

if (!directory.isDirectory()) {
throw new IllegalArgumentException("๊ฒฝ๋กœ๊ฐ€ ๋””๋ ‰ํ† ๋ฆฌ๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค: " + directoryPath);
}

try {
FileUtils.cleanDirectory(directory);
if (!directory.delete()) {
throw new IOException("๋””๋ ‰ํ† ๋ฆฌ ์‚ญ์ œ ์‹คํŒจ: " + directoryPath);
}
} catch (IOException e) {
throw new UncheckedIOException("๋””๋ ‰ํ† ๋ฆฌ ์‚ญ์ œ ์ค‘ ์˜ค๋ฅ˜ ๋ฐœ์ƒ", e);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
package com.springboot.api.counselcard.controller;

import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import com.springboot.api.common.annotation.ApiController;
import com.springboot.api.common.annotation.RoleSecured;
import com.springboot.api.common.annotation.ValidEnum;
Expand All @@ -19,6 +11,10 @@
import com.springboot.api.counselcard.dto.response.CounselCardIdRes;
import com.springboot.api.counselcard.dto.response.CounselCardIndependentLifeInformationRes;
import com.springboot.api.counselcard.dto.response.CounselCardLivingInformationRes;
import com.springboot.api.counselcard.dto.response.MainCounselBaseInformationRes;
import com.springboot.api.counselcard.dto.response.MainCounselHealthInformationRes;
import com.springboot.api.counselcard.dto.response.MainCounselIndependentLifeInformationRes;
import com.springboot.api.counselcard.dto.response.MainCounselLivingInformationRes;
import com.springboot.api.counselcard.dto.response.TimeRecordedRes;
import com.springboot.api.counselcard.service.CounselCardService;
import com.springboot.enums.CounselCardRecordType;
Expand All @@ -27,7 +23,15 @@
import jakarta.validation.Valid;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import java.util.List;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@ApiController(path = "/v1/counsel/card", name = "CounselCardController", description = "์ƒ๋‹ด์นด๋“œ ๊ด€๋ จ API๋ฅผ ์ œ๊ณตํ•˜๋Š” Controller")
@RequiredArgsConstructor
Expand All @@ -37,7 +41,7 @@ public class CounselCardController {
private final CounselCardService counselCardService;

@GetMapping("/{counselSessionId}/base-information")
@Operation(summary = "์ƒ๋‹ด ์นด๋“œ ๊ธฐ๋ณธ ์ •๋ณด ์กฐํšŒ", tags = {"์ƒ๋‹ด ์นด๋“œ ์ž‘์„ฑ", "๋ณธ์ƒ๋‹ด - ์ƒ๋‹ด ์นด๋“œ"})
@Operation(summary = "๊ธฐ์ดˆ ์„ค๋ฌธ์šฉ ์ƒ๋‹ด ์นด๋“œ ๊ธฐ๋ณธ ์ •๋ณด ์กฐํšŒ", tags = {"์ƒ๋‹ด ์นด๋“œ ์ž‘์„ฑ"})
@RoleSecured({RoleType.ROLE_ASSISTANT, RoleType.ROLE_ADMIN, RoleType.ROLE_USER})
ResponseEntity<CommonRes<CounselCardBaseInformationRes>> selectCounselCardBaseInformation(
@PathVariable @NotBlank(message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” ํ•„์ˆ˜ ์ž…๋ ฅ๊ฐ’์ž…๋‹ˆ๋‹ค") @Size(min = 26, max = 26, message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” 26์ž์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค") String counselSessionId) {
Expand All @@ -46,7 +50,7 @@ ResponseEntity<CommonRes<CounselCardBaseInformationRes>> selectCounselCardBaseIn
}

@GetMapping("/{counselSessionId}/health-information")
@Operation(summary = "์ƒ๋‹ด ์นด๋“œ ๊ฑด๊ฐ• ์ •๋ณด ์กฐํšŒ", tags = {"์ƒ๋‹ด ์นด๋“œ ์ž‘์„ฑ", "๋ณธ์ƒ๋‹ด - ์ƒ๋‹ด ์นด๋“œ"})
@Operation(summary = "๊ธฐ์ดˆ ์„ค๋ฌธ์šฉ ์ƒ๋‹ด ์นด๋“œ ๊ฑด๊ฐ• ์ •๋ณด ์กฐํšŒ", tags = {"์ƒ๋‹ด ์นด๋“œ ์ž‘์„ฑ"})
@RoleSecured({RoleType.ROLE_ASSISTANT, RoleType.ROLE_ADMIN, RoleType.ROLE_USER})
ResponseEntity<CommonRes<CounselCardHealthInformationRes>> selectCounselCardHealthInformation(
@PathVariable @NotBlank(message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” ํ•„์ˆ˜ ์ž…๋ ฅ๊ฐ’์ž…๋‹ˆ๋‹ค") @Size(min = 26, max = 26, message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” 26์ž์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค") String counselSessionId) {
Expand All @@ -55,7 +59,7 @@ ResponseEntity<CommonRes<CounselCardHealthInformationRes>> selectCounselCardHeal
}

@GetMapping("/{counselSessionId}/living-information")
@Operation(summary = "์ƒ๋‹ด ์นด๋“œ ์ƒํ™œ ์ •๋ณด ์กฐํšŒ", tags = {"์ƒ๋‹ด ์นด๋“œ ์ž‘์„ฑ", "๋ณธ์ƒ๋‹ด - ์ƒ๋‹ด ์นด๋“œ"})
@Operation(summary = "๊ธฐ์ดˆ ์„ค๋ฌธ์šฉ ์ƒ๋‹ด ์นด๋“œ ์ƒํ™œ ์ •๋ณด ์กฐํšŒ", tags = {"์ƒ๋‹ด ์นด๋“œ ์ž‘์„ฑ"})
@RoleSecured({RoleType.ROLE_ASSISTANT, RoleType.ROLE_ADMIN, RoleType.ROLE_USER})
ResponseEntity<CommonRes<CounselCardLivingInformationRes>> selectCounselCardLivingInformation(
@PathVariable @NotBlank(message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” ํ•„์ˆ˜ ์ž…๋ ฅ๊ฐ’์ž…๋‹ˆ๋‹ค") @Size(min = 26, max = 26, message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” 26์ž์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค") String counselSessionId) {
Expand All @@ -64,7 +68,7 @@ ResponseEntity<CommonRes<CounselCardLivingInformationRes>> selectCounselCardLivi
}

@GetMapping("/{counselSessionId}/independent-information")
@Operation(summary = "์ƒ๋‹ด ์นด๋“œ ์ž๋ฆฝ์ƒํ™œ ์—ญ๋Ÿ‰ ์กฐํšŒ", tags = {"์ƒ๋‹ด ์นด๋“œ ์ž‘์„ฑ", "๋ณธ์ƒ๋‹ด - ์ƒ๋‹ด ์นด๋“œ"})
@Operation(summary = "๊ธฐ์ดˆ ์„ค๋ฌธ์šฉ ์ƒ๋‹ด ์นด๋“œ ์ž๋ฆฝ์ƒํ™œ ์—ญ๋Ÿ‰ ์กฐํšŒ", tags = {"์ƒ๋‹ด ์นด๋“œ ์ž‘์„ฑ"})
@RoleSecured({RoleType.ROLE_ASSISTANT, RoleType.ROLE_ADMIN, RoleType.ROLE_USER})
ResponseEntity<CommonRes<CounselCardIndependentLifeInformationRes>> selectCounselCardIndependentLifeInformation(
@PathVariable @NotBlank(message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” ํ•„์ˆ˜ ์ž…๋ ฅ๊ฐ’์ž…๋‹ˆ๋‹ค") @Size(min = 26, max = 26, message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” 26์ž์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค") String counselSessionId) {
Expand Down Expand Up @@ -106,6 +110,7 @@ ResponseEntity<CommonRes<CounselCardIdRes>> deleteCounselCard(
new CommonRes<>(counselCardService.deleteCounselCard(counselSessionId)));
}

@Deprecated
@GetMapping("/{counselSessionId}/previous/item/list")
@Operation(summary = "์ด์ „ ์ƒ๋‹ด ์นด๋“œ item ๋ชฉ๋ก ์กฐํšŒ", tags = {"๋ณธ์ƒ๋‹ด - ์ƒ๋‹ด ์นด๋“œ"})
@RoleSecured({RoleType.ROLE_ASSISTANT, RoleType.ROLE_ADMIN, RoleType.ROLE_USER})
Expand All @@ -117,4 +122,45 @@ ResponseEntity<CommonRes<List<TimeRecordedRes<Object>>>> selectPreviousItemListB
new CommonRes<>(
counselCardService.selectPreviousRecordsByType(counselSessionId, type)));
}

@GetMapping("/main-counsel/{counselSessionId}/base-information")
@Operation(summary = "๋ณธ ์ƒ๋‹ด์šฉ ์ƒ๋‹ด ์นด๋“œ ๊ธฐ๋ณธ ์ •๋ณด ์กฐํšŒ", tags = {"๋ณธ์ƒ๋‹ด - ๊ธฐ์ดˆ ์„ค๋ฌธ"})
@RoleSecured({RoleType.ROLE_ASSISTANT, RoleType.ROLE_ADMIN, RoleType.ROLE_USER})
ResponseEntity<CommonRes<MainCounselBaseInformationRes>> selectMainCounselBaseInformation(
@PathVariable @NotBlank(message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” ํ•„์ˆ˜ ์ž…๋ ฅ๊ฐ’์ž…๋‹ˆ๋‹ค") @Size(min = 26, max = 26, message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” 26์ž์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค") String counselSessionId) {

MainCounselBaseInformationRes mainCounselBaseInformationRes = counselCardService.selectMainCounselBaseInformation(
counselSessionId);

return ResponseEntity.ok(
new CommonRes<>(mainCounselBaseInformationRes));
}

@GetMapping("/main-counsel/{counselSessionId}/health-information")
@Operation(summary = "๋ณธ ์ƒ๋‹ด์šฉ ์ƒ๋‹ด ์นด๋“œ ๊ฑด๊ฐ• ์ •๋ณด ์กฐํšŒ", tags = {"๋ณธ์ƒ๋‹ด - ๊ธฐ์ดˆ ์„ค๋ฌธ"})
@RoleSecured({RoleType.ROLE_ASSISTANT, RoleType.ROLE_ADMIN, RoleType.ROLE_USER})
ResponseEntity<CommonRes<MainCounselHealthInformationRes>> selectMainCounselHealthInformation(
@PathVariable @NotBlank(message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” ํ•„์ˆ˜ ์ž…๋ ฅ๊ฐ’์ž…๋‹ˆ๋‹ค") @Size(min = 26, max = 26, message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” 26์ž์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค") String counselSessionId) {
return ResponseEntity.ok(
new CommonRes<>(counselCardService.selectMainCounselHealthInformation(counselSessionId)));
}

@GetMapping("/main-counsel/{counselSessionId}/living-information")
@Operation(summary = "๋ณธ ์ƒ๋‹ด์šฉ ์ƒ๋‹ด ์นด๋“œ ์ƒํ™œ ์ •๋ณด ์กฐํšŒ", tags = {"๋ณธ์ƒ๋‹ด - ๊ธฐ์ดˆ ์„ค๋ฌธ"})
@RoleSecured({RoleType.ROLE_ASSISTANT, RoleType.ROLE_ADMIN, RoleType.ROLE_USER})
ResponseEntity<CommonRes<MainCounselLivingInformationRes>> selectMainCounselLivingInformation(
@PathVariable @NotBlank(message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” ํ•„์ˆ˜ ์ž…๋ ฅ๊ฐ’์ž…๋‹ˆ๋‹ค") @Size(min = 26, max = 26, message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” 26์ž์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค") String counselSessionId) {
return ResponseEntity.ok(
new CommonRes<>(counselCardService.selectMainCounselLivingInformation(counselSessionId)));
}

@GetMapping("/main-counsel/{counselSessionId}/independent-information")
@Operation(summary = "๋ณธ ์ƒ๋‹ด์šฉ ์ƒ๋‹ด ์นด๋“œ ์ž๋ฆฝ์ƒํ™œ ์—ญ๋Ÿ‰ ์กฐํšŒ", tags = {"๋ณธ์ƒ๋‹ด - ๊ธฐ์ดˆ ์„ค๋ฌธ"})
@RoleSecured({RoleType.ROLE_ASSISTANT, RoleType.ROLE_ADMIN, RoleType.ROLE_USER})
ResponseEntity<CommonRes<MainCounselIndependentLifeInformationRes>> selectMainCounselIndependentLifeInformation(
@PathVariable @NotBlank(message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” ํ•„์ˆ˜ ์ž…๋ ฅ๊ฐ’์ž…๋‹ˆ๋‹ค") @Size(min = 26, max = 26, message = "์ƒ๋‹ด ์„ธ์…˜ ID๋Š” 26์ž์—ฌ์•ผ ํ•ฉ๋‹ˆ๋‹ค") String counselSessionId) {
return ResponseEntity.ok(
new CommonRes<>(
counselCardService.selectMainCounselIndependentLifeInformation(counselSessionId)));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.springboot.api.counselcard.dto.response;

import com.springboot.enums.CounselPurposeType;
import java.util.List;

public record MainCounselBaseInformationRes(
MainCounselRecord<List<CounselPurposeType>> counselPurpose,
MainCounselRecord<String> significantNote,
MainCounselRecord<String> medicationNote
) {

}


Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.springboot.api.counselcard.dto.response;

import com.springboot.api.counselcard.dto.information.health.AllergyDTO;
import com.springboot.api.counselcard.dto.information.health.MedicationSideEffectDTO;
import com.springboot.enums.DiseaseType;
import java.util.List;

public record MainCounselHealthInformationRes(
MainCounselRecord<List<DiseaseType>> diseases,
MainCounselRecord<String> historyNote,
MainCounselRecord<String> mainInconvenienceNote,
MainCounselRecord<MedicationSideEffectDTO> medicationSideEffect,
MainCounselRecord<AllergyDTO> allergy
) {

}


Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.springboot.api.counselcard.dto.response;

import com.springboot.api.counselcard.dto.information.independentlife.CommunicationDTO;
import com.springboot.api.counselcard.dto.information.independentlife.EvacuationDTO;
import com.springboot.api.counselcard.dto.information.independentlife.WalkingDTO;

public record MainCounselIndependentLifeInformationRes(
MainCounselRecord<CommunicationDTO> communication,
MainCounselRecord<EvacuationDTO> evacuation,
MainCounselRecord<WalkingDTO> walking
) {

}


Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.springboot.api.counselcard.dto.response;

import com.springboot.api.counselcard.dto.information.living.ExerciseDTO;
import com.springboot.api.counselcard.dto.information.living.MedicationManagementDTO;
import com.springboot.api.counselcard.dto.information.living.NutritionDTO;
import com.springboot.api.counselcard.dto.information.living.SmokingDTO;
import com.springboot.enums.DrinkingAmount;

public record MainCounselLivingInformationRes(
MainCounselRecord<SmokingDTO> smoking,
MainCounselRecord<DrinkingAmount> drinkingAmount,
MainCounselRecord<ExerciseDTO> exercise,
MainCounselRecord<MedicationManagementDTO> medicationManagement,
MainCounselRecord<NutritionDTO> nutrition
) {

}


Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.springboot.api.counselcard.dto.response;

import java.util.List;

public record MainCounselRecord<T>(
T currentState,
List<TimeRecordedRes<T>> history
) {

}


Loading
Loading