CircuitBreakerConfig entity 추가

This commit is contained in:
curry772
2026-03-31 15:22:25 +09:00
parent 92aeddecd0
commit 76342bfaef
3 changed files with 114 additions and 0 deletions
@@ -0,0 +1,13 @@
package com.eactive.eai.common.circuitbreak.loader;
import com.eactive.eai.data.entity.onl.circuitbreaker.CircuitBreakerConfig;
import com.eactive.eai.data.jpa.AbstractDataLoader;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class CircuitBreakerConfigLoader
extends
AbstractDataLoader<CircuitBreakerConfig, String, CircuitBreakerConfigLoaderRepository> {
}
@@ -0,0 +1,10 @@
package com.eactive.eai.common.circuitbreak.loader;
import com.eactive.eai.data.DataLoaderRepository;
import com.eactive.eai.data.entity.onl.circuitbreaker.CircuitBreakerConfig;
import com.eactive.eai.data.jpa.BaseRepository;
import org.springframework.data.querydsl.QuerydslPredicateExecutor;
interface CircuitBreakerConfigLoaderRepository extends DataLoaderRepository<CircuitBreakerConfig>,
BaseRepository<CircuitBreakerConfig, String>, QuerydslPredicateExecutor<CircuitBreakerConfig> {
}
@@ -0,0 +1,91 @@
package com.eactive.eai.data.entity.onl.circuitbreaker;
import java.io.Serializable;
import java.time.LocalDateTime;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import org.hibernate.annotations.Comment;
import org.hibernate.annotations.GenericGenerator;
import com.eactive.eai.data.entity.AbstractEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
@Data
@EqualsAndHashCode(onlyExplicitlyIncluded = true, callSuper = true)
@Entity
@Table(name = "circuitbreaker_config")
@org.hibernate.annotations.Table(appliesTo = "circuitbreaker_config", comment = "서킷브레이커_설정")
public class CircuitBreakerConfig extends AbstractEntity<String> implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(generator = "UUID")
@GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator")
@Column(name = "cbreaker_id", updatable = false, nullable = false, length = 36)
@Comment("cicuitbreaker ID")
private String cbreakerId;
@Column(name = "cbreaker_type", unique = true, nullable = false, length = 1000)
@Comment("cicuitbreaker유형(apiId)")
String cbreakerType;
@Column(name = "cbreaker_name", unique = true, nullable = false, length = 1000)
@Comment("cicuitbreaker이름")
String cbreakerName;
@Column(name = "cbreaker_desc", nullable = true, length = 500)
@Comment("cicuitbreaker 설명")
String cbreakerDesc;
@Column(name = "fail_rate_threshold", nullable = false)
@Comment("회로를 열지 여부를 결정하는 실패 비율 임계값(%)")
int failureRateThreshold;
@Column(name = "sliding_window_size", nullable = false)
@Comment("슬라이딩 창의 크기")
int slidingWindowSize;
@Column(name = "min_num_calls", nullable = false)
@Comment("회로 상태 전환을 평가하기 전에 적어도 몇 번의 호출이 있어야 하는지를 설정")
int minimumNumberOfCalls;
@Column(name = "wait_duration_in_open", nullable = false)
@Comment("회로가 열린 후, 다음 시도(반열림 상태로 전환)까지 대기하는 시간(초)")
int waitDurationInOpenState;
@Column(name = "permit_num_calls_in_half", nullable = false)
@Comment("회로가 반열림 상태일 때 허용되는 호출 수를 설정")
int permittedNumberOfCallsInHalfOpenState;
@Column(name = "slow_call_rate_threshold", nullable = false)
@Comment("느린 호출의 비율이 임계값을 초과하면 회로 오픈")
int slowCallRateThreshold;
@Column(name = "slow_call_duration_threshold", nullable = false)
@Comment("호출이 \"느린호출\"로 간주되기 위한 시간 임계값")
int slowCallDurationThreshold;
@Column(name = "use_yn", length = 1, nullable = false)
@Comment("circuitbreaker 사용여부")
String useYn;
@Column(name = "modified_by", length = 50)
@Comment("수정자")
private String modifiedBy;
@Column(name = "modified_at")
@Comment("수정일시")
private LocalDateTime modifiedAt;
public @NonNull String getId() {
return this.cbreakerId;
}
}