🎨 细节优化

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 cd $HALO_DIR/target/dist/halo
# 运行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" echo "Halo部署完毕Enjoy"

View File

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

View File

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

View File

@ -61,41 +61,6 @@ public class FrontCommentController {
@Autowired @Autowired
private MailService mailService; 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

@ -644,8 +644,8 @@
<div class="form-group"> <div class="form-group">
<label for="statisticsCode" class="col-lg-2 col-sm-4 control-label"><@spring.message code='admin.setting.form.statistics-code' /> <label for="statisticsCode" class="col-lg-2 col-sm-4 control-label"><@spring.message code='admin.setting.form.statistics-code' />
<span data-toggle="tooltip" data-placement="top" title="<@spring.message code='admin.setting.form.statistics-code-tips' />" style="cursor: pointer"> <span data-toggle="tooltip" data-placement="top" title="<@spring.message code='admin.setting.form.statistics-code-tips' />" style="cursor: pointer">
<i class="fa fa-question-circle" aria-hidden="true"></i> <i class="fa fa-question-circle" aria-hidden="true"></i>
</span> </span>
</label> </label>
<div class="col-lg-4 col-sm-8"> <div class="col-lg-4 col-sm-8">
<textarea class="form-control" rows="6" id="statisticsCode" name="statistics_code" style="resize: none">${options.statistics_code!}</textarea> <textarea class="form-control" rows="6" id="statisticsCode" name="statistics_code" style="resize: none">${options.statistics_code!}</textarea>

View File

@ -28,7 +28,7 @@
<div class="col-md-9"> <div class="col-md-9">
<input type="hidden" id="postId" name="postId" value="${post.postId?c}"> <input type="hidden" id="postId" name="postId" value="${post.postId?c}">
<div style="margin-bottom: 10px;"> <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>
<div style="display: block;margin-bottom: 10px;"> <div style="display: block;margin-bottom: 10px;">
<span> <span>
@ -69,7 +69,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="postPassword" class="control-label">文章密码:</label> <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>
<div class="form-group"> <div class="form-group">
<label for="postDate" class="control-label">发布时间:</label> <label for="postDate" class="control-label">发布时间:</label>

View File

@ -26,7 +26,7 @@
<div class="row"> <div class="row">
<div class="col-md-9"> <div class="col-md-9">
<div style="margin-bottom: 10px;"> <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>
<div style="display: block;margin-bottom: 10px;"> <div style="display: block;margin-bottom: 10px;">
<span> <span>
@ -67,7 +67,7 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="postPassword" class="control-label">文章密码:</label> <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> </div>
<div class="box-footer"> <div class="box-footer">