Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

♻️코드 수정: WebSecurity HttpSecurity 설정 추가 #265

Merged
merged 5 commits into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import lombok.RequiredArgsConstructor;
import lombok.ToString;

import java.time.LocalDateTime;

@Getter
@ToString
@EqualsAndHashCode
Expand All @@ -19,4 +17,8 @@ public class RequestRegisterTemplateVO {

@JsonProperty("campaign_template_contents")
private final String campaignTemplateContents;

@JsonProperty("admin_code")
private final Long adminCode;

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public CampaignTemplateDTO fromRegisterRequestVOToDto(RequestRegisterTemplateVO
return CampaignTemplateDTO.builder()
.campaignTemplateTitle(requestRegisterTemplateVO.getCampaignTemplateTitle())
.campaignTemplateContents(requestRegisterTemplateVO.getCampaignTemplateContents())
.adminCode(requestRegisterTemplateVO.getAdminCode())
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down