Skip to content

Commit

Permalink
Merge pull request #223 from Team-Smeme/sohyeon_#222
Browse files Browse the repository at this point in the history
[ADD] 목표 제목 추가
  • Loading branch information
thguss authored Mar 8, 2024
2 parents 6f48524 + b7dc49c commit d3d85f6
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
@Builder(access = PRIVATE)
public record GoalGetResponse(
String name,
String title,
String way,
String detail
) {

public static GoalGetResponse from(GoalGetServiceResponse response) {
return GoalGetResponse.builder()
.name(response.goalType())
.name(response.goalType().name())
.title(response.goalType().getDescription())
.way(response.way())
.detail(response.detail())
.build();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
package com.smeem.api.goal.service.dto.response;

import com.smeem.domain.goal.model.Goal;
import com.smeem.domain.goal.model.GoalType;
import lombok.Builder;

import static lombok.AccessLevel.PRIVATE;

@Builder(access = PRIVATE)
public record GoalGetServiceResponse(
String goalType,
GoalType goalType,
String way,
String detail
) {

public static GoalGetServiceResponse of(Goal goal) {
return GoalGetServiceResponse.builder()
.goalType(goal.getType().name())
.goalType(goal.getType())
.way(goal.getWay())
.detail(goal.getDetail())
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
public record MemberGetResponse(
String username,
String target,
String title,
String way,
String detail,
String targetLang,
Expand All @@ -21,7 +22,8 @@ public record MemberGetResponse(
public static MemberGetResponse from(MemberGetServiceResponse response) {
return MemberGetResponse.builder()
.username(response.username())
.target(response.target())
.target(response.goalType().name())
.title(response.goalType().getDescription())
.way(response.way())
.detail(response.detail())
.targetLang(response.targetLangType().toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.smeem.api.badge.service.dto.response.BadgeServiceResponse;
import com.smeem.api.goal.service.dto.response.GoalGetServiceResponse;
import com.smeem.domain.goal.model.GoalType;
import com.smeem.domain.member.model.LangType;
import com.smeem.domain.member.model.Member;
import lombok.Builder;
Expand All @@ -12,7 +13,7 @@
@Builder(access = PRIVATE)
public record MemberGetServiceResponse(
String username,
String target,
GoalType goalType,
String way,
String detail,
LangType targetLangType,
Expand All @@ -29,7 +30,7 @@ public static MemberGetServiceResponse of(
) {
return MemberGetServiceResponse.builder()
.username(member.getUsername())
.target(goal.goalType())
.goalType(goal.goalType())
.way(goal.way())
.detail(goal.detail())
.targetLangType(member.getTargetLang())
Expand Down

0 comments on commit d3d85f6

Please sign in to comment.