🎨 细节优化

pull/139/head
ruibaby 2019-01-22 14:13:43 +08:00
parent 5912a50d2c
commit 40af072f95
7 changed files with 14 additions and 42 deletions

View File

@ -19,6 +19,6 @@ mvn package -Pprod
cd $HALO_DIR/target/dist/halo
# 运行Halo
nohup java -server -Xms256m -Xmx512m -jar `find ./ -name "halo*.jar"` > /dev/null 2>&1 &
nohup java -server -jar `find ./ -name "halo*.jar"` > /dev/null 2>&1 &
echo "Halo部署完毕Enjoy"

View File

@ -57,14 +57,19 @@ public class PageController {
@Autowired
LocaleMessageUtil localeMessageUtil;
@Autowired
private LinkService linkService;
@Autowired
private GalleryService galleryService;
@Autowired
private PostService postService;
@Autowired
private LogsService logsService;
@Autowired
private HttpServletRequest request;

View File

@ -47,8 +47,10 @@ import java.util.List;
public class FrontArchiveController extends BaseController {
private static final String POSTS_CACHE_NAME = "posts";
@Autowired
private PostService postService;
@Autowired
private CommentService commentService;

View File

@ -61,41 +61,6 @@ public class FrontCommentController {
@Autowired
private MailService mailService;
/**
*
*
* @param postId postId
*
* @return List
*/
@GetMapping(value = "/getComment/{postId}", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@ResponseBody
public List<Comment> getComment(@PathVariable Long postId) {
final Optional<Post> post = postService.findByPostId(postId);
final Sort sort = new Sort(Sort.Direction.DESC, "commentDate");
final Pageable pageable = PageRequest.of(0, 999, sort);
final List<Comment> comments = commentService.findCommentsByPostAndCommentStatus(post.orElse(new Post()), pageable, CommentStatusEnum.PUBLISHED.getCode()).getContent();
return CommentUtil.getComments(comments);
}
/**
*
*
* @param page
* @param post
*
* @return List
*/
@GetMapping(value = "/loadComment")
@ResponseBody
public List<Comment> loadComment(@RequestParam(value = "page") Integer page,
@RequestParam(value = "post") Post post) {
final Sort sort = new Sort(Sort.Direction.DESC, "commentDate");
final Pageable pageable = PageRequest.of(page - 1, 10, sort);
final List<Comment> comments = commentService.findCommentsByPostAndCommentStatus(post, pageable, CommentStatusEnum.PUBLISHED.getCode()).getContent();
return comments;
}
/**
*
*

View File

@ -28,7 +28,7 @@
<div class="col-md-9">
<input type="hidden" id="postId" name="postId" value="${post.postId?c}">
<div style="margin-bottom: 10px;">
<input type="text" class="form-control input-lg" id="postTitle" name="postTitle" placeholder="<@spring.message code='admin.posts.edit.form.title.placeholder' />" onblur="autoComplateUrl();" value="${post.postTitle!}">
<input type="text" class="form-control input-lg" id="postTitle" name="postTitle" placeholder="<@spring.message code='admin.posts.edit.form.title.placeholder' />" onblur="autoComplateUrl();" value="${post.postTitle!}" autocomplete="off">
</div>
<div style="display: block;margin-bottom: 10px;">
<span>
@ -69,7 +69,7 @@
</div>
<div class="form-group">
<label for="postPassword" class="control-label">文章密码:</label>
<input type="password" class="form-control" id="postPassword" name="postPassword" value="${post.postPassword!}">
<input type="password" class="form-control" id="postPassword" name="postPassword" value="${post.postPassword!}" autocomplete="off">
</div>
<div class="form-group">
<label for="postDate" class="control-label">发布时间:</label>

View File

@ -26,7 +26,7 @@
<div class="row">
<div class="col-md-9">
<div style="margin-bottom: 10px;">
<input type="text" class="form-control input-lg" id="postTitle" name="postTitle" placeholder="<@spring.message code='admin.posts.edit.form.title.placeholder' />" onblur="autoComplateUrl();">
<input type="text" class="form-control input-lg" id="postTitle" name="postTitle" placeholder="<@spring.message code='admin.posts.edit.form.title.placeholder' />" onblur="autoComplateUrl();" autocomplete="off">
</div>
<div style="display: block;margin-bottom: 10px;">
<span>
@ -67,7 +67,7 @@
</div>
<div class="form-group">
<label for="postPassword" class="control-label">文章密码:</label>
<input type="password" class="form-control" id="postPassword" name="postPassword">
<input type="password" class="form-control" id="postPassword" name="postPassword" autocomplete="off">
</div>
</div>
<div class="box-footer">