mirror of https://github.com/halo-dev/halo
🎨 代码优化
parent
1501bdad25
commit
c0d1484b93
|
@ -46,19 +46,19 @@ public class CommonTagDirective implements TemplateDirectiveModel {
|
||||||
String method = map.get(METHOD_KEY).toString();
|
String method = map.get(METHOD_KEY).toString();
|
||||||
switch (method) {
|
switch (method) {
|
||||||
case "menus":
|
case "menus":
|
||||||
environment.setVariable("menus", builder.build().wrap(menuService.findAllMenus()));
|
environment.setVariable("menus", builder.build().wrap(menuService.findAll()));
|
||||||
break;
|
break;
|
||||||
case "categories":
|
case "categories":
|
||||||
environment.setVariable("categories", builder.build().wrap(categoryService.findAllCategories()));
|
environment.setVariable("categories", builder.build().wrap(categoryService.findAll()));
|
||||||
break;
|
break;
|
||||||
case "tags":
|
case "tags":
|
||||||
environment.setVariable("tags", builder.build().wrap(tagService.findAllTags()));
|
environment.setVariable("tags", builder.build().wrap(tagService.findAll()));
|
||||||
break;
|
break;
|
||||||
case "links":
|
case "links":
|
||||||
environment.setVariable("links", builder.build().wrap(linkService.findAllLinks()));
|
environment.setVariable("links", builder.build().wrap(linkService.findAll()));
|
||||||
break;
|
break;
|
||||||
case "newComments":
|
case "newComments":
|
||||||
environment.setVariable("newComments", builder.build().wrap(commentService.findAllComments(1)));
|
environment.setVariable("newComments", builder.build().wrap(commentService.findAll(1)));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -26,14 +26,14 @@ public interface AttachmentService {
|
||||||
* @param attachment attachment
|
* @param attachment attachment
|
||||||
* @return Attachment
|
* @return Attachment
|
||||||
*/
|
*/
|
||||||
Attachment saveByAttachment(Attachment attachment);
|
Attachment save(Attachment attachment);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有附件信息
|
* 查询所有附件信息
|
||||||
*
|
*
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
List<Attachment> findAllAttachments();
|
List<Attachment> findAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有附件,分页
|
* 查询所有附件,分页
|
||||||
|
@ -41,7 +41,7 @@ public interface AttachmentService {
|
||||||
* @param pageable pageable
|
* @param pageable pageable
|
||||||
* @return Page
|
* @return Page
|
||||||
*/
|
*/
|
||||||
Page<Attachment> findAllAttachments(Pageable pageable);
|
Page<Attachment> findAll(Pageable pageable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据编号查询
|
* 根据编号查询
|
||||||
|
@ -57,7 +57,7 @@ public interface AttachmentService {
|
||||||
* @param attachId attachId
|
* @param attachId attachId
|
||||||
* @return Attachment
|
* @return Attachment
|
||||||
*/
|
*/
|
||||||
Attachment removeByAttachId(Long attachId);
|
Attachment remove(Long attachId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 上传转发
|
* 上传转发
|
||||||
|
@ -110,4 +110,11 @@ public interface AttachmentService {
|
||||||
* @return boolean
|
* @return boolean
|
||||||
*/
|
*/
|
||||||
boolean deleteUpYunAttachment(String fileName);
|
boolean deleteUpYunAttachment(String fileName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取附件总数
|
||||||
|
*
|
||||||
|
* @return Long
|
||||||
|
*/
|
||||||
|
Long getCount();
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ public interface CategoryService {
|
||||||
* @param category 分类目录
|
* @param category 分类目录
|
||||||
* @return 如果插入成功,返回分类目录对象
|
* @return 如果插入成功,返回分类目录对象
|
||||||
*/
|
*/
|
||||||
Category saveByCategory(Category category);
|
Category save(Category category);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据编号删除分类目录
|
* 根据编号删除分类目录
|
||||||
|
@ -29,14 +29,14 @@ public interface CategoryService {
|
||||||
* @param cateId 分类目录编号
|
* @param cateId 分类目录编号
|
||||||
* @return category
|
* @return category
|
||||||
*/
|
*/
|
||||||
Category removeByCateId(Long cateId);
|
Category remove(Long cateId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有分类目录
|
* 获取所有分类目录
|
||||||
*
|
*
|
||||||
* @return 返回List集合
|
* @return 返回List集合
|
||||||
*/
|
*/
|
||||||
List<Category> findAllCategories();
|
List<Category> findAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据编号查询单个分类
|
* 根据编号查询单个分类
|
||||||
|
|
|
@ -23,7 +23,7 @@ public interface CommentService {
|
||||||
*
|
*
|
||||||
* @param comment comment
|
* @param comment comment
|
||||||
*/
|
*/
|
||||||
void saveByComment(Comment comment);
|
void save(Comment comment);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除评论
|
* 删除评论
|
||||||
|
@ -31,7 +31,7 @@ public interface CommentService {
|
||||||
* @param commentId commentId
|
* @param commentId commentId
|
||||||
* @return Optional
|
* @return Optional
|
||||||
*/
|
*/
|
||||||
Optional<Comment> removeByCommentId(Long commentId);
|
Optional<Comment> remove(Long commentId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有的评论,用于后台管理
|
* 查询所有的评论,用于后台管理
|
||||||
|
@ -40,7 +40,7 @@ public interface CommentService {
|
||||||
* @param pageable pageable
|
* @param pageable pageable
|
||||||
* @return Page
|
* @return Page
|
||||||
*/
|
*/
|
||||||
Page<Comment> findAllComments(Integer status, Pageable pageable);
|
Page<Comment> findAll(Integer status, Pageable pageable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据评论状态查询评论
|
* 根据评论状态查询评论
|
||||||
|
@ -48,14 +48,14 @@ public interface CommentService {
|
||||||
* @param status 评论状态
|
* @param status 评论状态
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
List<Comment> findAllComments(Integer status);
|
List<Comment> findAll(Integer status);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有评论,不分页
|
* 查询所有评论,不分页
|
||||||
*
|
*
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
List<Comment> findAllComments();
|
List<Comment> findAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更改评论的状态
|
* 更改评论的状态
|
||||||
|
@ -125,4 +125,11 @@ public interface CommentService {
|
||||||
* @return 评论数量
|
* @return 评论数量
|
||||||
*/
|
*/
|
||||||
Integer getCountByStatus(Integer status);
|
Integer getCountByStatus(Integer status);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询评论总数
|
||||||
|
*
|
||||||
|
* @return Long
|
||||||
|
*/
|
||||||
|
Long getCount();
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ public interface GalleryService {
|
||||||
* @param gallery gallery
|
* @param gallery gallery
|
||||||
* @return Gallery
|
* @return Gallery
|
||||||
*/
|
*/
|
||||||
Gallery saveByGallery(Gallery gallery);
|
Gallery save(Gallery gallery);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据编号删除图片
|
* 根据编号删除图片
|
||||||
|
@ -31,15 +31,7 @@ public interface GalleryService {
|
||||||
* @param galleryId galleryId
|
* @param galleryId galleryId
|
||||||
* @return Gallery
|
* @return Gallery
|
||||||
*/
|
*/
|
||||||
Gallery removeByGalleryId(Long galleryId);
|
Gallery remove(Long galleryId);
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改图片信息
|
|
||||||
*
|
|
||||||
* @param gallery gallery
|
|
||||||
* @return Gallery
|
|
||||||
*/
|
|
||||||
Gallery updateByGallery(Gallery gallery);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有图片 分页
|
* 查询所有图片 分页
|
||||||
|
@ -47,14 +39,14 @@ public interface GalleryService {
|
||||||
* @param pageable pageable
|
* @param pageable pageable
|
||||||
* @return Page
|
* @return Page
|
||||||
*/
|
*/
|
||||||
Page<Gallery> findAllGalleries(Pageable pageable);
|
Page<Gallery> findAll(Pageable pageable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有图片 不分页
|
* 查询所有图片 不分页
|
||||||
*
|
*
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
List<Gallery> findAllGalleries();
|
List<Gallery> findAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据编号查询图片信息
|
* 根据编号查询图片信息
|
||||||
|
|
|
@ -21,7 +21,7 @@ public interface LinkService {
|
||||||
* @param link link
|
* @param link link
|
||||||
* @return Link
|
* @return Link
|
||||||
*/
|
*/
|
||||||
Link saveByLink(Link link);
|
Link save(Link link);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据编号删除
|
* 根据编号删除
|
||||||
|
@ -29,14 +29,14 @@ public interface LinkService {
|
||||||
* @param linkId linkId
|
* @param linkId linkId
|
||||||
* @return Link
|
* @return Link
|
||||||
*/
|
*/
|
||||||
Link removeByLinkId(Long linkId);
|
Link remove(Long linkId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有
|
* 查询所有
|
||||||
*
|
*
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
List<Link> findAllLinks();
|
List<Link> findAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据编号查询单个链接
|
* 根据编号查询单个链接
|
||||||
|
|
|
@ -6,7 +6,6 @@ import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -30,7 +29,7 @@ public interface LogsService {
|
||||||
/**
|
/**
|
||||||
* 移除所有日志
|
* 移除所有日志
|
||||||
*/
|
*/
|
||||||
void removeAllLogs();
|
void removeAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有日志并分页
|
* 查询所有日志并分页
|
||||||
|
@ -38,7 +37,7 @@ public interface LogsService {
|
||||||
* @param pageable pageable
|
* @param pageable pageable
|
||||||
* @return Page
|
* @return Page
|
||||||
*/
|
*/
|
||||||
Page<Logs> findAllLogs(Pageable pageable);
|
Page<Logs> findAll(Pageable pageable);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询最新的五条日志
|
* 查询最新的五条日志
|
||||||
|
@ -46,12 +45,4 @@ public interface LogsService {
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
List<Logs> findLogsLatest();
|
List<Logs> findLogsLatest();
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据编号查询
|
|
||||||
*
|
|
||||||
* @param logsId logsId
|
|
||||||
* @return Optional
|
|
||||||
*/
|
|
||||||
Optional<Logs> findLogsByLogsId(Long logsId);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,14 +21,14 @@ public interface MenuService {
|
||||||
* @param menu menu
|
* @param menu menu
|
||||||
* @return Menu
|
* @return Menu
|
||||||
*/
|
*/
|
||||||
Menu saveByMenu(Menu menu);
|
Menu save(Menu menu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有菜单
|
* 查询所有菜单
|
||||||
*
|
*
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
List<Menu> findAllMenus();
|
List<Menu> findAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除菜单
|
* 删除菜单
|
||||||
|
@ -36,7 +36,7 @@ public interface MenuService {
|
||||||
* @param menuId menuId
|
* @param menuId menuId
|
||||||
* @return Menu
|
* @return Menu
|
||||||
*/
|
*/
|
||||||
Menu removeByMenuId(Long menuId);
|
Menu remove(Long menuId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据编号查询菜单
|
* 根据编号查询菜单
|
||||||
|
|
|
@ -28,7 +28,7 @@ public interface PostService {
|
||||||
* @param post Post
|
* @param post Post
|
||||||
* @return Post
|
* @return Post
|
||||||
*/
|
*/
|
||||||
Post saveByPost(Post post);
|
Post save(Post post);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据编号删除文章
|
* 根据编号删除文章
|
||||||
|
@ -36,7 +36,7 @@ public interface PostService {
|
||||||
* @param postId postId
|
* @param postId postId
|
||||||
* @return Post
|
* @return Post
|
||||||
*/
|
*/
|
||||||
Post removeByPostId(Long postId);
|
Post remove(Long postId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改文章状态
|
* 修改文章状态
|
||||||
|
@ -47,13 +47,6 @@ public interface PostService {
|
||||||
*/
|
*/
|
||||||
Post updatePostStatus(Long postId, Integer status);
|
Post updatePostStatus(Long postId, Integer status);
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改文章阅读量
|
|
||||||
*
|
|
||||||
* @param post post
|
|
||||||
*/
|
|
||||||
void updatePostView(Post post);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量修改摘要
|
* 批量修改摘要
|
||||||
*
|
*
|
||||||
|
@ -61,22 +54,13 @@ public interface PostService {
|
||||||
*/
|
*/
|
||||||
void updateAllSummary(Integer postSummary);
|
void updateAllSummary(Integer postSummary);
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取文章列表 分页
|
|
||||||
*
|
|
||||||
* @param postType post or page
|
|
||||||
* @param pageable 分页信息
|
|
||||||
* @return Page
|
|
||||||
*/
|
|
||||||
Page<Post> findAllPosts(String postType, Pageable pageable);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取文章列表 不分页
|
* 获取文章列表 不分页
|
||||||
*
|
*
|
||||||
* @param postType post or page
|
* @param postType post or page
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
List<Post> findAllPosts(String postType);
|
List<Post> findAll(String postType);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 模糊查询文章
|
* 模糊查询文章
|
||||||
|
|
|
@ -21,7 +21,7 @@ public interface TagService {
|
||||||
* @param tag tag
|
* @param tag tag
|
||||||
* @return Tag
|
* @return Tag
|
||||||
*/
|
*/
|
||||||
Tag saveByTag(Tag tag);
|
Tag save(Tag tag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据编号移除标签
|
* 根据编号移除标签
|
||||||
|
@ -29,14 +29,14 @@ public interface TagService {
|
||||||
* @param tagId tagId
|
* @param tagId tagId
|
||||||
* @return Tag
|
* @return Tag
|
||||||
*/
|
*/
|
||||||
Tag removeByTagId(Long tagId);
|
Tag remove(Long tagId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取所有标签
|
* 获取所有标签
|
||||||
*
|
*
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
List<Tag> findAllTags();
|
List<Tag> findAll();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据编号查询标签
|
* 根据编号查询标签
|
||||||
|
|
|
@ -19,7 +19,7 @@ public interface UserService {
|
||||||
*
|
*
|
||||||
* @param user user
|
* @param user user
|
||||||
*/
|
*/
|
||||||
void saveByUser(User user);
|
void save(User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据用户名和密码查询,用于登录
|
* 根据用户名和密码查询,用于登录
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class AttachmentServiceImpl implements AttachmentService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = ATTACHMENTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = ATTACHMENTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public Attachment saveByAttachment(Attachment attachment) {
|
public Attachment save(Attachment attachment) {
|
||||||
return attachmentRepository.save(attachment);
|
return attachmentRepository.save(attachment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ public class AttachmentServiceImpl implements AttachmentService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = ATTACHMENTS_CACHE_NAME, key = "'attachment'")
|
@Cacheable(value = ATTACHMENTS_CACHE_NAME, key = "'attachment'")
|
||||||
public List<Attachment> findAllAttachments() {
|
public List<Attachment> findAll() {
|
||||||
return attachmentRepository.findAll();
|
return attachmentRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ public class AttachmentServiceImpl implements AttachmentService {
|
||||||
* @return Page
|
* @return Page
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Page<Attachment> findAllAttachments(Pageable pageable) {
|
public Page<Attachment> findAll(Pageable pageable) {
|
||||||
return attachmentRepository.findAll(pageable);
|
return attachmentRepository.findAll(pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ public class AttachmentServiceImpl implements AttachmentService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = ATTACHMENTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = ATTACHMENTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public Attachment removeByAttachId(Long attachId) {
|
public Attachment remove(Long attachId) {
|
||||||
Optional<Attachment> attachment = this.findByAttachId(attachId);
|
Optional<Attachment> attachment = this.findByAttachId(attachId);
|
||||||
attachmentRepository.delete(attachment.get());
|
attachmentRepository.delete(attachment.get());
|
||||||
return attachment.get();
|
return attachment.get();
|
||||||
|
@ -404,4 +404,14 @@ public class AttachmentServiceImpl implements AttachmentService {
|
||||||
}
|
}
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取附件总数
|
||||||
|
*
|
||||||
|
* @return Long
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Long getCount() {
|
||||||
|
return attachmentRepository.count();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class CategoryServiceImpl implements CategoryService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = POSTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = POSTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public Category saveByCategory(Category category) {
|
public Category save(Category category) {
|
||||||
return categoryRepository.save(category);
|
return categoryRepository.save(category);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public class CategoryServiceImpl implements CategoryService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = POSTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = POSTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public Category removeByCateId(Long cateId) {
|
public Category remove(Long cateId) {
|
||||||
Optional<Category> category = this.findByCateId(cateId);
|
Optional<Category> category = this.findByCateId(cateId);
|
||||||
categoryRepository.delete(category.get());
|
categoryRepository.delete(category.get());
|
||||||
return category.get();
|
return category.get();
|
||||||
|
@ -59,7 +59,7 @@ public class CategoryServiceImpl implements CategoryService {
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Category> findAllCategories() {
|
public List<Category> findAll() {
|
||||||
return categoryRepository.findAll();
|
return categoryRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ public class CommentServiceImpl implements CommentService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = {COMMENTS_CACHE_NAME, POSTS_CACHE_NAME}, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = {COMMENTS_CACHE_NAME, POSTS_CACHE_NAME}, allEntries = true, beforeInvocation = true)
|
||||||
public void saveByComment(Comment comment) {
|
public void save(Comment comment) {
|
||||||
commentRepository.save(comment);
|
commentRepository.save(comment);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ public class CommentServiceImpl implements CommentService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = {COMMENTS_CACHE_NAME, POSTS_CACHE_NAME}, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = {COMMENTS_CACHE_NAME, POSTS_CACHE_NAME}, allEntries = true, beforeInvocation = true)
|
||||||
public Optional<Comment> removeByCommentId(Long commentId) {
|
public Optional<Comment> remove(Long commentId) {
|
||||||
Optional<Comment> comment = this.findCommentById(commentId);
|
Optional<Comment> comment = this.findCommentById(commentId);
|
||||||
commentRepository.delete(comment.get());
|
commentRepository.delete(comment.get());
|
||||||
return comment;
|
return comment;
|
||||||
|
@ -65,7 +65,7 @@ public class CommentServiceImpl implements CommentService {
|
||||||
* @return Page
|
* @return Page
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Page<Comment> findAllComments(Integer status, Pageable pageable) {
|
public Page<Comment> findAll(Integer status, Pageable pageable) {
|
||||||
return commentRepository.findCommentsByCommentStatus(status, pageable);
|
return commentRepository.findCommentsByCommentStatus(status, pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ public class CommentServiceImpl implements CommentService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CachePut(value = COMMENTS_CACHE_NAME, key = "'comments_status_'+#status")
|
@CachePut(value = COMMENTS_CACHE_NAME, key = "'comments_status_'+#status")
|
||||||
public List<Comment> findAllComments(Integer status) {
|
public List<Comment> findAll(Integer status) {
|
||||||
return commentRepository.findCommentsByCommentStatus(status);
|
return commentRepository.findCommentsByCommentStatus(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ public class CommentServiceImpl implements CommentService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = COMMENTS_CACHE_NAME, key = "'comment'")
|
@Cacheable(value = COMMENTS_CACHE_NAME, key = "'comment'")
|
||||||
public List<Comment> findAllComments() {
|
public List<Comment> findAll() {
|
||||||
return commentRepository.findAll();
|
return commentRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,4 +188,14 @@ public class CommentServiceImpl implements CommentService {
|
||||||
public Integer getCountByStatus(Integer status) {
|
public Integer getCountByStatus(Integer status) {
|
||||||
return commentRepository.countAllByCommentStatus(status);
|
return commentRepository.countAllByCommentStatus(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询评论总数
|
||||||
|
*
|
||||||
|
* @return Long
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Long getCount() {
|
||||||
|
return commentRepository.count();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class GalleryServiceImpl implements GalleryService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = GALLERIES_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = GALLERIES_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public Gallery saveByGallery(Gallery gallery) {
|
public Gallery save(Gallery gallery) {
|
||||||
return galleryRepository.save(gallery);
|
return galleryRepository.save(gallery);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,24 +49,12 @@ public class GalleryServiceImpl implements GalleryService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = GALLERIES_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = GALLERIES_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public Gallery removeByGalleryId(Long galleryId) {
|
public Gallery remove(Long galleryId) {
|
||||||
Optional<Gallery> gallery = this.findByGalleryId(galleryId);
|
Optional<Gallery> gallery = this.findByGalleryId(galleryId);
|
||||||
galleryRepository.delete(gallery.get());
|
galleryRepository.delete(gallery.get());
|
||||||
return gallery.get();
|
return gallery.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改图片信息
|
|
||||||
*
|
|
||||||
* @param gallery gallery
|
|
||||||
* @return Gallery
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
@CacheEvict(value = GALLERIES_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
|
||||||
public Gallery updateByGallery(Gallery gallery) {
|
|
||||||
return galleryRepository.save(gallery);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询所有图片 分页
|
* 查询所有图片 分页
|
||||||
*
|
*
|
||||||
|
@ -74,7 +62,7 @@ public class GalleryServiceImpl implements GalleryService {
|
||||||
* @return Page
|
* @return Page
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Page<Gallery> findAllGalleries(Pageable pageable) {
|
public Page<Gallery> findAll(Pageable pageable) {
|
||||||
return galleryRepository.findAll(pageable);
|
return galleryRepository.findAll(pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +73,7 @@ public class GalleryServiceImpl implements GalleryService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = GALLERIES_CACHE_NAME, key = "'gallery'")
|
@Cacheable(value = GALLERIES_CACHE_NAME, key = "'gallery'")
|
||||||
public List<Gallery> findAllGalleries() {
|
public List<Gallery> findAll() {
|
||||||
return galleryRepository.findAll();
|
return galleryRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class LinkServiceImpl implements LinkService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = LINKS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = LINKS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public Link saveByLink(Link link) {
|
public Link save(Link link) {
|
||||||
return linkRepository.save(link);
|
return linkRepository.save(link);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public class LinkServiceImpl implements LinkService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = LINKS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = LINKS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public Link removeByLinkId(Long linkId) {
|
public Link remove(Long linkId) {
|
||||||
Optional<Link> link = this.findByLinkId(linkId);
|
Optional<Link> link = this.findByLinkId(linkId);
|
||||||
linkRepository.delete(link.get());
|
linkRepository.delete(link.get());
|
||||||
return link.get();
|
return link.get();
|
||||||
|
@ -62,7 +62,7 @@ public class LinkServiceImpl implements LinkService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = LINKS_CACHE_NAME, key = LINKS_CACHE_KEY)
|
@Cacheable(value = LINKS_CACHE_NAME, key = LINKS_CACHE_KEY)
|
||||||
public List<Link> findAllLinks() {
|
public List<Link> findAll() {
|
||||||
return linkRepository.findAll();
|
return linkRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ import org.springframework.stereotype.Service;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -49,7 +48,7 @@ public class LogsServiceImpl implements LogsService {
|
||||||
* 移除所有日志
|
* 移除所有日志
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void removeAllLogs() {
|
public void removeAll() {
|
||||||
logsRepository.deleteAll();
|
logsRepository.deleteAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +59,7 @@ public class LogsServiceImpl implements LogsService {
|
||||||
* @return Page
|
* @return Page
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Page<Logs> findAllLogs(Pageable pageable) {
|
public Page<Logs> findAll(Pageable pageable) {
|
||||||
return logsRepository.findAll(pageable);
|
return logsRepository.findAll(pageable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,15 +72,4 @@ public class LogsServiceImpl implements LogsService {
|
||||||
public List<Logs> findLogsLatest() {
|
public List<Logs> findLogsLatest() {
|
||||||
return logsRepository.findTopFive();
|
return logsRepository.findTopFive();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据编号查询
|
|
||||||
*
|
|
||||||
* @param logsId logsId
|
|
||||||
* @return Optional
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Optional<Logs> findLogsByLogsId(Long logsId) {
|
|
||||||
return logsRepository.findById(logsId);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class MenuServiceImpl implements MenuService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = MENUS_CACHE_NAME, key = MENUS_CACHE_KEY)
|
@Cacheable(value = MENUS_CACHE_NAME, key = MENUS_CACHE_KEY)
|
||||||
public List<Menu> findAllMenus() {
|
public List<Menu> findAll() {
|
||||||
return menuRepository.findAll();
|
return menuRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ public class MenuServiceImpl implements MenuService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = MENUS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = MENUS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public Menu saveByMenu(Menu menu) {
|
public Menu save(Menu menu) {
|
||||||
return menuRepository.save(menu);
|
return menuRepository.save(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ public class MenuServiceImpl implements MenuService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = MENUS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = MENUS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public Menu removeByMenuId(Long menuId) {
|
public Menu remove(Long menuId) {
|
||||||
Optional<Menu> menu = this.findByMenuId(menuId);
|
Optional<Menu> menu = this.findByMenuId(menuId);
|
||||||
menuRepository.delete(menu.get());
|
menuRepository.delete(menu.get());
|
||||||
return menu.get();
|
return menu.get();
|
||||||
|
|
|
@ -59,7 +59,7 @@ public class PostServiceImpl implements PostService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = {POSTS_CACHE_NAME, COMMENTS_CACHE_NAME}, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = {POSTS_CACHE_NAME, COMMENTS_CACHE_NAME}, allEntries = true, beforeInvocation = true)
|
||||||
public Post saveByPost(Post post) {
|
public Post save(Post post) {
|
||||||
return postRepository.save(post);
|
return postRepository.save(post);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class PostServiceImpl implements PostService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = {POSTS_CACHE_NAME, COMMENTS_CACHE_NAME}, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = {POSTS_CACHE_NAME, COMMENTS_CACHE_NAME}, allEntries = true, beforeInvocation = true)
|
||||||
public Post removeByPostId(Long postId) {
|
public Post remove(Long postId) {
|
||||||
Optional<Post> post = this.findByPostId(postId);
|
Optional<Post> post = this.findByPostId(postId);
|
||||||
postRepository.delete(post.get());
|
postRepository.delete(post.get());
|
||||||
return post.get();
|
return post.get();
|
||||||
|
@ -92,17 +92,6 @@ public class PostServiceImpl implements PostService {
|
||||||
return postRepository.save(post.get());
|
return postRepository.save(post.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改文章阅读量
|
|
||||||
*
|
|
||||||
* @param post post
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public void updatePostView(Post post) {
|
|
||||||
post.setPostViews(post.getPostViews() + 1);
|
|
||||||
postRepository.save(post);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量更新文章摘要
|
* 批量更新文章摘要
|
||||||
*
|
*
|
||||||
|
@ -111,7 +100,7 @@ public class PostServiceImpl implements PostService {
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = POSTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = POSTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public void updateAllSummary(Integer postSummary) {
|
public void updateAllSummary(Integer postSummary) {
|
||||||
List<Post> posts = this.findAllPosts(PostTypeEnum.POST_TYPE_POST.getDesc());
|
List<Post> posts = this.findAll(PostTypeEnum.POST_TYPE_POST.getDesc());
|
||||||
for (Post post : posts) {
|
for (Post post : posts) {
|
||||||
String text = StrUtil.cleanBlank(HtmlUtil.cleanHtmlTag(post.getPostContent()));
|
String text = StrUtil.cleanBlank(HtmlUtil.cleanHtmlTag(post.getPostContent()));
|
||||||
if (text.length() > postSummary) {
|
if (text.length() > postSummary) {
|
||||||
|
@ -123,18 +112,6 @@ public class PostServiceImpl implements PostService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取文章列表 分页
|
|
||||||
*
|
|
||||||
* @param postType post or page
|
|
||||||
* @param pageable 分页信息
|
|
||||||
* @return Page
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public Page<Post> findAllPosts(String postType, Pageable pageable) {
|
|
||||||
return postRepository.findPostsByPostType(postType, pageable);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取文章列表 不分页
|
* 获取文章列表 不分页
|
||||||
*
|
*
|
||||||
|
@ -143,7 +120,7 @@ public class PostServiceImpl implements PostService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(value = POSTS_CACHE_NAME, key = "'posts_type_'+#postType")
|
@Cacheable(value = POSTS_CACHE_NAME, key = "'posts_type_'+#postType")
|
||||||
public List<Post> findAllPosts(String postType) {
|
public List<Post> findAll(String postType) {
|
||||||
return postRepository.findPostsByPostType(postType);
|
return postRepository.findPostsByPostType(postType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class TagServiceImpl implements TagService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = POSTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = POSTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public Tag saveByTag(Tag tag) {
|
public Tag save(Tag tag) {
|
||||||
return tagRepository.save(tag);
|
return tagRepository.save(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,7 +47,7 @@ public class TagServiceImpl implements TagService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@CacheEvict(value = POSTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
@CacheEvict(value = POSTS_CACHE_NAME, allEntries = true, beforeInvocation = true)
|
||||||
public Tag removeByTagId(Long tagId) {
|
public Tag remove(Long tagId) {
|
||||||
Optional<Tag> tag = findByTagId(tagId);
|
Optional<Tag> tag = findByTagId(tagId);
|
||||||
tagRepository.delete(tag.get());
|
tagRepository.delete(tag.get());
|
||||||
return tag.get();
|
return tag.get();
|
||||||
|
@ -59,7 +59,7 @@ public class TagServiceImpl implements TagService {
|
||||||
* @return List
|
* @return List
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<Tag> findAllTags() {
|
public List<Tag> findAll() {
|
||||||
return tagRepository.findAll();
|
return tagRepository.findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ public class TagServiceImpl implements TagService {
|
||||||
nt = new Tag();
|
nt = new Tag();
|
||||||
nt.setTagName(tag);
|
nt.setTagName(tag);
|
||||||
nt.setTagUrl(tag);
|
nt.setTagUrl(tag);
|
||||||
tagsList.add(saveByTag(nt));
|
tagsList.add(save(nt));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return tagsList;
|
return tagsList;
|
||||||
|
|
|
@ -30,7 +30,7 @@ public class UserServiceImpl implements UserService {
|
||||||
* @param user user
|
* @param user user
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void saveByUser(User user) {
|
public void save(User user) {
|
||||||
userRepository.save(user);
|
userRepository.save(user);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ public class PostSyncTask {
|
||||||
post = postService.findByPostId(key).orElse(null);
|
post = postService.findByPostId(key).orElse(null);
|
||||||
if (null != post) {
|
if (null != post) {
|
||||||
post.setPostViews(post.getPostViews() + HaloConst.POSTS_VIEWS.get(key));
|
post.setPostViews(post.getPostViews() + HaloConst.POSTS_VIEWS.get(key));
|
||||||
postService.saveByPost(post);
|
postService.save(post);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,10 +7,7 @@ import cc.ryanc.halo.model.domain.User;
|
||||||
import cc.ryanc.halo.model.dto.HaloConst;
|
import cc.ryanc.halo.model.dto.HaloConst;
|
||||||
import cc.ryanc.halo.model.dto.JsonResult;
|
import cc.ryanc.halo.model.dto.JsonResult;
|
||||||
import cc.ryanc.halo.model.dto.LogsRecord;
|
import cc.ryanc.halo.model.dto.LogsRecord;
|
||||||
import cc.ryanc.halo.model.enums.CommonParamsEnum;
|
import cc.ryanc.halo.model.enums.*;
|
||||||
import cc.ryanc.halo.model.enums.ResponseStatusEnum;
|
|
||||||
import cc.ryanc.halo.model.enums.ResultCodeEnum;
|
|
||||||
import cc.ryanc.halo.model.enums.TrueFalseEnum;
|
|
||||||
import cc.ryanc.halo.service.*;
|
import cc.ryanc.halo.service.*;
|
||||||
import cc.ryanc.halo.utils.LocaleMessageUtil;
|
import cc.ryanc.halo.utils.LocaleMessageUtil;
|
||||||
import cc.ryanc.halo.web.controller.core.BaseController;
|
import cc.ryanc.halo.web.controller.core.BaseController;
|
||||||
|
@ -82,7 +79,7 @@ public class AdminController extends BaseController {
|
||||||
public String index(Model model) {
|
public String index(Model model) {
|
||||||
|
|
||||||
//查询评论的条数
|
//查询评论的条数
|
||||||
Integer commentCount = commentService.findAllComments().size();
|
Long commentCount = commentService.getCount();
|
||||||
model.addAttribute("commentCount", commentCount);
|
model.addAttribute("commentCount", commentCount);
|
||||||
|
|
||||||
//查询最新的文章
|
//查询最新的文章
|
||||||
|
@ -98,11 +95,16 @@ public class AdminController extends BaseController {
|
||||||
model.addAttribute("comments", comments);
|
model.addAttribute("comments", comments);
|
||||||
|
|
||||||
//附件数量
|
//附件数量
|
||||||
model.addAttribute("mediaCount", attachmentService.findAllAttachments().size());
|
model.addAttribute("mediaCount", attachmentService.getCount());
|
||||||
|
|
||||||
//文章阅读总数
|
//文章阅读总数
|
||||||
Long postViewsSum = postService.getPostViews();
|
Long postViewsSum = postService.getPostViews();
|
||||||
model.addAttribute("postViewsSum", postViewsSum);
|
model.addAttribute("postViewsSum", postViewsSum);
|
||||||
|
|
||||||
|
//成立天数
|
||||||
|
Date blogStart = DateUtil.parse(HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_START.getProp()));
|
||||||
|
long hadDays = DateUtil.between(blogStart, DateUtil.date(), DateUnit.DAY);
|
||||||
|
model.addAttribute("hadDays",hadDays);
|
||||||
return "admin/admin_index";
|
return "admin/admin_index";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +206,7 @@ public class AdminController extends BaseController {
|
||||||
@RequestParam(value = "size", defaultValue = "10") Integer size) {
|
@RequestParam(value = "size", defaultValue = "10") Integer size) {
|
||||||
Sort sort = new Sort(Sort.Direction.DESC, "logId");
|
Sort sort = new Sort(Sort.Direction.DESC, "logId");
|
||||||
Pageable pageable = PageRequest.of(page, size, sort);
|
Pageable pageable = PageRequest.of(page, size, sort);
|
||||||
Page<Logs> logs = logsService.findAllLogs(pageable);
|
Page<Logs> logs = logsService.findAll(pageable);
|
||||||
model.addAttribute("logs", logs);
|
model.addAttribute("logs", logs);
|
||||||
return "admin/widget/_logs-all";
|
return "admin/widget/_logs-all";
|
||||||
}
|
}
|
||||||
|
@ -217,7 +219,7 @@ public class AdminController extends BaseController {
|
||||||
@GetMapping(value = "/logs/clear")
|
@GetMapping(value = "/logs/clear")
|
||||||
public String logsClear() {
|
public String logsClear() {
|
||||||
try {
|
try {
|
||||||
logsService.removeAllLogs();
|
logsService.removeAll();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Clear log failed:{}" + e.getMessage());
|
log.error("Clear log failed:{}" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class AttachmentController {
|
||||||
@RequestParam(value = "size", defaultValue = "18") Integer size) {
|
@RequestParam(value = "size", defaultValue = "18") Integer size) {
|
||||||
Sort sort = new Sort(Sort.Direction.DESC, "attachId");
|
Sort sort = new Sort(Sort.Direction.DESC, "attachId");
|
||||||
Pageable pageable = PageRequest.of(page, size, sort);
|
Pageable pageable = PageRequest.of(page, size, sort);
|
||||||
Page<Attachment> attachments = attachmentService.findAllAttachments(pageable);
|
Page<Attachment> attachments = attachmentService.findAll(pageable);
|
||||||
model.addAttribute("attachments", attachments);
|
model.addAttribute("attachments", attachments);
|
||||||
return "admin/admin_attachment";
|
return "admin/admin_attachment";
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ public class AttachmentController {
|
||||||
@RequestParam(value = "type", defaultValue = "normal") String type) {
|
@RequestParam(value = "type", defaultValue = "normal") String type) {
|
||||||
Sort sort = new Sort(Sort.Direction.DESC, "attachId");
|
Sort sort = new Sort(Sort.Direction.DESC, "attachId");
|
||||||
Pageable pageable = PageRequest.of(page, 18, sort);
|
Pageable pageable = PageRequest.of(page, 18, sort);
|
||||||
Page<Attachment> attachments = attachmentService.findAllAttachments(pageable);
|
Page<Attachment> attachments = attachmentService.findAll(pageable);
|
||||||
model.addAttribute("attachments", attachments);
|
model.addAttribute("attachments", attachments);
|
||||||
model.addAttribute("id", id);
|
model.addAttribute("id", id);
|
||||||
if (StrUtil.equals(type, PostTypeEnum.POST_TYPE_POST.getDesc())) {
|
if (StrUtil.equals(type, PostTypeEnum.POST_TYPE_POST.getDesc())) {
|
||||||
|
@ -134,7 +134,7 @@ public class AttachmentController {
|
||||||
attachment.setAttachSize(resultMap.get("size"));
|
attachment.setAttachSize(resultMap.get("size"));
|
||||||
attachment.setAttachWh(resultMap.get("wh"));
|
attachment.setAttachWh(resultMap.get("wh"));
|
||||||
attachment.setAttachLocation(resultMap.get("location"));
|
attachment.setAttachLocation(resultMap.get("location"));
|
||||||
attachmentService.saveByAttachment(attachment);
|
attachmentService.save(attachment);
|
||||||
log.info("Upload file {} to {} successfully", resultMap.get("fileName"), resultMap.get("filePath"));
|
log.info("Upload file {} to {} successfully", resultMap.get("fileName"), resultMap.get("filePath"));
|
||||||
result.put("success", ResultCodeEnum.SUCCESS.getCode());
|
result.put("success", ResultCodeEnum.SUCCESS.getCode());
|
||||||
result.put("message", localeMessageUtil.getMessage("code.admin.attachment.upload-success"));
|
result.put("message", localeMessageUtil.getMessage("code.admin.attachment.upload-success"));
|
||||||
|
@ -183,7 +183,7 @@ public class AttachmentController {
|
||||||
boolean flag = true;
|
boolean flag = true;
|
||||||
try {
|
try {
|
||||||
//删除数据库中的内容
|
//删除数据库中的内容
|
||||||
attachmentService.removeByAttachId(attachId);
|
attachmentService.remove(attachId);
|
||||||
if (attachLocation != null) {
|
if (attachLocation != null) {
|
||||||
if (attachLocation.equals(SERVER.getDesc())) {
|
if (attachLocation.equals(SERVER.getDesc())) {
|
||||||
String delSmallFileName = delFileName.substring(0, delFileName.lastIndexOf('.')) + "_small" + attachment.get().getAttachSuffix();
|
String delSmallFileName = delFileName.substring(0, delFileName.lastIndexOf('.')) + "_small" + attachment.get().getAttachSuffix();
|
||||||
|
|
|
@ -147,8 +147,8 @@ public class BackupController {
|
||||||
* @return JsonResult
|
* @return JsonResult
|
||||||
*/
|
*/
|
||||||
public JsonResult backupPosts() {
|
public JsonResult backupPosts() {
|
||||||
List<Post> posts = postService.findAllPosts(PostTypeEnum.POST_TYPE_POST.getDesc());
|
List<Post> posts = postService.findAll(PostTypeEnum.POST_TYPE_POST.getDesc());
|
||||||
posts.addAll(postService.findAllPosts(PostTypeEnum.POST_TYPE_PAGE.getDesc()));
|
posts.addAll(postService.findAll(PostTypeEnum.POST_TYPE_PAGE.getDesc()));
|
||||||
try {
|
try {
|
||||||
if (HaloUtils.getBackUps(BackupTypeEnum.POSTS.getDesc()).size() > CommonParamsEnum.TEN.getValue()) {
|
if (HaloUtils.getBackUps(BackupTypeEnum.POSTS.getDesc()).size() > CommonParamsEnum.TEN.getValue()) {
|
||||||
FileUtil.del(System.getProperties().getProperty("user.home") + "/halo/backup/posts/");
|
FileUtil.del(System.getProperties().getProperty("user.home") + "/halo/backup/posts/");
|
||||||
|
|
|
@ -50,9 +50,8 @@ public class CategoryController {
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/save")
|
@PostMapping(value = "/save")
|
||||||
public String saveCategory(@ModelAttribute Category category) {
|
public String saveCategory(@ModelAttribute Category category) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
categoryService.saveByCategory(category);
|
categoryService.save(category);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Modify category failed: {}", e.getMessage());
|
log.error("Modify category failed: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -84,7 +83,7 @@ public class CategoryController {
|
||||||
@GetMapping(value = "/remove")
|
@GetMapping(value = "/remove")
|
||||||
public String removeCategory(@RequestParam("cateId") Long cateId) {
|
public String removeCategory(@RequestParam("cateId") Long cateId) {
|
||||||
try {
|
try {
|
||||||
categoryService.removeByCateId(cateId);
|
categoryService.remove(cateId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Delete category failed: {}", e.getMessage());
|
log.error("Delete category failed: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import cc.ryanc.halo.utils.OwoUtil;
|
||||||
import cc.ryanc.halo.web.controller.core.BaseController;
|
import cc.ryanc.halo.web.controller.core.BaseController;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.lang.Validator;
|
import cn.hutool.core.lang.Validator;
|
||||||
|
import cn.hutool.core.text.StrBuilder;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.crypto.SecureUtil;
|
import cn.hutool.crypto.SecureUtil;
|
||||||
import cn.hutool.extra.servlet.ServletUtil;
|
import cn.hutool.extra.servlet.ServletUtil;
|
||||||
|
@ -70,7 +71,7 @@ public class CommentController extends BaseController {
|
||||||
@RequestParam(value = "size", defaultValue = "10") Integer size) {
|
@RequestParam(value = "size", defaultValue = "10") Integer size) {
|
||||||
Sort sort = new Sort(Sort.Direction.DESC, "commentDate");
|
Sort sort = new Sort(Sort.Direction.DESC, "commentDate");
|
||||||
Pageable pageable = PageRequest.of(page, size, sort);
|
Pageable pageable = PageRequest.of(page, size, sort);
|
||||||
Page<Comment> comments = commentService.findAllComments(status, pageable);
|
Page<Comment> comments = commentService.findAll(status,pageable);
|
||||||
model.addAttribute("comments", comments);
|
model.addAttribute("comments", comments);
|
||||||
model.addAttribute("publicCount", commentService.getCountByStatus(CommentStatusEnum.PUBLISHED.getCode()));
|
model.addAttribute("publicCount", commentService.getCountByStatus(CommentStatusEnum.PUBLISHED.getCode()));
|
||||||
model.addAttribute("checkCount", commentService.getCountByStatus(CommentStatusEnum.CHECKING.getCode()));
|
model.addAttribute("checkCount", commentService.getCountByStatus(CommentStatusEnum.CHECKING.getCode()));
|
||||||
|
@ -132,7 +133,7 @@ public class CommentController extends BaseController {
|
||||||
@RequestParam("status") Integer status,
|
@RequestParam("status") Integer status,
|
||||||
@RequestParam(value = "page", defaultValue = "0") Integer page) {
|
@RequestParam(value = "page", defaultValue = "0") Integer page) {
|
||||||
try {
|
try {
|
||||||
commentService.removeByCommentId(commentId);
|
commentService.remove(commentId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Delete comment failed: {}", e.getMessage());
|
log.error("Delete comment failed: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -166,7 +167,7 @@ public class CommentController extends BaseController {
|
||||||
|
|
||||||
//修改被回复的评论的状态
|
//修改被回复的评论的状态
|
||||||
lastComment.setCommentStatus(CommentStatusEnum.PUBLISHED.getCode());
|
lastComment.setCommentStatus(CommentStatusEnum.PUBLISHED.getCode());
|
||||||
commentService.saveByComment(lastComment);
|
commentService.save(lastComment);
|
||||||
|
|
||||||
//保存评论
|
//保存评论
|
||||||
Comment comment = new Comment();
|
Comment comment = new Comment();
|
||||||
|
@ -177,13 +178,20 @@ public class CommentController extends BaseController {
|
||||||
comment.setCommentAuthorIp(ServletUtil.getClientIP(request));
|
comment.setCommentAuthorIp(ServletUtil.getClientIP(request));
|
||||||
comment.setCommentAuthorAvatarMd5(SecureUtil.md5(user.getUserEmail()));
|
comment.setCommentAuthorAvatarMd5(SecureUtil.md5(user.getUserEmail()));
|
||||||
comment.setCommentDate(DateUtil.date());
|
comment.setCommentDate(DateUtil.date());
|
||||||
String lastContent = "<a href='#comment-id-" + lastComment.getCommentId() + "'>@" + lastComment.getCommentAuthor() + "</a> ";
|
|
||||||
comment.setCommentContent(lastContent + OwoUtil.markToImg(HtmlUtil.escape(commentContent).replace("<br/>", "<br/>")));
|
StrBuilder buildContent = new StrBuilder("<a href='#comment-id-");
|
||||||
|
buildContent.append(lastComment.getCommentId());
|
||||||
|
buildContent.append("'>@");
|
||||||
|
buildContent.append(lastComment.getCommentAuthor());
|
||||||
|
buildContent.append("</a> ");
|
||||||
|
buildContent.append(OwoUtil.markToImg(HtmlUtil.escape(commentContent).replace("<br/>", "<br/>")));
|
||||||
|
|
||||||
|
comment.setCommentContent(buildContent.toString());
|
||||||
comment.setCommentAgent(userAgent);
|
comment.setCommentAgent(userAgent);
|
||||||
comment.setCommentParent(commentId);
|
comment.setCommentParent(commentId);
|
||||||
comment.setCommentStatus(CommentStatusEnum.PUBLISHED.getCode());
|
comment.setCommentStatus(CommentStatusEnum.PUBLISHED.getCode());
|
||||||
comment.setIsAdmin(1);
|
comment.setIsAdmin(1);
|
||||||
commentService.saveByComment(comment);
|
commentService.save(comment);
|
||||||
|
|
||||||
//邮件通知
|
//邮件通知
|
||||||
new EmailToAuthor(comment, lastComment, post, user, commentContent).start();
|
new EmailToAuthor(comment, lastComment, post, user, commentContent).start();
|
||||||
|
@ -221,11 +229,18 @@ public class CommentController extends BaseController {
|
||||||
map.put("blogTitle", HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_TITLE.getProp()));
|
map.put("blogTitle", HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_TITLE.getProp()));
|
||||||
map.put("commentAuthor", lastComment.getCommentAuthor());
|
map.put("commentAuthor", lastComment.getCommentAuthor());
|
||||||
map.put("pageName", lastComment.getPost().getPostTitle());
|
map.put("pageName", lastComment.getPost().getPostTitle());
|
||||||
|
|
||||||
|
StrBuilder pageUrl = new StrBuilder(HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp()));
|
||||||
if (StrUtil.equals(post.getPostType(), PostTypeEnum.POST_TYPE_POST.getDesc())) {
|
if (StrUtil.equals(post.getPostType(), PostTypeEnum.POST_TYPE_POST.getDesc())) {
|
||||||
map.put("pageUrl", HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp()) + "/archives/" + post.getPostUrl() + "#comment-id-" + comment.getCommentId());
|
pageUrl.append("/archives/");
|
||||||
} else {
|
} else {
|
||||||
map.put("pageUrl", HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp()) + "/p/" + post.getPostUrl() + "#comment-id-" + comment.getCommentId());
|
pageUrl.append("/p/");
|
||||||
}
|
}
|
||||||
|
pageUrl.append(post.getPostUrl());
|
||||||
|
pageUrl.append("#comment-id-");
|
||||||
|
pageUrl.append(comment.getCommentId());
|
||||||
|
|
||||||
|
map.put("pageUrl",pageUrl.toString());
|
||||||
map.put("commentContent", lastComment.getCommentContent());
|
map.put("commentContent", lastComment.getCommentContent());
|
||||||
map.put("replyAuthor", user.getUserDisplayName());
|
map.put("replyAuthor", user.getUserDisplayName());
|
||||||
map.put("replyContent", commentContent);
|
map.put("replyContent", commentContent);
|
||||||
|
@ -260,11 +275,18 @@ public class CommentController extends BaseController {
|
||||||
try {
|
try {
|
||||||
if (status == 1 && Validator.isEmail(comment.getCommentAuthorEmail())) {
|
if (status == 1 && Validator.isEmail(comment.getCommentAuthorEmail())) {
|
||||||
Map<String, Object> map = new HashMap<>(6);
|
Map<String, Object> map = new HashMap<>(6);
|
||||||
|
|
||||||
|
StrBuilder pageUrl = new StrBuilder(HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp()));
|
||||||
if (StrUtil.equals(post.getPostType(), PostTypeEnum.POST_TYPE_POST.getDesc())) {
|
if (StrUtil.equals(post.getPostType(), PostTypeEnum.POST_TYPE_POST.getDesc())) {
|
||||||
map.put("pageUrl", HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp()) + "/archives/" + post.getPostUrl() + "#comment-id-" + comment.getCommentId());
|
pageUrl.append("/archives/");
|
||||||
} else {
|
} else {
|
||||||
map.put("pageUrl", HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp()) + "/p/" + post.getPostUrl() + "#comment-id-" + comment.getCommentId());
|
pageUrl.append("/p/");
|
||||||
}
|
}
|
||||||
|
pageUrl.append(post.getPostUrl());
|
||||||
|
pageUrl.append("#comment-id-");
|
||||||
|
pageUrl.append(comment.getCommentId());
|
||||||
|
|
||||||
|
map.put("pageUrl",pageUrl.toString());
|
||||||
map.put("pageName", post.getPostTitle());
|
map.put("pageName", post.getPostTitle());
|
||||||
map.put("commentContent", comment.getCommentContent());
|
map.put("commentContent", comment.getCommentContent());
|
||||||
map.put("blogUrl", HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp()));
|
map.put("blogUrl", HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp()));
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class MenuController {
|
||||||
@PostMapping(value = "/save")
|
@PostMapping(value = "/save")
|
||||||
public String saveMenu(@ModelAttribute Menu menu) {
|
public String saveMenu(@ModelAttribute Menu menu) {
|
||||||
try {
|
try {
|
||||||
menuService.saveByMenu(menu);
|
menuService.save(menu);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Saving menu failed: {}" + e.getMessage());
|
log.error("Saving menu failed: {}" + e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ public class MenuController {
|
||||||
@GetMapping(value = "/remove")
|
@GetMapping(value = "/remove")
|
||||||
public String removeMenu(@RequestParam("menuId") Long menuId) {
|
public String removeMenu(@RequestParam("menuId") Long menuId) {
|
||||||
try {
|
try {
|
||||||
menuService.removeByMenuId(menuId);
|
menuService.remove(menuId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Deleting menu failed: {}", e.getMessage());
|
log.error("Deleting menu failed: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class PageController {
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public String pages(Model model) {
|
public String pages(Model model) {
|
||||||
List<Post> posts = postService.findAllPosts(PostTypeEnum.POST_TYPE_PAGE.getDesc());
|
List<Post> posts = postService.findAll(PostTypeEnum.POST_TYPE_PAGE.getDesc());
|
||||||
model.addAttribute("pages", posts);
|
model.addAttribute("pages", posts);
|
||||||
return "admin/admin_page";
|
return "admin/admin_page";
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ public class PageController {
|
||||||
@PostMapping(value = "/links/save")
|
@PostMapping(value = "/links/save")
|
||||||
public String saveLink(@ModelAttribute Link link) {
|
public String saveLink(@ModelAttribute Link link) {
|
||||||
try {
|
try {
|
||||||
linkService.saveByLink(link);
|
linkService.save(link);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Save/modify friendship link failed: {}", e.getMessage());
|
log.error("Save/modify friendship link failed: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -127,7 +127,7 @@ public class PageController {
|
||||||
@GetMapping(value = "/links/remove")
|
@GetMapping(value = "/links/remove")
|
||||||
public String removeLink(@RequestParam("linkId") Long linkId) {
|
public String removeLink(@RequestParam("linkId") Long linkId) {
|
||||||
try {
|
try {
|
||||||
linkService.removeByLinkId(linkId);
|
linkService.remove(linkId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Deleting a friendship link failed: {}", e.getMessage());
|
log.error("Deleting a friendship link failed: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,7 @@ public class PageController {
|
||||||
@RequestParam(value = "size", defaultValue = "18") Integer size) {
|
@RequestParam(value = "size", defaultValue = "18") Integer size) {
|
||||||
Sort sort = new Sort(Sort.Direction.DESC, "galleryId");
|
Sort sort = new Sort(Sort.Direction.DESC, "galleryId");
|
||||||
Pageable pageable = PageRequest.of(page, size, sort);
|
Pageable pageable = PageRequest.of(page, size, sort);
|
||||||
Page<Gallery> galleries = galleryService.findAllGalleries(pageable);
|
Page<Gallery> galleries = galleryService.findAll(pageable);
|
||||||
model.addAttribute("galleries", galleries);
|
model.addAttribute("galleries", galleries);
|
||||||
return "admin/admin_page_gallery";
|
return "admin/admin_page_gallery";
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ public class PageController {
|
||||||
if (StrUtil.isEmpty(gallery.getGalleryThumbnailUrl())) {
|
if (StrUtil.isEmpty(gallery.getGalleryThumbnailUrl())) {
|
||||||
gallery.setGalleryThumbnailUrl(gallery.getGalleryUrl());
|
gallery.setGalleryThumbnailUrl(gallery.getGalleryUrl());
|
||||||
}
|
}
|
||||||
galleryService.saveByGallery(gallery);
|
galleryService.save(gallery);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,7 @@ public class PageController {
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
public JsonResult removeGallery(@RequestParam("galleryId") Long galleryId) {
|
public JsonResult removeGallery(@RequestParam("galleryId") Long galleryId) {
|
||||||
try {
|
try {
|
||||||
galleryService.removeByGalleryId(galleryId);
|
galleryService.remove(galleryId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Failed to delete image: {}", e.getMessage());
|
log.error("Failed to delete image: {}", e.getMessage());
|
||||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.common.delete-failed"));
|
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.common.delete-failed"));
|
||||||
|
@ -248,7 +248,7 @@ public class PageController {
|
||||||
if (StrUtil.equals(post.getPostThumbnail(), BlogPropertiesEnum.DEFAULT_THUMBNAIL.getProp())) {
|
if (StrUtil.equals(post.getPostThumbnail(), BlogPropertiesEnum.DEFAULT_THUMBNAIL.getProp())) {
|
||||||
post.setPostThumbnail("/static/images/thumbnail/thumbnail-" + RandomUtil.randomInt(1, 10) + ".jpg");
|
post.setPostThumbnail("/static/images/thumbnail/thumbnail-" + RandomUtil.randomInt(1, 10) + ".jpg");
|
||||||
}
|
}
|
||||||
postService.saveByPost(post);
|
postService.save(post);
|
||||||
logsService.save(LogsRecord.PUSH_PAGE, post.getPostTitle(), request);
|
logsService.save(LogsRecord.PUSH_PAGE, post.getPostTitle(), request);
|
||||||
return new JsonResult(ResultCodeEnum.SUCCESS.getCode(), msg);
|
return new JsonResult(ResultCodeEnum.SUCCESS.getCode(), msg);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
|
@ -206,7 +206,7 @@ public class PostController extends BaseController {
|
||||||
if (StrUtil.equals(post.getPostThumbnail(), BlogPropertiesEnum.DEFAULT_THUMBNAIL.getProp())) {
|
if (StrUtil.equals(post.getPostThumbnail(), BlogPropertiesEnum.DEFAULT_THUMBNAIL.getProp())) {
|
||||||
post.setPostThumbnail("/static/images/thumbnail/thumbnail-" + RandomUtil.randomInt(1, 10) + ".jpg");
|
post.setPostThumbnail("/static/images/thumbnail/thumbnail-" + RandomUtil.randomInt(1, 10) + ".jpg");
|
||||||
}
|
}
|
||||||
postService.saveByPost(post);
|
postService.save(post);
|
||||||
logsService.save(LogsRecord.PUSH_POST, post.getPostTitle(), request);
|
logsService.save(LogsRecord.PUSH_POST, post.getPostTitle(), request);
|
||||||
return new JsonResult(ResultCodeEnum.SUCCESS.getCode(), localeMessageUtil.getMessage("code.admin.common.save-success"));
|
return new JsonResult(ResultCodeEnum.SUCCESS.getCode(), localeMessageUtil.getMessage("code.admin.common.save-success"));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -240,7 +240,7 @@ public class PostController extends BaseController {
|
||||||
post.setPostDate(new Date());
|
post.setPostDate(new Date());
|
||||||
}
|
}
|
||||||
post = postService.buildCategoriesAndTags(post, cateList, tagList);
|
post = postService.buildCategoriesAndTags(post, cateList, tagList);
|
||||||
post = postService.saveByPost(post);
|
post = postService.save(post);
|
||||||
if (null != post) {
|
if (null != post) {
|
||||||
return new JsonResult(ResultCodeEnum.SUCCESS.getCode(), localeMessageUtil.getMessage("code.admin.common.update-success"));
|
return new JsonResult(ResultCodeEnum.SUCCESS.getCode(), localeMessageUtil.getMessage("code.admin.common.update-success"));
|
||||||
} else {
|
} else {
|
||||||
|
@ -293,7 +293,7 @@ public class PostController extends BaseController {
|
||||||
public String removePost(@RequestParam("postId") Long postId, @RequestParam("postType") String postType) {
|
public String removePost(@RequestParam("postId") Long postId, @RequestParam("postType") String postType) {
|
||||||
try {
|
try {
|
||||||
Optional<Post> post = postService.findByPostId(postId);
|
Optional<Post> post = postService.findByPostId(postId);
|
||||||
postService.removeByPostId(postId);
|
postService.remove(postId);
|
||||||
logsService.save(LogsRecord.REMOVE_POST, post.get().getPostTitle(), request);
|
logsService.save(LogsRecord.REMOVE_POST, post.get().getPostTitle(), request);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Delete article failed: {}", e.getMessage());
|
log.error("Delete article failed: {}", e.getMessage());
|
||||||
|
@ -353,7 +353,7 @@ public class PostController extends BaseController {
|
||||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.post.no-baidu-token"));
|
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.post.no-baidu-token"));
|
||||||
}
|
}
|
||||||
String blogUrl = HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp());
|
String blogUrl = HaloConst.OPTIONS.get(BlogPropertiesEnum.BLOG_URL.getProp());
|
||||||
List<Post> posts = postService.findAllPosts(PostTypeEnum.POST_TYPE_POST.getDesc());
|
List<Post> posts = postService.findAll(PostTypeEnum.POST_TYPE_POST.getDesc());
|
||||||
StringBuilder urls = new StringBuilder();
|
StringBuilder urls = new StringBuilder();
|
||||||
for (Post post : posts) {
|
for (Post post : posts) {
|
||||||
urls.append(blogUrl);
|
urls.append(blogUrl);
|
||||||
|
|
|
@ -49,7 +49,7 @@ public class TagController {
|
||||||
@PostMapping(value = "/save")
|
@PostMapping(value = "/save")
|
||||||
public String saveTag(@ModelAttribute Tag tag) {
|
public String saveTag(@ModelAttribute Tag tag) {
|
||||||
try {
|
try {
|
||||||
tagService.saveByTag(tag);
|
tagService.save(tag);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Add/modify tag failed: {}", e.getMessage());
|
log.error("Add/modify tag failed: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -81,7 +81,7 @@ public class TagController {
|
||||||
@GetMapping(value = "/remove")
|
@GetMapping(value = "/remove")
|
||||||
public String removeTag(@RequestParam("tagId") Long tagId) {
|
public String removeTag(@RequestParam("tagId") Long tagId) {
|
||||||
try {
|
try {
|
||||||
tagService.removeByTagId(tagId);
|
tagService.remove(tagId);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("Failed to delete tag: {}", e.getMessage());
|
log.error("Failed to delete tag: {}", e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class UserController {
|
||||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), error.getDefaultMessage());
|
return new JsonResult(ResultCodeEnum.FAIL.getCode(), error.getDefaultMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
userService.saveByUser(user);
|
userService.save(user);
|
||||||
configuration.setSharedVariable("user", userService.findUser());
|
configuration.setSharedVariable("user", userService.findUser());
|
||||||
session.removeAttribute(HaloConst.USER_SESSION_KEY);
|
session.removeAttribute(HaloConst.USER_SESSION_KEY);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -95,7 +95,7 @@ public class UserController {
|
||||||
User user = userService.findByUserIdAndUserPass(userId, SecureUtil.md5(beforePass));
|
User user = userService.findByUserIdAndUserPass(userId, SecureUtil.md5(beforePass));
|
||||||
if (null != user) {
|
if (null != user) {
|
||||||
user.setUserPass(SecureUtil.md5(newPass));
|
user.setUserPass(SecureUtil.md5(newPass));
|
||||||
userService.saveByUser(user);
|
userService.save(user);
|
||||||
session.removeAttribute(HaloConst.USER_SESSION_KEY);
|
session.removeAttribute(HaloConst.USER_SESSION_KEY);
|
||||||
} else {
|
} else {
|
||||||
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.user.old-password-error"));
|
return new JsonResult(ResultCodeEnum.FAIL.getCode(), localeMessageUtil.getMessage("code.admin.user.old-password-error"));
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class ApiCategoryController {
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public JsonResult categories() {
|
public JsonResult categories() {
|
||||||
List<Category> categories = categoryService.findAllCategories();
|
List<Category> categories = categoryService.findAll();
|
||||||
if (null != categories && categories.size() > 0) {
|
if (null != categories && categories.size() > 0) {
|
||||||
return new JsonResult(ResponseStatusEnum.SUCCESS.getCode(), ResponseStatusEnum.SUCCESS.getMsg(), categories);
|
return new JsonResult(ResponseStatusEnum.SUCCESS.getCode(), ResponseStatusEnum.SUCCESS.getMsg(), categories);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class ApiGalleryController {
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public JsonResult galleries() {
|
public JsonResult galleries() {
|
||||||
List<Gallery> galleries = galleryService.findAllGalleries();
|
List<Gallery> galleries = galleryService.findAll();
|
||||||
if (null != galleries && galleries.size() > 0) {
|
if (null != galleries && galleries.size() > 0) {
|
||||||
return new JsonResult(ResponseStatusEnum.SUCCESS.getCode(), ResponseStatusEnum.SUCCESS.getMsg(), galleries);
|
return new JsonResult(ResponseStatusEnum.SUCCESS.getCode(), ResponseStatusEnum.SUCCESS.getMsg(), galleries);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class ApiLinkController {
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public JsonResult links() {
|
public JsonResult links() {
|
||||||
List<Link> links = linkService.findAllLinks();
|
List<Link> links = linkService.findAll();
|
||||||
if (null != links && links.size() > 0) {
|
if (null != links && links.size() > 0) {
|
||||||
return new JsonResult(ResponseStatusEnum.SUCCESS.getCode(), ResponseStatusEnum.SUCCESS.getMsg(), links);
|
return new JsonResult(ResponseStatusEnum.SUCCESS.getCode(), ResponseStatusEnum.SUCCESS.getMsg(), links);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -35,7 +35,7 @@ public class ApiMenuController {
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public JsonResult menus() {
|
public JsonResult menus() {
|
||||||
List<Menu> menus = menuService.findAllMenus();
|
List<Menu> menus = menuService.findAll();
|
||||||
if (null != menus && menus.size() > 0) {
|
if (null != menus && menus.size() > 0) {
|
||||||
return new JsonResult(ResponseStatusEnum.SUCCESS.getCode(), ResponseStatusEnum.SUCCESS.getMsg(), menus);
|
return new JsonResult(ResponseStatusEnum.SUCCESS.getCode(), ResponseStatusEnum.SUCCESS.getMsg(), menus);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class ApiTagController {
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public JsonResult tags() {
|
public JsonResult tags() {
|
||||||
List<Tag> tags = tagService.findAllTags();
|
List<Tag> tags = tagService.findAll();
|
||||||
if (null != tags && tags.size() > 0) {
|
if (null != tags && tags.size() > 0) {
|
||||||
return new JsonResult(ResponseStatusEnum.SUCCESS.getCode(), ResponseStatusEnum.SUCCESS.getMsg(), tags);
|
return new JsonResult(ResponseStatusEnum.SUCCESS.getCode(), ResponseStatusEnum.SUCCESS.getMsg(), tags);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -115,14 +115,14 @@ public class InstallController {
|
||||||
user.setUserDisplayName(userDisplayName);
|
user.setUserDisplayName(userDisplayName);
|
||||||
user.setUserEmail(userEmail);
|
user.setUserEmail(userEmail);
|
||||||
user.setUserPass(SecureUtil.md5(userPwd));
|
user.setUserPass(SecureUtil.md5(userPwd));
|
||||||
userService.saveByUser(user);
|
userService.save(user);
|
||||||
|
|
||||||
//默认分类
|
//默认分类
|
||||||
Category category = new Category();
|
Category category = new Category();
|
||||||
category.setCateName("未分类");
|
category.setCateName("未分类");
|
||||||
category.setCateUrl("default");
|
category.setCateUrl("default");
|
||||||
category.setCateDesc("未分类");
|
category.setCateDesc("未分类");
|
||||||
categoryService.saveByCategory(category);
|
categoryService.save(category);
|
||||||
|
|
||||||
//第一篇文章
|
//第一篇文章
|
||||||
Post post = new Post();
|
Post post = new Post();
|
||||||
|
@ -139,7 +139,7 @@ public class InstallController {
|
||||||
post.setUser(user);
|
post.setUser(user);
|
||||||
post.setCategories(categories);
|
post.setCategories(categories);
|
||||||
post.setAllowComment(AllowCommentEnum.ALLOW.getCode());
|
post.setAllowComment(AllowCommentEnum.ALLOW.getCode());
|
||||||
postService.saveByPost(post);
|
postService.save(post);
|
||||||
|
|
||||||
//第一个评论
|
//第一个评论
|
||||||
Comment comment = new Comment();
|
Comment comment = new Comment();
|
||||||
|
@ -154,7 +154,7 @@ public class InstallController {
|
||||||
comment.setCommentStatus(0);
|
comment.setCommentStatus(0);
|
||||||
comment.setCommentAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36");
|
comment.setCommentAgent("Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.162 Safari/537.36");
|
||||||
comment.setIsAdmin(0);
|
comment.setIsAdmin(0);
|
||||||
commentService.saveByComment(comment);
|
commentService.save(comment);
|
||||||
|
|
||||||
optionsService.saveOption(BlogPropertiesEnum.IS_INSTALL.getProp(), TrueFalseEnum.TRUE.getDesc());
|
optionsService.saveOption(BlogPropertiesEnum.IS_INSTALL.getProp(), TrueFalseEnum.TRUE.getDesc());
|
||||||
|
|
||||||
|
@ -186,14 +186,14 @@ public class InstallController {
|
||||||
menuIndex.setMenuUrl("/");
|
menuIndex.setMenuUrl("/");
|
||||||
menuIndex.setMenuSort(1);
|
menuIndex.setMenuSort(1);
|
||||||
menuIndex.setMenuIcon("");
|
menuIndex.setMenuIcon("");
|
||||||
menuService.saveByMenu(menuIndex);
|
menuService.save(menuIndex);
|
||||||
|
|
||||||
Menu menuArchive = new Menu();
|
Menu menuArchive = new Menu();
|
||||||
menuArchive.setMenuName("归档");
|
menuArchive.setMenuName("归档");
|
||||||
menuArchive.setMenuUrl("/archives");
|
menuArchive.setMenuUrl("/archives");
|
||||||
menuArchive.setMenuSort(2);
|
menuArchive.setMenuSort(2);
|
||||||
menuArchive.setMenuIcon("");
|
menuArchive.setMenuIcon("");
|
||||||
menuService.saveByMenu(menuArchive);
|
menuService.save(menuArchive);
|
||||||
|
|
||||||
HaloConst.OPTIONS.clear();
|
HaloConst.OPTIONS.clear();
|
||||||
HaloConst.OPTIONS = optionsService.findAllOptions();
|
HaloConst.OPTIONS = optionsService.findAllOptions();
|
||||||
|
|
|
@ -48,7 +48,7 @@ public class FrontCategoryController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping
|
@GetMapping
|
||||||
public String categories(Model model) {
|
public String categories(Model model) {
|
||||||
List<Category> categories = categoryService.findAllCategories();
|
List<Category> categories = categoryService.findAll();
|
||||||
model.addAttribute("categories", categories);
|
model.addAttribute("categories", categories);
|
||||||
return this.render("categories");
|
return this.render("categories");
|
||||||
}
|
}
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class FrontCommentController {
|
||||||
if (StrUtil.isNotEmpty(comment.getCommentAuthorUrl())) {
|
if (StrUtil.isNotEmpty(comment.getCommentAuthorUrl())) {
|
||||||
comment.setCommentAuthorUrl(URLUtil.formatUrl(comment.getCommentAuthorUrl()));
|
comment.setCommentAuthorUrl(URLUtil.formatUrl(comment.getCommentAuthorUrl()));
|
||||||
}
|
}
|
||||||
commentService.saveByComment(comment);
|
commentService.save(comment);
|
||||||
if (comment.getCommentParent() > 0) {
|
if (comment.getCommentParent() > 0) {
|
||||||
new EmailToParent(comment, lastComment, post).start();
|
new EmailToParent(comment, lastComment, post).start();
|
||||||
new EmailToAdmin(comment, post).start();
|
new EmailToAdmin(comment, post).start();
|
||||||
|
|
|
@ -15,9 +15,10 @@ import org.springframework.data.domain.Pageable;
|
||||||
import org.springframework.data.domain.Sort;
|
import org.springframework.data.domain.Sort;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import java.util.List;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -61,7 +62,7 @@ public class FrontIndexController extends BaseController {
|
||||||
@PathVariable(value = "page") Integer page) {
|
@PathVariable(value = "page") Integer page) {
|
||||||
Sort sort = new Sort(Sort.Direction.DESC, "postDate");
|
Sort sort = new Sort(Sort.Direction.DESC, "postDate");
|
||||||
//默认显示10条
|
//默认显示10条
|
||||||
Integer size = 10;
|
int size = 10;
|
||||||
//尝试加载设置选项,用于设置显示条数
|
//尝试加载设置选项,用于设置显示条数
|
||||||
if (StrUtil.isNotBlank(HaloConst.OPTIONS.get(BlogPropertiesEnum.INDEX_POSTS.getProp()))) {
|
if (StrUtil.isNotBlank(HaloConst.OPTIONS.get(BlogPropertiesEnum.INDEX_POSTS.getProp()))) {
|
||||||
size = Integer.parseInt(HaloConst.OPTIONS.get(BlogPropertiesEnum.INDEX_POSTS.getProp()));
|
size = Integer.parseInt(HaloConst.OPTIONS.get(BlogPropertiesEnum.INDEX_POSTS.getProp()));
|
||||||
|
@ -79,29 +80,6 @@ public class FrontIndexController extends BaseController {
|
||||||
return this.render("index");
|
return this.render("index");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ajax分页
|
|
||||||
*
|
|
||||||
* @param page page 当前页码
|
|
||||||
* @return List
|
|
||||||
*/
|
|
||||||
@GetMapping(value = "next")
|
|
||||||
@ResponseBody
|
|
||||||
public List<Post> ajaxIndex(@RequestParam(value = "page") Integer page) {
|
|
||||||
Sort sort = new Sort(Sort.Direction.DESC, "postDate");
|
|
||||||
//默认显示10条
|
|
||||||
Integer size = 10;
|
|
||||||
//尝试加载设置选项,用于设置显示条数
|
|
||||||
if (StrUtil.isNotBlank(HaloConst.OPTIONS.get(BlogPropertiesEnum.INDEX_POSTS.getProp()))) {
|
|
||||||
size = Integer.parseInt(HaloConst.OPTIONS.get(BlogPropertiesEnum.INDEX_POSTS.getProp()));
|
|
||||||
}
|
|
||||||
|
|
||||||
//文章数据,只获取文章,没有分页
|
|
||||||
Pageable pageable = PageRequest.of(page - 1, size, sort);
|
|
||||||
List<Post> posts = postService.findPostByStatus(pageable).getContent();
|
|
||||||
return posts;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 搜索文章
|
* 搜索文章
|
||||||
*
|
*
|
||||||
|
|
|
@ -52,7 +52,7 @@ public class FrontPageController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/gallery")
|
@GetMapping(value = "/gallery")
|
||||||
public String gallery(Model model) {
|
public String gallery(Model model) {
|
||||||
List<Gallery> galleries = galleryService.findAllGalleries();
|
List<Gallery> galleries = galleryService.findAll();
|
||||||
model.addAttribute("galleries", galleries);
|
model.addAttribute("galleries", galleries);
|
||||||
return this.render("gallery");
|
return this.render("gallery");
|
||||||
}
|
}
|
||||||
|
|
|
@ -183,7 +183,7 @@
|
||||||
<#if (options.widget_daycount!'true')=='true'>
|
<#if (options.widget_daycount!'true')=='true'>
|
||||||
<div class="col-lg-3 col-xs-6" id="widgetDayCountBody">
|
<div class="col-lg-3 col-xs-6" id="widgetDayCountBody">
|
||||||
<div class="small-box bg-red">
|
<div class="small-box bg-red">
|
||||||
<div class="inner"><h3 id="blogStart"></h3><p><@spring.message code='admin.index.widgets.day-count' /></p></div>
|
<div class="inner"><h3 id="blogStart">${hadDays!}</h3><p><@spring.message code='admin.index.widgets.day-count' /></p></div>
|
||||||
<div class="icon"><i class="ion ion-pie-graph"></i></div>
|
<div class="icon"><i class="ion ion-pie-graph"></i></div>
|
||||||
<a href="#" class="small-box-footer" data-toggle="modal" data-target="#blogInfo">${options.blog_start!'0000-00-00'} <i class="fa fa-star"></i></a>
|
<a href="#" class="small-box-footer" data-toggle="modal" data-target="#blogInfo">${options.blog_start!'0000-00-00'} <i class="fa fa-star"></i></a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -366,7 +366,7 @@
|
||||||
<h4 class="modal-title" id="blog-data"><@spring.message code='admin.index.blog-data.title' /></h4>
|
<h4 class="modal-title" id="blog-data"><@spring.message code='admin.index.blog-data.title' /></h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<p>「${options.blog_title!}」<@spring.message code='admin.index.blog-data.days-count-before' /><span id="blogStartDay"></span><@spring.message code='admin.index.blog-data.days-count-after' /></p>
|
<p>「${options.blog_title!}」<@spring.message code='admin.index.blog-data.days-count-before' /><span id="blogStartDay">${hadDays!}</span><@spring.message code='admin.index.blog-data.days-count-after' /></p>
|
||||||
<p><@spring.message code='admin.index.blog-data.during' /></p>
|
<p><@spring.message code='admin.index.blog-data.during' /></p>
|
||||||
<p><@spring.message code='admin.index.blog-data.posts-count-before' /> <@articleTag method="postsCount">${postsCount!0}</@articleTag> <@spring.message code='admin.index.blog-data.posts-count-after' /></p>
|
<p><@spring.message code='admin.index.blog-data.posts-count-before' /> <@articleTag method="postsCount">${postsCount!0}</@articleTag> <@spring.message code='admin.index.blog-data.posts-count-after' /></p>
|
||||||
<p><@spring.message code='admin.index.blog-data.tags-count-before' /> <@commonTag method="tags">${tags?size}</@commonTag> <@spring.message code='admin.index.blog-data.tags-count-after' /></p>
|
<p><@spring.message code='admin.index.blog-data.tags-count-before' /> <@commonTag method="tags">${tags?size}</@commonTag> <@spring.message code='admin.index.blog-data.tags-count-after' /></p>
|
||||||
|
@ -382,14 +382,6 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script type="application/javascript">
|
<script type="application/javascript">
|
||||||
$(document).ready(function () {
|
|
||||||
var dateBegin = new Date("${options.blog_start!'0000-00-00'}");
|
|
||||||
var dateEnd = new Date();
|
|
||||||
var parseDate = dateEnd.getTime() - dateBegin.getTime();
|
|
||||||
var days = Math.floor(parseDate/(24*3600*1000));
|
|
||||||
$('#blogStart').html(days+1);
|
|
||||||
$('#blogStartDay').html(days+1);
|
|
||||||
});
|
|
||||||
$('#btnWidgetsOption').click(function () {
|
$('#btnWidgetsOption').click(function () {
|
||||||
$('#widgetOptionsPanel').slideToggle(400);
|
$('#widgetOptionsPanel').slideToggle(400);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue