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

♻️ 코드 수정 : 쿠폰 수정 시 날짜 db에 저장되도록 수정 #291

Merged
merged 9 commits into from
Nov 29, 2024
Merged
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package intbyte4.learnsmate.coupon.domain.vo.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.*;

import java.time.LocalDateTime;

@ToString
@AllArgsConstructor
@NoArgsConstructor
@Getter
Expand All @@ -23,9 +22,14 @@ public class AdminCouponEditRequestVO {
@JsonProperty("coupon_discount_rate")
private Integer couponDiscountRate;

@JsonProperty("coupon_category_name")
private String couponCategoryName;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss")
@JsonProperty("coupon_start_date")
private LocalDateTime couponStartDate;

@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ss")
@JsonProperty("coupon_expire_date")
private LocalDateTime couponExpireDate;
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import intbyte4.learnsmate.member.service.MemberService;
import jakarta.transaction.Transactional;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
Expand All @@ -31,6 +32,7 @@
import java.util.List;
import java.util.stream.Collectors;

@Slf4j
@Service
@RequiredArgsConstructor
public class CouponFacade {
Expand Down Expand Up @@ -143,6 +145,7 @@ public List<CouponFindResponseVO> findAllCoupons() {
.couponExpireDate(couponDTO.getCouponExpireDate())
.createdAt(couponDTO.getCreatedAt())
.updatedAt(couponDTO.getUpdatedAt())
.adminCode(adminDTO.getAdminCode())
.adminName(adminDTO.getAdminName())
.tutorName(null)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ protected SecurityFilterChain configure(HttpSecurity http) throws Exception {
.requestMatchers(new AntPathRequestMatcher("/campaign-template/**", "POST")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/coupon/**", "GET")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/coupon/**", "POST")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/coupon/**", "PATCH")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/member/**", "POST")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/member/excel/**", "POST")).permitAll()
.requestMatchers(new AntPathRequestMatcher("/issue-coupon/**", "GET")).permitAll()
Expand Down
Loading