mirror of
https://codeup.aliyun.com/64f7d6b8ce01efaafef1e678/coal/coal.git
synced 2026-01-25 07:46:40 +08:00
完善ip黑名单
This commit is contained in:
@@ -13,6 +13,8 @@ import lombok.Data;
|
||||
import org.hibernate.annotations.Comment;
|
||||
import org.hibernate.annotations.Type;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
@Entity
|
||||
public class IpListEntity extends CommonEntity {
|
||||
@@ -28,4 +30,11 @@ public class IpListEntity extends CommonEntity {
|
||||
@Comment("地址类型 0:黑名单 1:白名单")
|
||||
private String addressType;
|
||||
|
||||
|
||||
@Comment("开始时间")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
@Comment("结束时间")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
}
|
||||
|
||||
@@ -8,6 +8,6 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface IpListRepository extends BaseRepository<IpListEntity> {
|
||||
@Query(value = "select address_type from t_ip_list where address >>= cast(?1 as inet) order by address_type limit 1 ", nativeQuery = true)
|
||||
@Query(value = "select address_type from t_ip_list where address >>= cast(?1 as inet) order by address_type desc limit 1 ", nativeQuery = true)
|
||||
String getAddressType(String address);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user