mirror of
				https://github.com/continew-org/continew-starter.git
				synced 2025-10-31 22:57:19 +08:00 
			
		
		
		
	refactor: 优化部分代码
修复 Qodana 扫描问题
This commit is contained in:
		| @@ -77,10 +77,8 @@ public class SaTokenDaoRedisImpl implements SaTokenDao { | ||||
|         // 判断是否想要设置为永久 | ||||
|         if (timeout == SaTokenDao.NEVER_EXPIRE) { | ||||
|             long expire = getTimeout(key); | ||||
|             if (expire == SaTokenDao.NEVER_EXPIRE) { | ||||
|                 // 如果其已经被设置为永久,则不作任何处理 | ||||
|             } else { | ||||
|                 // 如果尚未被设置为永久,那么再次 set 一次 | ||||
|             // 如果其已经被设置为永久,则不作任何处理。如果尚未被设置为永久,那么再次 set 一次 | ||||
|             if (expire != SaTokenDao.NEVER_EXPIRE) { | ||||
|                 this.set(key, this.get(key), timeout); | ||||
|             } | ||||
|             return; | ||||
| @@ -123,8 +121,7 @@ public class SaTokenDaoRedisImpl implements SaTokenDao { | ||||
|  | ||||
|     @Override | ||||
|     public long getObjectTimeout(String key) { | ||||
|         long timeout = RedisUtils.getTimeToLive(key); | ||||
|         return timeout < 0 ? timeout : timeout / 1000; | ||||
|         return this.getTimeout(key); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
| @@ -132,10 +129,8 @@ public class SaTokenDaoRedisImpl implements SaTokenDao { | ||||
|         // 判断是否想要设置为永久 | ||||
|         if (timeout == SaTokenDao.NEVER_EXPIRE) { | ||||
|             long expire = getObjectTimeout(key); | ||||
|             if (expire == SaTokenDao.NEVER_EXPIRE) { | ||||
|                 // 如果其已经被设置为永久,则不作任何处理 | ||||
|             } else { | ||||
|                 // 如果尚未被设置为永久,那么再次 set 一次 | ||||
|             // 如果其已经被设置为永久,则不作任何处理。如果尚未被设置为永久,那么再次 set 一次 | ||||
|             if (expire != SaTokenDao.NEVER_EXPIRE) { | ||||
|                 this.setObject(key, this.getObject(key), timeout); | ||||
|             } | ||||
|             return; | ||||
|   | ||||
| @@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.annotation.TableField; | ||||
| import com.baomidou.mybatisplus.annotation.TableId; | ||||
| import lombok.Data; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| @@ -33,6 +34,7 @@ import java.time.LocalDateTime; | ||||
| @Data | ||||
| public class BaseDO implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -25,6 +25,7 @@ import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import lombok.Data; | ||||
| import top.charles7c.continew.starter.extension.crud.constant.ContainerPool; | ||||
|  | ||||
| import java.io.Serial; | ||||
| import java.io.Serializable; | ||||
| import java.time.LocalDateTime; | ||||
|  | ||||
| @@ -37,6 +38,7 @@ import java.time.LocalDateTime; | ||||
| @Data | ||||
| public class BaseResp implements Serializable { | ||||
|  | ||||
|     @Serial | ||||
|     private static final long serialVersionUID = 1L; | ||||
|  | ||||
|     /** | ||||
|   | ||||
| @@ -24,6 +24,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; | ||||
| import io.swagger.v3.oas.annotations.media.Schema; | ||||
| import jakarta.validation.constraints.Min; | ||||
| import lombok.Data; | ||||
| import lombok.EqualsAndHashCode; | ||||
| import org.hibernate.validator.constraints.Range; | ||||
| import org.springdoc.core.annotations.ParameterObject; | ||||
| import org.springframework.data.domain.Sort; | ||||
| @@ -38,6 +39,7 @@ import java.io.Serial; | ||||
|  */ | ||||
| @Data | ||||
| @ParameterObject | ||||
| @EqualsAndHashCode(callSuper = true) | ||||
| @Schema(description = "分页查询条件") | ||||
| public class PageQuery extends SortQuery { | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user