Skip to content

Commit

Permalink
feat(#59) : swagger에서 null 포함하지 않는 어노테이션 공통적으로 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
j2noo committed May 20, 2024
1 parent d6c3ca4 commit 3e69270
Show file tree
Hide file tree
Showing 18 changed files with 34 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.remind.api.connection.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;

@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(description = "의사/센터가 환자의 관계 요청 응답을 수락하는 응답 객체")
public record AcceptConnectionResponseDto(
@Schema(description = "요청을 수락하며 생긴 커넥션의 아이디")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.remind.api.connection.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;

@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(description = "환자 -> 의사/센터 관계 요청하는 응답 객체")
public record RequestConnectionResponseDto(
@Schema(description = "요청을 보내며 생긴 요청 row의 아이디")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.remind.api.member.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;

@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public record CautionPatientDto(
@Schema(description = "환자 아이디")
Long memberId,
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/com/remind/api/member/dto/PatientDto.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package com.remind.api.member.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;

@Builder
//@AllArgsConstructor
@JsonInclude(JsonInclude.Include.NON_NULL)
public record PatientDto(
@Schema(description = "멤버 아이디")
Long memberId,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.remind.api.member.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.remind.api.member.dto.CautionPatientDto;
import com.remind.api.member.dto.PatientDto;
import io.swagger.v3.oas.annotations.media.Schema;
Expand All @@ -8,6 +9,7 @@
import java.util.List;

@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(description = "주의가 필요한 환자 목록 리스트")
public record CautionPatientsResponseDto(
@Schema(description = "관리중인 환자 목록 리스트")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.remind.api.member.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Getter;

@Getter
@JsonInclude(JsonInclude.Include.NON_NULL)
public class KakaoGetMemberInfoResponse {
@JsonProperty("id")
private Long authId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package com.remind.api.member.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.remind.core.domain.member.enums.RolesType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;

@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public record KakaoLoginResponse(@Schema(description = "Remind의 리프레시 토큰")
String refreshToken,

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.remind.api.member.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.remind.core.domain.member.enums.RolesType;
import lombok.Builder;

@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public record OnboardingResponseDto(Long userId, RolesType rolesType) {
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.remind.api.member.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.remind.api.member.dto.PatientDto;
import com.remind.api.mood.dto.MoodChartDto;
import io.swagger.v3.oas.annotations.media.Schema;
Expand All @@ -8,6 +9,7 @@
import java.util.List;

@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public record PatientsResponseDto(
@Schema(description = "관리중인 환자 목록 리스트")
List<PatientDto> patientDtos,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package com.remind.api.member.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;

@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(description = "토큰 응답 model")
public record TokenResponseDto(
@Schema(description = "access token 유효 기간: 30분")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.remind.api.prescription.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.Column;
import lombok.Builder;

import java.time.LocalDate;

@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(description = "약 복용 정보 업데이트 응답 객체")
public record CreatePrescriptionResponseDto(
Long PrescriptionId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public class TakingMedicineController {
private final TakingMedicineService takingMedicineService;
@Operation(
summary = "memberId(), 날짜로 해당 날짜의 약 복용 정보를 조회하는 api",
description = "memberId(), 날짜로 해당 날짜의 약 복용 정보를 조회하는 api\n 나의 정보를 조회하는 경우에는 memberId = 0 을 넣어주세요"
description = "나의 정보를 조회하는 경우에는 memberId = 0 을 넣어주세요." +
"date는 string으로, YYYY-MM-DD 형식으로 주세요."
)
@GetMapping("/daily")
public ResponseEntity<ApiSuccessResponse<DailyTakingMedicineInfoResponse>> getDailyTakingMedicineInfo(
Expand Down Expand Up @@ -57,7 +58,8 @@ public ResponseEntity<ApiSuccessResponse<MonthlyTakingMedicineInfoResponse>> get

@Operation(
summary = "특정 날짜의 약 복용 정보를 등록하는 api",
description = "특정 날짜의 약 복용 정보를 등록하는 api"
description = "medicineType : BREAKFAST, LUNCH, DINNER, ETC" +
"약을 복용하지 않은 경우 notTakingReason을 비워두거나 빈 문자열"
)
@PostMapping("")
public ResponseEntity<ApiSuccessResponse<CreateTakingMedicineResponse>> createTakingMedicine(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.remind.api.takingMedicine.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.remind.core.domain.takingMedicine.enums.MedicinesType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
Expand All @@ -8,6 +9,7 @@
import java.time.format.DateTimeFormatter;

@Schema(description = "특정 날짜의 약 복용 정보를 반환할 dto")
@JsonInclude(JsonInclude.Include.NON_NULL)
@Builder
public record DailyTakingMedicineDto(
@Schema(description = "해당 약 처방 정보의 식별 id")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.remind.api.takingMedicine.dto;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.remind.core.domain.takingMedicine.enums.MedicinesType;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;
Expand All @@ -8,6 +9,7 @@
import java.time.LocalTime;

@Schema(description = "특정 월에서 일 단위의 약 복용 정보를 반환할 dto")
@JsonInclude(JsonInclude.Include.NON_NULL)
@Builder
public record MonthlyTakingMedicineDto(

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package com.remind.api.takingMedicine.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Builder;

@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
public record CreateTakingMedicineResponse(
String notTakingReason,
Boolean isTaking
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package com.remind.api.takingMedicine.dto.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.remind.api.takingMedicine.dto.DailyTakingMedicineDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Builder;

import java.util.List;

@Builder
@JsonInclude(JsonInclude.Include.NON_NULL)
@Schema(description = "특정 날짜의 약 복용 정보를 반환할 dto list")
public record DailyTakingMedicineInfoResponse(
@Schema(description = "특정 날짜의 약 복용 정보를 반환할 리스트")
Expand Down

This file was deleted.

2 changes: 0 additions & 2 deletions src/main/java/com/remind/core/domain/member/Patient.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.remind.core.domain.member;

import com.remind.api.takingMedicine.dto.response.UpdateTakingMedicineResponseDto;
import jakarta.persistence.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

@Entity
@Getter
Expand Down

0 comments on commit 3e69270

Please sign in to comment.