Skip to content

Commit

Permalink
feat: 添加任务优先级、任务状态、任务标签、任务-任务标签关系、任务类型、任务;
Browse files Browse the repository at this point in the history
添加任务优先级、任务状态、任务标签、任务-任务标签关系、任务类型、任务;
  • Loading branch information
Imfdj_lt committed Feb 21, 2021
1 parent 4cf7910 commit 8344f7b
Show file tree
Hide file tree
Showing 74 changed files with 2,981 additions and 105 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ see [egg docs][egg] for more detail.
### Todo

- [ ] 优先级配置
- [ ] 标签配置
- [ ] 任务状态
- [ ] 标签配置(多对多)
- [ ] ~~任务类型配置~~
- [ ] 任务-参与者关系表
- [ ] 任务-参与者关系表(多对多)
- [ ] 任务工时
- [ ] 任务动态表
- [ ] 任务附件表
Expand Down
2 changes: 1 addition & 1 deletion app/contract/request/project.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ const body = {
type: 'number',
required: false,
values: [1, 2, 3],
description: '项目状态.1为正常、2为已归档、3为已删除',
description: '项目状态.1为正常、2为已归档、3为已在回收站',
},
intro: {
type: 'string',
Expand Down
130 changes: 130 additions & 0 deletions app/contract/request/task.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
'use strict';

const body = {
taskId: {
id: { type: 'number', required: true, description: 'id' },
},
taskBodyReq: {
name: {
type: 'string',
required: true,
min: 1,
max: 600,
trim: true,
example: '任务名称',
description: '任务名称',
},
parent_id: {
type: 'number',
required: false,
min: 0,
example: '0',
description: '父ID',
},
task_list_id: {
type: 'number',
required: true,
min: 1,
example: '1',
description: '所属任务列表ID',
},
task_state_id: {
type: 'number',
required: true,
min: 1,
example: '1',
description: '任务状态',
},
task_type_id: {
type: 'number',
required: true,
min: 1,
example: '1',
description: '任务类型ID',
},
task_priority_id: {
type: 'number',
required: true,
min: 1,
example: '1',
description: '任务优先级ID',
},
executor_id: {
type: 'number',
required: false,
min: 0,
example: '1',
description: '执行者ID',
},
start_date: {
type: 'string',
max: 30,
trim: true,
required: false,
example: '2021-01-01 00:00:00',
description: '开始时间',
},
end_date: {
type: 'string',
max: 30,
trim: true,
required: false,
example: '2021-01-01 00:00:00',
description: '结束时间',
},
remark: {
type: 'string',
required: false,
trim: true,
example: '',
description: '任务备注',
},
is_privacy: {
type: 'number',
required: false,
min: 0,
max: 1,
example: '0',
description: '是否为隐私模式.1为true,0为false',
},
is_recycle: {
type: 'number',
required: false,
min: 0,
max: 1,
example: '0',
description: '是否进入回收站.1为true,0为false',
},
likes: {
type: 'number',
required: false,
min: 0,
example: '0',
description: '点赞数',
},
sort: {
type: 'number',
required: false,
min: 0,
example: '0',
description: '排序,越小越靠前',
},
},
};

module.exports = {
...body,
taskPutBodyReq: {
...body.taskId,
...body.taskBodyReq,
},
taskDelBodyReq: {
ids: {
type: 'array',
required: true,
itemType: 'number',
description: 'ids',
example: [1, 2],
},
},
};
51 changes: 51 additions & 0 deletions app/contract/request/task_priority.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
'use strict';

const body = {
task_priorityId: {
id: { type: 'number', required: true, description: 'id' },
},
task_priorityBodyReq: {
name: {
type: 'string',
required: true,
min: 1,
max: 30,
trim: true,
example: '优先级名称',
description: '优先级名称',
},
color: {
type: 'string',
required: true,
min: 1,
max: 10,
trim: true,
example: '颜色',
description: '颜色',
},
sort: {
type: 'number',
required: false,
max: 999999999,
example: '0',
description: '排序,越大越靠前',
},
},
};

module.exports = {
...body,
task_priorityPutBodyReq: {
...body.task_priorityId,
...body.task_priorityBodyReq,
},
task_priorityDelBodyReq: {
ids: {
type: 'array',
required: true,
itemType: 'number',
description: 'ids',
example: [1, 2],
},
},
};
60 changes: 60 additions & 0 deletions app/contract/request/task_state.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
'use strict';

const body = {
task_stateId: {
id: { type: 'number', required: true, description: 'id' },
},
task_stateBodyReq: {
name: {
type: 'string',
required: true,
min: 1,
max: 50,
trim: true,
example: '状态名称',
description: '状态名称',
},
color: {
type: 'string',
required: false,
min: 1,
max: 16,
trim: true,
example: '颜色',
description: '颜色',
},
icon: {
type: 'string',
required: false,
min: 1,
max: 50,
trim: true,
example: '图标',
description: '图标',
},
sort: {
type: 'number',
required: false,
max: 999999999,
example: '0',
description: '排序,越大越靠前',
},
},
};

module.exports = {
...body,
task_statePutBodyReq: {
...body.task_stateId,
...body.task_stateBodyReq,
},
task_stateDelBodyReq: {
ids: {
type: 'array',
required: true,
itemType: 'number',
description: 'ids',
example: [1, 2],
},
},
};
51 changes: 51 additions & 0 deletions app/contract/request/task_tag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
'use strict';

const body = {
task_tagId: {
id: { type: 'number', required: true, description: 'id' },
},
task_tagBodyReq: {
name: {
type: 'string',
required: true,
min: 1,
max: 100,
trim: true,
example: '标签名称',
description: '标签名称',
},
color: {
type: 'string',
required: true,
min: 1,
max: 30,
trim: true,
example: '颜色',
description: '颜色',
},
project_id: {
type: 'number',
required: true,
min: 1,
example: '1',
description: '所属项目ID',
},
},
};

module.exports = {
...body,
task_tagPutBodyReq: {
...body.task_tagId,
...body.task_tagBodyReq,
},
task_tagDelBodyReq: {
ids: {
type: 'array',
required: true,
itemType: 'number',
description: 'ids',
example: [1, 2],
},
},
};
40 changes: 40 additions & 0 deletions app/contract/request/task_task_tag.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
'use strict';

const body = {
task_task_tagId: {
id: { type: 'number', required: true, description: 'id' },
},
task_task_tagBodyReq: {
task_id: {
type: 'number',
required: true,
min: 1,
example: '1',
description: '任务ID',
},
task_tag_id: {
type: 'number',
required: true,
min: 1,
example: '1',
description: '任务标签ID',
},
},
};

module.exports = {
...body,
task_task_tagPutBodyReq: {
...body.task_task_tagId,
...body.task_task_tagBodyReq,
},
task_task_tagDelBodyReq: {
ids: {
type: 'array',
required: true,
itemType: 'number',
description: 'ids',
example: [1, 2],
},
},
};
Loading

0 comments on commit 8344f7b

Please sign in to comment.