国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

? Java java?? ?? ??? ??? ?? ??? ??

??? ??? ?? ??? ??

Jan 15, 2025 pm 06:05 PM

?? ??? ?? ??? ? ?? ???? ?3? ??????? ??? ???? ??? ? ?? ????? ???? ??? ??? ??? ?????.

?? ???? ??? ???? ??????. ?? ??? ???? ????, ???? ??? ????? ??, ?? ?????? ?? ??? ????, ???? ?? ???? ???? ???? ????. ??? ???? ??? ??? ? ????? ??? ???? ?? ?? ????? ?? ??? ??? ? ?? ??? ??? ????? ??? ? ?? ???? ? ???? ????? ?? ??????.

? ? ?, ?? ??? ?? ???? ?? ?? ??, ?? ?? ?? ??? ??? ?? ??? ??????. ?? ??? ?? ??? ??? ??? ??? ??? ???? ??? ???? ???? ?? ???? ???? ?? ??? ????? ?????. ?? ??? ? ?? ??? ?? ???? ?? ??? ???? ? ??? ?? ?? ?? ???????.

? ??? ?? ?? ??? ??? ??????. ?? ??? ?? ?? ??? ???? ?? ???? ??? ??? ? ??? ?? ??????. ?? ???? ??? ?? ?? ??? ?????? ???? ????? ??? ???? ????? ????? ??? ? ????.

? ?? ????? ???? ?? ???? ???? ??? ?? ?? ??? ??? ?? ??? ?? ??? ???? ?? ??? ???. ?? ?? ??? ?????? ??? ?? ????? ???? ??? ??? ??? ??? ? ?? ???? ??? ???? ???? ??? ? ????.

1. ?? ?? ?? ??

??? ??? ?? ???? ??? ? ???? ???? ??? ??? ??? ???? ?? ???? ? ? ?? ?? ??? ????. ??? ?????.

1.1 ??? ??

  • ??? ??? ??: ???? ??? ??? ???? ??? ??? ?? ???? ???? ??? ??? ? ?? ??? ???? ?? ???? ????.
  • ?? ??? ??: ??? ???? ?? ?? ?? ???? ????? ???? ???? ?? ?? ?? ?? ??? ??? ? ?? ??? ??? ?????.
  • ??? ?? ??: ?? ???? ??? ??? ???? ????? ?? ??? ???? ??? ??? ???? ??? ?????.
  • ??? ??? ?? ?? ??: ?? ???? ???? ?? ??? ???? ???? ?? ??? ????? ???? ??? ? ????.

1.2 ?? ??

  • ??? ?? ??: ?? ? ???? ?? ????? ???? ?? ??? ?? ??? ?????.
  • ?? ??? ?? ???? ???: ???? ???? ???? ???? ??? ??? ??? ???? ???? ??? ??? ???? ?????.
  • ?? ????? ??: ???? ??? ? ?? ?? ?????? ???? ???? ???? ?? ??? ?????.
  • ?? ????: ?? ?? ?? ?? ? ?? ??? ?? ???? ??? ???? ????? ????.

1.3 ??? ??

  • ??? ???: ??? ?? ?? ??? ? ??? ???? ???? ?? ????? ?????.
  • API ???: ??? ??? ?? ????? ? ???? API? ???? ????? ?????.
  • ??? ??? ??: ??? ???? ???? ???? ??????? ???? ??? ?????.
  • ?? ?? ? ???: ??? ????? ?? ??? ????? ???? ??? ???? ???? ???? ????? ?????.

1.4 ?? ??

  • ?? ?? ??: ??? ????? ??? ??? ??? ????? ???.
  • ?? ???: ??? ???? ?? ?? ??? ?? ???? ??? ??? ?????.
  • ?? ????: ??? ??? ?? ????? ??? ???? ???? ?? ??? ??? ????.
  • ?? ??: ?? ??? ????? ?????? ???? ? ??? ?? ??? ??? ?????.

1.5 ??? ??

  • ?? ??? ???: ????? ???? ?? ??? ?? ???? ???? ??? ??? ?????.
  • ?? ?? ???: ???? ????? ?? ??? ?? ??? ? ?? ???? ?????.
  • ?? ??? ??: ?? ??? ???? ???? ????? ???? ????? ??? ?? ??? ????.
  • ??? ????: ?? ?? ?? ??? ???? ?? ?? ???? ????? ????? ?? ?????.

??? ??? ???? ????? ???? ??? ???? ??? ?? ?? ???? ???? ??? ???? ???? ?? ? ????.

2. ??? ?? ? ??

?? ??? ?? ?? ??? ???? ?? ??? ??? ??? ???? ???? ??? ??? ???? ????. ??? ?? ?? ?? ?? ??? ?? ?? ?????? ???? ??? ?? ??? ??? ?? ??? ???? ???? ????? ??? ??? ??? ????? ? ? ????.

? ????? ???? ????? ??? ??? ???? ??? ??, ?? ??, ??? ??? ?? ?? ??? ??? ???? ????? ?????. ??? ? ??? ??? ???? ??? ???? ??? ? ?? ????? ??? ?? ???? ???? ? ??? ????? ???? ????.

???? ???? ??? ???? ?? ???? ??? ???? ?? ???? ?? ???? ??? ?? ???? ???????.

2.1 ???

Designing an Internet Credit Purchase System

???? ?? ??? ??? 6??? ?????.

??? ?? ??

  • ?? ???? ?? ???? ??? ???? ???? ??? ?? ???? ?????. ? ????? ?? ??? ???? ??? ??? ??? ???? ????? ?????.
  • ???? ???? ???? '??'? ?????.
  • ?? ???? ???? ??? ? ?? ?? ?? '??? ? ??' ???? ???? ???? ?? ???? ?? ??????. ??? ??? ???? ????? ???? ?? ???? ?????.

?? ??

  • ???? ???? ??? ???? ?? ??? ??? ?????.
  • ??? ???? ????? ?? ???? ???? ?? ???? ?? ???????.
  • ??? ???? ?? ???? ?????.
?? ??
  • ? ???? ???? ?? ????? ???? ?3? ?? ???? ???????.
  • ?? ?? ??? ???? ?? ?? ?????? ??(??)? ?????.
?? ??
  • ?? ?? ?????? ??? ???? ??? ?????.
    • ??? ??? ?? ????? ??? ???? ?? ??? ?????.
    • ??? ??? ??:
      • ?? ?? ?: ????? ??? ???? ???? ????? ??? ????.
      • ??? ??? ??: ????? ??? ???? ????? ??? ??? ? ? ??? ?????.
??? ???
  • ??? ???? ???? ??? ????? ??? ???? ?????.
    • ??? ?? ?: ???? ??? ???? ???? ?? ??? ?????.
    • ???? ??? ??: ???? ???? ?????.
      • ??? ???? ??? ??? ????.
      • ??? ???? ???? ??? ????? ???? ??? ??? ????.
????? ????
  • ???? ?? ????: ??? ??? ??? ????? ???????.
  • ??? ??? ????: ??? ?? ??? WebSocket ??? ?? ?????.

? ??? ????? ???? ???? ??? ???? ??? ???? ???? ??? ????? ?????.

2.2 ??? ?????

?? ??? ?????? ??? ??? ?? ?? ?? ?? ??? ???? ? ??? ???.

Designing an Internet Credit Purchase System

???? ?? ??? ??? 6??? ?????.

??? ?? ??

  • ??? ??? ?? ???? ???? ?????.
  • ?????? ???? ??? ???? ???? ?? ??? ?? ???? ??? ??? ??? ?? ???? ?????.

?? ??

  • ??? ???? ???? "??"? ???? ?????? ???? ?? ??? ????.
  • ???? ????? ??? ???? ???? ????? ?? ??? ? ??? ?????.
  • ???? ?? ??? ?? ???? ????? 15? ?? ???? ??? ?????.
  • ???? ?? ??? ?????? ??? ??? ?? ???? ???????.

?? ??

  • ??? ?? ???? ???? ?? ????? ?????.
  • ?????? ? ??? ???? ??? ???? ?? ??????? ?? ??? ??????.
  • ?? ??? ???? ???? ?? ????? ?????? ?????.
  • ?????? ??? ???? ?? ??? ?? ?????? ???????.

?? ??

  • ?? ??????? ??? ?? ??? ???? ?? ??? ?????.
  • ?? ?????? ??? ?? ???? ?? ??? ????.
    • ??? ??? ??:
      • ???? ?? ?????? ?? ?? ??? ?????.
      • ??? ????? ?????, ????? ???? ??? ?????.
    • ??? ??? ??:
      • ???? ???? ?? ??? ???? ???? ??? ???? ?? ??? ???????.
    • ?? ?? ?? ??? ?? ?? ??:
      • ???? ????? ?? ?????? ???? ?? ??? ?????. ??? ????? ??? ???? ???? ??? ???? ?????.

??? ???

  • ??? ???? ???? ????? ??? ???? ?????.
  • ???? ??? ??? ???? ???? ???? ?????.
    • ???? ??? ??:
      • ???? ?????? ????? ???? ?????.
      • ???? ?????? ??? ?? ??? ???? ?????.
    • ???? ??? ??:
      • ???? ????? ??? ???? ?????.
      • ???? ??? ??? ?? ?? ??? ?????.

????? ????

  • ???? WebSocket ??? ?? ???? ??? ???? ?? ??? ????? ????.
  • ??? ????? ?? ??? ?? ?? ??? ????? ??? ?? ? ?? ??? ??? ???? ??? ? ????.

3. ??? ??

?? ???? ??? ?? ??? ????? ?????? ?? ?? ?? ???? ??? ????? ??? ?????. ? ????? ??? ???? ???? ???? ?? ???? ??? ? ?? ????? ?? ???? ?? ?? ???? ?? ???? ???? ??? ?????.

// Domain Models
@Getter @Setter
@Entity
public class Package {
    @Id
    private String id;
    private String name;
    private BigDecimal price;
    private BigDecimal providerCost;
    private String description;
    private boolean active;
}

@Getter @Setter
@Entity
public class Order {
    @Id
    private String id;
    private String customerId;
    private String packageId;
    private String reservationId;
    private String paymentId;
    private String escrowId;
    private OrderStatus status;
    private BigDecimal amount;
    private BigDecimal providerCost;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
}

@Getter @Setter
@Entity
public class QuotaReservation {
    @Id
    private String id;
    private String packageId;
    private LocalDateTime expiresAt;
    private ReservationStatus status;
}

// Enums
public enum OrderStatus {
    CREATED, RESERVED, PAYMENT_PENDING, PAYMENT_COMPLETED, 
    IN_ESCROW, ACTIVATING, ACTIVATION_FAILED, COMPLETED, REFUNDED
}

public enum ReservationStatus {
    ACTIVE, EXPIRED, USED, CANCELLED
}

??? ??? ??? ????.

  • ???: ???? ??? ? ?? ??? ?? ???? ???? ????. ??? ID, ??, ??, ??? ??, ??, ??? ?? ?? ?? ?? ??? ?????.

  • ??: ???? ?? ????? ?????. ???? ?? ID, ?? ID, ??? ??? ID ?? ??? ?? ID, ?? ID, ???? ID, ?? ??, ?? ??, ???? ??, ????? ? ?? ????? ?????.

  • QuotaReservation: ??? ???? ?? ?? ??? ?????. ?? ID, ??? ???, ?? ??, ?? ??(?? ?? ?? ?)? ?????.

  • OrderStatus Enum: ? ???? CREATED ? RESERVED?? PAYMENT_PENDING, COMPLETED ?? REFUNDED?? ??? ?? ? ?? ?? ??? ??? ?????.

  • ReservationStatus Enum: ????? ? ???? ACTIVE, EXPIRED, USED ?? CANCELLED ? ??? ?? ??? ?????.

??? ???? ???? ?? ???? ???, ?? ? ??? ??? ???? ?? ??? ?????. ????? ??? ????? ???? ?? ?????? ???? ?? ?????.

// Request/Response DTOs
@Getter @Setter
public class OrderRequest {
    private String customerId;
    private String packageId;
    private BigDecimal amount;
}

@Getter @Setter
public class PaymentCallback {
    private String orderId;
    private String paymentId;
    private String status;
    private BigDecimal amount;
    private LocalDateTime timestamp;
}

@Getter @Setter
public class QuotaResponse {
    private String packageId;
    private boolean available;
    private Integer remainingQuota;
    private LocalDateTime timestamp;
}

@Getter @Setter
public class ReservationResponse {
    private String id;
    private String packageId;
    private LocalDateTime expiresAt;
    private ReservationStatus status;
}

@Getter @Setter
public class ActivationResponse {
    private String orderId;
    private boolean success;
    private String activationId;
    private String errorCode;
    private String errorMessage;
}

@Getter @Setter
public class VerificationResponse {
    private String orderId;
    private String activationId;
    private boolean success;
    private String status;
    private LocalDateTime activatedAt;
}

@Getter @Setter
public class PaymentRequest {
    private String orderId;
    private BigDecimal amount;
    private String currency;
    private String customerId;
    private String returnUrl;
    private String callbackUrl;
}

@Getter @Setter
public class PaymentSession {
    private String sessionId;
    private String paymentUrl;
    private LocalDateTime expiresAt;
    private String status;
}

@Getter @Setter
public class EscrowResponse {
    private String id;
    private String paymentId;
    private BigDecimal amount;
    private String status;
    private LocalDateTime createdAt;
}

??? ?????.

  • OrderRequest: ?? ? ??? ???? ? ??? ???? ?? ?? ????. ???? ?? ID, ????? ???, ??? ??? ?????.

  • PaymentCallback: ?? ?? ?????? ????? ?????. ?? ?? ??? ?? ID, ?? ID, ??(?? ?? ??), ?? ??, ?? ?? ?? ????? ?????.

  • QuotaResponse: ??? ??? ?? ????. ??? ?? ?? ??, ?? ???, ??? ????? ????? ?? ?? ?????.

  • ReservationResponse: ???? ???? ?? ID, ?? ???, ?? ?? ??, ?? ??(?: ?? ?? ???) ? ?? ?? ??? ?????. .

  • ActivationResponse: ??? ???? ??? ?????? ?????. ????? ???? ??? ID? ??? ??? ?? ?? ?? ??? ?????.

  • ????: ??? ? ?? ?? ???? ?????? ?????. ???? ?? ID, ??? ID, ?? ?? ? ??? ??? ?????.

  • PaymentRequest: ?? ????? ???? ?? ? DTO? ?? ID, ?? ??, ??, ?? ID ? ?? URL? ?? ??? ?? ??? ?????.

  • PaymentSession: ?? ????? ??? ? ???? ?????. ???? ?? ID, ?? URL(???? ???? ?? ??), ?? ??, ?? ??? ?????.

  • EscrowResponse: ??? ????? ??? ?? ???? ID, ?? ID, ?? ??, ??, ?? ?? ? ??? ?? ?? ??? ?????.

??? ?? ???? ??? ???? ????? ? ???? ?? ?? ?? ??? ?? ?? ??? ?????. ?? ??(??? ?? ?)? ?? ??? ????? ?????.

// Domain Models
@Getter @Setter
@Entity
public class Package {
    @Id
    private String id;
    private String name;
    private BigDecimal price;
    private BigDecimal providerCost;
    private String description;
    private boolean active;
}

@Getter @Setter
@Entity
public class Order {
    @Id
    private String id;
    private String customerId;
    private String packageId;
    private String reservationId;
    private String paymentId;
    private String escrowId;
    private OrderStatus status;
    private BigDecimal amount;
    private BigDecimal providerCost;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
}

@Getter @Setter
@Entity
public class QuotaReservation {
    @Id
    private String id;
    private String packageId;
    private LocalDateTime expiresAt;
    private ReservationStatus status;
}

// Enums
public enum OrderStatus {
    CREATED, RESERVED, PAYMENT_PENDING, PAYMENT_COMPLETED, 
    IN_ESCROW, ACTIVATING, ACTIVATION_FAILED, COMPLETED, REFUNDED
}

public enum ReservationStatus {
    ACTIVE, EXPIRED, USED, CANCELLED
}
?? ???
1. ??:

? ???? ??? ???? ???? ?? ??? ?????. ??? ??? ??? ??? ??? API? ?? ???? ??? ??? ????.

2. ?? ??:
  • updateCache(): ? ???? ?????? ?? ??? ???? ??? 5??? ?? ??? ?? ????. ??? ?? ??? ?????.
  • getPackage(): ? ???? ?? ID? ???? ???? ??? ??? ?????.
  • updatePackageQuota(): ??? ?? ??? ???? ? ???? ?? ???? ?? ? ??? ??? ???????.
??? ??
1. ??:

? ???? ???? API?? ??? ?????. ??? ??, ??? ??, ??? ???, ??? ?? ?? ??? ?????.

2. ?? ??:
  • checkQuota(): ? ???? ???? API? ???? ???? ?? ??? ???? ???? ?????.
  • ReserveQuota(): ????? ??? ?? ??? ?? ??? ???? ?????.
  • activateService(): ??? ?? ???? ???? ?? ?? ? ???? ???? ?? ??? ?????.
  • verifyActivation(): ??? ? ? ???? ?? ?? ????? ?????.
  • getAllPackages(): ? ???? ?????? ?? ??? ?? ???? ????, ?? ??? ??????? ????? ??? ??? ???? ? ?????.
3. ??? ????:

? ???? ???? ??? ?? ?? RetryTemplate? ???? ???? API? ?? ??? ???? ??????. ?? ?? ??? ??? ?????? ???? ???? ???? ?????.

??? ??? ?????? ? ??? ???? ??? ???? ????? ???? ??? ???? API? ???? ???? ??? ????? ?????.

// Domain Models
@Getter @Setter
@Entity
public class Package {
    @Id
    private String id;
    private String name;
    private BigDecimal price;
    private BigDecimal providerCost;
    private String description;
    private boolean active;
}

@Getter @Setter
@Entity
public class Order {
    @Id
    private String id;
    private String customerId;
    private String packageId;
    private String reservationId;
    private String paymentId;
    private String escrowId;
    private OrderStatus status;
    private BigDecimal amount;
    private BigDecimal providerCost;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
}

@Getter @Setter
@Entity
public class QuotaReservation {
    @Id
    private String id;
    private String packageId;
    private LocalDateTime expiresAt;
    private ReservationStatus status;
}

// Enums
public enum OrderStatus {
    CREATED, RESERVED, PAYMENT_PENDING, PAYMENT_COMPLETED, 
    IN_ESCROW, ACTIVATING, ACTIVATION_FAILED, COMPLETED, REFUNDED
}

public enum ReservationStatus {
    ACTIVE, EXPIRED, USED, CANCELLED
}
?? ????? ??

? ???? ?? ??? ???? ???? ???? ?? ???? ?? ?????? ?? ???? ??? ???? ? ???? ??? ???.

1. ???Payment(PaymentRequest ??):
  • ?? ????? ???? ????? ?????. ?? ?? ????? ?? ?? ?????? ??? ????.
  • ?? URL ? ?? ??? ?? ??? ??? PaymentSession ??? ?????.
2.holdInEscrow(String PaymentId):
  • ? ??? ??? ?? ID? ???? ???? ???? ??? ?????.
  • ???? ??? ?? ?? ????? ??? EscrowResponse ??? ?????.
3. releaseToProvider(??? ???? ID):
  • ???? ????? ???? ? ???? ??? ??? ????? ???? ?????.
  • ???? ID? ??? ??? ???? ???? ? ?????.
4. ???? ??(??? ???? ID):
  • ??? ??? ?? ? ??? ???? ?? ? ??? ???? ????? ??? ???? ?? ??? ? ????.
  • ?? ???? ???? ID? ?????.
?? ??:
  • ???? WebClient? ???? ?? ?????? REST API? HTTP ??? ?? ??? ??? ?????.
  • ?? ??, ???? ??, ?? ?? ? ??? ??? ?????.
  • ?? ???? ??? ??(.block()? ??)? ???? ?? ???? ?? ??? ?????? ???? ???? ?????.

? ??? ????? ???? ???? ?? ??? ???? ? ??? ??? ?? ?????.

// Domain Models
@Getter @Setter
@Entity
public class Package {
    @Id
    private String id;
    private String name;
    private BigDecimal price;
    private BigDecimal providerCost;
    private String description;
    private boolean active;
}

@Getter @Setter
@Entity
public class Order {
    @Id
    private String id;
    private String customerId;
    private String packageId;
    private String reservationId;
    private String paymentId;
    private String escrowId;
    private OrderStatus status;
    private BigDecimal amount;
    private BigDecimal providerCost;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
}

@Getter @Setter
@Entity
public class QuotaReservation {
    @Id
    private String id;
    private String packageId;
    private LocalDateTime expiresAt;
    private ReservationStatus status;
}

// Enums
public enum OrderStatus {
    CREATED, RESERVED, PAYMENT_PENDING, PAYMENT_COMPLETED, 
    IN_ESCROW, ACTIVATING, ACTIVATION_FAILED, COMPLETED, REFUNDED
}

public enum ReservationStatus {
    ACTIVE, EXPIRED, USED, CANCELLED
}
?? DTO
1. ??? ??:
  • ?? ??? ?? ??? ?? ????? ?????. ???? ??? ?????.
    • ?? ??? ???(?? ??)
    • ??? ??
    • ??? ???? ??? ID???.
    • ???? ????? ?? ?? ???(templateData)
2. SMS ??:
  • ??? ??? ????? SMS? ?? ???????. ???? ??? ?????.
    • ?? ??? ????(phoneNumber)???.
    • ??? ??? ??? ID???.
    • ???? ?? ?? ???(templateData)
?? ???

? ???? ?? ??? ?? ????? ???? ?? ??? ?????. ?? ??? ??? ????.

1.?? ?? ???(?? ??):
  • ? ??? ?? ?? ??? ?????. ??? ?????:
    • buildSuccessEmail? ???? ??? ??? ?????.
    • buildSuccessSms? ???? SMS ??? ?????.
    • ?? QuotaWebSocketHandler? ???? WebSocket? ?? ??? ????? ????.
2. sendFailureNotification(?? ??):
  • ??? ?? ??? ?????. ??? ?????:
    • ??? ???? buildFailureEmail.
    • SMS ???? buildFailureSms.
    • ?? ??? ????? WebSocket ????? ????.
3. ??? ??:
  • buildSuccessEmail ? buildFailureEmail: ? ???? ??? ?? ??? ?? ??? ??? ?????. ???? ?? ????? ?????.
  • buildSuccessSms ? buildFailureSms: ??? ??? ????? SMS ??????.
?? ??:
  • WebSocket ????: QuotaWebSocketHandler? ???? ?????? ????? ???????.
  • ?? ??: ??? ???? ???? ?? ??? ?????.

? ???? ?? ???? ???, SMS ?? ??? ????? ?? ?? ??? ?? ??? ?? ? ????.

// Domain Models
@Getter @Setter
@Entity
public class Package {
    @Id
    private String id;
    private String name;
    private BigDecimal price;
    private BigDecimal providerCost;
    private String description;
    private boolean active;
}

@Getter @Setter
@Entity
public class Order {
    @Id
    private String id;
    private String customerId;
    private String packageId;
    private String reservationId;
    private String paymentId;
    private String escrowId;
    private OrderStatus status;
    private BigDecimal amount;
    private BigDecimal providerCost;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
}

@Getter @Setter
@Entity
public class QuotaReservation {
    @Id
    private String id;
    private String packageId;
    private LocalDateTime expiresAt;
    private ReservationStatus status;
}

// Enums
public enum OrderStatus {
    CREATED, RESERVED, PAYMENT_PENDING, PAYMENT_COMPLETED, 
    IN_ESCROW, ACTIVATING, ACTIVATION_FAILED, COMPLETED, REFUNDED
}

public enum ReservationStatus {
    ACTIVE, EXPIRED, USED, CANCELLED
}
QuotaUpdate ???
  • ? ???? ??? ????? ?? ??? ???? ?????. ???? ? ?? ?? ??? ?????.
    • packageId: ?????? ???? ID???.
    • availableQuota: ? ???? ?? ??????.
    • ?????: ????? ???? ??.
??? ??
1. ??? ??:
  • WebSocket ??? ???? ?? ?????.
  • /ws/quota?? WebSocket ??? ???? ?? ???(quotaWebSocketHandler)? ?????.
  • allowedOrigins("*")? ???? ?? ?????? ??? ?????.
2. ???WebSocketHandler():
  • ?? ?? ???? ??? ???? WebSocket ??? Bean? ?????.
???WebSocketHandler

?? WebSocket ??? ???? ????! ??? ????? ?? ??? ????? ?????.

1. ??:
  • PackageCacheService: ???? ????? ??? ?? ??? ?????? ? ??? ???.
  • ObjectMapper: JSON ????? Java ??? ?? ? ??? ???? ??? ?????.
  • ??: ?? ?? WebSocket ??(?? ??? ?????)? ?????.
2. ??:
  • afterConnection??(WebSocketSession ??):
    • ?????? ? ????? ??? ?? ??? ?????.
  • afterConnectionClosed(WebSocketSession ??, CloseStatus ??):
    • ??? ???? ????? ??? ?????.
  • handlerTextMessage(WebSocketSession ??, TextMessage ???):
    • ?? ???? ?????.
    • ??? JSON? QuotaUpdate ??? ???? ?? ??? ???????.
3. sendOrderUpdate(?? ??):
  • ??? ?? ???? ?? ??? ?? ??? ????? ????.
  • Order ??? JSON?? ???? ?? WebSocket ??? ???? ????.
  • ?? ??? ????? ??? ???.
??? ?? ??:
  • ??? ????:
    • ??? ?? ? ?? ????? ?? ???? ?? ????.
  • ?????? ??? ??:
    • ConcurrentHashSet? ???? ??? ?????? ????? ?? ?????? ????? ?? ? ??? ???? ????.
  • ?? ??:
    • ??? ??? ??? ?? ? ??? ???? ??? ? ?? ??? ? ????.

? ??? ???? ????? ?? ???? ???? ??? ????? ???? ?? ??? ??? ? ?? ??? ?? ?? ??? ?? ? ????.

// Domain Models
@Getter @Setter
@Entity
public class Package {
    @Id
    private String id;
    private String name;
    private BigDecimal price;
    private BigDecimal providerCost;
    private String description;
    private boolean active;
}

@Getter @Setter
@Entity
public class Order {
    @Id
    private String id;
    private String customerId;
    private String packageId;
    private String reservationId;
    private String paymentId;
    private String escrowId;
    private OrderStatus status;
    private BigDecimal amount;
    private BigDecimal providerCost;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
}

@Getter @Setter
@Entity
public class QuotaReservation {
    @Id
    private String id;
    private String packageId;
    private LocalDateTime expiresAt;
    private ReservationStatus status;
}

// Enums
public enum OrderStatus {
    CREATED, RESERVED, PAYMENT_PENDING, PAYMENT_COMPLETED, 
    IN_ESCROW, ACTIVATING, ACTIVATION_FAILED, COMPLETED, REFUNDED
}

public enum ReservationStatus {
    ACTIVE, EXPIRED, USED, CANCELLED
}

??? ??? ??? ?? ?? ???? ?? ??? ???? ?? ?? ????? ???? ? ???? ?????.

QuotaNotAvailableException:

  • ? ??? ???? ???? ????? ????? ?? ???? ?? ???? ?? ??? ??? ?????.
  • "??? ???? ??? ? ????."?? ??? ?? ???? ?? ????? ???? ??? ?? ??? ???? ??? ? ????.

OrderNotFoundException:

  • ? ??? ???? ??? ?? ID? ???? ??? ?? ? ?? ? ?????.
  • '??? ?? ? ??: [orderId]'? ?? ??? ?? ???? ???? ?? ?? ??? ???????? ?? ??? ? ????.

?? ?? ??:

  • ?? ??? ??? ?? ??(??? ???? ??? ?? ??? ???? ? ??) ? ??? ?????.
  • ?? ???? ??? ? ?? ?? ?? ??? ???? ????? ?????.

??? ??? ?????? ???? ???? ?? ??? ???? ??? ?????. ?? ?? ???? ??? ???? ??? ?? ??? ??? ???? ? ???? ???? ?? ??? ???? ?? ? ????.

// Request/Response DTOs
@Getter @Setter
public class OrderRequest {
    private String customerId;
    private String packageId;
    private BigDecimal amount;
}

@Getter @Setter
public class PaymentCallback {
    private String orderId;
    private String paymentId;
    private String status;
    private BigDecimal amount;
    private LocalDateTime timestamp;
}

@Getter @Setter
public class QuotaResponse {
    private String packageId;
    private boolean available;
    private Integer remainingQuota;
    private LocalDateTime timestamp;
}

@Getter @Setter
public class ReservationResponse {
    private String id;
    private String packageId;
    private LocalDateTime expiresAt;
    private ReservationStatus status;
}

@Getter @Setter
public class ActivationResponse {
    private String orderId;
    private boolean success;
    private String activationId;
    private String errorCode;
    private String errorMessage;
}

@Getter @Setter
public class VerificationResponse {
    private String orderId;
    private String activationId;
    private boolean success;
    private String status;
    private LocalDateTime activatedAt;
}

@Getter @Setter
public class PaymentRequest {
    private String orderId;
    private BigDecimal amount;
    private String currency;
    private String customerId;
    private String returnUrl;
    private String callbackUrl;
}

@Getter @Setter
public class PaymentSession {
    private String sessionId;
    private String paymentUrl;
    private LocalDateTime expiresAt;
    private String status;
}

@Getter @Setter
public class EscrowResponse {
    private String id;
    private String paymentId;
    private BigDecimal amount;
    private String status;
    private LocalDateTime createdAt;
}

OrderService ???? ?? ??? ??? ??? ??? ?????. ?? ??? ??? ???????.

?? ??
  1. createOrder(?? ?? ??):

    • ? ??? ? ????? ??? ????. ???? ?? ???? ????, ?? ??? ????, ???? ????, RESERVED? ?? ??? ??????? ??? ?????.
  2. processPayment(??? orderId, PaymentCallback ??):

    • ??? ??? ?????. ???? ?? ????? ???? ??? ?????? ?? ??? ????? ?? ??? ??? ????? ?????. ??? ???? ???? ??? ?????.
  3. verifyActivation(?? ??):

    • ??? ???? ???? ?????? ?? ?? ???? ?????. ?? 3??? ???? ??? ??? ?? ???? ?? ??? ?????.
  4. completeOrder(?? ??):

    • ?? ?? ???? ? ???? ??? ?????. ???? ??? ????? ????? ??? ?????? ????? ??? ????.
  5. handleActivationFailure(?? ??):

    • ???? ??? ?? ? ??? ???? ??? ??? ?? ??? ?????? ??? ?? ? ????.
  6. getOrder(??? ?? ID):

    • ? ??? ??? ID? ??? ?????. ??? ???? ??? ?? ??? ?????.
???? ??
  • ???? ?? ??? ????? ????? ????? ?????.
  • ??? ?? ?? ? ??? ??? ??? ?? ?? ??? ??? ?? ?????.
  • ??? ?? ???? ?? ???? ?? ??? ?? ? ????.

? ???? ?? ?? ????? ???? ??? ??? ??? ?? ?? ?? ??? ????.

// Domain Models
@Getter @Setter
@Entity
public class Package {
    @Id
    private String id;
    private String name;
    private BigDecimal price;
    private BigDecimal providerCost;
    private String description;
    private boolean active;
}

@Getter @Setter
@Entity
public class Order {
    @Id
    private String id;
    private String customerId;
    private String packageId;
    private String reservationId;
    private String paymentId;
    private String escrowId;
    private OrderStatus status;
    private BigDecimal amount;
    private BigDecimal providerCost;
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;
}

@Getter @Setter
@Entity
public class QuotaReservation {
    @Id
    private String id;
    private String packageId;
    private LocalDateTime expiresAt;
    private ReservationStatus status;
}

// Enums
public enum OrderStatus {
    CREATED, RESERVED, PAYMENT_PENDING, PAYMENT_COMPLETED, 
    IN_ESCROW, ACTIVATING, ACTIVATION_FAILED, COMPLETED, REFUNDED
}

public enum ReservationStatus {
    ACTIVE, EXPIRED, USED, CANCELLED
}

OrderController ???? ????? ??? ???? REST API ?????? ?????. Think? ??? ?? ?????? ??? ??? ???? ??? ??? ??? ?? ??? ???.

?? ??
  1. POST /api/orders(createOrder):

    • ? ?????? ? ?? ??? ?????.
    • ??? ??? ????.
      • ???????? OrderRequest? ????.
      • OrderService.createOrder? ???? ??? ???? ??? ?????.
      • ??:
        • ?? ?? ???? ????? ?? ??? ??? ?? 200 OK ??
        • ??? ???? ??? ? ?? ?? 409 ??? ?????.
        • ??? ?? ??? ?? 500 ?? ?? ??? ?????.
  2. POST /api/orders/callback(PaymentCallback ??):

    • ?? ??????? ?? ?? ????? ?????.
    • ??? ??? ????.
      • ?? ?? ????? ??? PaymentCallback? ?????.
      • OrderService.processPayment? ???? ??? ???? ?? ??? ???????.
      • ??? ??? ??? ????.
        • ??? ????? ???? 200 OK
        • 404 ??? ?? ID? ???? ?? ?? ?? ? ????.
        • 422 ?? ??? ???? ?? ?? ??? ? ?? ?????.
        • ??? ?? ??? ?? 500 ?? ?? ??? ??????.
  3. GET /api/orders/{orderId}(getOrder):

    • ? ?????? ID?? ?? ??? ????? ?????.
    • ?? ??? ??? ????.
      • OrderService.getOrder? ???? ??? ?????.
      • ??:
        • ?? ????? ???? 200 OK ??
        • ?? ID? ???? ??? ??? 404 Not Found???.
??
  • ???? ??: OrderController? ?? ???? ??? OrderService? ???? ?? ???? ????? ?????.
  • ??: ?? ????? @Valid ??? ???? ???? ???? ???? ???? ????? ?????.
  • ?? ??:
    • ??? ? ?? ????? ?? ??? ?? ???? ??? ?? ????? ??? ??? ?????.
    • ? ?? ???? ? ??? ?? ??? ?????.
  • ??: ? ?? ???? ?? ???? ??, ??, ?? ???? ?? ?? ???? ?????.

? ????? ?????? ???? ??? ??? ???? ?? ??? ??? ???? ????.

??

? ?? ??? ??? ??, ?? ??, ??? ???? ?? ??? ??? ????? ?? ??? ?? ?? ???? ???? ?? ??? ?????. ? ???? ?? ??? ???? ?? ? ?? ??? ?? ? ?? ??? ????!

??? ? ???? ??? ? ?? ? ?? ???????.

  • ??? ?? ????? ???? ???? ?? ???? ?? ???? ????.
  • ??? ??? ?? ??? ???? ?? ????? ???? ?????.
  • ?? ?? ??? ???? ?? ??? ??? ?? API? ?? ???? ????.
  • ? ?? ??? ? ?? ???? ?? ?? ??? ??? ?????.
  • ?? ???? ???? ?? ??? ??? ???? ?????.
  • ???? ? ??? ???? ??? ??? ???? ???? ?????.
  • ?? ??? ???? ???? ???? ?????.

????? ?? ?????! ? ??? ??? ??? ???? ?? ???? ???? ???? ????? ????. ?? ? ???? ????? ????. ?? ??? ??? ????. ?? ???? ??? ???? ?? ????.

??:

  • ?? ????? SOLID ??? ?? ?? ??
  • ??????? ????? ????? ?????? ??
  • Flash ??? ?? ?? ??? ??? ??
  • Wikipedia? ????

? ??? ??? ??? ?? ??? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? ????? ??
? ?? ??? ????? ???? ??? ??????, ???? ?????? ????. ? ???? ?? ???? ?? ??? ?? ????. ???? ??? ???? ???? ??? ?? admin@php.cn?? ?????.

? AI ??

Undresser.AI Undress

Undresser.AI Undress

???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover

AI Clothes Remover

???? ?? ???? ??? AI ?????.

Video Face Swap

Video Face Swap

??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

???

??? ??

???++7.3.1

???++7.3.1

???? ?? ?? ?? ???

SublimeText3 ??? ??

SublimeText3 ??? ??

??? ??, ???? ?? ????.

???? 13.0.1 ???

???? 13.0.1 ???

??? PHP ?? ?? ??

???? CS6

???? CS6

??? ? ?? ??

SublimeText3 Mac ??

SublimeText3 Mac ??

? ??? ?? ?? ?????(SublimeText3)

???

??? ??

?? ????
1783
16
Cakephp ????
1728
56
??? ????
1579
28
PHP ????
1444
31
???
?? ?? ?? ??? ??? ?? ?? ?? ??? ??? Jun 24, 2025 pm 09:41 PM

?? ?? ?? ??? ??? ?? ??? ??, ? ? ?? ? ??? ?????. 1. ??? ?? ???? ?? ???? ???-????, ? ??? ??? ??? ? ????, Hashmap? ???-??? ?? ??? ??? ???? ????. 2. NULL ? ?? ???? HashMap? ??? NULL ?? ?? ? ?? ???? ?? HashTable? NULL ?? ?? ???? ??? NullPointerException? ?????. 3. ????? ??? ????? ?? ??? ?? ?? ? ????? HashTable? ? ??? ?? ?? ??? ????. ?? ConcurrenTashMap? ???? ?? ????.

?? ???? ??? ??? ?????? ?? ???? ??? ??? ?????? Jun 28, 2025 am 01:01 AM

Java? ?? ??? ??? ?? ??? ??? ?? ??? ??? ?? ??? ?? ?? ??? ???? ??? ?? ???? ?????. 1. ??? ???? ??? ?? ?? ? ???? ?? ??? ???? ?? ?? ??? ? ????. 2. ???? ?? ??? ???? ??? ?? ???? ?? ?? ??? ???????. 3. ?? ???? ?? ?? ?? ? ???? ???? ?? NULL ?? ??? ? ????. 4. ?? ???? ??? ?? ?? ? ??? ?????? ?? ??? ??? ?? ?? ??? ????? ??? ??? ??? ??????? ?? ???? ??????.

?????? ?? ???? ?????? ?????? ?? ???? ?????? Jun 24, 2025 pm 10:57 PM

staticmethodsininterfaceswereIntRectionSelffacesswithinteffaceswithinteffaceswithintintinjava8toallowutilityFunctionswithinterfaceitswithinteffaceswithinterfaceffaces

JIT ????? ??? ??? ??????? JIT ????? ??? ??? ??????? Jun 24, 2025 pm 10:45 PM

JIT ????? ??? ???, ??? ?? ? ???, ?? ?? ? ???? ? ? ?? ?? ??? ? ?? ??? ?? ??? ??????. 1. ??? ???? ?? ?? ??? ??? ?? ?? ???? ??? ?? ?????. 2. ??? ?? ? ??? ?? ?? ? ??? ???? ?? ?? ???; 3. ?? ??? ??? ?? ??? ???? ???? ???? ? ?? ?? ??? ?????. 4. ?? ??? ?? ??? ??? ???? ???? ?? ? ??? ???? ?? ??? ?????.

???? ??? ??? ??? ?????? ???? ??? ??? ??? ?????? Jun 25, 2025 pm 12:21 PM

???? ??? ??? Java?? ??? ?? ???? ??? ?? ? ? ??? ??? ???? ? ?????. ?? ???? ??? ??, ??? ?? ??? ?? ?? ??? ??? ????? ???? ????? ?????. ?? ??? ??? ??, ????? ? ??? ????, ?? ??? ??? ?????? ? ?? ? ?? ?????.

??? '??'???? ?????? ??? '??'???? ?????? Jun 24, 2025 pm 07:29 PM

injava, thefinalkeywordpreventsavariable'svalue'svalueffrombeingchangedafterassignment, butitsbehaviordiffersforprimitivesandobjectreences.forprimitivevariables, asinfinalintmax_speed = 100; wherereassoncesanerror.forobjectref

?? ??? ?????? ?? ??? ?????? Jun 24, 2025 pm 11:29 PM

??? ??? ?? ?? ??? ????? ? ???? ????? ???? ?? ???? ?? ???? ?????. ?? ??? ??? ????. ?? ?? ?? ??? ???? ???? ?? ?? ??? ??? ?? ?? ??? ??? ?????. ?? ??? ??? ????. ?? ??? ?? ??? ?? ?? ??? ?? ?? ??? ???? NewClass ()? ??? ?? ???? ????. ?? ??? ?? ??? ???? ?? ??? ?? ? ? ??? ?? ?? ??? ????? ????? ?????. ?? ??, ?? ?????? ?????, ??? ? ?? ????? ??? ?? ?????. ???? ?? ?? ??? ???? ?? ???? ?? ? ??? ???? ?? ??? ?? ?????? ?????. ???? ???? ??? ??, ?? ?? ? ?? ??? ????, ?? ?? ???? ?????.

?? ????? ?????? ?? ????? ?????? Jun 24, 2025 pm 11:09 PM

??? ? ?? ??? ???? : ????? ?? ?. 1. int? ???? ???? ?? ?? ?? ? ??? ???? ?????. 2. ?? ? ???? (int) myDouble ??? ?? ?? ??? ?????. ?? ??? ??? ?? ??? ?? ??, ?? ?? ?? ???? ?? ??? ?? ???? ?? ?????. ???? ? ??? ??? ????. ?? ??? ??? ??? ??? ??? ?? ??? ??? ? ??? ?? ???? ??? ??? ??? ??? ? ??? ?? ??? ?? ??? ?? ?? ? ? ????. ?? ?? ??? ?? ??? ??? ??? ??? ? ??????.

See all articles