Feature/issue 109 (#111)
* feat: add cancel task api * feat: update frontend resources * fix: readme img dismiss
This commit is contained in:
parent
b33cab86d9
commit
0badba566a
|
@ -2,7 +2,7 @@
|
|||
|
||||
## 简介
|
||||
|
||||
 是面向团队的**关系型数据库模型文档管理平台**,旨在通过自动化的方式解决模型文档管理过程中维护成本高、内容更新不及时以及团队协作复杂等问题。
|
||||
 是面向团队的**关系型数据库模型文档管理平台**,旨在通过自动化的方式解决模型文档管理过程中维护成本高、内容更新不及时以及团队协作复杂等问题。
|
||||
|
||||
平台文档:https://doc.databasir.com
|
||||
|
||||
|
|
|
@ -91,7 +91,14 @@ public class ProjectController {
|
|||
|
||||
@PostMapping(Routes.GroupProject.LIST_MANUAL_TASKS)
|
||||
public JsonData<List<ProjectSimpleTaskResponse>> listManualTasks(@PathVariable Integer projectId,
|
||||
@RequestBody ProjectTaskListCondition condition) {
|
||||
@RequestBody ProjectTaskListCondition condition) {
|
||||
return JsonData.ok(projectService.listManualTasks(projectId, condition));
|
||||
}
|
||||
|
||||
@PatchMapping(Routes.GroupProject.CANCEL_MANUAL_TASK)
|
||||
public JsonData<Void> cancelTask(@PathVariable Integer projectId,
|
||||
@PathVariable Integer taskId) {
|
||||
projectService.cancelTask(projectId, taskId);
|
||||
return JsonData.ok();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,8 @@ public interface Routes {
|
|||
String TEST_CONNECTION = BASE + "/projects/test_connection";
|
||||
|
||||
String LIST_MANUAL_TASKS = BASE + "/projects/{projectId}/list_manual_tasks";
|
||||
|
||||
String CANCEL_MANUAL_TASK = BASE + "/projects/{projectId}/tasks/{taskId}/cancel";
|
||||
}
|
||||
|
||||
interface Document {
|
||||
|
|
|
@ -17,4 +17,4 @@
|
|||
#fcc28c
|
||||
#ffa
|
||||
#fff
|
||||
*/.hljs{background:#333;color:#fff}.hljs-doctag,.hljs-meta-keyword,.hljs-name,.hljs-strong{font-weight:700}.hljs-code,.hljs-emphasis{font-style:italic}.hljs-section,.hljs-tag{color:#62c8f3}.hljs-selector-class,.hljs-selector-id,.hljs-template-variable,.hljs-variable{color:#ade5fc}.hljs-meta-string,.hljs-string{color:#a2fca2}.hljs-attr,.hljs-quote,.hljs-selector-attr{color:#7bd694}.hljs-tag .hljs-attr{color:inherit}.hljs-attribute,.hljs-title,.hljs-type{color:#ffa}.hljs-number,.hljs-symbol{color:#d36363}.hljs-bullet,.hljs-template-tag{color:#b8d8a2}.hljs-built_in,.hljs-keyword,.hljs-literal,.hljs-selector-tag{color:#fcc28c}.hljs-code,.hljs-comment,.hljs-formula{color:#888}.hljs-link,.hljs-regexp,.hljs-selector-pseudo{color:#c6b4f0}.hljs-meta{color:#fc9b9b}.hljs-deletion{background:#fc9b9b;color:#333}.hljs-addition{background:#a2fca2;color:#333}.hljs-subst{color:#fff}.hljs a{color:inherit}.hljs a:focus,.hljs a:hover{color:inherit;text-decoration:underline}.hljs mark{background:#555;color:inherit}.span-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1;display:inline-block;align-items:left;justify-content:space-between;font-size:14px;padding:8px}.doc-toc-aside{overflow-wrap:break-word;text-overflow:ellipsis;bottom:0;top:100px;position:fixed;overflow-y:hidden;overflow-x:hidden;max-width:var(--el-aside-width);width:var(--el-aside-width);border-width:0 1px 0 0;border-color:#ddd;border-style:solid}.doc-toc-aside:hover{overflow-y:auto;scrollbar-width:thin}.search-input{border-width:0 0 1px 0;border-style:solid;width:90%;min-height:33px}.search-input::-moz-placeholder{color:hsla(0,0%,71%,.808)}.search-input:-ms-input-placeholder{color:hsla(0,0%,71%,.808)}.search-input::placeholder{color:hsla(0,0%,71%,.808)}.search-input:focus{outline:none;border-color:#000}
|
||||
*/.hljs{background:#333;color:#fff}.hljs-doctag,.hljs-meta-keyword,.hljs-name,.hljs-strong{font-weight:700}.hljs-code,.hljs-emphasis{font-style:italic}.hljs-section,.hljs-tag{color:#62c8f3}.hljs-selector-class,.hljs-selector-id,.hljs-template-variable,.hljs-variable{color:#ade5fc}.hljs-meta-string,.hljs-string{color:#a2fca2}.hljs-attr,.hljs-quote,.hljs-selector-attr{color:#7bd694}.hljs-tag .hljs-attr{color:inherit}.hljs-attribute,.hljs-title,.hljs-type{color:#ffa}.hljs-number,.hljs-symbol{color:#d36363}.hljs-bullet,.hljs-template-tag{color:#b8d8a2}.hljs-built_in,.hljs-keyword,.hljs-literal,.hljs-selector-tag{color:#fcc28c}.hljs-code,.hljs-comment,.hljs-formula{color:#888}.hljs-link,.hljs-regexp,.hljs-selector-pseudo{color:#c6b4f0}.hljs-meta{color:#fc9b9b}.hljs-deletion{background:#fc9b9b;color:#333}.hljs-addition{background:#a2fca2;color:#333}.hljs-subst{color:#fff}.hljs a{color:inherit}.hljs a:focus,.hljs a:hover{color:inherit;text-decoration:underline}.hljs mark{background:#555;color:inherit}.span-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1;display:inline-block;align-items:left;justify-content:space-between;font-size:14px;padding:8px}.doc-toc-aside{overflow-wrap:break-word;text-overflow:ellipsis;bottom:0;top:100px;position:fixed;overflow-y:hidden;overflow-x:hidden;max-width:var(--el-aside-width);width:var(--el-aside-width);border-width:0 1px 0 0;border-color:#ddd;border-style:solid}.doc-toc-aside:hover{overflow-y:auto;scrollbar-width:thin}.search-input{border-width:0 0 1px 0;border-style:solid;width:90%;min-height:33px}.search-input::-moz-placeholder{color:hsla(0,0%,71%,.808)}.search-input:-ms-input-placeholder{color:hsla(0,0%,71%,.808)}.search-input::placeholder{color:hsla(0,0%,71%,.808)}.search-input:focus{outline:none;border-color:#000}.card-header{display:flex;justify-content:space-between;align-items:center}
|
|
@ -17,4 +17,4 @@
|
|||
#fcc28c
|
||||
#ffa
|
||||
#fff
|
||||
*/.hljs{background:#333;color:#fff}.hljs-doctag,.hljs-meta-keyword,.hljs-name,.hljs-strong{font-weight:700}.hljs-code,.hljs-emphasis{font-style:italic}.hljs-section,.hljs-tag{color:#62c8f3}.hljs-selector-class,.hljs-selector-id,.hljs-template-variable,.hljs-variable{color:#ade5fc}.hljs-meta-string,.hljs-string{color:#a2fca2}.hljs-attr,.hljs-quote,.hljs-selector-attr{color:#7bd694}.hljs-tag .hljs-attr{color:inherit}.hljs-attribute,.hljs-title,.hljs-type{color:#ffa}.hljs-number,.hljs-symbol{color:#d36363}.hljs-bullet,.hljs-template-tag{color:#b8d8a2}.hljs-built_in,.hljs-keyword,.hljs-literal,.hljs-selector-tag{color:#fcc28c}.hljs-code,.hljs-comment,.hljs-formula{color:#888}.hljs-link,.hljs-regexp,.hljs-selector-pseudo{color:#c6b4f0}.hljs-meta{color:#fc9b9b}.hljs-deletion{background:#fc9b9b;color:#333}.hljs-addition{background:#a2fca2;color:#333}.hljs-subst{color:#fff}.hljs a{color:inherit}.hljs a:focus,.hljs a:hover{color:inherit;text-decoration:underline}.hljs mark{background:#555;color:inherit}.span-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1;display:inline-block;align-items:left;justify-content:space-between;font-size:14px;padding:8px}.doc-toc-aside{overflow-wrap:break-word;text-overflow:ellipsis;bottom:0;top:100px;position:fixed;overflow-y:hidden;overflow-x:hidden;max-width:var(--el-aside-width);width:var(--el-aside-width);border-width:0 1px 0 0;border-color:#ddd;border-style:solid}.doc-toc-aside:hover{overflow-y:auto;scrollbar-width:thin}.search-input{border-width:0 0 1px 0;border-style:solid;width:90%;min-height:33px}.search-input::-moz-placeholder{color:hsla(0,0%,71%,.808)}.search-input:-ms-input-placeholder{color:hsla(0,0%,71%,.808)}.search-input::placeholder{color:hsla(0,0%,71%,.808)}.search-input:focus{outline:none;border-color:#000}
|
||||
*/.hljs{background:#333;color:#fff}.hljs-doctag,.hljs-meta-keyword,.hljs-name,.hljs-strong{font-weight:700}.hljs-code,.hljs-emphasis{font-style:italic}.hljs-section,.hljs-tag{color:#62c8f3}.hljs-selector-class,.hljs-selector-id,.hljs-template-variable,.hljs-variable{color:#ade5fc}.hljs-meta-string,.hljs-string{color:#a2fca2}.hljs-attr,.hljs-quote,.hljs-selector-attr{color:#7bd694}.hljs-tag .hljs-attr{color:inherit}.hljs-attribute,.hljs-title,.hljs-type{color:#ffa}.hljs-number,.hljs-symbol{color:#d36363}.hljs-bullet,.hljs-template-tag{color:#b8d8a2}.hljs-built_in,.hljs-keyword,.hljs-literal,.hljs-selector-tag{color:#fcc28c}.hljs-code,.hljs-comment,.hljs-formula{color:#888}.hljs-link,.hljs-regexp,.hljs-selector-pseudo{color:#c6b4f0}.hljs-meta{color:#fc9b9b}.hljs-deletion{background:#fc9b9b;color:#333}.hljs-addition{background:#a2fca2;color:#333}.hljs-subst{color:#fff}.hljs a{color:inherit}.hljs a:focus,.hljs a:hover{color:inherit;text-decoration:underline}.hljs mark{background:#555;color:inherit}.span-ellipsis{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;flex:1;display:inline-block;align-items:left;justify-content:space-between;font-size:14px;padding:8px}.doc-toc-aside{overflow-wrap:break-word;text-overflow:ellipsis;bottom:0;top:100px;position:fixed;overflow-y:hidden;overflow-x:hidden;max-width:var(--el-aside-width);width:var(--el-aside-width);border-width:0 1px 0 0;border-color:#ddd;border-style:solid}.doc-toc-aside:hover{overflow-y:auto;scrollbar-width:thin}.search-input{border-width:0 0 1px 0;border-style:solid;width:90%;min-height:33px}.search-input::-moz-placeholder{color:hsla(0,0%,71%,.808)}.search-input:-ms-input-placeholder{color:hsla(0,0%,71%,.808)}.search-input::placeholder{color:hsla(0,0%,71%,.808)}.search-input:focus{outline:none;border-color:#000}.card-header{display:flex;justify-content:space-between;align-items:center}
|
|
@ -1 +1 @@
|
|||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.787360f3.js"></script><script defer="defer" type="module" src="/js/app.29a225fb.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.15b40a89.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.405c78b5.js" nomodule></script><script defer="defer" src="/js/app-legacy.3f95f6dc.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
||||
<!doctype html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="/favicon.ico"><title>databasir</title><script defer="defer" type="module" src="/js/chunk-vendors.787360f3.js"></script><script defer="defer" type="module" src="/js/app.c9efd150.js"></script><link href="/css/chunk-vendors.8e1003a6.css" rel="stylesheet"><link href="/css/app.15b40a89.css" rel="stylesheet"><script defer="defer" src="/js/chunk-vendors-legacy.405c78b5.js" nomodule></script><script defer="defer" src="/js/app-legacy.57eb4513.js" nomodule></script></head><body><noscript><strong>We're sorry but databasir doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div></body></html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -207,4 +207,15 @@ public class ProjectService {
|
|||
var tasks = projectSyncTaskDao.selectList(condition.toCondition(projectId));
|
||||
return projectSimpleTaskResponseConverter.of(tasks);
|
||||
}
|
||||
|
||||
public void cancelTask(Integer projectId, Integer taskId) {
|
||||
if (!projectDao.existsById(projectId)) {
|
||||
throw DomainErrors.PROJECT_NOT_FOUND.exception();
|
||||
}
|
||||
projectSyncTaskDao.selectOptionalById(taskId).ifPresent(task -> {
|
||||
if (task.getStatus() == ProjectSyncTaskStatus.NEW || task.getStatus() == ProjectSyncTaskStatus.RUNNING) {
|
||||
projectSyncTaskDao.updateStatusAndResultById(taskId, ProjectSyncTaskStatus.CANCELED, "主动取消");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,5 +5,5 @@ public enum ProjectSyncTaskStatus {
|
|||
RUNNING,
|
||||
FINISHED,
|
||||
FAILED,
|
||||
CANCELLED
|
||||
CANCELED
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue