-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: Main Camapaign Contact 등록 요청 DTO 구현
[#45]
- Loading branch information
Showing
3 changed files
with
88 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/main/java/com/careerzip/global/admin/dto/response/ContactSummary.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.careerzip.global.admin.dto.response; | ||
|
||
import com.careerzip.domain.account.entity.Account; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
public class ContactSummary { | ||
|
||
private final String name; | ||
private final String email; | ||
|
||
@Builder | ||
private ContactSummary(String name, String email) { | ||
this.name = name; | ||
this.email = email; | ||
} | ||
|
||
public static ContactSummary from(Account account) { | ||
return ContactSummary.builder() | ||
.name(account.getName()) | ||
.email(account.getEmail()) | ||
.build(); | ||
} | ||
|
||
public static List<ContactSummary> listOf(List<Account> accounts) { | ||
return accounts.stream() | ||
.map(ContactSummary::from) | ||
.collect(Collectors.toList()); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/com/careerzip/global/newsletter/dto/request/CampaignRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package com.careerzip.global.newsletter.dto.request; | ||
|
||
import lombok.Getter; | ||
|
||
@Getter | ||
public class CampaignRequest { | ||
|
||
private final String campaignId; | ||
|
||
private CampaignRequest(String campaignId) { | ||
this.campaignId = campaignId; | ||
} | ||
|
||
public static CampaignRequest from(String campaignId) { | ||
return new CampaignRequest(campaignId); | ||
} | ||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/com/careerzip/global/newsletter/dto/request/ContactRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.careerzip.global.newsletter.dto.request; | ||
|
||
import com.careerzip.domain.account.entity.Account; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@Getter | ||
public class ContactRequest { | ||
|
||
private final CampaignRequest campaign; | ||
private final String name; | ||
private final String email; | ||
|
||
@Builder | ||
private ContactRequest(CampaignRequest campaign, String name, String email) { | ||
this.campaign = campaign; | ||
this.name = name; | ||
this.email = email; | ||
} | ||
|
||
public static ContactRequest from(Account account) { | ||
return ContactRequest.builder() | ||
.campaign(CampaignRequest.from("zKaDh")) | ||
.name(account.getName()) | ||
.email(account.getEmail()) | ||
.build(); | ||
} | ||
|
||
public static List<ContactRequest> listOf(List<Account> accounts) { | ||
return accounts.stream() | ||
.map(ContactRequest::from) | ||
.collect(Collectors.toList()); | ||
} | ||
} |