Skip to content

Commit

Permalink
release 1.1.1 (#316)
Browse files Browse the repository at this point in the history
release 1.1.1

Co-authored-by: John Niang <[email protected]>
  • Loading branch information
ruibaby and JohnNiang authored Sep 26, 2019
2 parents c097008 + bade5f9 commit 2730d4d
Show file tree
Hide file tree
Showing 43 changed files with 128 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ apply plugin: 'io.spring.dependency-management'

group = 'run.halo.app'
archivesBaseName = 'halo'
version = '1.1.0'
version = '1.1.1'
sourceCompatibility = '1.8'
description = 'Halo, personal blog system developed in Java.'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import run.halo.app.service.*;
import run.halo.app.utils.MarkdownUtils;

import java.io.File;
import java.util.List;
import java.util.concurrent.TimeUnit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.data.web.SortDefault;
import org.springframework.web.bind.annotation.*;
import run.halo.app.cache.lock.CacheLock;
import run.halo.app.model.dto.BaseCommentDTO;
import run.halo.app.model.dto.JournalDTO;
import run.halo.app.model.dto.JournalWithCmtCountDTO;
import run.halo.app.model.entity.Journal;
import run.halo.app.model.entity.JournalComment;
import run.halo.app.model.enums.CommentStatus;
import run.halo.app.model.enums.JournalType;
import run.halo.app.model.params.JournalCommentParam;
import run.halo.app.model.vo.BaseCommentVO;
import run.halo.app.model.vo.BaseCommentWithParentVO;
Expand All @@ -23,8 +29,11 @@
import static org.springframework.data.domain.Sort.Direction.DESC;

/**
* Content Journal controller.
*
* @author johnniang
* @date 19-4-26
* @author ryanwang
* @date 2019-04-26
*/
@RestController("PortalJournalController")
@RequestMapping("/api/content/journals")
Expand All @@ -44,6 +53,20 @@ public JournalController(JournalService journalService,
this.optionService = optionService;
}

@GetMapping
@ApiOperation("Lists journals")
public Page<JournalWithCmtCountDTO> pageBy(@PageableDefault(sort = "createTime", direction = DESC) Pageable pageable) {
Page<Journal> journals = journalService.pageBy(JournalType.PUBLIC, pageable);
return journalService.convertToCmtCountDto(journals);
}

@GetMapping("{journalId:\\d+}")
@ApiOperation("Gets a journal detail")
public JournalDTO getBy(@PathVariable("journalId") Integer journalId) {
Journal journal = journalService.getById(journalId);
return journalService.convertTo(journal);
}

@GetMapping("{journalId:\\d+}/comments/top_view")
public Page<CommentWithHasChildrenVO> listTopComments(@PathVariable("journalId") Integer journalId,
@RequestParam(name = "page", required = false, defaultValue = "0") int page,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package run.halo.app.controller.content.api;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.data.web.SortDefault;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import run.halo.app.model.dto.PhotoDTO;
import run.halo.app.model.params.PhotoQuery;
import run.halo.app.service.PhotoService;

import java.util.List;

import static org.springframework.data.domain.Sort.Direction.DESC;

/**
* Content photo controller.
*
* @author ryanwang
* @date 2019-09-21
*/
@RestController("ApiContentPhotoController")
@RequestMapping("/api/content/photos")
public class PhotoController {

private final PhotoService photoService;

public PhotoController(PhotoService photoService) {
this.photoService = photoService;
}

/**
* List all photos
*
* @param sort sort
* @return all of photos
*/
@GetMapping(value = "latest")
public List<PhotoDTO> listPhotos(@SortDefault(sort = "updateTime", direction = Sort.Direction.DESC) Sort sort) {
return photoService.listDtos(sort);
}

@GetMapping
public Page<PhotoDTO> pageBy(@PageableDefault(sort = "updateTime", direction = DESC) Pageable pageable,
PhotoQuery photoQuery) {
return photoService.pageDtosBy(pageable, photoQuery);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.springframework.web.bind.annotation.*;
import run.halo.app.cache.lock.CacheLock;
import run.halo.app.model.dto.BaseCommentDTO;
import run.halo.app.model.dto.post.BasePostDetailDTO;
import run.halo.app.model.dto.post.BasePostSimpleDTO;
import run.halo.app.model.entity.Post;
import run.halo.app.model.entity.PostComment;
Expand Down Expand Up @@ -55,7 +54,7 @@ public PostController(PostService postService,

@GetMapping
@ApiOperation("Lists posts")
public Page<BasePostSimpleDTO> pageBy(@PageableDefault(sort = "updateTime", direction = DESC) Pageable pageable) {
public Page<BasePostSimpleDTO> pageBy(@PageableDefault(sort = "createTime", direction = DESC) Pageable pageable) {
Page<Post> postPage = postService.pageBy(PostStatus.PUBLISHED, pageable);
return postService.convertToSimple(postPage);
}
Expand All @@ -71,8 +70,8 @@ public Page<BasePostSimpleDTO> pageBy(@RequestParam(value = "keyword") String ke
@GetMapping("{postId:\\d+}")
@ApiOperation("Gets a post")
public PostDetailVO getBy(@PathVariable("postId") Integer postId,
@RequestParam(value = "formatDisabled", required = false, defaultValue = "true") Boolean formatDisabled,
@RequestParam(value = "sourceDisabled", required = false, defaultValue = "false") Boolean sourceDisabled) {
@RequestParam(value = "formatDisabled", required = false, defaultValue = "true") Boolean formatDisabled,
@RequestParam(value = "sourceDisabled", required = false, defaultValue = "false") Boolean sourceDisabled) {
PostDetailVO postDetailVO = postService.convertToDetailVo(postService.getById(postId));

if (formatDisabled) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,19 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault;
import org.springframework.data.web.SortDefault;
import org.springframework.web.bind.annotation.*;
import run.halo.app.cache.lock.CacheLock;
import run.halo.app.model.dto.BaseCommentDTO;
import run.halo.app.model.dto.post.BasePostDetailDTO;
import run.halo.app.model.dto.post.BasePostSimpleDTO;
import run.halo.app.model.entity.Sheet;
import run.halo.app.model.entity.SheetComment;
import run.halo.app.model.enums.CommentStatus;
import run.halo.app.model.enums.PostStatus;
import run.halo.app.model.params.SheetCommentParam;
import run.halo.app.model.vo.BaseCommentVO;
import run.halo.app.model.vo.BaseCommentWithParentVO;
Expand All @@ -26,6 +32,7 @@
* Sheet controller.
*
* @author johnniang
* @author ryanwang
* @date 19-4-26
*/
@RestController("PortalSheetController")
Expand All @@ -44,6 +51,33 @@ public SheetController(SheetService sheetService, SheetCommentService sheetComme
this.optionService = optionService;
}

@GetMapping
@ApiOperation("Lists sheets")
public Page<BasePostSimpleDTO> pageBy(@PageableDefault(sort = "createTime", direction = DESC) Pageable pageable) {
Page<Sheet> sheetPage = sheetService.pageBy(PostStatus.PUBLISHED, pageable);
return sheetService.convertToSimple(sheetPage);
}

@GetMapping("{sheetId:\\d+}")
@ApiOperation("Gets a sheet")
public BasePostDetailDTO getBy(@PathVariable("sheetId") Integer sheetId,
@RequestParam(value = "formatDisabled", required = false, defaultValue = "true") Boolean formatDisabled,
@RequestParam(value = "sourceDisabled", required = false, defaultValue = "false") Boolean sourceDisabled) {
BasePostDetailDTO sheetDetailVO = sheetService.convertToDetail(sheetService.getById(sheetId));

if (formatDisabled) {
// Clear the format content
sheetDetailVO.setFormatContent(null);
}

if (sourceDisabled) {
// Clear the original content
sheetDetailVO.setOriginalContent(null);
}

return sheetDetailVO;
}

@GetMapping("{sheetId:\\d+}/comments/top_view")
public Page<CommentWithHasChildrenVO> listTopComments(@PathVariable("sheetId") Integer sheetId,
@RequestParam(name = "page", required = false, defaultValue = "0") int page,
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/run/halo/app/model/params/BaseCommentParam.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package run.halo.app.model.params;

import lombok.Data;
import org.hibernate.validator.constraints.URL;
import run.halo.app.model.dto.base.InputConverter;
import run.halo.app.utils.ReflectionUtils;

Expand Down Expand Up @@ -29,6 +30,7 @@ public abstract class BaseCommentParam<COMMENT> implements InputConverter<COMMEN
private String email;

@Size(max = 127, message = "评论者博客链接的字符长度不能超过 {max}")
@URL(message= "博客链接格式不正确")
private String authorUrl;

@NotBlank(message = "评论内容不能为空")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ public enum SeoProperties implements PropertyEnum {

DESCRIPTION("seo_description", String.class, ""),

BAIDU_TOKEN("seo_baidu_token", String.class, ""),

/**
* 是否禁止爬虫
*/
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/main/resources/admin/index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html><html lang=zh-cmn-Hans><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta name=robots content=noindex,nofllow><meta name=generator content=Halo><link rel=icon href=/logo.png><title>Halo Dashboard</title><style>#loader{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;border:solid 3px #e5e5e5;border-top-color:#333;border-radius:50%;width:30px;height:30px;animation:spin .6s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}</style><link href=/css/chunk-00feb227.84211a72.css rel=prefetch><link href=/css/chunk-09a78eda.0e33e21a.css rel=prefetch><link href=/css/chunk-1922a40e.f4349937.css rel=prefetch><link href=/css/chunk-1e303e8c.46a67c57.css rel=prefetch><link href=/css/chunk-2cf7efe4.0e33e21a.css rel=prefetch><link href=/css/chunk-36ac1a23.0becaf8c.css rel=prefetch><link href=/css/chunk-38e065ca.8f4ac180.css rel=prefetch><link href=/css/chunk-59456d4e.afea7f86.css rel=prefetch><link href=/css/chunk-afda5a22.041fa426.css rel=prefetch><link href=/css/chunk-f1c576e6.b38ba436.css rel=prefetch><link href=/css/fail.809a6bc5.css rel=prefetch><link href=/js/chunk-00feb227.2c332405.js rel=prefetch><link href=/js/chunk-09a78eda.ecea3d8e.js rel=prefetch><link href=/js/chunk-0ba750a2.c7f7fd0b.js rel=prefetch><link href=/js/chunk-13882457.562b4d43.js rel=prefetch><link href=/js/chunk-1922a40e.3378b225.js rel=prefetch><link href=/js/chunk-1e303e8c.f696700e.js rel=prefetch><link href=/js/chunk-2cf7efe4.edad6794.js rel=prefetch><link href=/js/chunk-2d0b383e.6fd94865.js rel=prefetch><link href=/js/chunk-2d0b64bf.db02cecd.js rel=prefetch><link href=/js/chunk-2d0b8b03.818cca76.js rel=prefetch><link href=/js/chunk-2d0cf13d.02e642fe.js rel=prefetch><link href=/js/chunk-2d21a35c.cff39891.js rel=prefetch><link href=/js/chunk-2d228c74.3f60fbb2.js rel=prefetch><link href=/js/chunk-2d228d13.e7c565c8.js rel=prefetch><link href=/js/chunk-36ac1a23.36af80b4.js rel=prefetch><link href=/js/chunk-37a26d88.04a2a49e.js rel=prefetch><link href=/js/chunk-38e065ca.a9b9711f.js rel=prefetch><link href=/js/chunk-59456d4e.13903f8f.js rel=prefetch><link href=/js/chunk-664d53d7.4cc459ed.js rel=prefetch><link href=/js/chunk-6709ac89.606ab90b.js rel=prefetch><link href=/js/chunk-78dfb9ad.2fb3220c.js rel=prefetch><link href=/js/chunk-7f061eff.83785ccc.js rel=prefetch><link href=/js/chunk-afda5a22.464c5981.js rel=prefetch><link href=/js/chunk-b0eebb32.3d368473.js rel=prefetch><link href=/js/chunk-f1c576e6.04de3e8c.js rel=prefetch><link href=/js/fail.ef3c85c4.js rel=prefetch><link href=/css/app.ad52b47a.css rel=preload as=style><link href=/css/chunk-vendors.70dcf28e.css rel=preload as=style><link href=/js/app.0bb46c3a.js rel=preload as=script><link href=/js/chunk-vendors.8dff577d.js rel=preload as=script><link href=/css/chunk-vendors.70dcf28e.css rel=stylesheet><link href=/css/app.ad52b47a.css rel=stylesheet></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app><div id=loader></div></div><script src=/js/chunk-vendors.8dff577d.js></script><script src=/js/app.0bb46c3a.js></script></body></html>
<!DOCTYPE html><html lang=zh-cmn-Hans><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"><meta name=robots content=noindex,nofllow><meta name=generator content=Halo><link rel=icon href=/logo.png><title>Halo Dashboard</title><style>#loader{position:absolute;top:0;right:0;bottom:0;left:0;margin:auto;border:solid 3px #e5e5e5;border-top-color:#333;border-radius:50%;width:30px;height:30px;animation:spin .6s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}</style><link href=/css/chunk-00feb227.84211a72.css rel=prefetch><link href=/css/chunk-09a78eda.0e33e21a.css rel=prefetch><link href=/css/chunk-0cc826ee.d94071d6.css rel=prefetch><link href=/css/chunk-1922a40e.f4349937.css rel=prefetch><link href=/css/chunk-1e303e8c.46a67c57.css rel=prefetch><link href=/css/chunk-2cf7efe4.0e33e21a.css rel=prefetch><link href=/css/chunk-36ac1a23.0becaf8c.css rel=prefetch><link href=/css/chunk-59456d4e.afea7f86.css rel=prefetch><link href=/css/chunk-afda5a22.041fa426.css rel=prefetch><link href=/css/chunk-f1c576e6.b38ba436.css rel=prefetch><link href=/css/fail.809a6bc5.css rel=prefetch><link href=/js/chunk-00feb227.9a8da69e.js rel=prefetch><link href=/js/chunk-09a78eda.cc69abe1.js rel=prefetch><link href=/js/chunk-0ba750a2.1fe7a063.js rel=prefetch><link href=/js/chunk-0cc826ee.944fd5f4.js rel=prefetch><link href=/js/chunk-13882457.c82a4d82.js rel=prefetch><link href=/js/chunk-1922a40e.c260b56d.js rel=prefetch><link href=/js/chunk-1e303e8c.13b99962.js rel=prefetch><link href=/js/chunk-2cf7efe4.01e2d029.js rel=prefetch><link href=/js/chunk-2d0b383e.d5e906d0.js rel=prefetch><link href=/js/chunk-2d0b64bf.dc1f06bd.js rel=prefetch><link href=/js/chunk-2d0b8b03.44d2af44.js rel=prefetch><link href=/js/chunk-2d0cf13d.49fc8c5f.js rel=prefetch><link href=/js/chunk-2d21a35c.82f5da19.js rel=prefetch><link href=/js/chunk-2d228c74.931307e8.js rel=prefetch><link href=/js/chunk-2d228d13.c03e48e4.js rel=prefetch><link href=/js/chunk-36ac1a23.907bf32d.js rel=prefetch><link href=/js/chunk-37a26d88.20c02945.js rel=prefetch><link href=/js/chunk-59456d4e.0c1f28f5.js rel=prefetch><link href=/js/chunk-664d53d7.69874f43.js rel=prefetch><link href=/js/chunk-6709ac89.81fe9f80.js rel=prefetch><link href=/js/chunk-78dfb9ad.08dc84c7.js rel=prefetch><link href=/js/chunk-7f061eff.9efbb5ce.js rel=prefetch><link href=/js/chunk-afda5a22.14d03c3c.js rel=prefetch><link href=/js/chunk-b0eebb32.58f570c3.js rel=prefetch><link href=/js/chunk-f1c576e6.a11c537b.js rel=prefetch><link href=/js/fail.244fe78b.js rel=prefetch><link href=/css/app.ad52b47a.css rel=preload as=style><link href=/css/chunk-vendors.70dcf28e.css rel=preload as=style><link href=/js/app.e29a566a.js rel=preload as=script><link href=/js/chunk-vendors.8dff577d.js rel=preload as=script><link href=/css/chunk-vendors.70dcf28e.css rel=stylesheet><link href=/css/app.ad52b47a.css rel=stylesheet></head><body><noscript><strong>We're sorry but vue-antd-pro doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id=app><div id=loader></div></div><script src=/js/chunk-vendors.8dff577d.js></script><script src=/js/app.e29a566a.js></script></body></html>

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Loading

0 comments on commit 2730d4d

Please sign in to comment.