Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
beyond-clouds
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
段启岩
beyond-clouds
Commits
6fe11361
Commit
6fe11361
authored
Feb 04, 2020
by
段启岩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加项目类别详细信息
parent
88678cec
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
0 deletions
+14
-0
src/main/java/cn/meteor/beyondclouds/modules/project/entity/Project.java
+3
-0
src/main/java/cn/meteor/beyondclouds/modules/project/service/impl/ProjectServiceImpl.java
+11
-0
No files found.
src/main/java/cn/meteor/beyondclouds/modules/project/entity/Project.java
View file @
6fe11361
...
...
@@ -39,6 +39,9 @@ public class Project implements Serializable {
@ApiModelProperty
(
value
=
"项目类别ID"
)
private
Integer
categoryId
;
@ApiModelProperty
(
value
=
"项目类别名称"
)
private
String
category
;
@ApiModelProperty
(
value
=
"项目源码链接"
)
private
String
sourceLink
;
...
...
src/main/java/cn/meteor/beyondclouds/modules/project/service/impl/ProjectServiceImpl.java
View file @
6fe11361
...
...
@@ -68,6 +68,7 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
}
// 2.保存项目
project
.
setCategory
(
projectCategory
.
getCategory
());
save
(
project
);
// 3.保存项目详情
...
...
@@ -153,7 +154,17 @@ public class ProjectServiceImpl extends ServiceImpl<ProjectMapper, Project> impl
throw
new
ProjectServiceException
(
ProjectErrorCode
.
PROJECT_NOT_FOUND
);
}
// 检查项目类别是否存在
Integer
categoryId
=
project
.
getCategoryId
();
ProjectCategory
projectCategory
=
projectCategoryMapper
.
selectById
(
categoryId
);
// 若分类不存在,则抛出异常
if
(
null
==
projectCategory
)
{
throw
new
ProjectServiceException
(
ProjectErrorCode
.
INCORRECT_CATEGORY
);
}
// 2.更新项目基本信息
project
.
setCategory
(
projectCategory
.
getCategory
());
updateById
(
project
);
// 3.更新项目详情
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment