mirror of https://github.com/halo-dev/halo
Update dependencies.
parent
0e1163ea66
commit
7b8fc49604
|
@ -1,7 +1,7 @@
|
||||||
plugins {
|
plugins {
|
||||||
id 'org.springframework.boot' version '2.1.7.RELEASE'
|
id 'org.springframework.boot' version '2.2.0.RELEASE'
|
||||||
id "io.freefair.lombok" version "3.6.6"
|
id "io.freefair.lombok" version "3.6.6"
|
||||||
// id 'war'
|
id 'war'
|
||||||
id 'java'
|
id 'java'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,34 +1,34 @@
|
||||||
package run.halo.app.controller.admin.api;
|
//package run.halo.app.controller.admin.api;
|
||||||
|
//
|
||||||
import io.swagger.annotations.ApiOperation;
|
//import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.boot.actuate.trace.http.HttpTrace;
|
//import org.springframework.boot.actuate.trace.http.HttpTrace;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
//import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
//import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
//import org.springframework.web.bind.annotation.RestController;
|
||||||
import run.halo.app.service.TraceService;
|
//import run.halo.app.service.TraceService;
|
||||||
|
//
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* Trace controller.
|
// * Trace controller.
|
||||||
*
|
// *
|
||||||
* @author johnniang
|
// * @author johnniang
|
||||||
* @date 19-6-18
|
// * @date 19-6-18
|
||||||
*/
|
// */
|
||||||
@RestController
|
//@RestController
|
||||||
@RequestMapping("/api/admin/traces")
|
//@RequestMapping("/api/admin/traces")
|
||||||
public class TraceController {
|
//public class TraceController {
|
||||||
|
//
|
||||||
private final TraceService traceService;
|
// private final TraceService traceService;
|
||||||
|
//
|
||||||
public TraceController(TraceService traceService) {
|
// public TraceController(TraceService traceService) {
|
||||||
this.traceService = traceService;
|
// this.traceService = traceService;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@GetMapping
|
// @GetMapping
|
||||||
@ApiOperation("Lists http traces")
|
// @ApiOperation("Lists http traces")
|
||||||
public List<HttpTrace> listHttpTraces() {
|
// public List<HttpTrace> listHttpTraces() {
|
||||||
return traceService.listHttpTraces();
|
// return traceService.listHttpTraces();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|
|
@ -48,6 +48,7 @@ public interface CategoryRepository extends BaseRepository<Category, Integer> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List categories by parent id.
|
* List categories by parent id.
|
||||||
|
*
|
||||||
* @param id parent id.
|
* @param id parent id.
|
||||||
* @return list of category
|
* @return list of category
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -7,22 +7,30 @@ import run.halo.app.model.projection.CommentChildrenCountProjection;
|
||||||
import run.halo.app.model.projection.CommentCountProjection;
|
import run.halo.app.model.projection.CommentCountProjection;
|
||||||
import run.halo.app.repository.base.BaseCommentRepository;
|
import run.halo.app.repository.base.BaseCommentRepository;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Journal comment repository.
|
* Journal comment repository.
|
||||||
*
|
*
|
||||||
* @author johnniang
|
* @author johnniang
|
||||||
* @date 19-4-24
|
* @author ryanwang
|
||||||
|
* @date 2019-04-24
|
||||||
*/
|
*/
|
||||||
public interface JournalCommentRepository extends BaseCommentRepository<JournalComment> {
|
public interface JournalCommentRepository extends BaseCommentRepository<JournalComment> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Count the number of comments by post id.
|
||||||
|
*
|
||||||
|
* @param postIds post id collection must not be null
|
||||||
|
* @return a list of CommentCountProjection
|
||||||
|
*/
|
||||||
@Query("select new run.halo.app.model.projection.CommentCountProjection(count(comment.id), comment.postId) " +
|
@Query("select new run.halo.app.model.projection.CommentCountProjection(count(comment.id), comment.postId) " +
|
||||||
"from JournalComment comment " +
|
"from JournalComment comment " +
|
||||||
"where comment.postId in ?1 group by comment.postId")
|
"where comment.postId in ?1 group by comment.postId")
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
List<CommentCountProjection> countByPostIds(@NonNull Iterable<Integer> postIds);
|
List<CommentCountProjection> countByPostIds(@NonNull Collection<Integer> postIds);
|
||||||
|
|
||||||
@Query("select new run.halo.app.model.projection.CommentChildrenCountProjection(count(comment.id), comment.parentId) " +
|
@Query("select new run.halo.app.model.projection.CommentChildrenCountProjection(count(comment.id), comment.parentId) " +
|
||||||
"from JournalComment comment " +
|
"from JournalComment comment " +
|
||||||
|
@ -30,5 +38,5 @@ public interface JournalCommentRepository extends BaseCommentRepository<JournalC
|
||||||
"group by comment.parentId")
|
"group by comment.parentId")
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
List<CommentChildrenCountProjection> findDirectChildrenCount(@NonNull Iterable<Long> commentIds);
|
List<CommentChildrenCountProjection> findDirectChildrenCount(@NonNull Collection<Long> commentIds);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import run.halo.app.model.enums.PostStatus;
|
||||||
import run.halo.app.model.projection.CategoryPostCountProjection;
|
import run.halo.app.model.projection.CategoryPostCountProjection;
|
||||||
import run.halo.app.repository.base.BaseRepository;
|
import run.halo.app.repository.base.BaseRepository;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -58,7 +59,7 @@ public interface PostCategoryRepository extends BaseRepository<PostCategory, Int
|
||||||
* @return a list of post category
|
* @return a list of post category
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
List<PostCategory> findAllByPostIdIn(@NonNull Iterable<Integer> postIds);
|
List<PostCategory> findAllByPostIdIn(@NonNull Collection<Integer> postIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds all post categories by post id.
|
* Finds all post categories by post id.
|
||||||
|
|
|
@ -7,13 +7,15 @@ import run.halo.app.model.projection.CommentChildrenCountProjection;
|
||||||
import run.halo.app.model.projection.CommentCountProjection;
|
import run.halo.app.model.projection.CommentCountProjection;
|
||||||
import run.halo.app.repository.base.BaseCommentRepository;
|
import run.halo.app.repository.base.BaseCommentRepository;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PostComment repository.
|
* PostComment repository.
|
||||||
*
|
*
|
||||||
* @author johnniang
|
* @author johnniang
|
||||||
* @date 3/21/19
|
* @author ryanwang
|
||||||
|
* @date 2019-03-21
|
||||||
*/
|
*/
|
||||||
public interface PostCommentRepository extends BaseCommentRepository<PostComment> {
|
public interface PostCommentRepository extends BaseCommentRepository<PostComment> {
|
||||||
|
|
||||||
|
@ -22,7 +24,7 @@ public interface PostCommentRepository extends BaseCommentRepository<PostComment
|
||||||
"where comment.postId in ?1 group by comment.postId")
|
"where comment.postId in ?1 group by comment.postId")
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
List<CommentCountProjection> countByPostIds(@NonNull Iterable<Integer> postIds);
|
List<CommentCountProjection> countByPostIds(@NonNull Collection<Integer> postIds);
|
||||||
|
|
||||||
@Query("select new run.halo.app.model.projection.CommentChildrenCountProjection(count(comment.id), comment.parentId) " +
|
@Query("select new run.halo.app.model.projection.CommentChildrenCountProjection(count(comment.id), comment.parentId) " +
|
||||||
"from PostComment comment " +
|
"from PostComment comment " +
|
||||||
|
@ -30,5 +32,5 @@ public interface PostCommentRepository extends BaseCommentRepository<PostComment
|
||||||
"group by comment.parentId")
|
"group by comment.parentId")
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
List<CommentChildrenCountProjection> findDirectChildrenCount(@NonNull Iterable<Long> commentIds);
|
List<CommentChildrenCountProjection> findDirectChildrenCount(@NonNull Collection<Long> commentIds);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import run.halo.app.model.enums.PostStatus;
|
||||||
import run.halo.app.model.projection.TagPostPostCountProjection;
|
import run.halo.app.model.projection.TagPostPostCountProjection;
|
||||||
import run.halo.app.repository.base.BaseRepository;
|
import run.halo.app.repository.base.BaseRepository;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@ public interface PostTagRepository extends BaseRepository<PostTag, Integer> {
|
||||||
* @return a list of post tags
|
* @return a list of post tags
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
List<PostTag> findAllByPostIdIn(@NonNull Iterable<Integer> postIds);
|
List<PostTag> findAllByPostIdIn(@NonNull Collection<Integer> postIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes post tags by post id.
|
* Deletes post tags by post id.
|
||||||
|
@ -104,7 +105,7 @@ public interface PostTagRepository extends BaseRepository<PostTag, Integer> {
|
||||||
*/
|
*/
|
||||||
@Query("select new run.halo.app.model.projection.TagPostPostCountProjection(count(pt.postId), pt.tagId) from PostTag pt where pt.tagId in ?1 group by pt.tagId")
|
@Query("select new run.halo.app.model.projection.TagPostPostCountProjection(count(pt.postId), pt.tagId) from PostTag pt where pt.tagId in ?1 group by pt.tagId")
|
||||||
@NonNull
|
@NonNull
|
||||||
List<TagPostPostCountProjection> findPostCountByTagIds(@NonNull Iterable<Integer> tagIds);
|
List<TagPostPostCountProjection> findPostCountByTagIds(@NonNull Collection<Integer> tagIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds post count of tag.
|
* Finds post count of tag.
|
||||||
|
|
|
@ -7,13 +7,15 @@ import run.halo.app.model.projection.CommentChildrenCountProjection;
|
||||||
import run.halo.app.model.projection.CommentCountProjection;
|
import run.halo.app.model.projection.CommentCountProjection;
|
||||||
import run.halo.app.repository.base.BaseCommentRepository;
|
import run.halo.app.repository.base.BaseCommentRepository;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sheet comment repository.
|
* Sheet comment repository.
|
||||||
*
|
*
|
||||||
* @author johnniang
|
* @author johnniang
|
||||||
* @date 19-4-24
|
* @author ryanwang
|
||||||
|
* @date 2019-04-24
|
||||||
*/
|
*/
|
||||||
public interface SheetCommentRepository extends BaseCommentRepository<SheetComment> {
|
public interface SheetCommentRepository extends BaseCommentRepository<SheetComment> {
|
||||||
|
|
||||||
|
@ -22,7 +24,7 @@ public interface SheetCommentRepository extends BaseCommentRepository<SheetComme
|
||||||
"where comment.postId in ?1 group by comment.postId")
|
"where comment.postId in ?1 group by comment.postId")
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
List<CommentCountProjection> countByPostIds(@NonNull Iterable<Integer> postIds);
|
List<CommentCountProjection> countByPostIds(@NonNull Collection<Integer> postIds);
|
||||||
|
|
||||||
@Query("select new run.halo.app.model.projection.CommentChildrenCountProjection(count(comment.id), comment.parentId) " +
|
@Query("select new run.halo.app.model.projection.CommentChildrenCountProjection(count(comment.id), comment.parentId) " +
|
||||||
"from SheetComment comment " +
|
"from SheetComment comment " +
|
||||||
|
@ -30,5 +32,5 @@ public interface SheetCommentRepository extends BaseCommentRepository<SheetComme
|
||||||
"group by comment.parentId")
|
"group by comment.parentId")
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
List<CommentChildrenCountProjection> findDirectChildrenCount(@NonNull Iterable<Long> commentIds);
|
List<CommentChildrenCountProjection> findDirectChildrenCount(@NonNull Collection<Long> commentIds);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ public interface TagRepository extends BaseRepository<Tag, Integer> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get tag by name
|
* Get tag by name
|
||||||
|
*
|
||||||
* @param name name
|
* @param name name
|
||||||
* @return Tag
|
* @return Tag
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -12,13 +12,15 @@ import run.halo.app.model.enums.CommentStatus;
|
||||||
import run.halo.app.model.projection.CommentChildrenCountProjection;
|
import run.halo.app.model.projection.CommentChildrenCountProjection;
|
||||||
import run.halo.app.model.projection.CommentCountProjection;
|
import run.halo.app.model.projection.CommentCountProjection;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base comment repository.
|
* Base comment repository.
|
||||||
*
|
*
|
||||||
* @author johnniang
|
* @author johnniang
|
||||||
* @date 19-4-24
|
* @author ryanwang
|
||||||
|
* @date 2019-04-24
|
||||||
*/
|
*/
|
||||||
@NoRepositoryBean
|
@NoRepositoryBean
|
||||||
public interface BaseCommentRepository<COMMENT extends BaseComment> extends BaseRepository<COMMENT, Long>, JpaSpecificationExecutor<COMMENT> {
|
public interface BaseCommentRepository<COMMENT extends BaseComment> extends BaseRepository<COMMENT, Long>, JpaSpecificationExecutor<COMMENT> {
|
||||||
|
@ -41,7 +43,7 @@ public interface BaseCommentRepository<COMMENT extends BaseComment> extends Base
|
||||||
* @return a list of comment
|
* @return a list of comment
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
List<COMMENT> findAllByPostIdIn(@NonNull Iterable<Integer> postIds);
|
List<COMMENT> findAllByPostIdIn(@NonNull Collection<Integer> postIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds all comments by post id.
|
* Finds all comments by post id.
|
||||||
|
@ -63,7 +65,7 @@ public interface BaseCommentRepository<COMMENT extends BaseComment> extends Base
|
||||||
"where comment.postId in ?1 " +
|
"where comment.postId in ?1 " +
|
||||||
"group by comment.postId")
|
"group by comment.postId")
|
||||||
@NonNull
|
@NonNull
|
||||||
List<CommentCountProjection> countByPostIds(@NonNull Iterable<Integer> postIds);
|
List<CommentCountProjection> countByPostIds(@NonNull Collection<Integer> postIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Counts by comment status.
|
* Counts by comment status.
|
||||||
|
@ -113,7 +115,7 @@ public interface BaseCommentRepository<COMMENT extends BaseComment> extends Base
|
||||||
* @return a list of comment
|
* @return a list of comment
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
List<COMMENT> findAllByStatusAndParentIdIn(@NonNull CommentStatus status, @NonNull Iterable<Long> parentIds);
|
List<COMMENT> findAllByStatusAndParentIdIn(@NonNull CommentStatus status, @NonNull Collection<Long> parentIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds comments by post id, comment status and parent id.
|
* Finds comments by post id, comment status and parent id.
|
||||||
|
@ -133,5 +135,5 @@ public interface BaseCommentRepository<COMMENT extends BaseComment> extends Base
|
||||||
"where comment.parentId in ?1 " +
|
"where comment.parentId in ?1 " +
|
||||||
"group by comment.parentId")
|
"group by comment.parentId")
|
||||||
@NonNull
|
@NonNull
|
||||||
List<CommentChildrenCountProjection> findDirectChildrenCount(@NonNull Iterable<Long> commentIds);
|
List<CommentChildrenCountProjection> findDirectChildrenCount(@NonNull Collection<Long> commentIds);
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,7 @@ import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.repository.NoRepositoryBean;
|
import org.springframework.data.repository.NoRepositoryBean;
|
||||||
import org.springframework.lang.NonNull;
|
import org.springframework.lang.NonNull;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,6 +16,8 @@ import java.util.List;
|
||||||
* @param <DOMAIN> doamin type
|
* @param <DOMAIN> doamin type
|
||||||
* @param <ID> id type
|
* @param <ID> id type
|
||||||
* @author johnniang
|
* @author johnniang
|
||||||
|
* @author ryanwang
|
||||||
|
* @date 2019-03-15
|
||||||
*/
|
*/
|
||||||
@NoRepositoryBean
|
@NoRepositoryBean
|
||||||
public interface BaseRepository<DOMAIN, ID> extends JpaRepository<DOMAIN, ID> {
|
public interface BaseRepository<DOMAIN, ID> extends JpaRepository<DOMAIN, ID> {
|
||||||
|
@ -27,7 +30,7 @@ public interface BaseRepository<DOMAIN, ID> extends JpaRepository<DOMAIN, ID> {
|
||||||
* @return a list of domains
|
* @return a list of domains
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
List<DOMAIN> findAllByIdIn(@NonNull Iterable<ID> ids, @NonNull Sort sort);
|
List<DOMAIN> findAllByIdIn(@NonNull Collection<ID> ids, @NonNull Sort sort);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Finds all domain by domain id list.
|
* Finds all domain by domain id list.
|
||||||
|
@ -37,7 +40,7 @@ public interface BaseRepository<DOMAIN, ID> extends JpaRepository<DOMAIN, ID> {
|
||||||
* @return a list of domains
|
* @return a list of domains
|
||||||
*/
|
*/
|
||||||
@NonNull
|
@NonNull
|
||||||
Page<DOMAIN> findAllByIdIn(@NonNull Iterable<ID> ids, @NonNull Pageable pageable);
|
Page<DOMAIN> findAllByIdIn(@NonNull Collection<ID> ids, @NonNull Pageable pageable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes by id list.
|
* Deletes by id list.
|
||||||
|
@ -45,6 +48,6 @@ public interface BaseRepository<DOMAIN, ID> extends JpaRepository<DOMAIN, ID> {
|
||||||
* @param ids id list of domain must not be null
|
* @param ids id list of domain must not be null
|
||||||
* @return number of rows affected
|
* @return number of rows affected
|
||||||
*/
|
*/
|
||||||
long deleteByIdIn(@NonNull Iterable<ID> ids);
|
long deleteByIdIn(@NonNull Collection<ID> ids);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,7 @@ import javax.persistence.EntityManager;
|
||||||
import javax.persistence.TypedQuery;
|
import javax.persistence.TypedQuery;
|
||||||
import javax.persistence.criteria.*;
|
import javax.persistence.criteria.*;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -26,6 +27,8 @@ import java.util.List;
|
||||||
* @param <DOMAIN> domain type
|
* @param <DOMAIN> domain type
|
||||||
* @param <ID> id type
|
* @param <ID> id type
|
||||||
* @author johnniang
|
* @author johnniang
|
||||||
|
* @author ryanwang
|
||||||
|
* @date 2019-03-15
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BaseRepositoryImpl<DOMAIN, ID> extends SimpleJpaRepository<DOMAIN, ID> implements BaseRepository<DOMAIN, ID> {
|
public class BaseRepositoryImpl<DOMAIN, ID> extends SimpleJpaRepository<DOMAIN, ID> implements BaseRepository<DOMAIN, ID> {
|
||||||
|
@ -68,8 +71,8 @@ public class BaseRepositoryImpl<DOMAIN, ID> extends SimpleJpaRepository<DOMAIN,
|
||||||
* @return a list of domains
|
* @return a list of domains
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<DOMAIN> findAllByIdIn(Iterable<ID> ids, Sort sort) {
|
public List<DOMAIN> findAllByIdIn(Collection<ID> ids, Sort sort) {
|
||||||
Assert.notNull(ids, "The given Iterable of Id's must not be null!");
|
Assert.notNull(ids, "The given Collection of Id's must not be null!");
|
||||||
Assert.notNull(sort, "Sort info must nto be null");
|
Assert.notNull(sort, "Sort info must nto be null");
|
||||||
|
|
||||||
log.debug("Customized findAllById method was invoked");
|
log.debug("Customized findAllById method was invoked");
|
||||||
|
@ -90,8 +93,8 @@ public class BaseRepositoryImpl<DOMAIN, ID> extends SimpleJpaRepository<DOMAIN,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<DOMAIN> findAllByIdIn(Iterable<ID> ids, Pageable pageable) {
|
public Page<DOMAIN> findAllByIdIn(Collection<ID> ids, Pageable pageable) {
|
||||||
Assert.notNull(ids, "The given Iterable of Id's must not be null!");
|
Assert.notNull(ids, "The given Collection of Id's must not be null!");
|
||||||
Assert.notNull(pageable, "Page info must nto be null");
|
Assert.notNull(pageable, "Page info must nto be null");
|
||||||
|
|
||||||
if (!ids.iterator().hasNext()) {
|
if (!ids.iterator().hasNext()) {
|
||||||
|
@ -119,7 +122,7 @@ public class BaseRepositoryImpl<DOMAIN, ID> extends SimpleJpaRepository<DOMAIN,
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public long deleteByIdIn(Iterable<ID> ids) {
|
public long deleteByIdIn(Collection<ID> ids) {
|
||||||
|
|
||||||
log.debug("Customized deleteByIdIn method was invoked");
|
log.debug("Customized deleteByIdIn method was invoked");
|
||||||
// Find all domains
|
// Find all domains
|
||||||
|
@ -147,7 +150,7 @@ public class BaseRepositoryImpl<DOMAIN, ID> extends SimpleJpaRepository<DOMAIN,
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
private final JpaEntityInformation<T, ?> entityInformation;
|
private final JpaEntityInformation<T, ?> entityInformation;
|
||||||
@Nullable
|
@Nullable
|
||||||
ParameterExpression<Iterable> parameter;
|
ParameterExpression<Collection> parameter;
|
||||||
|
|
||||||
ByIdsSpecification(JpaEntityInformation<T, ?> entityInformation) {
|
ByIdsSpecification(JpaEntityInformation<T, ?> entityInformation) {
|
||||||
this.entityInformation = entityInformation;
|
this.entityInformation = entityInformation;
|
||||||
|
@ -156,7 +159,7 @@ public class BaseRepositoryImpl<DOMAIN, ID> extends SimpleJpaRepository<DOMAIN,
|
||||||
@Override
|
@Override
|
||||||
public Predicate toPredicate(Root<T> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
|
public Predicate toPredicate(Root<T> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
|
||||||
Path<?> path = root.get(this.entityInformation.getIdAttribute());
|
Path<?> path = root.get(this.entityInformation.getIdAttribute());
|
||||||
this.parameter = cb.parameter(Iterable.class);
|
this.parameter = cb.parameter(Collection.class);
|
||||||
return path.in(this.parameter);
|
return path.in(this.parameter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,24 @@
|
||||||
package run.halo.app.service;
|
//package run.halo.app.service;
|
||||||
|
//
|
||||||
import org.springframework.boot.actuate.trace.http.HttpTrace;
|
//import org.springframework.boot.actuate.trace.http.HttpTrace;
|
||||||
import org.springframework.lang.NonNull;
|
//import org.springframework.lang.NonNull;
|
||||||
|
//
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* Trace service interface.
|
// * Trace service interface.
|
||||||
*
|
// *
|
||||||
* @author johnniang
|
// * @author johnniang
|
||||||
* @date 2019-06-18
|
// * @date 2019-06-18
|
||||||
*/
|
// */
|
||||||
public interface TraceService {
|
//public interface TraceService {
|
||||||
|
//
|
||||||
/**
|
// /**
|
||||||
* Gets all http traces.
|
// * Gets all http traces.
|
||||||
*
|
// *
|
||||||
* @return
|
// * @return
|
||||||
*/
|
// */
|
||||||
@NonNull
|
// @NonNull
|
||||||
List<HttpTrace> listHttpTraces();
|
// List<HttpTrace> listHttpTraces();
|
||||||
|
//
|
||||||
}
|
//}
|
||||||
|
|
|
@ -1,29 +1,29 @@
|
||||||
package run.halo.app.service.impl;
|
//package run.halo.app.service.impl;
|
||||||
|
//
|
||||||
import org.springframework.boot.actuate.trace.http.HttpTrace;
|
//import org.springframework.boot.actuate.trace.http.HttpTrace;
|
||||||
import org.springframework.boot.actuate.trace.http.HttpTraceRepository;
|
//import org.springframework.boot.actuate.trace.http.HttpTraceRepository;
|
||||||
import org.springframework.stereotype.Service;
|
//import org.springframework.stereotype.Service;
|
||||||
import run.halo.app.service.TraceService;
|
//import run.halo.app.service.TraceService;
|
||||||
|
//
|
||||||
import java.util.List;
|
//import java.util.List;
|
||||||
|
//
|
||||||
/**
|
///**
|
||||||
* TraceService implementation class.
|
// * TraceService implementation class.
|
||||||
*
|
// *
|
||||||
* @author johnniang
|
// * @author johnniang
|
||||||
* @date 2019-06-18
|
// * @date 2019-06-18
|
||||||
*/
|
// */
|
||||||
@Service
|
//@Service
|
||||||
public class TraceServiceImpl implements TraceService {
|
//public class TraceServiceImpl implements TraceService {
|
||||||
|
//
|
||||||
private final HttpTraceRepository httpTraceRepository;
|
// private final HttpTraceRepository httpTraceRepository;
|
||||||
|
//
|
||||||
public TraceServiceImpl(HttpTraceRepository httpTraceRepository) {
|
// public TraceServiceImpl(HttpTraceRepository httpTraceRepository) {
|
||||||
this.httpTraceRepository = httpTraceRepository;
|
// this.httpTraceRepository = httpTraceRepository;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
@Override
|
// @Override
|
||||||
public List<HttpTrace> listHttpTraces() {
|
// public List<HttpTrace> listHttpTraces() {
|
||||||
return httpTraceRepository.findAll();
|
// return httpTraceRepository.findAll();
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
server:
|
server:
|
||||||
port: 8090
|
port: 8090
|
||||||
use-forward-headers: true
|
forward-headers-strategy: native
|
||||||
compression:
|
compression:
|
||||||
enabled: false
|
enabled: false
|
||||||
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
|
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
|
||||||
|
@ -40,9 +40,6 @@ spring:
|
||||||
multipart:
|
multipart:
|
||||||
max-file-size: 10240MB
|
max-file-size: 10240MB
|
||||||
max-request-size: 10240MB
|
max-request-size: 10240MB
|
||||||
mvc:
|
|
||||||
favicon:
|
|
||||||
enabled: false
|
|
||||||
cache:
|
cache:
|
||||||
type: none
|
type: none
|
||||||
logging:
|
logging:
|
||||||
|
@ -51,6 +48,7 @@ logging:
|
||||||
org.hibernate: INFO
|
org.hibernate: INFO
|
||||||
org.hibernate.type.descriptor.sql.BasicBinder: INFO
|
org.hibernate.type.descriptor.sql.BasicBinder: INFO
|
||||||
org.hibernate.type.descriptor.sql.BasicExtractor: INFO
|
org.hibernate.type.descriptor.sql.BasicExtractor: INFO
|
||||||
|
file:
|
||||||
path: ${user.home}/halo-dev/logs
|
path: ${user.home}/halo-dev/logs
|
||||||
|
|
||||||
halo:
|
halo:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
server:
|
server:
|
||||||
port: 8090
|
port: 8090
|
||||||
use-forward-headers: true
|
forward-headers-strategy: native
|
||||||
compression:
|
compression:
|
||||||
enabled: false
|
enabled: false
|
||||||
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
|
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
|
||||||
|
@ -39,15 +39,13 @@ spring:
|
||||||
multipart:
|
multipart:
|
||||||
max-file-size: 10MB
|
max-file-size: 10MB
|
||||||
max-request-size: 10MB
|
max-request-size: 10MB
|
||||||
mvc:
|
|
||||||
favicon:
|
|
||||||
enabled: false
|
|
||||||
cache:
|
cache:
|
||||||
type: none
|
type: none
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
run.halo.app: DEBUG
|
run.halo.app: DEBUG
|
||||||
org.hibernate: ERROR
|
org.hibernate: ERROR
|
||||||
|
file:
|
||||||
path: ${user.home}/halo-test/logs
|
path: ${user.home}/halo-test/logs
|
||||||
|
|
||||||
halo:
|
halo:
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
server:
|
server:
|
||||||
port: 8090
|
port: 8090
|
||||||
use-forward-headers: true
|
forward-headers-strategy: native
|
||||||
compression:
|
compression:
|
||||||
enabled: false
|
enabled: false
|
||||||
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
|
mime-types: application/javascript,text/css,application/json,application/xml,text/html,text/xml,text/plain
|
||||||
|
@ -42,10 +42,8 @@ spring:
|
||||||
multipart:
|
multipart:
|
||||||
max-file-size: 10240MB
|
max-file-size: 10240MB
|
||||||
max-request-size: 10240MB
|
max-request-size: 10240MB
|
||||||
mvc:
|
|
||||||
favicon:
|
|
||||||
enabled: false
|
|
||||||
logging:
|
logging:
|
||||||
level:
|
level:
|
||||||
run.halo.app: INFO
|
run.halo.app: INFO
|
||||||
|
file:
|
||||||
path: ${user.home}/.halo/logs
|
path: ${user.home}/.halo/logs
|
Loading…
Reference in New Issue