feat: 정기결제 관리 — 구독 현황/해지/재개/플랜변경 백엔드
- member.plan_product, plan_auto_renew 컬럼(구독 상품·자동갱신) - GET /api/billing/subscription: 플랜·만료일·다음결제일·자동갱신 - POST /api/billing/cancel: 자동갱신 중단(만료일까지 이용), /resume: 재개 - verify 시 상품·자동갱신 기록, 만료 강등·관리자 변경 시 구독정보 정리 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
a4b6c3fd2d
commit
be15f5b85d
@@ -31,6 +31,8 @@ public class Member implements Serializable {
|
||||
private String role; // USER / ADMIN
|
||||
private String plan; // FREE / PREMIUM (멤버십)
|
||||
private LocalDateTime planExpiresAt; // 유료 멤버십 만료일 (NULL=만료없음/무료)
|
||||
private String planProduct; // 구독 상품 ID (premium_monthly 등)
|
||||
private Boolean planAutoRenew; // 자동 갱신 여부 (해지 시 false)
|
||||
private Long points; // 활동 포인트 (게시판 글/댓글 작성 보상)
|
||||
private String status; // ACTIVE / SUSPENDED / WITHDRAWN
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@@ -19,6 +19,8 @@ public class MemberResponse {
|
||||
private String role;
|
||||
private String plan; // FREE / PREMIUM
|
||||
private java.time.LocalDateTime planExpiresAt; // 유료 멤버십 만료일
|
||||
private String planProduct; // 구독 상품 ID
|
||||
private Boolean planAutoRenew; // 자동 갱신 여부
|
||||
private Long points; // 활동 포인트
|
||||
private String googlePicture; // 구글 아바타 URL
|
||||
private String profileImage; // 사용자 지정 프로필 이미지(data URL)
|
||||
@@ -33,6 +35,8 @@ public class MemberResponse {
|
||||
.role(m.getRole())
|
||||
.plan(m.getPlan())
|
||||
.planExpiresAt(m.getPlanExpiresAt())
|
||||
.planProduct(m.getPlanProduct())
|
||||
.planAutoRenew(m.getPlanAutoRenew())
|
||||
.points(m.getPoints())
|
||||
.googlePicture(m.getGooglePicture())
|
||||
.profileImage(m.getProfileImage())
|
||||
|
||||
@@ -50,9 +50,13 @@ public interface MemberMapper {
|
||||
|
||||
int updatePlan(@Param("id") Long id, @Param("plan") String plan);
|
||||
|
||||
/** 결제로 멤버십 부여/갱신 (plan + 만료일) */
|
||||
/** 결제로 멤버십 부여/갱신 (plan + 만료일 + 구독상품 + 자동갱신) */
|
||||
int updateMembership(@Param("id") Long id, @Param("plan") String plan,
|
||||
@Param("expiresAt") java.time.LocalDateTime expiresAt);
|
||||
@Param("expiresAt") java.time.LocalDateTime expiresAt,
|
||||
@Param("product") String product, @Param("autoRenew") boolean autoRenew);
|
||||
|
||||
/** 구독 해지/재개 (자동 갱신 플래그) */
|
||||
int updateAutoRenew(@Param("id") Long id, @Param("autoRenew") boolean autoRenew);
|
||||
|
||||
/** 만료된 유료회원을 FREE 로 강등 (스케줄러). 강등된 건수 반환 */
|
||||
int downgradeExpired();
|
||||
|
||||
Reference in New Issue
Block a user