Unverified Commit 2730d4df authored by Ryan Wang's avatar Ryan Wang Committed by GitHub
Browse files

release 1.1.1 (#316)


release 1.1.1
Co-authored-by: default avatarJohn Niang <johnniang@foxmail.com>
parents c0970084 bade5f9f
Showing with 120 additions and 11 deletions
+120 -11
......@@ -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.'
......
......@@ -23,6 +23,7 @@ import run.halo.app.model.vo.PostListVO;
import run.halo.app.service.*;
import run.halo.app.utils.MarkdownUtils;
import java.io.File;
import java.util.List;
import java.util.concurrent.TimeUnit;
......
......@@ -3,13 +3,19 @@ package run.halo.app.controller.content.api;
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;
......@@ -23,8 +29,11 @@ import java.util.List;
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")
......@@ -44,6 +53,20 @@ public class JournalController {
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,
......
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);
}
}
......@@ -10,7 +10,6 @@ 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.Post;
import run.halo.app.model.entity.PostComment;
......@@ -55,7 +54,7 @@ public class PostController {
@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);
}
......@@ -71,8 +70,8 @@ public class PostController {
@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) {
......
......@@ -3,13 +3,19 @@ package run.halo.app.controller.content.api;
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;
......@@ -26,6 +32,7 @@ import static org.springframework.data.domain.Sort.Direction.DESC;
* Sheet controller.
*
* @author johnniang
* @author ryanwang
* @date 19-4-26
*/
@RestController("PortalSheetController")
......@@ -44,6 +51,33 @@ public class SheetController {
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,
......
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;
......@@ -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 = "评论内容不能为空")
......
......@@ -13,8 +13,6 @@ public enum SeoProperties implements PropertyEnum {
DESCRIPTION("seo_description", String.class, ""),
BAIDU_TOKEN("seo_baidu_token", String.class, ""),
/**
* 是否禁止爬虫
*/
......
.page-header-wrapper-grid-content-main[data-v-59c6a198]{width:100%;height:100%;min-height:100%;-webkit-transition:.3s;transition:.3s}.page-header-wrapper-grid-content-main .profile-center-avatarHolder[data-v-59c6a198]{text-align:center;margin-bottom:24px}.page-header-wrapper-grid-content-main .profile-center-avatarHolder>.avatar[data-v-59c6a198]{margin:0 auto;width:104px;height:104px;margin-bottom:20px;border-radius:50%;overflow:hidden;cursor:pointer}.page-header-wrapper-grid-content-main .profile-center-avatarHolder>.avatar img[data-v-59c6a198]{height:100%;width:100%}.page-header-wrapper-grid-content-main .profile-center-avatarHolder .username[data-v-59c6a198]{color:rgba(0,0,0,.85);font-size:20px;line-height:28px;font-weight:500;margin-bottom:4px}.page-header-wrapper-grid-content-main .profile-center-detail p[data-v-59c6a198]{margin-bottom:8px;padding-left:26px;position:relative}.page-header-wrapper-grid-content-main .profile-center-detail i[data-v-59c6a198]{position:absolute;height:14px;width:14px;left:0;top:4px}
\ No newline at end of file
.page-header-wrapper-grid-content-main[data-v-63742d21]{width:100%;height:100%;min-height:100%;-webkit-transition:.3s;transition:.3s}.page-header-wrapper-grid-content-main .profile-center-avatarHolder[data-v-63742d21]{text-align:center;margin-bottom:24px}.page-header-wrapper-grid-content-main .profile-center-avatarHolder>.avatar[data-v-63742d21]{margin:0 auto;width:104px;height:104px;margin-bottom:20px;border-radius:50%;overflow:hidden;cursor:pointer}.page-header-wrapper-grid-content-main .profile-center-avatarHolder>.avatar img[data-v-63742d21]{height:100%;width:100%}.page-header-wrapper-grid-content-main .profile-center-avatarHolder .username[data-v-63742d21]{color:rgba(0,0,0,.85);font-size:20px;line-height:28px;font-weight:500;margin-bottom:4px}.page-header-wrapper-grid-content-main .profile-center-detail p[data-v-63742d21]{margin-bottom:8px;padding-left:26px;position:relative}.page-header-wrapper-grid-content-main .profile-center-detail i[data-v-63742d21]{position:absolute;height:14px;width:14px;left:0;top:4px}
\ No newline at end of file
<!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>
\ No newline at end of file
<!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>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment