Support journal search.

pull/146/head
ruibaby 2019-04-26 22:58:27 +08:00
parent c438d99d47
commit 6f35efe90f
78 changed files with 151 additions and 80 deletions

View File

@ -13,7 +13,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
* Halo run! * Halo run!
* </pre> * </pre>
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2017/11/14 * @date : 2017/11/14
*/ */
@SpringBootApplication @SpringBootApplication

View File

@ -18,7 +18,7 @@ import javax.annotation.PostConstruct;
/** /**
* FreeMarker configuration. * FreeMarker configuration.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2018/4/26 * @date : 2018/4/26
*/ */
@Slf4j @Slf4j

View File

@ -30,7 +30,7 @@ import java.util.List;
/** /**
* Mvc configuration. * Mvc configuration.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2018/1/2 * @date : 2018/1/2
*/ */
@Slf4j @Slf4j

View File

@ -12,6 +12,7 @@ import run.halo.app.model.dto.JournalDTO;
import run.halo.app.model.dto.JournalWithCmtCountDTO; import run.halo.app.model.dto.JournalWithCmtCountDTO;
import run.halo.app.model.entity.Journal; import run.halo.app.model.entity.Journal;
import run.halo.app.model.params.JournalParam; import run.halo.app.model.params.JournalParam;
import run.halo.app.model.params.JournalQuery;
import run.halo.app.model.vo.BaseCommentVO; import run.halo.app.model.vo.BaseCommentVO;
import run.halo.app.model.vo.BaseCommentWithParentVO; import run.halo.app.model.vo.BaseCommentWithParentVO;
import run.halo.app.service.JournalCommentService; import run.halo.app.service.JournalCommentService;
@ -27,6 +28,7 @@ import static org.springframework.data.domain.Sort.Direction.DESC;
* Journal controller. * Journal controller.
* *
* @author johnniang * @author johnniang
* @author ryanwang
* @date 19-4-25 * @date 19-4-25
*/ */
@RestController @RestController
@ -49,8 +51,9 @@ public class JournalController {
@GetMapping @GetMapping
@ApiOperation("Gets latest journals") @ApiOperation("Gets latest journals")
public Page<JournalWithCmtCountDTO> pageBy(@PageableDefault(sort = "updateTime", direction = DESC) Pageable pageable) { public Page<JournalWithCmtCountDTO> pageBy(@PageableDefault(sort = "updateTime", direction = DESC) Pageable pageable,
Page<Journal> journalPage = journalService.listAll(pageable); JournalQuery journalQuery) {
Page<Journal> journalPage = journalService.pageBy(journalQuery,pageable);
return journalService.convertToCmtCountDto(journalPage); return journalService.convertToCmtCountDto(journalPage);
} }

View File

@ -15,7 +15,7 @@ import java.util.List;
/** /**
* Link Controller * Link Controller
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/21 * @date : 2019/3/21
*/ */
@RestController @RestController

View File

@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.GetMapping;
/** /**
* Admin page. * Admin page.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-04-23 * @date : 2019-04-23
*/ */
@Controller @Controller

View File

@ -21,7 +21,7 @@ import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* Photo controller * Photo controller
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/21 * @date : 2019/3/21
*/ */
@RestController @RestController

View File

@ -18,7 +18,7 @@ import java.util.Set;
/** /**
* Theme controller. * Theme controller.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/20 * @date : 2019/3/20
*/ */
@RestController @RestController

View File

@ -28,7 +28,7 @@ import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* Blog archive page controller * Blog archive page controller
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-17 * @date : 2019-03-17
*/ */
@Slf4j @Slf4j

View File

@ -21,7 +21,7 @@ import run.halo.app.service.ThemeService;
import static org.springframework.data.domain.Sort.Direction.DESC; import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/20 * @date : 2019/3/20
*/ */
@Controller @Controller

View File

@ -24,7 +24,7 @@ import java.util.List;
import static org.springframework.data.domain.Sort.Direction.DESC; import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-21 * @date : 2019-03-21
*/ */
@Controller @Controller

View File

@ -24,7 +24,7 @@ import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* Blog index page controller * Blog index page controller
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-17 * @date : 2019-03-17
*/ */
@Slf4j @Slf4j

View File

@ -24,7 +24,7 @@ import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* Search Controller * Search Controller
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-04-21 * @date : 2019-04-21
*/ */
@Controller @Controller

View File

@ -12,7 +12,7 @@ import run.halo.app.service.SheetService;
import run.halo.app.service.ThemeService; import run.halo.app.service.ThemeService;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-21 * @date : 2019-03-21
*/ */
@Controller @Controller

View File

@ -23,7 +23,7 @@ import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* Tag Controller * Tag Controller
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-21 * @date : 2019-03-21
*/ */
@Controller @Controller

View File

@ -18,7 +18,7 @@ import java.io.FileNotFoundException;
/** /**
* Error page Controller * Error page Controller
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2017/12/26 * @date : 2017/12/26
*/ */
@Slf4j @Slf4j

View File

@ -29,7 +29,7 @@ import static run.halo.app.model.support.HaloConst.DEFAULT_THEME_ID;
/** /**
* Installation controller. * Installation controller.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-17 * @date : 2019-03-17
*/ */
@Slf4j @Slf4j

View File

@ -5,7 +5,7 @@ import org.springframework.core.convert.converter.ConverterFactory;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/14 * @date : 2019/3/14
*/ */
@Component @Component

View File

@ -7,7 +7,7 @@ import java.util.Objects;
/** /**
* Theme property. * Theme property.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-22 * @date : 2019-03-22
*/ */
@Data @Data

View File

@ -23,7 +23,7 @@ import java.util.List;
/** /**
* The method executed after the application is started. * The method executed after the application is started.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2018/12/5 * @date : 2018/12/5
*/ */
@Slf4j @Slf4j

View File

@ -7,7 +7,7 @@ import lombok.Data;
/** /**
* Link output dto. * Link output dto.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/21 * @date : 2019/3/21
*/ */
@Data @Data

View File

@ -7,7 +7,7 @@ import lombok.Data;
import java.util.Date; import java.util.Date;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/21 * @date : 2019/3/21
*/ */
@Data @Data

View File

@ -12,7 +12,7 @@ import javax.persistence.*;
/** /**
* Attachment entity * Attachment entity
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-12 * @date : 2019-03-12
*/ */
@Data @Data

View File

@ -11,7 +11,7 @@ import javax.persistence.*;
/** /**
* Link entity * Link entity
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-12 * @date : 2019-03-12
*/ */
@Data @Data

View File

@ -11,7 +11,7 @@ import javax.persistence.*;
/** /**
* Menu entity * Menu entity
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-12 * @date : 2019-03-12
*/ */
@Data @Data

View File

@ -12,7 +12,7 @@ import java.util.Date;
/** /**
* Photo entity * Photo entity
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-12 * @date : 2019-03-12
*/ */
@Data @Data

View File

@ -11,7 +11,7 @@ import java.util.Objects;
/** /**
* Post tag entity. * Post tag entity.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-12 * @date : 2019-03-12
*/ */
@Data @Data

View File

@ -11,7 +11,7 @@ import javax.persistence.*;
/** /**
* Tag entity * Tag entity
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-12 * @date : 2019-03-12
*/ */
@Data @Data

View File

@ -14,7 +14,7 @@ import java.util.Date;
/** /**
* User entity * User entity
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-12 * @date : 2019-03-12
*/ */
@Data @Data

View File

@ -3,7 +3,7 @@ package run.halo.app.model.enums;
/** /**
* Attach origin. * Attach origin.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-12 * @date : 2019-03-12
*/ */
public enum AttachmentType implements ValueEnum<Integer> { public enum AttachmentType implements ValueEnum<Integer> {

View File

@ -9,7 +9,7 @@ import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2018/12/21 * @date : 2018/12/21
*/ */
@Component @Component

View File

@ -7,7 +7,7 @@ import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2018/12/31 * @date : 2018/12/31
*/ */
@Component @Component

View File

@ -7,7 +7,7 @@ import org.springframework.stereotype.Component;
import java.util.List; import java.util.List;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2018/12/31 * @date : 2018/12/31
*/ */
@Component @Component

View File

@ -12,7 +12,7 @@ import java.util.Map;
/** /**
* Freemarker custom tag of category. * Freemarker custom tag of category.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/22 * @date : 2019/3/22
*/ */
@Component @Component

View File

@ -12,7 +12,7 @@ import java.util.Map;
/** /**
* Freemarker custom tag of comment. * Freemarker custom tag of comment.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/22 * @date : 2019/3/22
*/ */
@Component @Component

View File

@ -15,7 +15,7 @@ import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* Freemarker custom tag of link. * Freemarker custom tag of link.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/22 * @date : 2019/3/22
*/ */
@Component @Component

View File

@ -12,7 +12,7 @@ import java.util.Map;
/** /**
* Freemarker custom tag of menu. * Freemarker custom tag of menu.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/22 * @date : 2019/3/22
*/ */
@Component @Component

View File

@ -15,7 +15,7 @@ import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* Freemarker custom tag of photo. * Freemarker custom tag of photo.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/4/21 * @date : 2019/4/21
*/ */
@Component @Component

View File

@ -12,7 +12,7 @@ import java.util.Map;
/** /**
* Freemarker custom tag of post. * Freemarker custom tag of post.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2018/4/26 * @date : 2018/4/26
*/ */
@Component @Component

View File

@ -12,7 +12,7 @@ import java.util.Map;
/** /**
* Freemarker custom tag of tag. * Freemarker custom tag of tag.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/22 * @date : 2019/3/22
*/ */
@Component @Component

View File

@ -10,7 +10,7 @@ import javax.validation.constraints.Size;
/** /**
* Attachment params. * Attachment params.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/04/20 * @date : 2019/04/20
*/ */
@Data @Data

View File

@ -6,7 +6,7 @@ import run.halo.app.model.enums.AttachmentType;
/** /**
* Attachment query params. * Attachment query params.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/04/18 * @date : 2019/04/18
*/ */
@Data @Data

View File

@ -6,7 +6,7 @@ import run.halo.app.model.enums.CommentStatus;
/** /**
* Comment query params. * Comment query params.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/04/18 * @date : 2019/04/18
*/ */
@Data @Data

View File

@ -0,0 +1,18 @@
package run.halo.app.model.params;
import lombok.Data;
/**
* Journal query params.
*
* @author ryanwang
* @date : 2019/04/26
*/
@Data
public class JournalQuery {
/**
* Keyword.
*/
private String keyword;
}

View File

@ -10,7 +10,7 @@ import java.util.Date;
/** /**
* Post param. * Post param.
* *
* @author RYAN0UP * @author ryanwang
* @date 2019/04/25 * @date 2019/04/25
*/ */
@Data @Data

View File

@ -5,7 +5,7 @@ import lombok.Data;
/** /**
* Photo query params. * Photo query params.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/04/25 * @date : 2019/04/25
*/ */
@Data @Data

View File

@ -1,7 +1,7 @@
package run.halo.app.model.properties; package run.halo.app.model.properties;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-17 * @date : 2019-03-17
*/ */
public enum BlogProperties implements PropertyEnum { public enum BlogProperties implements PropertyEnum {

View File

@ -9,7 +9,7 @@ import java.util.Date;
* *
* </pre> * </pre>
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2018/6/4 * @date : 2018/6/4
*/ */
@Data @Data

View File

@ -5,7 +5,7 @@ package run.halo.app.model.support;
* *
* </pre> * </pre>
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2017/12/29 * @date : 2017/12/29
*/ */
public class HaloConst { public class HaloConst {

View File

@ -5,7 +5,7 @@ package run.halo.app.model.support;
* *
* </pre> * </pre>
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2018/1/19 * @date : 2018/1/19
*/ */
public interface LogsRecord { public interface LogsRecord {

View File

@ -9,7 +9,7 @@ import java.util.List;
/** /**
* Theme file. * Theme file.
* *
* @author RYAN0UP * @author ryanwang
* @date 2019/04/02 * @date 2019/04/02
*/ */
@Data @Data

View File

@ -9,7 +9,7 @@ import java.util.List;
/** /**
* Link team vo. * Link team vo.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/22 * @date : 2019/3/22
*/ */
@Data @Data

View File

@ -6,7 +6,7 @@ import run.halo.app.model.dto.MenuDTO;
import java.util.List; import java.util.List;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2019-04-07 * @date : 2019-04-07
*/ */
@Data @Data

View File

@ -9,7 +9,7 @@ import java.util.List;
/** /**
* Link team vo. * Link team vo.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/22 * @date : 2019/3/22
*/ */
@Data @Data

View File

@ -1,5 +1,6 @@
package run.halo.app.repository; package run.halo.app.repository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import run.halo.app.model.entity.Journal; import run.halo.app.model.entity.Journal;
import run.halo.app.repository.base.BaseRepository; import run.halo.app.repository.base.BaseRepository;
@ -9,6 +10,6 @@ import run.halo.app.repository.base.BaseRepository;
* @author johnniang * @author johnniang
* @date 3/22/19 * @date 3/22/19
*/ */
public interface JournalRepository extends BaseRepository<Journal, Integer> { public interface JournalRepository extends BaseRepository<Journal, Integer>, JpaSpecificationExecutor<Journal> {
} }

View File

@ -10,7 +10,7 @@ import run.halo.app.repository.base.BasePostRepository;
* Post repository. * Post repository.
* *
* @author johnniang * @author johnniang
* @author RYAN0UP * @author ryanwang
*/ */
public interface PostRepository extends BasePostRepository<Post>, JpaSpecificationExecutor<Post> { public interface PostRepository extends BasePostRepository<Post>, JpaSpecificationExecutor<Post> {

View File

@ -8,6 +8,7 @@ import run.halo.app.model.dto.JournalDTO;
import run.halo.app.model.dto.JournalWithCmtCountDTO; import run.halo.app.model.dto.JournalWithCmtCountDTO;
import run.halo.app.model.entity.Journal; import run.halo.app.model.entity.Journal;
import run.halo.app.model.params.JournalParam; import run.halo.app.model.params.JournalParam;
import run.halo.app.model.params.JournalQuery;
import run.halo.app.service.base.CrudService; import run.halo.app.service.base.CrudService;
import java.util.List; import java.util.List;
@ -16,6 +17,7 @@ import java.util.List;
* Journal service interface. * Journal service interface.
* *
* @author johnniang * @author johnniang
* @author ryanwang
* @date 19-4-24 * @date 19-4-24
*/ */
public interface JournalService extends CrudService<Journal, Integer> { public interface JournalService extends CrudService<Journal, Integer> {
@ -37,6 +39,16 @@ public interface JournalService extends CrudService<Journal, Integer> {
*/ */
Page<Journal> pageLatest(int top); Page<Journal> pageLatest(int top);
/**
* Pages journals.
*
* @param journalQuery journal query must not be null
* @param pageable page info must not be null
* @return a page of post
*/
@NonNull
Page<Journal> pageBy(@NonNull JournalQuery journalQuery, @NonNull Pageable pageable);
/** /**
* Converts to journal dto. * Converts to journal dto.
* *

View File

@ -5,7 +5,7 @@ import java.util.Map;
/** /**
* Mail server * Mail server
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-17 * @date : 2019-03-17
*/ */
public interface MailService { public interface MailService {

View File

@ -14,7 +14,7 @@ import java.util.List;
* Menu service. * Menu service.
* *
* @author johnniang * @author johnniang
* @author RYAN0UP * @author ryanwang
*/ */
public interface MenuService extends CrudService<Menu, Integer> { public interface MenuService extends CrudService<Menu, Integer> {

View File

@ -20,7 +20,7 @@ import java.util.Set;
* Post service. * Post service.
* *
* @author johnniang * @author johnniang
* @author RYAN0UP * @author ryanwang
*/ */
public interface PostService extends BasePostService<Post> { public interface PostService extends BasePostService<Post> {

View File

@ -14,7 +14,7 @@ import java.util.Optional;
import java.util.Set; import java.util.Set;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/26 * @date : 2019/3/26
*/ */
public interface ThemeService { public interface ThemeService {

View File

@ -30,7 +30,7 @@ import java.util.Objects;
/** /**
* AttachmentService implementation * AttachmentService implementation
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-14 * @date : 2019-03-14
*/ */
@Slf4j @Slf4j

View File

@ -24,7 +24,7 @@ import java.util.stream.Collectors;
/** /**
* CategoryService implementation class * CategoryService implementation class
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-14 * @date : 2019-03-14
*/ */
@Slf4j @Slf4j

View File

@ -1,7 +1,11 @@
package run.halo.app.service.impl; package run.halo.app.service.impl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl; import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.lang.NonNull;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils; import org.springframework.util.CollectionUtils;
@ -9,22 +13,22 @@ import run.halo.app.model.dto.JournalDTO;
import run.halo.app.model.dto.JournalWithCmtCountDTO; import run.halo.app.model.dto.JournalWithCmtCountDTO;
import run.halo.app.model.entity.Journal; import run.halo.app.model.entity.Journal;
import run.halo.app.model.params.JournalParam; import run.halo.app.model.params.JournalParam;
import run.halo.app.model.params.JournalQuery;
import run.halo.app.repository.JournalRepository; import run.halo.app.repository.JournalRepository;
import run.halo.app.service.JournalCommentService; import run.halo.app.service.JournalCommentService;
import run.halo.app.service.JournalService; import run.halo.app.service.JournalService;
import run.halo.app.service.base.AbstractCrudService; import run.halo.app.service.base.AbstractCrudService;
import run.halo.app.utils.ServiceUtils; import run.halo.app.utils.ServiceUtils;
import java.util.Collections; import javax.persistence.criteria.Predicate;
import java.util.List; import java.util.*;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors; import java.util.stream.Collectors;
/** /**
* Journal service implementation. * Journal service implementation.
* *
* @author johnniang * @author johnniang
* @author ryanwang
* @date 19-4-24 * @date 19-4-24
*/ */
@Service @Service
@ -53,6 +57,13 @@ public class JournalServiceImpl extends AbstractCrudService<Journal, Integer> im
return listAll(ServiceUtils.buildLatestPageable(top)); return listAll(ServiceUtils.buildLatestPageable(top));
} }
@Override
public Page<Journal> pageBy(JournalQuery journalQuery, Pageable pageable) {
Assert.notNull(journalQuery, "Journal query must not be null");
Assert.notNull(pageable, "Page info must not be null");
return journalRepository.findAll(buildSpecByQuery(journalQuery), pageable);
}
@Override @Override
public JournalDTO convertTo(Journal journal) { public JournalDTO convertTo(Journal journal) {
Assert.notNull(journal, "Journal must not be null"); Assert.notNull(journal, "Journal must not be null");
@ -94,4 +105,30 @@ public class JournalServiceImpl extends AbstractCrudService<Journal, Integer> im
} }
/**
* Build specification by journal query.
*
* @param journalQuery query query must not be null
* @return a query specification
*/
@NonNull
private Specification<Journal> buildSpecByQuery(@NonNull JournalQuery journalQuery) {
Assert.notNull(journalQuery, "Journal query must not be null");
return (Specification<Journal>) (root, query, criteriaBuilder) -> {
List<Predicate> predicates = new LinkedList<>();
if (journalQuery.getKeyword() != null) {
// Format like condition
String likeCondition = String.format("%%%s%%", StringUtils.strip(journalQuery.getKeyword()));
// Build like predicate
Predicate contentLike = criteriaBuilder.like(root.get("content"), likeCondition);
predicates.add(criteriaBuilder.or(contentLike));
}
return query.where(predicates.toArray(new Predicate[0])).getRestriction();
};
}
} }

View File

@ -23,7 +23,7 @@ import java.util.stream.Collectors;
/** /**
* LinkService implementation class * LinkService implementation class
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-14 * @date : 2019-03-14
*/ */
@Service @Service

View File

@ -14,7 +14,7 @@ import org.springframework.util.Assert;
/** /**
* LogService implementation class * LogService implementation class
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-14 * @date : 2019-03-14
*/ */
@Service @Service

View File

@ -19,7 +19,7 @@ import java.util.Properties;
/** /**
* Mail service implementation. * Mail service implementation.
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-17 * @date : 2019-03-17
*/ */
@Slf4j @Slf4j

View File

@ -22,7 +22,7 @@ import java.util.stream.Collectors;
/** /**
* MenuService implementation class * MenuService implementation class
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-14 * @date : 2019-03-14
*/ */
@Service @Service

View File

@ -28,7 +28,7 @@ import java.util.stream.Collectors;
/** /**
* OptionService implementation class * OptionService implementation class
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-14 * @date : 2019-03-14
*/ */
@Slf4j @Slf4j

View File

@ -28,7 +28,7 @@ import java.util.stream.Collectors;
/** /**
* PhotoService implementation class * PhotoService implementation class
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-14 * @date : 2019-03-14
*/ */
@Service @Service

View File

@ -27,7 +27,7 @@ import java.util.stream.Collectors;
/** /**
* PostCommentService implementation class * PostCommentService implementation class
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-14 * @date : 2019-03-14
*/ */
@Slf4j @Slf4j

View File

@ -41,7 +41,7 @@ import static org.springframework.data.domain.Sort.Direction.DESC;
* Post service implementation. * Post service implementation.
* *
* @author johnniang * @author johnniang
* @author RYAN0UP * @author ryanwang
*/ */
@Slf4j @Slf4j
@Service @Service

View File

@ -19,7 +19,7 @@ import java.util.stream.Collectors;
/** /**
* TagService implementation class * TagService implementation class
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-14 * @date : 2019-03-14
*/ */
@Slf4j @Slf4j

View File

@ -51,7 +51,7 @@ import java.util.zip.ZipInputStream;
import static run.halo.app.model.support.HaloConst.DEFAULT_THEME_ID; import static run.halo.app.model.support.HaloConst.DEFAULT_THEME_ID;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2019/3/26 * @date : 2019/3/26
*/ */
@Slf4j @Slf4j

View File

@ -32,7 +32,7 @@ import java.util.concurrent.TimeUnit;
/** /**
* UserService implementation class * UserService implementation class
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2019-03-14 * @date : 2019-03-14
*/ */
@Service @Service

View File

@ -25,7 +25,7 @@ import java.util.UUID;
* *
* </pre> * </pre>
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2017/12/22 * @date : 2017/12/22
*/ */
@Slf4j @Slf4j

View File

@ -17,7 +17,7 @@ import java.util.Set;
/** /**
* Markdown utils * Markdown utils
* *
* @author : RYAN0UP * @author ryanwang
* @date : 2018/11/14 * @date : 2018/11/14
*/ */
public class MarkdownUtils { public class MarkdownUtils {

View File

@ -3,7 +3,7 @@ package run.halo.app.utils;
import org.junit.Test; import org.junit.Test;
/** /**
* @author : RYAN0UP * @author ryanwang
* @date : 2017/12/26 * @date : 2017/12/26
* @version : 1.0 * @version : 1.0
* description: * description: