mirror of
https://gitee.com/lijiahangmax/orion-ops.git
synced 2026-09-24 15:30:00 +08:00
add chinese const.
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
package com.orion.ops.consts;
|
||||
|
||||
/**
|
||||
* 中文常量
|
||||
*
|
||||
* @author Jiahang Li
|
||||
* @version 1.0.0
|
||||
* @since 2022/5/29 16:25
|
||||
*/
|
||||
public class CnConst {
|
||||
|
||||
private CnConst() {
|
||||
}
|
||||
|
||||
public static final String ENABLE = "启用";
|
||||
|
||||
public static final String DISABLE = "停用";
|
||||
|
||||
public static final String RESOLVE = "通过";
|
||||
|
||||
public static final String REJECT = "驳回";
|
||||
|
||||
public static final String SUCCESS = "成功";
|
||||
|
||||
public static final String FAILURE = "失败";
|
||||
|
||||
public static final String OPEN = "开启";
|
||||
|
||||
public static final String CLOSE = "关闭";
|
||||
|
||||
public static final String YES = "是";
|
||||
|
||||
public static final String NO = "否";
|
||||
|
||||
public static final String APP = "应用";
|
||||
|
||||
public static final String RELEASE = "发布";
|
||||
|
||||
|
||||
}
|
||||
@@ -122,18 +122,6 @@ public class Const extends com.orion.constant.Const {
|
||||
|
||||
public static final int MIN_TRACKER_DELAY_MS = 50;
|
||||
|
||||
public static final String ENABLE_LABEL = "启用";
|
||||
|
||||
public static final String DISABLE_LABEL = "停用";
|
||||
|
||||
public static final String RESOLVE_LABEL = "通过";
|
||||
|
||||
public static final String REJECT_LABEL = "驳回";
|
||||
|
||||
public static final String SUCCESS_LABEL = "成功";
|
||||
|
||||
public static final String FAILURE_LABEL = "失败";
|
||||
|
||||
public static final Double D_0 = 0D;
|
||||
|
||||
public static final int DEFAULT_FILE_CLEAN_THRESHOLD = 60;
|
||||
@@ -144,10 +132,6 @@ public class Const extends com.orion.constant.Const {
|
||||
|
||||
public static final int SFTP_UPLOAD_THRESHOLD = 512;
|
||||
|
||||
public static final String APP_CN = "应用";
|
||||
|
||||
public static final String RELEASE_CN = "发布";
|
||||
|
||||
public static final String LF_2 = "\n\n";
|
||||
|
||||
public static final String LF_3 = "\n\n\n";
|
||||
|
||||
@@ -59,7 +59,6 @@ public class MachineFieldConst {
|
||||
|
||||
public static final String DESCRIPTION_LEN_MESSAGE = "描述长度不能大于 " + DESCRIPTION_MAX_LEN + "位";
|
||||
|
||||
|
||||
/**
|
||||
* 验证数据合法性
|
||||
*
|
||||
|
||||
@@ -27,7 +27,7 @@ public class MachineInfoExportDTO {
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 机器标签
|
||||
* 唯一标识
|
||||
*/
|
||||
@ExportField(index = 1, header = "唯一标识", width = 25)
|
||||
private String tag;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class MachineInfoImportDTO extends BaseDataImportDTO {
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 机器标签
|
||||
* 唯一标识
|
||||
*/
|
||||
@ImportField(index = 1)
|
||||
private String tag;
|
||||
|
||||
+2
-1
@@ -1,6 +1,7 @@
|
||||
package com.orion.ops.handler.app.pipeline.stage;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.orion.ops.consts.CnConst;
|
||||
import com.orion.ops.consts.Const;
|
||||
import com.orion.ops.consts.MessageConst;
|
||||
import com.orion.ops.consts.app.PipelineLogStatus;
|
||||
@@ -80,7 +81,7 @@ public class ReleaseStageHandler extends AbstractStageHandler {
|
||||
ApplicationPipelineStageConfigDTO config = JSON.parseObject(detail.getStageConfig(), ApplicationPipelineStageConfigDTO.class);
|
||||
request.setDescription(config.getDescription());
|
||||
// 标题
|
||||
request.setTitle(Strings.def(config.getTitle(), () -> Const.RELEASE_CN + Const.SPACE + detail.getAppName()));
|
||||
request.setTitle(Strings.def(config.getTitle(), () -> CnConst.RELEASE + Const.SPACE + detail.getAppName()));
|
||||
// 构建id
|
||||
Long buildId = config.getBuildId();
|
||||
ApplicationBuildDO build = null;
|
||||
|
||||
+3
-2
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.orion.constant.Letters;
|
||||
import com.orion.lang.wrapper.DataGrid;
|
||||
import com.orion.ops.consts.AuditStatus;
|
||||
import com.orion.ops.consts.CnConst;
|
||||
import com.orion.ops.consts.Const;
|
||||
import com.orion.ops.consts.MessageConst;
|
||||
import com.orion.ops.consts.app.PipelineDetailStatus;
|
||||
@@ -219,7 +220,7 @@ public class ApplicationPipelineTaskServiceImpl implements ApplicationPipelineTa
|
||||
}
|
||||
int effect = applicationPipelineTaskDAO.updateById(update);
|
||||
this.setEventLogParams(task);
|
||||
EventParamsHolder.addParam(EventKeys.OPERATOR, resolve ? Const.RESOLVE_LABEL : Const.REJECT_LABEL);
|
||||
EventParamsHolder.addParam(EventKeys.OPERATOR, resolve ? CnConst.RESOLVE : CnConst.REJECT);
|
||||
return effect;
|
||||
}
|
||||
|
||||
@@ -307,7 +308,7 @@ public class ApplicationPipelineTaskServiceImpl implements ApplicationPipelineTa
|
||||
Long appId = detail.getAppId();
|
||||
ApplicationInfoDO appInfo = appMap.get(appId);
|
||||
Valid.notNull(appInfo, detail.getAppName() + MessageConst.ABSENT);
|
||||
String appSymbol = Const.APP_CN + Strings.SPACE + appInfo.getAppName() + Strings.SPACE;
|
||||
String appSymbol = CnConst.APP + Strings.SPACE + appInfo.getAppName() + Strings.SPACE;
|
||||
// 检查构建版本
|
||||
if (StageType.BUILD.getType().equals(detail.getStageType())) {
|
||||
appBuildStage.add(appId);
|
||||
|
||||
+1
-1
@@ -313,7 +313,7 @@ public class ApplicationReleaseServiceImpl implements ApplicationReleaseService
|
||||
// 设置日志参数
|
||||
EventParamsHolder.addParam(EventKeys.ID, id);
|
||||
EventParamsHolder.addParam(EventKeys.TITLE, release.getReleaseTitle());
|
||||
EventParamsHolder.addParam(EventKeys.OPERATOR, resolve ? Const.RESOLVE_LABEL : Const.REJECT_LABEL);
|
||||
EventParamsHolder.addParam(EventKeys.OPERATOR, resolve ? CnConst.RESOLVE : CnConst.REJECT);
|
||||
return effect;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -8,6 +8,7 @@ import com.orion.net.remote.CommandExecutors;
|
||||
import com.orion.net.remote.channel.SessionHolder;
|
||||
import com.orion.net.remote.channel.SessionStore;
|
||||
import com.orion.net.remote.channel.ssh.CommandExecutor;
|
||||
import com.orion.ops.consts.CnConst;
|
||||
import com.orion.ops.consts.Const;
|
||||
import com.orion.ops.consts.MessageConst;
|
||||
import com.orion.ops.consts.event.EventKeys;
|
||||
@@ -171,7 +172,7 @@ public class MachineInfoServiceImpl implements MachineInfoService {
|
||||
// 设置日志参数
|
||||
EventParamsHolder.addParam(EventKeys.ID_LIST, idList);
|
||||
EventParamsHolder.addParam(EventKeys.COUNT, effect);
|
||||
EventParamsHolder.addParam(EventKeys.OPERATOR, Const.ENABLE.equals(status) ? Const.ENABLE_LABEL : Const.DISABLE_LABEL);
|
||||
EventParamsHolder.addParam(EventKeys.OPERATOR, Const.ENABLE.equals(status) ? CnConst.ENABLE : CnConst.DISABLE);
|
||||
return effect;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -2,6 +2,7 @@ package com.orion.ops.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.orion.lang.wrapper.DataGrid;
|
||||
import com.orion.ops.consts.CnConst;
|
||||
import com.orion.ops.consts.Const;
|
||||
import com.orion.ops.consts.MessageConst;
|
||||
import com.orion.ops.consts.event.EventKeys;
|
||||
@@ -185,7 +186,7 @@ public class SchedulerTaskServiceImpl implements SchedulerTaskService {
|
||||
taskRegister.submit(TaskType.SCHEDULER_TASK, task.getExpression(), id);
|
||||
}
|
||||
// 设置日志参数
|
||||
EventParamsHolder.addParam(EventKeys.OPERATOR, enable ? Const.ENABLE_LABEL : Const.DISABLE_LABEL);
|
||||
EventParamsHolder.addParam(EventKeys.OPERATOR, enable ? CnConst.ENABLE : CnConst.DISABLE);
|
||||
EventParamsHolder.addParam(EventKeys.ID, id);
|
||||
EventParamsHolder.addParam(EventKeys.NAME, task.getTaskName());
|
||||
return effect;
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.orion.id.UUIds;
|
||||
import com.orion.lang.wrapper.DataGrid;
|
||||
import com.orion.lang.wrapper.HttpWrapper;
|
||||
import com.orion.ops.consts.CnConst;
|
||||
import com.orion.ops.consts.Const;
|
||||
import com.orion.ops.consts.KeyConst;
|
||||
import com.orion.ops.consts.MessageConst;
|
||||
@@ -193,7 +194,7 @@ public class UserServiceImpl implements UserService {
|
||||
// 设置日志参数
|
||||
EventParamsHolder.addParam(EventKeys.ID, id);
|
||||
EventParamsHolder.addParam(EventKeys.USERNAME, userInfo.getUsername());
|
||||
EventParamsHolder.addParam(EventKeys.OPERATOR, enable ? Const.ENABLE_LABEL : Const.DISABLE_LABEL);
|
||||
EventParamsHolder.addParam(EventKeys.OPERATOR, enable ? CnConst.ENABLE : CnConst.DISABLE);
|
||||
return effect;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user