feat: 1.1.0
1. 完成手动新增任务功能 2. 优化查询界面默认显示空问题
This commit is contained in:
parent
7bf0eed6b6
commit
22ea53b477
@ -1,5 +1,6 @@
|
||||
package com.aizuda.easy.retry.client.core.client;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.aizuda.easy.retry.client.core.BizIdGenerate;
|
||||
import com.aizuda.easy.retry.client.core.RetryArgSerializer;
|
||||
import com.aizuda.easy.retry.client.core.cache.GroupVersionCache;
|
||||
@ -17,7 +18,6 @@ import com.aizuda.easy.retry.common.core.enums.RetryResultStatusEnum;
|
||||
import com.aizuda.easy.retry.common.core.enums.RetryStatusEnum;
|
||||
import com.aizuda.easy.retry.common.core.log.LogUtils;
|
||||
import com.aizuda.easy.retry.common.core.model.Result;
|
||||
import com.aizuda.easy.retry.common.core.util.Assert;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
import com.aizuda.easy.retry.server.model.dto.ConfigDTO;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
@ -145,7 +145,7 @@ public class RetryEndPoint {
|
||||
* @param generateRetryBizIdDTO 生成bizId模型
|
||||
* @return bizId
|
||||
*/
|
||||
@PostMapping("/generate/biz-id")
|
||||
@PostMapping("/generate/biz-id/v1")
|
||||
public Result<String> bizIdGenerate(@RequestBody @Validated GenerateRetryBizIdDTO generateRetryBizIdDTO) {
|
||||
|
||||
String scene = generateRetryBizIdDTO.getScene();
|
||||
|
||||
@ -46,7 +46,7 @@ public class RestExceptionHandler {
|
||||
*/
|
||||
@ExceptionHandler({Exception.class})
|
||||
public Result onException(Exception ex) {
|
||||
log.error("异常类 businessException,", ex);
|
||||
log.error("异常类 onException,", ex);
|
||||
return new Result<String>(0, "系统异常");
|
||||
}
|
||||
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
package com.aizuda.easy.retry.common.core.util;
|
||||
|
||||
/**
|
||||
* @author: www.byteblogs.com
|
||||
* @date : 2022-02-16 14:37
|
||||
*/
|
||||
public class Assert extends cn.hutool.core.lang.Assert {
|
||||
|
||||
}
|
||||
@ -1,114 +0,0 @@
|
||||
package com.aizuda.easy.retry.common.core.util;
|
||||
|
||||
import com.aizuda.easy.retry.common.core.exception.AbstractError;
|
||||
import com.aizuda.easy.retry.common.core.exception.BaseEasyRetryException;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
public class Asserts {
|
||||
|
||||
public static void isTrue(boolean expression, AbstractError serviceError, Object... args) {
|
||||
if (!expression) {
|
||||
// Class<BaseEasyRetryException> baseXRetryExceptionClass = BaseEasyRetryException.class;
|
||||
// Constructor<BaseEasyRetryException> constructor = baseXRetryExceptionClass.getConstructor(String.class, Object[].class);
|
||||
// constructor.newInstance(serviceError.toString(), args);
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isFalse(boolean expression, AbstractError serviceError, Object... args) {
|
||||
if (expression) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isNull(Object object, AbstractError serviceError, Object... args) {
|
||||
if (object != null) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void notNull(Object object, AbstractError serviceError, Object... args) {
|
||||
if (object == null) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void hasLength(String text, AbstractError serviceError, Object... args) {
|
||||
if (!StringUtils.isNotEmpty(text)) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void hasText(String text, AbstractError serviceError, Object... args) {
|
||||
if (!StringUtils.isNotBlank(text)) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isEquals(Object one, Object another, AbstractError serviceError, Object... args) {
|
||||
if (!Objects.equals(one, another)) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void notEquals(Object one, Object another, AbstractError serviceError, Object... args) {
|
||||
if (Objects.equals(one, another)) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void doesNotContain(String textToSearch, String substring, AbstractError serviceError, Object... args) {
|
||||
if (StringUtils.isNotEmpty(textToSearch) && StringUtils.isNotEmpty(substring) &&
|
||||
textToSearch.contains(substring)) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void notEmpty(Object[] array, AbstractError serviceError, Object... args) {
|
||||
if (array == null || array.length == 0) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void noNullElements(Object[] array, AbstractError serviceError, Object... args) {
|
||||
if (array != null) {
|
||||
for (Object element : array) {
|
||||
if (element == null) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void notEmpty(Collection collection, AbstractError serviceError, Object... args) {
|
||||
if (CollectionUtils.isEmpty(collection)) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void notEmpty(Map map, AbstractError serviceError, Object... args) {
|
||||
if (CollectionUtils.isEmpty(map)) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isInstanceOf(Class<?> type, Object obj, AbstractError serviceError, Object... args) {
|
||||
notNull(type, serviceError);
|
||||
if (!type.isInstance(obj)) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
public static void isAssignable(Class<?> superType, Class<?> subType, AbstractError serviceError, Object... args) {
|
||||
notNull(superType, serviceError);
|
||||
if (subType == null || !superType.isAssignableFrom(subType)) {
|
||||
throw new BaseEasyRetryException(serviceError.toString(), args);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -116,6 +116,12 @@
|
||||
<version>${org.mapstruct.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mapstruct</groupId>
|
||||
<artifactId>mapstruct-processor</artifactId>
|
||||
<version>${org.mapstruct.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package com.aizuda.easy.retry.server.persistence.support.access.retry;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.aizuda.easy.retry.common.core.enums.RetryStatusEnum;
|
||||
import com.aizuda.easy.retry.common.core.util.Assert;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
import com.aizuda.easy.retry.server.exception.EasyRetryServerException;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryTaskMapper;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package com.aizuda.easy.retry.server.persistence.support.processor;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.aizuda.easy.retry.server.exception.EasyRetryServerException;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.po.RetryTask;
|
||||
import com.aizuda.easy.retry.server.persistence.support.RetryTaskAccess;
|
||||
import com.aizuda.easy.retry.common.core.util.Assert;
|
||||
import com.aizuda.easy.retry.server.persistence.support.access.retry.AbstractRetryTaskAccess;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.aizuda.easy.retry.server.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.HashUtil;
|
||||
import com.aizuda.easy.retry.server.exception.EasyRetryServerException;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.mapper.GroupConfigMapper;
|
||||
@ -14,7 +15,6 @@ import com.aizuda.easy.retry.server.support.handler.ClientRegisterHandler;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.aizuda.easy.retry.common.core.util.Assert;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
import com.aizuda.easy.retry.server.service.GroupConfigService;
|
||||
import com.aizuda.easy.retry.server.service.convert.GroupConfigConverter;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.aizuda.easy.retry.server.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.aizuda.easy.retry.server.exception.EasyRetryServerException;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryDeadLetterMapper;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryTaskMapper;
|
||||
@ -9,7 +10,6 @@ import com.aizuda.easy.retry.server.service.convert.RetryDeadLetterResponseVOCon
|
||||
import com.aizuda.easy.retry.server.support.strategy.WaitStrategies;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.aizuda.easy.retry.common.core.util.Assert;
|
||||
import com.aizuda.easy.retry.server.config.RequestDataHelper;
|
||||
import com.aizuda.easy.retry.server.service.RetryDeadLetterService;
|
||||
import com.aizuda.easy.retry.server.web.model.base.PageResult;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.aizuda.easy.retry.server.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.aizuda.easy.retry.common.core.log.LogUtils;
|
||||
import com.aizuda.easy.retry.server.exception.EasyRetryServerException;
|
||||
import com.aizuda.easy.retry.server.model.dto.RetryTaskDTO;
|
||||
@ -15,7 +16,6 @@ import com.aizuda.easy.retry.server.support.strategy.WaitStrategies;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.aizuda.easy.retry.common.core.enums.RetryStatusEnum;
|
||||
import com.aizuda.easy.retry.server.config.RequestDataHelper;
|
||||
import com.aizuda.easy.retry.common.core.util.Assert;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
import com.aizuda.easy.retry.server.service.RetryService;
|
||||
import com.aizuda.easy.retry.server.service.convert.RetryTaskConverter;
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
package com.aizuda.easy.retry.server.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.aizuda.easy.retry.client.model.GenerateRetryBizIdDTO;
|
||||
import com.aizuda.easy.retry.common.core.enums.RetryStatusEnum;
|
||||
import com.aizuda.easy.retry.common.core.model.Result;
|
||||
import com.aizuda.easy.retry.common.core.util.Assert;
|
||||
import com.aizuda.easy.retry.server.config.RequestDataHelper;
|
||||
import com.aizuda.easy.retry.server.exception.EasyRetryServerException;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryTaskMapper;
|
||||
@ -164,12 +164,12 @@ public class RetryTaskServiceImpl implements RetryTaskService {
|
||||
generateRetryBizIdDTO.setExecutorName(generateRetryBizIdVO.getExecutorName());
|
||||
|
||||
HttpEntity<GenerateRetryBizIdDTO> requestEntity = new HttpEntity<>(generateRetryBizIdDTO);
|
||||
Result<String> result = restTemplate.postForObject(url, requestEntity, Result.class);
|
||||
Result result = restTemplate.postForObject(url, requestEntity, Result.class);
|
||||
|
||||
Assert.notNull(result, () -> new EasyRetryServerException("biz生成失败"));
|
||||
Assert.isTrue(1 == result.getStatus(), () -> new EasyRetryServerException("biz生成失败:请确保参数与执行器名称正确"));
|
||||
|
||||
return result.getData();
|
||||
return (String) result.getData();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.aizuda.easy.retry.server.service.impl;
|
||||
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.crypto.SecureUtil;
|
||||
import com.aizuda.easy.retry.server.exception.EasyRetryServerException;
|
||||
@ -12,7 +13,6 @@ import com.auth0.jwt.JWT;
|
||||
import com.auth0.jwt.algorithms.Algorithm;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.aizuda.easy.retry.common.core.util.Assert;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
import com.aizuda.easy.retry.server.service.convert.SystemUserResponseVOConverter;
|
||||
import com.aizuda.easy.retry.server.web.annotation.RoleEnum;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.aizuda.easy.retry.server.support.dispatch.actor.exec;
|
||||
|
||||
import akka.actor.AbstractActor;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.aizuda.easy.retry.client.model.DispatchRetryDTO;
|
||||
import com.aizuda.easy.retry.client.model.DispatchRetryResultDTO;
|
||||
@ -8,7 +9,6 @@ import com.aizuda.easy.retry.common.core.constant.SystemConstants;
|
||||
import com.aizuda.easy.retry.common.core.log.LogUtils;
|
||||
import com.aizuda.easy.retry.common.core.model.Result;
|
||||
import com.aizuda.easy.retry.common.core.model.XRetryHeaders;
|
||||
import com.aizuda.easy.retry.common.core.util.Assert;
|
||||
import com.aizuda.easy.retry.common.core.util.JsonUtil;
|
||||
import com.aizuda.easy.retry.server.exception.EasyRetryServerException;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryTaskLogMapper;
|
||||
|
||||
@ -2,11 +2,11 @@ package com.aizuda.easy.retry.server.support.dispatch.actor.result;
|
||||
|
||||
import akka.actor.AbstractActor;
|
||||
import akka.actor.ActorRef;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.aizuda.easy.retry.common.core.enums.RetryStatusEnum;
|
||||
import com.aizuda.easy.retry.common.core.log.LogUtils;
|
||||
import com.aizuda.easy.retry.common.core.util.Assert;
|
||||
import com.aizuda.easy.retry.server.akka.ActorGenerator;
|
||||
import com.aizuda.easy.retry.server.exception.EasyRetryServerException;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryTaskLogMapper;
|
||||
|
||||
@ -2,11 +2,11 @@ package com.aizuda.easy.retry.server.support.dispatch.actor.result;
|
||||
|
||||
import akka.actor.AbstractActor;
|
||||
import akka.actor.ActorRef;
|
||||
import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.PageDTO;
|
||||
import com.aizuda.easy.retry.common.core.enums.RetryStatusEnum;
|
||||
import com.aizuda.easy.retry.common.core.log.LogUtils;
|
||||
import com.aizuda.easy.retry.common.core.util.Assert;
|
||||
import com.aizuda.easy.retry.server.akka.ActorGenerator;
|
||||
import com.aizuda.easy.retry.server.exception.EasyRetryServerException;
|
||||
import com.aizuda.easy.retry.server.persistence.mybatis.mapper.RetryTaskLogMapper;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.aizuda.easy.retry.server.web.controller;
|
||||
|
||||
import com.aizuda.easy.retry.common.core.model.Result;
|
||||
import com.aizuda.easy.retry.server.service.RetryTaskService;
|
||||
import com.aizuda.easy.retry.server.web.annotation.LoginRequired;
|
||||
import com.aizuda.easy.retry.server.web.model.base.PageResult;
|
||||
@ -62,8 +63,8 @@ public class RetryTaskController {
|
||||
|
||||
@LoginRequired
|
||||
@PostMapping("/generate/biz-id")
|
||||
public String bizIdGenerate(@RequestBody @Validated GenerateRetryBizIdVO generateRetryBizIdVO) {
|
||||
return retryTaskService.bizIdGenerate(generateRetryBizIdVO);
|
||||
public Result<String> bizIdGenerate(@RequestBody @Validated GenerateRetryBizIdVO generateRetryBizIdVO) {
|
||||
return new Result<>(retryTaskService.bizIdGenerate(generateRetryBizIdVO));
|
||||
}
|
||||
|
||||
@LoginRequired
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
package com.aizuda.easy.retry.server.web.model.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 生成bizId模型
|
||||
@ -27,12 +26,12 @@ public class GenerateRetryBizIdVO {
|
||||
/**
|
||||
* 执行参数
|
||||
*/
|
||||
@NotBlank(message = "参数 不能为空")
|
||||
@NotBlank(message = "参数不能为空")
|
||||
private String argsStr;
|
||||
|
||||
/**
|
||||
* 执行器名称
|
||||
*/
|
||||
@NotBlank(message = "executorName 不能为空")
|
||||
@NotBlank(message = "执行器不能为空")
|
||||
private String executorName;
|
||||
}
|
||||
|
||||
@ -2,8 +2,7 @@ package com.aizuda.easy.retry.server.web.model.request;
|
||||
|
||||
import com.aizuda.easy.retry.common.core.enums.RetryStatusEnum;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import org.hibernate.validator.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* 重试数据模型
|
||||
|
||||
@ -6,9 +6,8 @@
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"test:unit": "vue-cli-service test:unit",
|
||||
"lint": "vue-cli-service lint",
|
||||
"build:preview": "vue-cli-service build --mode preview",
|
||||
"lint:nofix": "vue-cli-service lint --no-fix"
|
||||
"lint": "eslint --fix --ext .js,.vue src",
|
||||
"build:preview": "vue-cli-service build --mode preview"
|
||||
},
|
||||
"dependencies": {
|
||||
"@ant-design-vue/pro-layout": "^1.0.11",
|
||||
|
||||
6
frontend/public/index.html
vendored
6
frontend/public/index.html
vendored
@ -5,7 +5,7 @@
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="icon" href="<%= BASE_URL %>logo.png">
|
||||
<title>easy-retry</title>
|
||||
<title>Easy-Retry</title>
|
||||
<style>.first-loading-wrp{display:flex;justify-content:center;align-items:center;flex-direction:column;min-height:420px;height:100%}.first-loading-wrp>h1{font-size:128px}.first-loading-wrp .loading-wrp{padding:98px;display:flex;justify-content:center;align-items:center}.dot{animation:antRotate 1.2s infinite linear;transform:rotate(45deg);position:relative;display:inline-block;font-size:32px;width:32px;height:32px;box-sizing:border-box}.dot i{width:14px;height:14px;position:absolute;display:block;background-color:#1890ff;border-radius:100%;transform:scale(.75);transform-origin:50% 50%;opacity:.3;animation:antSpinMove 1s infinite linear alternate}.dot i:nth-child(1){top:0;left:0}.dot i:nth-child(2){top:0;right:0;-webkit-animation-delay:.4s;animation-delay:.4s}.dot i:nth-child(3){right:0;bottom:0;-webkit-animation-delay:.8s;animation-delay:.8s}.dot i:nth-child(4){bottom:0;left:0;-webkit-animation-delay:1.2s;animation-delay:1.2s}@keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@-webkit-keyframes antRotate{to{-webkit-transform:rotate(405deg);transform:rotate(405deg)}}@keyframes antSpinMove{to{opacity:1}}@-webkit-keyframes antSpinMove{to{opacity:1}}</style>
|
||||
<!-- require cdn assets css -->
|
||||
<% for (var i in htmlWebpackPlugin.options.cdn && htmlWebpackPlugin.options.cdn.css) { %>
|
||||
@ -18,11 +18,11 @@
|
||||
</noscript>
|
||||
<div id="app">
|
||||
<div class="first-loading-wrp">
|
||||
<h1>easy-retry</h1>
|
||||
<h2>Easy-Retry</h2>
|
||||
<div class="loading-wrp">
|
||||
<span class="dot dot-spin"><i></i><i></i><i></i><i></i></span>
|
||||
</div>
|
||||
<div style="display: flex; justify-content: center; align-items: center;">easy-retry</div>
|
||||
<div style="display: flex; justify-content: center; align-items: center;">分布式重试服务平台</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- require cdn assets js -->
|
||||
|
||||
@ -13,6 +13,9 @@ const api = {
|
||||
allGroupNameList: `/group/all/group-name/list`,
|
||||
retryTaskPage: '/retry-task/list',
|
||||
retryTaskById: '/retry-task/',
|
||||
saveRetryTask: '/retry-task',
|
||||
bizIdGenerate: '/retry-task/generate/biz-id',
|
||||
updateRetryTaskExecutorName: '/retry-task/executor-name/batch',
|
||||
updateRetryTaskStatus: '/retry-task/status',
|
||||
retryTaskLogPage: '/retry-task-log/list',
|
||||
retryTaskLogById: '/retry-task-log/',
|
||||
@ -36,6 +39,22 @@ const api = {
|
||||
|
||||
export default api
|
||||
|
||||
export function bizIdGenerate (data) {
|
||||
return request({
|
||||
url: api.bizIdGenerate,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function saveRetryTask (data) {
|
||||
return request({
|
||||
url: api.saveRetryTask,
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function getTotalPartition () {
|
||||
return request({
|
||||
url: api.totalPartition,
|
||||
|
||||
@ -23,7 +23,7 @@ export default {
|
||||
menu: {
|
||||
locale: true
|
||||
},
|
||||
title: 'easy-retry',
|
||||
title: 'Easy-Retry',
|
||||
pwa: false,
|
||||
iconfontUrl: '',
|
||||
production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true'
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
-->
|
||||
<template v-slot:menuHeaderRender>
|
||||
<div>
|
||||
<!-- <logo-svg />-->
|
||||
<!-- <logo-svg />-->
|
||||
<h1>{{ title }}</h1>
|
||||
</div>
|
||||
</template>
|
||||
@ -31,7 +31,7 @@
|
||||
<template v-slot:headerContentRender>
|
||||
<div>
|
||||
<a-tooltip title="刷新页面">
|
||||
<a-icon type="reload" style="font-size: 18px;cursor: pointer;" @click="() => { $router.go(0) }" />
|
||||
<a-icon type="reload" style="font-size: 18px;cursor: pointer;" @click="() => { $router.go(0) }" />
|
||||
</a-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<div class="top">
|
||||
<div class="header">
|
||||
<a href="/">
|
||||
<span class="title">easy-retry</span>
|
||||
<span class="title">Easy-Retry</span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="desc">
|
||||
|
||||
@ -15,10 +15,10 @@
|
||||
<span class="table-page-search-submitButtons" :style="advanced && { float: 'right', overflow: 'hidden' } || {} ">
|
||||
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
|
||||
<a-button style="margin-left: 8px" @click="() => queryParam = {}">重置</a-button>
|
||||
<!-- <a @click="toggleAdvanced" style="margin-left: 8px">-->
|
||||
<!-- {{ advanced ? '收起' : '展开' }}-->
|
||||
<!-- <a-icon :type="advanced ? 'up' : 'down'"/>-->
|
||||
<!-- </a>-->
|
||||
<!-- <a @click="toggleAdvanced" style="margin-left: 8px">-->
|
||||
<!-- {{ advanced ? '收起' : '展开' }}-->
|
||||
<!-- <a-icon :type="advanced ? 'up' : 'down'"/>-->
|
||||
<!-- </a>-->
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
|
||||
@ -51,6 +51,7 @@
|
||||
:data="loadData"
|
||||
:alert="options.alert"
|
||||
:rowSelection="options.rowSelection"
|
||||
:scroll="{ x: 2000 }"
|
||||
>
|
||||
<span slot="serial" slot-scope="text, record, index">
|
||||
{{ index + 1 }}
|
||||
@ -158,6 +159,7 @@ export default {
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
width: '150px',
|
||||
fixed: 'right',
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
],
|
||||
@ -188,6 +190,10 @@ export default {
|
||||
created () {
|
||||
getAllGroupNameList().then(res => {
|
||||
this.groupNameList = res.data
|
||||
if (this.groupNameList !== null && this.groupNameList.length > 0) {
|
||||
this.queryParam['groupName'] = this.groupNameList[0]
|
||||
this.$refs.table.refresh(true)
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
||||
@ -51,6 +51,7 @@
|
||||
:data="loadData"
|
||||
:alert="options.alert"
|
||||
:rowSelection="options.rowSelection"
|
||||
:scroll="{ x: 2000 }"
|
||||
>
|
||||
<span slot="serial" slot-scope="text, record, index">
|
||||
{{ index + 1 }}
|
||||
@ -100,7 +101,8 @@ export default {
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
scopedSlots: { customRender: 'serial' }
|
||||
scopedSlots: { customRender: 'serial' },
|
||||
width: '50px'
|
||||
},
|
||||
{
|
||||
title: '组名称',
|
||||
@ -114,8 +116,7 @@ export default {
|
||||
},
|
||||
{
|
||||
title: '业务id',
|
||||
dataIndex: 'bizId',
|
||||
ellipsis: true
|
||||
dataIndex: 'bizId'
|
||||
},
|
||||
{
|
||||
title: '业务编号',
|
||||
@ -129,8 +130,7 @@ export default {
|
||||
},
|
||||
{
|
||||
title: '失败原因',
|
||||
dataIndex: 'errorMessage',
|
||||
ellipsis: true
|
||||
dataIndex: 'errorMessage'
|
||||
},
|
||||
{
|
||||
title: '触发时间',
|
||||
@ -142,6 +142,7 @@ export default {
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
fixed: 'right',
|
||||
width: '150px',
|
||||
scopedSlots: { customRender: 'action' }
|
||||
}
|
||||
|
||||
@ -51,7 +51,7 @@
|
||||
</div>
|
||||
<div class="table-operator">
|
||||
<a-button type="primary" icon="plus" @click="handleNew()">新增</a-button>
|
||||
<a-dropdown v-action:edit v-if="selectedRowKeys.length > 0">
|
||||
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||
<a-menu slot="overlay">
|
||||
<a-menu-item key="1"><a-icon type="delete" />删除</a-menu-item>
|
||||
<!-- lock | unlock -->
|
||||
@ -66,11 +66,12 @@
|
||||
<s-table
|
||||
ref="table"
|
||||
size="default"
|
||||
rowKey="key"
|
||||
:rowKey="(record) => record.id"
|
||||
:columns="columns"
|
||||
:data="loadData"
|
||||
:alert="options.alert"
|
||||
:rowSelection="options.rowSelection"
|
||||
:scroll="{ x: 2000 }"
|
||||
>
|
||||
<span slot="serial" slot-scope="text, record">
|
||||
{{ record.id }}
|
||||
@ -132,9 +133,9 @@ export default {
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '#',
|
||||
title: 'ID',
|
||||
scopedSlots: { customRender: 'serial' },
|
||||
width: '5%'
|
||||
fixed: 'left'
|
||||
},
|
||||
{
|
||||
title: '组名称',
|
||||
@ -177,6 +178,7 @@ export default {
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
fixed: 'right',
|
||||
dataIndex: 'action',
|
||||
width: '150px',
|
||||
scopedSlots: { customRender: 'action' }
|
||||
@ -208,6 +210,10 @@ export default {
|
||||
created () {
|
||||
getAllGroupNameList().then(res => {
|
||||
this.groupNameList = res.data
|
||||
if (this.groupNameList !== null && this.groupNameList.length > 0) {
|
||||
this.queryParam['groupName'] = this.groupNameList[0]
|
||||
this.$refs.table.refresh(true)
|
||||
}
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
@ -260,8 +266,10 @@ export default {
|
||||
this.$message.success('重试完成成功')
|
||||
}
|
||||
})
|
||||
},
|
||||
refresh (v) {
|
||||
this.$refs.table.refresh(true)
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -2,80 +2,68 @@
|
||||
<div>
|
||||
<a-modal :visible="visible" title="新增任务" @ok="handleOk" @cancel="visible = false" width="800px">
|
||||
<a-form @submit="handleOk" :form="form" v-bind="formItemLayout">
|
||||
<a-form-item
|
||||
label="组">
|
||||
<a-form-item label="组">
|
||||
<a-select
|
||||
placeholder="请选择组"
|
||||
v-decorator="[
|
||||
'groupName',
|
||||
{rules: [{ required: true, message: '请选择组'}]}
|
||||
]"
|
||||
@change="value => handleChange(value)">
|
||||
v-decorator="['groupName', { rules: [{ required: true, message: '请选择组' }] }]"
|
||||
@change="(value) => handleChange(value)"
|
||||
>
|
||||
<a-select-option v-for="item in groupNameList" :value="item" :key="item">{{ item }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="场景名称">
|
||||
<a-form-item label="场景名称">
|
||||
<a-select
|
||||
placeholder="请选择场景名称"
|
||||
v-decorator="[
|
||||
'sceneName',
|
||||
{rules: [{ required: true, message: '请选择场景名称'}]}
|
||||
]"
|
||||
@change="value => handleChange(value)">
|
||||
<a-select-option v-for="item in sceneList" :value="item.sceneName" :key="item.sceneName"> {{ item.sceneName }}</a-select-option>
|
||||
v-decorator="['sceneName', { rules: [{ required: true, message: '请选择场景名称' }] }]" >
|
||||
<a-select-option v-for="item in sceneList" :value="item.sceneName" :key="item.sceneName">
|
||||
{{ item.sceneName }}</a-select-option
|
||||
>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="执行器名称">
|
||||
<a-form-item label="执行器名称">
|
||||
<a-input
|
||||
v-decorator="[
|
||||
'executorName',
|
||||
{rules: [{ required: true, message: '请输入执行器名称'}]}
|
||||
]"
|
||||
v-decorator="['executorName', { rules: [{ required: true, message: '请输入执行器名称' }] }]"
|
||||
name="executorName"
|
||||
placeholder="请输入执行器名称" />
|
||||
placeholder="请输入执行器名称"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="重试ID">
|
||||
<a-form-item label="重试ID">
|
||||
<a-input
|
||||
v-decorator="[
|
||||
'bizId',
|
||||
{rules: [{ required: true, message: '请输入重试ID'}]}
|
||||
]"
|
||||
name="bizNo"
|
||||
placeholder="请输入业务编号" >
|
||||
v-decorator="['bizId', { rules: [{ required: true, message: '请输入重试ID' }] }]"
|
||||
name="bizId"
|
||||
placeholder="请输入业务编号"
|
||||
>
|
||||
<a-tooltip slot="suffix" title="同一个场景下正在重试中的重试ID不能重复,若重复的重试ID在上报时会被幂等处理">
|
||||
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
||||
<a-icon type="info-circle" style="color: rgba(0, 0, 0, 0.45)" />
|
||||
</a-tooltip>
|
||||
</a-input>
|
||||
<a-button type="primary" style="position: absolute;margin: 3px 10px">
|
||||
生成
|
||||
</a-button>
|
||||
<a-button type="primary" style="position: absolute; margin: 3px 10px" @click="bizIdGenerate"> 生成 </a-button>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="业务编号">
|
||||
<a-form-item label="业务编号">
|
||||
<a-input
|
||||
v-decorator="[
|
||||
'bizNo',
|
||||
{rules: [{ required: false, message: '请输入业务编号'}]}
|
||||
]"
|
||||
v-decorator="['bizNo', { rules: [{ required: false, message: '请输入业务编号' }] }]"
|
||||
name="bizNo"
|
||||
placeholder="请输入业务编号" >
|
||||
placeholder="请输入业务编号"
|
||||
>
|
||||
<a-tooltip slot="suffix" title="具有业务特征的编号比如订单号、物流编号等">
|
||||
<a-icon type="info-circle" style="color: rgba(0,0,0,.45)" />
|
||||
<a-icon type="info-circle" style="color: rgba(0, 0, 0, 0.45)" />
|
||||
</a-tooltip>
|
||||
</a-input>
|
||||
</a-form-item>
|
||||
<a-form-item
|
||||
label="参数">
|
||||
<a-form-item label="重试状态">
|
||||
<a-select
|
||||
placeholder="请选择重试状态"
|
||||
v-decorator="['retryStatus', { rules: [{ required: true, message: '请选择重试状态' }] }]"
|
||||
>
|
||||
<a-select-option v-for="(value, key) in retryStatus" :value="key" :key="key"> {{ value }}</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="参数">
|
||||
<a-textarea
|
||||
rows="4"
|
||||
placeholder="请输入参数"
|
||||
v-decorator="[
|
||||
'argsStr',
|
||||
{rules: [{ required: true, message: '请输入参数'}]}
|
||||
]" />
|
||||
v-decorator="['argsStr', { rules: [{ required: true, message: '请输入参数' }] }]"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
@ -83,13 +71,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { getAllGroupNameList, getSceneList } from '@/api/manage'
|
||||
import { getAllGroupNameList, getSceneList, saveRetryTask, bizIdGenerate } from '@/api/manage'
|
||||
|
||||
export default {
|
||||
name: 'SavRetryTask',
|
||||
props: {
|
||||
},
|
||||
props: {},
|
||||
data () {
|
||||
return {
|
||||
visible: false,
|
||||
@ -99,35 +85,57 @@ export default {
|
||||
wrapperCol: { lg: { span: 14 }, sm: { span: 17 } }
|
||||
},
|
||||
groupNameList: [],
|
||||
sceneList: []
|
||||
sceneList: [],
|
||||
retryStatus: {
|
||||
0: '重试中',
|
||||
1: '重试完成',
|
||||
2: '最大次数',
|
||||
3: '暂停'
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleOk (e) {
|
||||
console.log(e)
|
||||
|
||||
e.preventDefault()
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
console.log(values)
|
||||
saveRetryTask(values).then((res) => {
|
||||
this.form.resetFields()
|
||||
this.$message.success('新增任务成功')
|
||||
this.visible = false
|
||||
this.$emit('refresh', 1)
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
handleChange (value) {
|
||||
getSceneList({ 'groupName': value }).then(res => {
|
||||
getSceneList({ groupName: value }).then((res) => {
|
||||
this.sceneList = res.data
|
||||
})
|
||||
},
|
||||
isShow (visible, data) {
|
||||
this.visible = visible
|
||||
getAllGroupNameList().then(res => {
|
||||
getAllGroupNameList().then((res) => {
|
||||
this.groupNameList = res.data
|
||||
})
|
||||
},
|
||||
bizIdGenerate () {
|
||||
const groupName = this.form.getFieldValue('groupName')
|
||||
const sceneName = this.form.getFieldValue('sceneName')
|
||||
const executorName = this.form.getFieldValue('executorName')
|
||||
const argsStr = this.form.getFieldValue('argsStr')
|
||||
|
||||
bizIdGenerate({ groupName, sceneName, executorName, argsStr }).then(res => {
|
||||
this.form.setFieldsValue({
|
||||
'bizId': res.data
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
<template>
|
||||
<a @click="handleEdit(record)">编辑</a>
|
||||
<a-divider type="vertical" />
|
||||
<a href="javascript:;">删除</a>
|
||||
<a href="javascript:;">删除</a>
|
||||
</template>
|
||||
</span>
|
||||
</s-table>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user