Skip to content

Commit

Permalink
Feat: GetResponse Main Campaign 신규 회원 등록 API 구현
Browse files Browse the repository at this point in the history
[#45]
  • Loading branch information
MuseopKim committed Jun 27, 2021
1 parent b1b6c41 commit f1c67ab
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/com/careerzip/controller/AdminController.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.careerzip.global.admin.dto.response.AdminArchiveResponse;
import com.careerzip.global.admin.dto.response.AdminArchivesResponse;
import com.careerzip.global.admin.dto.response.CampaignsResponse;
import com.careerzip.global.admin.dto.response.ContactSummary;
import com.careerzip.global.admin.service.AdminService;
import com.careerzip.global.admin.service.NewsLetterService;
import com.careerzip.global.api.ApiResponse;
Expand All @@ -12,6 +13,8 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RequiredArgsConstructor
@RestController
Expand Down Expand Up @@ -39,4 +42,10 @@ public ApiResponse<CampaignsResponse> findAllCampaigns() {
CampaignsResponse campaigns = newsLetterService.findAllCampaigns();
return ApiResponse.success(campaigns);
}

@PostMapping("/news-letter/campaigns/main/contacts")
public ApiResponse<List<ContactSummary>> addContactsToMainCampaign() {
List<ContactSummary> contacts = newsLetterService.addContactsToMainCampaign();
return ApiResponse.success(contacts);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ protected void configure(HttpSecurity http) throws Exception {
.antMatchers("/admin/login").permitAll()
// 원활한 GetResponse API 연동 테스트를 위해 잠시 권한을 오픈 합니다.
.antMatchers("/admin/news-letter/campaigns").permitAll()
.antMatchers("/admin/news-letter/campaigns/main/contacts").permitAll()
.antMatchers("/admin/**").hasRole(ADMIN.name())
.anyRequest().authenticated();

Expand Down

0 comments on commit f1c67ab

Please sign in to comment.