[fix] 添加令牌密钥

This commit is contained in:
wujiawei 2024-10-09 20:28:45 +08:00
parent 1e89813793
commit 571fe7893d
9 changed files with 93 additions and 5 deletions

View File

@ -66,7 +66,17 @@ public class LazyNettyServerPropertiesQueryListCommand {
*/
@Schema(description ="类型配置、DB",name ="type",example = "")
private PropertiesType type;
/**
* 令牌key
*/
@Schema(description = "令牌key", name = "appKey", example = "")
private String appKey;
/**
* 令牌密钥
*/
@Schema(description = "令牌密钥", name = "appSecret", example = "")
private String appSecret;
/**
*
* 更新时间

View File

@ -65,7 +65,17 @@ public class LazyNettyServerPropertiesQueryOneCommand {
*/
@Schema(description ="类型配置、DB",name ="type",example = "")
private PropertiesType type;
/**
* 令牌key
*/
@Schema(description = "令牌key", name = "appKey", example = "")
private String appKey;
/**
* 令牌密钥
*/
@Schema(description = "令牌密钥", name = "appSecret", example = "")
private String appSecret;
/**
*
* 更新时间

View File

@ -66,7 +66,17 @@ public class LazyNettyServerPropertiesRemoveCommand {
*/
@Schema(description ="类型配置、DB",name ="type",example = "")
private PropertiesType type;
/**
* 令牌key
*/
@Schema(description = "令牌key", name = "appKey", example = "")
private String appKey;
/**
* 令牌密钥
*/
@Schema(description = "令牌密钥", name = "appSecret", example = "")
private String appSecret;
/**
*
* 更新时间

View File

@ -65,7 +65,17 @@ public class LazyNettyServerPropertiesStoryCommand {
*/
@Schema(description ="类型配置、DB",name ="type",example = "")
private PropertiesType type;
/**
* 令牌key
*/
@Schema(description = "令牌key", name = "appKey", example = "")
private String appKey;
/**
* 令牌密钥
*/
@Schema(description = "令牌密钥", name = "appSecret", example = "")
private String appSecret;
/**
*
* 更新时间

View File

@ -65,7 +65,17 @@ public class LazyNettyServerPropertiesUpdateCommand {
*/
@Schema(description ="类型配置、DB",name ="type",example = "")
private PropertiesType type;
/**
* 令牌key
*/
@Schema(description = "令牌key", name = "appKey", example = "")
private String appKey;
/**
* 令牌密钥
*/
@Schema(description = "令牌密钥", name = "appSecret", example = "")
private String appSecret;
/**
*
* 更新时间

View File

@ -65,7 +65,17 @@ public class LazyNettyServerPropertiesDTO {
*/
@Schema(description ="类型配置、DB",name ="type",example = "")
private PropertiesType type;
/**
* 令牌key
*/
@Schema(description = "令牌key", name = "appKey", example = "")
private String appKey;
/**
* 令牌密钥
*/
@Schema(description = "令牌密钥", name = "appSecret", example = "")
private String appSecret;
/**
*
* 更新时间

View File

@ -54,6 +54,8 @@ public class InitConfig implements CommandLineRunner, DisposableBean {
String clientId = nettyClientProperties.getClientId();
String inetHost = nettyClientProperties.getInetHost();
int inetPort = nettyClientProperties.getInetPort();
String appKey = nettyClientProperties.getAppKey();
String appSecret = nettyClientProperties.getAppSecret();
if (Objects.isNull(clientId) ||
Objects.isNull(inetHost)) {
log.warn("配置信息为空,请通过页面添加配置信息:{}", nettyClientProperties);
@ -65,6 +67,9 @@ public class InitConfig implements CommandLineRunner, DisposableBean {
lazyNettyServerPropertiesDO.setInetPort(inetPort);
lazyNettyServerPropertiesDO.setType(PropertiesType.CONFIG);
lazyNettyServerPropertiesDO.setIsDeleted(false);
lazyNettyServerPropertiesDO.setAppKey(appKey);
lazyNettyServerPropertiesDO.setAppSecret(appSecret);
// 根据服务端端口port 唯一性验证
boolean exists = lazyLambdaStream.exists(LazyWrappers.<LazyNettyServerPropertiesDO>lambdaWrapper()
.eq(LazyNettyServerPropertiesDO::getInetHost, inetHost)

View File

@ -5,6 +5,7 @@ import lombok.experimental.Accessors;
import io.swagger.v3.oas.annotations.media.Schema;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import org.framework.lazy.cloud.network.heartbeat.client.config.PropertiesType;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableField;
import java.lang.String;
import java.time.LocalDateTime;
@ -65,7 +66,17 @@ public class LazyNettyServerProperties {
*/
@Schema(description ="类型配置、DB",name ="type",example = "")
private PropertiesType type;
/**
* 令牌key
*/
@Schema(description = "令牌key", name = "appKey", example = "")
private String appKey;
/**
* 令牌密钥
*/
@Schema(description = "令牌密钥", name = "appSecret", example = "")
private String appSecret;
/**
*
* 更新时间

View File

@ -1,17 +1,15 @@
package org.framework.lazy.cloud.network.heartbeat.client.infrastructure.entity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.experimental.Accessors;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import org.framework.lazy.cloud.network.heartbeat.client.config.PropertiesType;
import org.framework.lazy.cloud.network.heartbeat.common.enums.NettyClientStatus;
import org.wu.framework.lazy.orm.core.stereotype.LazyTable;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableField;
import org.wu.framework.lazy.orm.core.stereotype.*;
import io.swagger.v3.oas.annotations.media.Schema;
import org.wu.framework.lazy.orm.core.stereotype.LazyTableFieldUnique;
import java.lang.String;
import java.time.LocalDateTime;
import java.lang.Integer;
/**
* describe 服务端配置信息
*
@ -75,6 +73,20 @@ public class LazyNettyServerPropertiesDO {
@LazyTableField(name="is_deleted",comment="是否删除")
private Boolean isDeleted;
/**
* 令牌key
*/
@Schema(description = "令牌key", name = "appKey", example = "")
@LazyTableField(name = "app_key", comment = "令牌key")
private String appKey;
/**
* 令牌密钥
*/
@Schema(description = "令牌密钥", name = "appSecret", example = "")
@LazyTableField(name = "app_secret", comment = "令牌密钥")
private String appSecret;
/**
*
* 类型配置DB