Skip to content

Commit

Permalink
πŸš€ :: Api-v0.1.0-1
Browse files Browse the repository at this point in the history
πŸš€ :: Api-v0.1.0-1
  • Loading branch information
ImNM authored Feb 2, 2023
2 parents 96c2169 + 8274a5a commit b9d416e
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
@SecurityRequirement(name = "access-token")
@Tag(name = "응원톑 컨트둀러")
@RestController
@RequestMapping("/v1/event/{eventId}/comments")
@RequestMapping("/v1/events/{eventId}/comments")
@RequiredArgsConstructor
public class CommentController {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package band.gosrock.api.config;


import javax.servlet.Filter;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.security.web.context.AbstractSecurityWebApplicationInitializer;
import org.springframework.web.filter.ForwardedHeaderFilter;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@RequiredArgsConstructor
@Profile({"prod", "staging"})
public class ServletFilterConfig implements WebMvcConfigurer {

private final HttpContentCacheFilter httpContentCacheFilter;
private final ForwardedHeaderFilter forwardedHeaderFilter;

@Bean
public FilterRegistrationBean securityFilterChain(
@Qualifier(AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME)
Filter securityFilter) {
FilterRegistrationBean registration = new FilterRegistrationBean(securityFilter);
registration.setOrder(Integer.MAX_VALUE - 2);
registration.setName(AbstractSecurityWebApplicationInitializer.DEFAULT_FILTER_NAME);
return registration;
}

@Bean
public FilterRegistrationBean setForwardedHeaderFilterOrder() {
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(forwardedHeaderFilter);
registrationBean.setOrder(Integer.MAX_VALUE - 1);
return registrationBean;
}

@Bean
public FilterRegistrationBean setHttpContentCacheFilterOrder() {
FilterRegistrationBean registrationBean = new FilterRegistrationBean();
registrationBean.setFilter(httpContentCacheFilter);
registrationBean.setOrder(Integer.MAX_VALUE);
return registrationBean;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
@SecurityRequirement(name = "access-token")
@Tag(name = "λ°œκΈ‰ ν‹°μΌ“ κ΄€λ ¨ μ–΄λ“œλ―Ό 컨트둀러")
@RestController
@RequestMapping("/v1/event/{eventId}/issuedTickets")
@RequestMapping("/v1/events/{eventId}/issuedTickets")
@RequiredArgsConstructor
public class AdminIssuedTicketController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@SecurityRequirement(name = "access-token")
@Tag(name = "ν‹°μΌ“ μƒν’ˆ κ΄€λ ¨ 컨트둀러")
@RestController
@RequestMapping("/v1/event/{eventId}/ticketItems")
@RequestMapping("/v1/events/{eventId}/ticketItems")
@RequiredArgsConstructor
public class TicketItemController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
@SecurityRequirement(name = "access-token")
@Tag(name = "ν‹°μΌ“μƒν’ˆ μ˜΅μ…˜ κ΄€λ ¨ 컨트둀러")
@RestController
@RequestMapping("/v1/event/{eventId}/ticketOptions")
@RequestMapping("/v1/events/{eventId}/ticketOptions")
@RequiredArgsConstructor
public class TicketOptionController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@


import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

Expand All @@ -16,7 +17,7 @@ public enum HostRole {
GUEST("GUEST", "게슀트");

private final String name;
private final String value;
@JsonValue private final String value;

// Enum Validation 을 μœ„ν•œ μ½”λ“œ, enum 에 μ†ν•˜μ§€ μ•ŠμœΌλ©΄ null 리턴
@JsonCreator
Expand Down

0 comments on commit b9d416e

Please sign in to comment.