@@ -0,0 +1,12 @@
|
||||
package ru.soune.nocopy.entity.tokenoperation;
|
||||
|
||||
public enum OperationType {
|
||||
SEARCH("search"), MONITORING("monitoring"), CREATE_LEGAL_CASE("legal_case"),
|
||||
FILE_UPLOAD("file_upload"), GLOBAL_SEARCH("global_search");
|
||||
|
||||
private final String name;
|
||||
|
||||
private OperationType(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package ru.soune.nocopy.entity.tokenoperation;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import lombok.*;
|
||||
import org.hibernate.annotations.CreationTimestamp;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Table(name = "token_operation")
|
||||
@Entity
|
||||
@Setter @Getter
|
||||
@NoArgsConstructor
|
||||
public class TokenOperation {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
|
||||
@Enumerated(EnumType.STRING)
|
||||
@Column(name = "operation_type")
|
||||
private OperationType operationType;
|
||||
|
||||
@Column(name = "user_id")
|
||||
private Long userId;
|
||||
|
||||
@Column(name = "spent")
|
||||
private Long spent;
|
||||
|
||||
@CreationTimestamp
|
||||
@Column(name = "created_at", updatable = false)
|
||||
private LocalDateTime createdAt;
|
||||
}
|
||||
Reference in New Issue
Block a user