diff --git a/LearnsMate/src/main/java/intbyte4/learnsmate/campaign_template/domain/vo/request/RequestRegisterTemplateVO.java b/LearnsMate/src/main/java/intbyte4/learnsmate/campaign_template/domain/vo/request/RequestRegisterTemplateVO.java index 89a1b79c..9f99db26 100644 --- a/LearnsMate/src/main/java/intbyte4/learnsmate/campaign_template/domain/vo/request/RequestRegisterTemplateVO.java +++ b/LearnsMate/src/main/java/intbyte4/learnsmate/campaign_template/domain/vo/request/RequestRegisterTemplateVO.java @@ -6,8 +6,6 @@ import lombok.RequiredArgsConstructor; import lombok.ToString; -import java.time.LocalDateTime; - @Getter @ToString @EqualsAndHashCode @@ -19,4 +17,8 @@ public class RequestRegisterTemplateVO { @JsonProperty("campaign_template_contents") private final String campaignTemplateContents; + + @JsonProperty("admin_code") + private final Long adminCode; + } diff --git a/LearnsMate/src/main/java/intbyte4/learnsmate/campaign_template/mapper/CampaignTemplateMapper.java b/LearnsMate/src/main/java/intbyte4/learnsmate/campaign_template/mapper/CampaignTemplateMapper.java index 9d5597c8..ea4d4f6a 100644 --- a/LearnsMate/src/main/java/intbyte4/learnsmate/campaign_template/mapper/CampaignTemplateMapper.java +++ b/LearnsMate/src/main/java/intbyte4/learnsmate/campaign_template/mapper/CampaignTemplateMapper.java @@ -36,6 +36,7 @@ public CampaignTemplateDTO fromRegisterRequestVOToDto(RequestRegisterTemplateVO return CampaignTemplateDTO.builder() .campaignTemplateTitle(requestRegisterTemplateVO.getCampaignTemplateTitle()) .campaignTemplateContents(requestRegisterTemplateVO.getCampaignTemplateContents()) + .adminCode(requestRegisterTemplateVO.getAdminCode()) .build(); } diff --git a/LearnsMate/src/main/java/intbyte4/learnsmate/campaign_template/service/CampaignTemplateServiceImpl.java b/LearnsMate/src/main/java/intbyte4/learnsmate/campaign_template/service/CampaignTemplateServiceImpl.java index 2e9d0348..2ffcfc9f 100644 --- a/LearnsMate/src/main/java/intbyte4/learnsmate/campaign_template/service/CampaignTemplateServiceImpl.java +++ b/LearnsMate/src/main/java/intbyte4/learnsmate/campaign_template/service/CampaignTemplateServiceImpl.java @@ -99,10 +99,11 @@ public FindCampaignTemplateDTO findByTemplateCode(Long campaignTemplateCode) { private CampaignTemplate convertToCampaignTemplate(CampaignTemplateDTO campaignTemplateDTO, AdminDTO adminDTO) { Admin user = adminMapper.toEntity(adminDTO); + campaignTemplateDTO.setCampaignTemplateCode(null); campaignTemplateDTO.setCampaignTemplateFlag(true); campaignTemplateDTO.setCreatedAt(LocalDateTime.now()); campaignTemplateDTO.setUpdatedAt(LocalDateTime.now()); - + campaignTemplateDTO.setAdminCode(adminDTO.getAdminCode()); return campaignTemplateMapper.toEntity(campaignTemplateDTO, user); } diff --git a/LearnsMate/src/main/java/intbyte4/learnsmate/security/WebSecurity.java b/LearnsMate/src/main/java/intbyte4/learnsmate/security/WebSecurity.java index 22c60ed2..67d8794c 100644 --- a/LearnsMate/src/main/java/intbyte4/learnsmate/security/WebSecurity.java +++ b/LearnsMate/src/main/java/intbyte4/learnsmate/security/WebSecurity.java @@ -86,6 +86,7 @@ protected SecurityFilterChain configure(HttpSecurity http) throws Exception { .requestMatchers(new AntPathRequestMatcher("/campaign/**", "DELETE")).permitAll() .requestMatchers(new AntPathRequestMatcher("/campaign-template/**", "GET")).permitAll() .requestMatchers(new AntPathRequestMatcher("/campaign-template/**", "PATCH")).permitAll() + .requestMatchers(new AntPathRequestMatcher("/campaign-template/**", "POST")).permitAll() .requestMatchers(new AntPathRequestMatcher("/coupon/**", "GET")).permitAll() .requestMatchers(new AntPathRequestMatcher("/coupon/**", "POST")).permitAll() .requestMatchers(new AntPathRequestMatcher("/member/**", "POST")).permitAll()