Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
IEQEFCR
halo
提交
e9232891
H
halo
项目概览
IEQEFCR
/
halo
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
halo
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e9232891
编写于
4月 22, 2019
作者:
J
johnniang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix tag deletion bug
上级
cee5ccba
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
22 addition
and
3 deletion
+22
-3
src/main/java/run/halo/app/config/HaloConfiguration.java
src/main/java/run/halo/app/config/HaloConfiguration.java
+1
-1
src/main/java/run/halo/app/service/PostCategoryService.java
src/main/java/run/halo/app/service/PostCategoryService.java
+3
-0
src/main/java/run/halo/app/service/PostTagService.java
src/main/java/run/halo/app/service/PostTagService.java
+3
-0
src/main/java/run/halo/app/service/base/CrudService.java
src/main/java/run/halo/app/service/base/CrudService.java
+11
-0
src/main/java/run/halo/app/service/impl/PostCategoryServiceImpl.java
...va/run/halo/app/service/impl/PostCategoryServiceImpl.java
+1
-1
src/main/java/run/halo/app/service/impl/PostServiceImpl.java
src/main/java/run/halo/app/service/impl/PostServiceImpl.java
+1
-1
src/main/java/run/halo/app/web/controller/content/api/CommentController.java
...alo/app/web/controller/content/api/CommentController.java
+2
-0
未找到文件。
src/main/java/run/halo/app/config/HaloConfiguration.java
浏览文件 @
e9232891
...
...
@@ -85,7 +85,7 @@ public class HaloConfiguration {
logFilter
.
setOrder
(
Ordered
.
HIGHEST_PRECEDENCE
+
9
);
logFilter
.
setFilter
(
new
LogFilter
());
logFilter
.
addUrlPatterns
(
"/
api/
*"
);
logFilter
.
addUrlPatterns
(
"/*"
);
return
logFilter
;
}
...
...
src/main/java/run/halo/app/service/PostCategoryService.java
浏览文件 @
e9232891
...
...
@@ -4,6 +4,7 @@ import org.springframework.data.domain.Page;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.lang.NonNull
;
import
org.springframework.lang.Nullable
;
import
org.springframework.transaction.annotation.Transactional
;
import
run.halo.app.model.entity.Category
;
import
run.halo.app.model.entity.Post
;
import
run.halo.app.model.entity.PostCategory
;
...
...
@@ -103,6 +104,7 @@ public interface PostCategoryService extends CrudService<PostCategory, Integer>
* @return a list of post category deleted
*/
@NonNull
@Transactional
List
<
PostCategory
>
removeByPostId
(
@NonNull
Integer
postId
);
/**
...
...
@@ -112,5 +114,6 @@ public interface PostCategoryService extends CrudService<PostCategory, Integer>
* @return a list of post category deleted
*/
@NonNull
@Transactional
List
<
PostCategory
>
removeByCategoryId
(
@NonNull
Integer
categoryId
);
}
src/main/java/run/halo/app/service/PostTagService.java
浏览文件 @
e9232891
package
run.halo.app.service
;
import
org.springframework.transaction.annotation.Transactional
;
import
run.halo.app.model.dto.TagWithCountOutputDTO
;
import
run.halo.app.model.entity.Post
;
import
run.halo.app.model.entity.PostTag
;
...
...
@@ -113,6 +114,7 @@ public interface PostTagService extends CrudService<PostTag, Integer> {
* @return a list of post tag
*/
@NonNull
@Transactional
List
<
PostTag
>
removeByPostId
(
@NonNull
Integer
postId
);
/**
...
...
@@ -122,5 +124,6 @@ public interface PostTagService extends CrudService<PostTag, Integer> {
* @return a list of post tag
*/
@NonNull
@Transactional
List
<
PostTag
>
removeByTagId
(
@NonNull
Integer
tagId
);
}
src/main/java/run/halo/app/service/base/CrudService.java
浏览文件 @
e9232891
package
run.halo.app.service.base
;
import
org.springframework.transaction.annotation.Transactional
;
import
run.halo.app.exception.NotFoundException
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
...
...
@@ -124,6 +125,7 @@ public interface CrudService<DOMAIN, ID> {
* @return DOMAIN
*/
@NonNull
@Transactional
DOMAIN
create
(
@NonNull
DOMAIN
domain
);
/**
...
...
@@ -133,6 +135,7 @@ public interface CrudService<DOMAIN, ID> {
* @return List
*/
@NonNull
@Transactional
List
<
DOMAIN
>
createInBatch
(
@NonNull
Collection
<
DOMAIN
>
domains
);
/**
...
...
@@ -142,6 +145,7 @@ public interface CrudService<DOMAIN, ID> {
* @return DOMAIN
*/
@NonNull
@Transactional
DOMAIN
update
(
@NonNull
DOMAIN
domain
);
/**
...
...
@@ -151,6 +155,7 @@ public interface CrudService<DOMAIN, ID> {
* @return List
*/
@NonNull
@Transactional
List
<
DOMAIN
>
updateInBatch
(
@NonNull
Collection
<
DOMAIN
>
domains
);
/**
...
...
@@ -161,6 +166,7 @@ public interface CrudService<DOMAIN, ID> {
* @throws NotFoundException If the specified id does not exist
*/
@NonNull
@Transactional
DOMAIN
removeById
(
@NonNull
ID
id
);
/**
...
...
@@ -170,6 +176,7 @@ public interface CrudService<DOMAIN, ID> {
* @return DOMAIN
*/
@Nullable
@Transactional
DOMAIN
removeByIdOfNullable
(
@NonNull
ID
id
);
/**
...
...
@@ -177,6 +184,7 @@ public interface CrudService<DOMAIN, ID> {
*
* @param domain domain
*/
@Transactional
void
remove
(
@NonNull
DOMAIN
domain
);
/**
...
...
@@ -184,6 +192,7 @@ public interface CrudService<DOMAIN, ID> {
*
* @param ids ids
*/
@Transactional
void
removeInBatch
(
@NonNull
Collection
<
ID
>
ids
);
/**
...
...
@@ -191,10 +200,12 @@ public interface CrudService<DOMAIN, ID> {
*
* @param domains domains
*/
@Transactional
void
removeAll
(
@NonNull
Collection
<
DOMAIN
>
domains
);
/**
* Remove all
*/
@Transactional
void
removeAll
();
}
src/main/java/run/halo/app/service/impl/PostCategoryServiceImpl.java
浏览文件 @
e9232891
...
...
@@ -171,7 +171,7 @@ public class PostCategoryServiceImpl extends AbstractCrudService<PostCategory, I
@Override
public
List
<
PostCategory
>
removeByPostId
(
Integer
postId
)
{
Assert
.
notNull
(
postId
,
"Post id must not be null"
);
Assert
.
notNull
(
postId
,
"Po
removeById
st id must not be null"
);
return
postCategoryRepository
.
deleteByPostId
(
postId
);
}
...
...
src/main/java/run/halo/app/service/impl/PostServiceImpl.java
浏览文件 @
e9232891
...
...
@@ -443,7 +443,6 @@ public class PostServiceImpl extends AbstractCrudService<Post, Integer> implemen
}
@Override
@Transactional
public
Post
removeById
(
Integer
postId
)
{
Assert
.
notNull
(
postId
,
"Post id must not be null"
);
...
...
@@ -501,6 +500,7 @@ public class PostServiceImpl extends AbstractCrudService<Post, Integer> implemen
postListVO
.
setTags
(
Optional
.
ofNullable
(
tagListMap
.
get
(
post
.
getId
()))
.
orElseGet
(
LinkedList:
:
new
)
.
stream
()
.
filter
(
Objects:
:
nonNull
)
.
map
(
tag
->
new
TagOutputDTO
().<
TagOutputDTO
>
convertFrom
(
tag
))
.
collect
(
Collectors
.
toList
()));
...
...
src/main/java/run/halo/app/web/controller/content/api/CommentController.java
浏览文件 @
e9232891
package
run.halo.app.web.controller.content.api
;
import
io.swagger.annotations.ApiOperation
;
import
run.halo.app.model.dto.CommentOutputDTO
;
import
run.halo.app.model.entity.User
;
import
run.halo.app.model.params.CommentParam
;
...
...
@@ -43,6 +44,7 @@ public class CommentController {
}
@PostMapping
@ApiOperation
(
"Comments a post"
)
public
CommentOutputDTO
comment
(
@RequestBody
CommentParam
commentParam
,
HttpServletRequest
request
)
{
// Get authentication
Authentication
authentication
=
SecurityContextHolder
.
getContext
().
getAuthentication
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录