mirror of https://github.com/halo-dev/halo
🎨 代码优化
parent
e0e3be00bb
commit
1e648ddc45
|
@ -1,8 +1,6 @@
|
|||
package cc.ryanc.halo.repository;
|
||||
|
||||
import cc.ryanc.halo.model.domain.Attachment;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
/**
|
||||
|
|
|
@ -5,7 +5,6 @@ import cc.ryanc.halo.model.domain.Post;
|
|||
import cc.ryanc.halo.model.domain.Tag;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
|
|
@ -63,7 +63,6 @@ public class AttachmentServiceImpl implements AttachmentService {
|
|||
* 新增附件信息
|
||||
*
|
||||
* @param attachment attachment
|
||||
*
|
||||
* @return Attachment
|
||||
*/
|
||||
@Override
|
||||
|
@ -87,7 +86,6 @@ public class AttachmentServiceImpl implements AttachmentService {
|
|||
* 获取所有附件信息 分页
|
||||
*
|
||||
* @param pageable pageable
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
@Override
|
||||
|
@ -99,7 +97,6 @@ public class AttachmentServiceImpl implements AttachmentService {
|
|||
* 根据附件id查询附件
|
||||
*
|
||||
* @param attachId attachId
|
||||
*
|
||||
* @return Optional
|
||||
*/
|
||||
@Override
|
||||
|
@ -111,7 +108,6 @@ public class AttachmentServiceImpl implements AttachmentService {
|
|||
* 根据编号移除附件
|
||||
*
|
||||
* @param attachId attachId
|
||||
*
|
||||
* @return Attachment
|
||||
*/
|
||||
@Override
|
||||
|
@ -127,7 +123,6 @@ public class AttachmentServiceImpl implements AttachmentService {
|
|||
*
|
||||
* @param file file
|
||||
* @param request request
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
@Override
|
||||
|
@ -159,7 +154,6 @@ public class AttachmentServiceImpl implements AttachmentService {
|
|||
*
|
||||
* @param file file
|
||||
* @param request request
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
@Override
|
||||
|
@ -251,7 +245,6 @@ public class AttachmentServiceImpl implements AttachmentService {
|
|||
*
|
||||
* @param file file
|
||||
* @param request request
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
@Override
|
||||
|
@ -312,7 +305,6 @@ public class AttachmentServiceImpl implements AttachmentService {
|
|||
*
|
||||
* @param file file
|
||||
* @param request request
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
@Override
|
||||
|
@ -362,7 +354,6 @@ public class AttachmentServiceImpl implements AttachmentService {
|
|||
* 七牛云删除附件
|
||||
*
|
||||
* @param key key
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
|
@ -391,7 +382,6 @@ public class AttachmentServiceImpl implements AttachmentService {
|
|||
* 又拍云删除附件
|
||||
*
|
||||
* @param fileName fileName
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -10,7 +10,6 @@ import org.springframework.data.domain.Pageable;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
|
@ -23,11 +23,10 @@ import java.util.Map;
|
|||
@Service
|
||||
public class OptionsServiceImpl implements OptionsService {
|
||||
|
||||
private static final String POSTS_CACHE_NAME = "posts";
|
||||
@Autowired
|
||||
private OptionsRepository optionsRepository;
|
||||
|
||||
private static final String POSTS_CACHE_NAME = "posts";
|
||||
|
||||
/**
|
||||
* 批量保存设置
|
||||
*
|
||||
|
|
|
@ -11,7 +11,6 @@ import cc.ryanc.halo.repository.PostRepository;
|
|||
import cc.ryanc.halo.service.CategoryService;
|
||||
import cc.ryanc.halo.service.PostService;
|
||||
import cc.ryanc.halo.service.TagService;
|
||||
import cc.ryanc.halo.utils.HaloUtils;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HtmlUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -21,20 +20,14 @@ import org.springframework.cache.annotation.Cacheable;
|
|||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.data.jpa.domain.Specifications;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.persistence.criteria.CriteriaBuilder;
|
||||
import javax.persistence.criteria.CriteriaQuery;
|
||||
import javax.persistence.criteria.Predicate;
|
||||
import javax.persistence.criteria.Root;
|
||||
import java.util.*;
|
||||
|
||||
import static org.springframework.data.jpa.domain.Specification.where;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
|
||||
import static cc.ryanc.halo.model.dto.HaloConst.POSTS_VIEWS;
|
||||
|
@ -67,7 +60,6 @@ public class PostServiceImpl implements PostService {
|
|||
* 保存文章
|
||||
*
|
||||
* @param post Post
|
||||
*
|
||||
* @return Post
|
||||
*/
|
||||
@Override
|
||||
|
@ -91,7 +83,6 @@ public class PostServiceImpl implements PostService {
|
|||
* 根据编号移除文章
|
||||
*
|
||||
* @param postId postId
|
||||
*
|
||||
* @return Post
|
||||
*/
|
||||
@Override
|
||||
|
@ -107,7 +98,6 @@ public class PostServiceImpl implements PostService {
|
|||
*
|
||||
* @param postId postId
|
||||
* @param status status
|
||||
*
|
||||
* @return Post
|
||||
*/
|
||||
@Override
|
||||
|
@ -142,7 +132,6 @@ public class PostServiceImpl implements PostService {
|
|||
* 获取文章列表 不分页
|
||||
*
|
||||
* @param postType post or page
|
||||
*
|
||||
* @return List
|
||||
*/
|
||||
@Override
|
||||
|
@ -158,7 +147,6 @@ public class PostServiceImpl implements PostService {
|
|||
* @param postType 文章类型
|
||||
* @param postStatus 文章状态
|
||||
* @param pageable 分页信息
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
@Override
|
||||
|
@ -196,7 +184,6 @@ public class PostServiceImpl implements PostService {
|
|||
* @param status 0,1,2
|
||||
* @param postType post or page
|
||||
* @param pageable 分页信息
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
@Override
|
||||
|
@ -213,7 +200,6 @@ public class PostServiceImpl implements PostService {
|
|||
* 根据文章状态查询 分页,首页分页
|
||||
*
|
||||
* @param pageable pageable
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
@Override
|
||||
|
@ -232,7 +218,6 @@ public class PostServiceImpl implements PostService {
|
|||
*
|
||||
* @param status 0,1,2
|
||||
* @param postType post or page
|
||||
*
|
||||
* @return List
|
||||
*/
|
||||
@Override
|
||||
|
@ -245,7 +230,6 @@ public class PostServiceImpl implements PostService {
|
|||
* 根据编号查询文章
|
||||
*
|
||||
* @param postId postId
|
||||
*
|
||||
* @return Optional
|
||||
*/
|
||||
@Override
|
||||
|
@ -257,7 +241,6 @@ public class PostServiceImpl implements PostService {
|
|||
* 根据编号和类型查询文章
|
||||
*
|
||||
* @param postId postId
|
||||
*
|
||||
* @return Post
|
||||
*/
|
||||
@Override
|
||||
|
@ -270,7 +253,6 @@ public class PostServiceImpl implements PostService {
|
|||
*
|
||||
* @param postUrl 路径
|
||||
* @param postType post or page
|
||||
*
|
||||
* @return Post
|
||||
*/
|
||||
@Override
|
||||
|
@ -294,7 +276,6 @@ public class PostServiceImpl implements PostService {
|
|||
* 获取下一篇文章 较新
|
||||
*
|
||||
* @param postDate postDate
|
||||
*
|
||||
* @return Post
|
||||
*/
|
||||
@Override
|
||||
|
@ -306,7 +287,6 @@ public class PostServiceImpl implements PostService {
|
|||
* 获取下一篇文章 较老
|
||||
*
|
||||
* @param postDate postDate
|
||||
*
|
||||
* @return Post
|
||||
*/
|
||||
@Override
|
||||
|
@ -359,7 +339,6 @@ public class PostServiceImpl implements PostService {
|
|||
|
||||
/**
|
||||
* @return List
|
||||
*
|
||||
* @Author Aquan
|
||||
* @Description 查询归档信息 返回所有文章
|
||||
* @Date 2019.1.4 11:16
|
||||
|
@ -386,7 +365,6 @@ public class PostServiceImpl implements PostService {
|
|||
*
|
||||
* @param year year
|
||||
* @param month month
|
||||
*
|
||||
* @return List
|
||||
*/
|
||||
@Override
|
||||
|
@ -399,7 +377,6 @@ public class PostServiceImpl implements PostService {
|
|||
* 根据年份查询文章
|
||||
*
|
||||
* @param year year
|
||||
*
|
||||
* @return List
|
||||
*/
|
||||
@Override
|
||||
|
@ -414,7 +391,6 @@ public class PostServiceImpl implements PostService {
|
|||
* @param year year year
|
||||
* @param month month month
|
||||
* @param pageable pageable pageable
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
@Override
|
||||
|
@ -432,7 +408,6 @@ public class PostServiceImpl implements PostService {
|
|||
*
|
||||
* @param category category
|
||||
* @param pageable pageable
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
@Override
|
||||
|
@ -451,7 +426,6 @@ public class PostServiceImpl implements PostService {
|
|||
*
|
||||
* @param tag tag
|
||||
* @param pageable pageable
|
||||
*
|
||||
* @return Page
|
||||
*/
|
||||
@Override
|
||||
|
@ -480,7 +454,6 @@ public class PostServiceImpl implements PostService {
|
|||
* 当前文章的相似文章
|
||||
*
|
||||
* @param post post
|
||||
*
|
||||
* @return List
|
||||
*/
|
||||
@Override
|
||||
|
@ -518,7 +491,6 @@ public class PostServiceImpl implements PostService {
|
|||
* 根据文章状态查询数量
|
||||
*
|
||||
* @param status 文章状态
|
||||
*
|
||||
* @return 文章数量
|
||||
*/
|
||||
@Override
|
||||
|
@ -546,7 +518,6 @@ public class PostServiceImpl implements PostService {
|
|||
* @param post post
|
||||
* @param cateList cateList
|
||||
* @param tagList tagList
|
||||
*
|
||||
* @return Post Post
|
||||
*/
|
||||
@Override
|
||||
|
@ -564,7 +535,6 @@ public class PostServiceImpl implements PostService {
|
|||
* 获取最近的文章
|
||||
*
|
||||
* @param limit 条数
|
||||
*
|
||||
* @return List
|
||||
*/
|
||||
@Override
|
||||
|
|
|
@ -39,7 +39,6 @@ public class HaloUtils {
|
|||
* 获取备份文件信息
|
||||
*
|
||||
* @param dir dir
|
||||
*
|
||||
* @return List
|
||||
*/
|
||||
public static List<BackupDto> getBackUps(String dir) {
|
||||
|
@ -74,7 +73,6 @@ public class HaloUtils {
|
|||
* 转换文件大小
|
||||
*
|
||||
* @param size size
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String parseSize(long size) {
|
||||
|
@ -101,7 +99,6 @@ public class HaloUtils {
|
|||
* 获取文件创建时间
|
||||
*
|
||||
* @param srcPath 文件绝对路径
|
||||
*
|
||||
* @return 时间
|
||||
*/
|
||||
public static Date getCreateTime(String srcPath) {
|
||||
|
@ -124,7 +121,6 @@ public class HaloUtils {
|
|||
* 获取文件长和宽
|
||||
*
|
||||
* @param file file
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String getImageWh(File file) {
|
||||
|
@ -186,7 +182,6 @@ public class HaloUtils {
|
|||
* 获取主题下的模板文件名
|
||||
*
|
||||
* @param theme theme
|
||||
*
|
||||
* @return List
|
||||
*/
|
||||
public static List<String> getTplName(String theme) {
|
||||
|
@ -294,7 +289,6 @@ public class HaloUtils {
|
|||
* @param blogUrl 博客地址
|
||||
* @param token 百度推送token
|
||||
* @param urls 文章路径
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String baiduPost(String blogUrl, String token, String urls) {
|
||||
|
|
|
@ -43,7 +43,6 @@ public class MarkdownUtils {
|
|||
* 渲染Markdown
|
||||
*
|
||||
* @param content content
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
public static String renderMarkdown(String content) {
|
||||
|
@ -55,7 +54,6 @@ public class MarkdownUtils {
|
|||
* 获取元数据
|
||||
*
|
||||
* @param content content
|
||||
*
|
||||
* @return Map
|
||||
*/
|
||||
public static Map<String, List<String>> getFrontMatter(String content) {
|
||||
|
|
|
@ -20,9 +20,7 @@ public class Md5Util {
|
|||
* 计算文件MD5编码
|
||||
*
|
||||
* @param file file
|
||||
*
|
||||
* @return byte
|
||||
*
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
private static byte[] createChecksum(MultipartFile file) throws Exception {
|
||||
|
@ -47,9 +45,7 @@ public class Md5Util {
|
|||
* 生成文件hash值
|
||||
*
|
||||
* @param file file
|
||||
*
|
||||
* @return String
|
||||
*
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
public static String getMD5Checksum(MultipartFile file) throws Exception {
|
||||
|
|
|
@ -19,7 +19,6 @@ public class OwoUtil {
|
|||
* 将表情标志转化为图片地址
|
||||
*
|
||||
* @param mark 表情标志
|
||||
*
|
||||
* @return 表情图片地址
|
||||
*/
|
||||
public static String markToImg(String mark) {
|
||||
|
|
|
@ -20,7 +20,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
|
@ -118,7 +117,6 @@ public class AdminController extends BaseController {
|
|||
* 处理跳转到登录页的请求
|
||||
*
|
||||
* @param session session
|
||||
*
|
||||
* @return 模板路径admin/admin_login
|
||||
*/
|
||||
@GetMapping(value = "/login")
|
||||
|
@ -137,7 +135,6 @@ public class AdminController extends BaseController {
|
|||
* @param loginName 登录名:邮箱/用户名
|
||||
* @param loginPwd loginPwd 密码
|
||||
* @param session session session
|
||||
*
|
||||
* @return JsonResult JsonResult
|
||||
*/
|
||||
@PostMapping(value = "/getLogin")
|
||||
|
@ -189,7 +186,6 @@ public class AdminController extends BaseController {
|
|||
* 退出登录 销毁session
|
||||
*
|
||||
* @param session session
|
||||
*
|
||||
* @return 重定向到/admin/login
|
||||
*/
|
||||
@GetMapping(value = "/logOut")
|
||||
|
@ -209,7 +205,6 @@ public class AdminController extends BaseController {
|
|||
*/
|
||||
@GetMapping(value = "/logs")
|
||||
public String logs(Model model, @PageableDefault Pageable pageable) {
|
||||
final Sort sort = new Sort(Sort.Direction.DESC, "logId");
|
||||
final Page<Logs> logs = logsService.findAll(pageable);
|
||||
model.addAttribute("logs", logs);
|
||||
return "admin/widget/_logs-all";
|
||||
|
@ -278,7 +273,6 @@ public class AdminController extends BaseController {
|
|||
*
|
||||
* @param file file
|
||||
* @param request request
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@PostMapping(value = "/tools/markdownImport")
|
||||
|
|
|
@ -62,7 +62,6 @@ public class BackupController {
|
|||
* 渲染备份页面
|
||||
*
|
||||
* @param model model
|
||||
*
|
||||
* @return 模板路径admin/admin_backup
|
||||
*/
|
||||
@GetMapping
|
||||
|
@ -86,7 +85,6 @@ public class BackupController {
|
|||
* 执行备份
|
||||
*
|
||||
* @param type 备份类型
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@GetMapping(value = "doBackup")
|
||||
|
@ -208,7 +206,6 @@ public class BackupController {
|
|||
*
|
||||
* @param fileName 文件名
|
||||
* @param type 备份类型
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@GetMapping(value = "delBackup")
|
||||
|
@ -229,7 +226,6 @@ public class BackupController {
|
|||
*
|
||||
* @param fileName 文件名
|
||||
* @param type 备份类型
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@GetMapping(value = "sendToEmail")
|
||||
|
|
|
@ -49,7 +49,6 @@ public class CategoryController {
|
|||
* 新增/修改分类目录
|
||||
*
|
||||
* @param category category对象
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@PostMapping(value = "/save")
|
||||
|
@ -81,7 +80,6 @@ public class CategoryController {
|
|||
* 处理删除分类目录的请求
|
||||
*
|
||||
* @param cateId cateId
|
||||
*
|
||||
* @return 重定向到/admin/category
|
||||
*/
|
||||
@GetMapping(value = "/remove")
|
||||
|
@ -99,7 +97,6 @@ public class CategoryController {
|
|||
*
|
||||
* @param cateId cateId
|
||||
* @param model model
|
||||
*
|
||||
* @return 模板路径admin/admin_category
|
||||
*/
|
||||
@GetMapping(value = "/edit")
|
||||
|
|
|
@ -19,7 +19,6 @@ import cn.hutool.http.HtmlUtil;
|
|||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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;
|
||||
|
|
|
@ -52,7 +52,6 @@ public class OptionController {
|
|||
* 保存设置选项
|
||||
*
|
||||
* @param options options
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@PostMapping(value = "/save")
|
||||
|
|
|
@ -23,7 +23,6 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.propertyeditors.CustomDateEditor;
|
||||
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;
|
||||
|
|
|
@ -68,7 +68,6 @@ public class PostController extends BaseController {
|
|||
* 去除html,htm后缀,以及将空格替换成-
|
||||
*
|
||||
* @param url url
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
private static String urlFilter(String url) {
|
||||
|
@ -125,7 +124,6 @@ public class PostController extends BaseController {
|
|||
*
|
||||
* @param postId 文章编号
|
||||
* @param model model
|
||||
*
|
||||
* @return 模板路径/themes/{theme}/post
|
||||
*/
|
||||
@GetMapping(value = "/view")
|
||||
|
@ -150,7 +148,6 @@ public class PostController extends BaseController {
|
|||
*
|
||||
* @param postId 文章编号
|
||||
* @param model model
|
||||
*
|
||||
* @return 模板路径admin/admin_editor
|
||||
*/
|
||||
@GetMapping(value = "/edit")
|
||||
|
@ -238,7 +235,6 @@ public class PostController extends BaseController {
|
|||
* 处理移至回收站的请求
|
||||
*
|
||||
* @param postId 文章编号
|
||||
*
|
||||
* @return 重定向到/admin/posts
|
||||
*/
|
||||
@GetMapping(value = "/throw")
|
||||
|
@ -256,7 +252,6 @@ public class PostController extends BaseController {
|
|||
* 处理文章为发布的状态
|
||||
*
|
||||
* @param postId 文章编号
|
||||
*
|
||||
* @return 重定向到/admin/posts
|
||||
*/
|
||||
@GetMapping(value = "/revert")
|
||||
|
@ -275,7 +270,6 @@ public class PostController extends BaseController {
|
|||
* 处理删除文章的请求
|
||||
*
|
||||
* @param postId 文章编号
|
||||
*
|
||||
* @return 重定向到/admin/posts
|
||||
*/
|
||||
@GetMapping(value = "/remove")
|
||||
|
@ -297,7 +291,6 @@ public class PostController extends BaseController {
|
|||
* 更新所有摘要
|
||||
*
|
||||
* @param postSummary 文章摘要字数
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@GetMapping(value = "/updateSummary")
|
||||
|
@ -317,7 +310,6 @@ public class PostController extends BaseController {
|
|||
* 验证文章路径是否已经存在
|
||||
*
|
||||
* @param postUrl 文章路径
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@GetMapping(value = "/checkUrl")
|
||||
|
@ -335,7 +327,6 @@ public class PostController extends BaseController {
|
|||
* 将所有文章推送到百度
|
||||
*
|
||||
* @param baiduToken baiduToken
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@GetMapping(value = "/pushAllToBaidu")
|
||||
|
|
|
@ -48,7 +48,6 @@ public class TagController {
|
|||
* 新增/修改标签
|
||||
*
|
||||
* @param tag tag
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@PostMapping(value = "/save")
|
||||
|
@ -80,7 +79,6 @@ public class TagController {
|
|||
* 处理删除标签的请求
|
||||
*
|
||||
* @param tagId 标签编号
|
||||
*
|
||||
* @return 重定向到/admin/tag
|
||||
*/
|
||||
@GetMapping(value = "/remove")
|
||||
|
@ -98,7 +96,6 @@ public class TagController {
|
|||
*
|
||||
* @param model model
|
||||
* @param tagId 标签编号
|
||||
*
|
||||
* @return 模板路径admin/admin_tag
|
||||
*/
|
||||
@GetMapping(value = "/edit")
|
||||
|
|
|
@ -66,7 +66,6 @@ public class ThemeController extends BaseController {
|
|||
* 渲染主题设置页面
|
||||
*
|
||||
* @param model model
|
||||
*
|
||||
* @return 模板路径admin/admin_theme
|
||||
*/
|
||||
@GetMapping
|
||||
|
@ -83,7 +82,6 @@ public class ThemeController extends BaseController {
|
|||
*
|
||||
* @param siteTheme 主题名称
|
||||
* @param request request
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@GetMapping(value = "/set")
|
||||
|
@ -113,7 +111,6 @@ public class ThemeController extends BaseController {
|
|||
* 上传主题
|
||||
*
|
||||
* @param file 文件
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@RequestMapping(value = "/upload", method = RequestMethod.POST)
|
||||
|
@ -147,7 +144,6 @@ public class ThemeController extends BaseController {
|
|||
* 删除主题
|
||||
*
|
||||
* @param themeName 主题文件夹名
|
||||
*
|
||||
* @return string 重定向到/admin/themes
|
||||
*/
|
||||
@GetMapping(value = "/remove")
|
||||
|
@ -179,7 +175,6 @@ public class ThemeController extends BaseController {
|
|||
*
|
||||
* @param remoteAddr 远程地址
|
||||
* @param themeName 主题名称
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@PostMapping(value = "/clone")
|
||||
|
@ -209,7 +204,6 @@ public class ThemeController extends BaseController {
|
|||
* 更新主题
|
||||
*
|
||||
* @param themeName 主题名
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@GetMapping(value = "/pull")
|
||||
|
@ -253,7 +247,6 @@ public class ThemeController extends BaseController {
|
|||
* 编辑主题
|
||||
*
|
||||
* @param model model
|
||||
*
|
||||
* @return 模板路径admin/admin_theme-editor
|
||||
*/
|
||||
@GetMapping(value = "/editor")
|
||||
|
@ -267,7 +260,6 @@ public class ThemeController extends BaseController {
|
|||
* 获取模板文件内容
|
||||
*
|
||||
* @param tplName 模板文件名
|
||||
*
|
||||
* @return 模板内容
|
||||
*/
|
||||
@GetMapping(value = "/getTpl", produces = "text/text;charset=UTF-8")
|
||||
|
@ -296,7 +288,6 @@ public class ThemeController extends BaseController {
|
|||
*
|
||||
* @param tplName 模板名称
|
||||
* @param tplContent 模板内容
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@PostMapping(value = "/editor/save")
|
||||
|
|
|
@ -56,7 +56,6 @@ public class UserController {
|
|||
*
|
||||
* @param user user
|
||||
* @param session session
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@PostMapping(value = "save")
|
||||
|
@ -85,7 +84,6 @@ public class UserController {
|
|||
* @param newPass 新密码
|
||||
* @param userId 用户编号
|
||||
* @param session session
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@PostMapping(value = "changePass")
|
||||
|
|
|
@ -137,11 +137,11 @@ public class ApiArchivesController {
|
|||
}
|
||||
|
||||
/**
|
||||
* @return JsonResult
|
||||
* @Author Aquan
|
||||
* @Description 返回所有文章
|
||||
* @Date 2019.1.4 11:06
|
||||
* @Param
|
||||
* @return JsonResult
|
||||
**/
|
||||
@GetMapping(value = "/all")
|
||||
public JsonResult archivesAllPost() {
|
||||
|
|
|
@ -51,7 +51,6 @@ public class ApiCommentController {
|
|||
* @param result result
|
||||
* @param postId postId
|
||||
* @param request request
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@PostMapping(value = "/save")
|
||||
|
|
|
@ -48,7 +48,6 @@ public class ApiMetaWeBlog {
|
|||
|
||||
/**
|
||||
* @param request request
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
@PostMapping
|
||||
|
@ -126,9 +125,7 @@ public class ApiMetaWeBlog {
|
|||
|
||||
/**
|
||||
* @param methodCall
|
||||
*
|
||||
* @return
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
private Post parsetPost(final JSONObject methodCall) throws Exception {
|
||||
|
@ -165,7 +162,6 @@ public class ApiMetaWeBlog {
|
|||
* 根据文章编号获取文章信息
|
||||
*
|
||||
* @param postId 文章编号
|
||||
*
|
||||
* @return 文章信息xml格式
|
||||
*/
|
||||
private String getPost(Long postId) {
|
||||
|
@ -180,7 +176,6 @@ public class ApiMetaWeBlog {
|
|||
* 根据文章编号构建文章信息
|
||||
*
|
||||
* @param postId 文章编号
|
||||
*
|
||||
* @return 文章信息xml格式
|
||||
*/
|
||||
private String buildPost(final Long postId) {
|
||||
|
@ -248,7 +243,6 @@ public class ApiMetaWeBlog {
|
|||
* 组装分类信息
|
||||
*
|
||||
* @return 分类信息xml格式
|
||||
*
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
private String getCategories() throws Exception {
|
||||
|
@ -265,7 +259,6 @@ public class ApiMetaWeBlog {
|
|||
* 构建分类信息
|
||||
*
|
||||
* @return 分类信息xml节点
|
||||
*
|
||||
* @throws Exception Exception
|
||||
*/
|
||||
private String buildCategories() throws Exception {
|
||||
|
|
|
@ -82,7 +82,6 @@ public class ApiOptionController {
|
|||
* </p>
|
||||
*
|
||||
* @param optionName 设置选项名称
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@GetMapping(value = "/one")
|
||||
|
|
|
@ -58,7 +58,6 @@ public class ApiPageController {
|
|||
* </p>
|
||||
*
|
||||
* @param postId postId
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@GetMapping(value = "/{postId}")
|
||||
|
|
|
@ -23,7 +23,7 @@ import java.util.HashMap;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static cc.ryanc.halo.model.dto.HaloConst.*;
|
||||
import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
|
@ -66,7 +66,6 @@ public class InstallController {
|
|||
* 渲染安装页面
|
||||
*
|
||||
* @param model model
|
||||
*
|
||||
* @return 模板路径
|
||||
*/
|
||||
@GetMapping
|
||||
|
@ -92,7 +91,6 @@ public class InstallController {
|
|||
* @param userEmail 用户邮箱
|
||||
* @param userPwd 用户密码
|
||||
* @param request request
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@PostMapping(value = "/do")
|
||||
|
|
|
@ -33,8 +33,8 @@ import java.util.ArrayList;
|
|||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static org.springframework.data.domain.Sort.Direction.DESC;
|
||||
import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
|
||||
import static org.springframework.data.domain.Sort.Direction.DESC;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
|
@ -61,7 +61,6 @@ public class FrontArchiveController extends BaseController {
|
|||
* 文章归档
|
||||
*
|
||||
* @param model model
|
||||
*
|
||||
* @return 模板路径
|
||||
*/
|
||||
@GetMapping
|
||||
|
@ -74,7 +73,6 @@ public class FrontArchiveController extends BaseController {
|
|||
*
|
||||
* @param model model
|
||||
* @param page page 当前页码
|
||||
*
|
||||
* @return 模板路径/themes/{theme}/archives
|
||||
*/
|
||||
@GetMapping(value = "page/{page}")
|
||||
|
@ -98,7 +96,6 @@ public class FrontArchiveController extends BaseController {
|
|||
* @param model model
|
||||
* @param year year 年份
|
||||
* @param month month 月份
|
||||
*
|
||||
* @return 模板路径/themes/{theme}/archives
|
||||
*/
|
||||
@GetMapping(value = "{year}/{month}")
|
||||
|
@ -119,7 +116,6 @@ public class FrontArchiveController extends BaseController {
|
|||
*
|
||||
* @param postUrl 文章路径名
|
||||
* @param model model
|
||||
*
|
||||
* @return 模板路径/themes/{theme}/post
|
||||
*/
|
||||
@GetMapping(value = "{postUrl}")
|
||||
|
@ -193,7 +189,6 @@ public class FrontArchiveController extends BaseController {
|
|||
* @param postId postId
|
||||
* @param postPassword postPassword
|
||||
* @param response response
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
@PostMapping(value = "/verifyPostPassword")
|
||||
|
|
|
@ -22,8 +22,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import static org.springframework.data.domain.Sort.Direction.DESC;
|
||||
import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
|
||||
import static org.springframework.data.domain.Sort.Direction.DESC;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
|
|
|
@ -65,7 +65,6 @@ public class FrontCommentController {
|
|||
* @param comment comment实体
|
||||
* @param post post实体
|
||||
* @param request request
|
||||
*
|
||||
* @return JsonResult
|
||||
*/
|
||||
@PostMapping(value = "/newComment")
|
||||
|
|
|
@ -19,8 +19,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import static org.springframework.data.domain.Sort.Direction.DESC;
|
||||
import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
|
||||
import static org.springframework.data.domain.Sort.Direction.DESC;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
|
@ -43,7 +43,6 @@ public class FrontIndexController extends BaseController {
|
|||
* 请求首页
|
||||
*
|
||||
* @param model model
|
||||
*
|
||||
* @return 模板路径
|
||||
*/
|
||||
@GetMapping
|
||||
|
|
|
@ -45,9 +45,7 @@ public class FrontOthersController {
|
|||
* 获取文章rss
|
||||
*
|
||||
* @param model model
|
||||
*
|
||||
* @return String
|
||||
*
|
||||
* @throws IOException IOException
|
||||
* @throws TemplateException TemplateException
|
||||
*/
|
||||
|
@ -77,9 +75,7 @@ public class FrontOthersController {
|
|||
* 获取 XML 格式的站点地图
|
||||
*
|
||||
* @param model model
|
||||
*
|
||||
* @return String
|
||||
*
|
||||
* @throws IOException IOException
|
||||
* @throws TemplateException TemplateException
|
||||
*/
|
||||
|
@ -103,7 +99,6 @@ public class FrontOthersController {
|
|||
* 获取 HTML 格式的站点地图
|
||||
*
|
||||
* @param model model
|
||||
*
|
||||
* @return String
|
||||
*/
|
||||
@GetMapping(value = "sitemap.html", produces = {"text/html"})
|
||||
|
@ -124,9 +119,7 @@ public class FrontOthersController {
|
|||
* robots
|
||||
*
|
||||
* @param model model
|
||||
*
|
||||
* @return String
|
||||
*
|
||||
* @throws IOException IOException
|
||||
* @throws TemplateException TemplateException
|
||||
*/
|
||||
|
|
|
@ -70,7 +70,6 @@ public class FrontPageController extends BaseController {
|
|||
*
|
||||
* @param postUrl 页面路径
|
||||
* @param model model
|
||||
*
|
||||
* @return 模板路径/themes/{theme}/post
|
||||
*/
|
||||
@GetMapping(value = "/p/{postUrl}")
|
||||
|
|
|
@ -23,8 +23,8 @@ import org.springframework.web.bind.annotation.PathVariable;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import static org.springframework.data.domain.Sort.Direction.DESC;
|
||||
import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
|
||||
import static org.springframework.data.domain.Sort.Direction.DESC;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
|
@ -47,7 +47,6 @@ public class FrontSearchController extends BaseController {
|
|||
*
|
||||
* @param model model
|
||||
* @param keyword 关键词
|
||||
*
|
||||
* @return 模板路径/themes/{theme}/search
|
||||
*/
|
||||
@GetMapping
|
||||
|
@ -62,7 +61,6 @@ public class FrontSearchController extends BaseController {
|
|||
* @param model model
|
||||
* @param keyword 关键词
|
||||
* @param page 当前页码
|
||||
*
|
||||
* @return 模板路径/themes/{theme}/search
|
||||
*/
|
||||
@GetMapping(value = "page/{page}")
|
||||
|
|
|
@ -20,8 +20,8 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import static org.springframework.data.domain.Sort.Direction.DESC;
|
||||
import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
|
||||
import static org.springframework.data.domain.Sort.Direction.DESC;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
|
|
Loading…
Reference in New Issue