🎨 代码优化

pull/216/head
ruibaby 2019-01-31 23:20:21 +08:00
parent e0e3be00bb
commit 1e648ddc45
44 changed files with 56 additions and 182 deletions

View File

@ -38,5 +38,5 @@ public class HaloConst {
/** /**
* *
*/ */
public static Map<Long,Long> POSTS_VIEWS = new HashMap<>(); public static Map<Long, Long> POSTS_VIEWS = new HashMap<>();
} }

View File

@ -13,17 +13,17 @@ public enum AttachLocationEnum {
/** /**
* *
*/ */
SERVER(0,"server"), SERVER(0, "server"),
/** /**
* *
*/ */
QINIU(1,"qiniu"), QINIU(1, "qiniu"),
/** /**
* *
*/ */
UPYUN(2,"upyun"); UPYUN(2, "upyun");
private Integer code; private Integer code;
private String desc; private String desc;

View File

@ -1,8 +1,6 @@
package cc.ryanc.halo.repository; package cc.ryanc.halo.repository;
import cc.ryanc.halo.model.domain.Attachment; 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; import org.springframework.data.jpa.repository.JpaRepository;
/** /**

View File

@ -96,6 +96,6 @@ public interface CommentRepository extends JpaRepository<Comment, Long> {
* @param limit * @param limit
* @return List * @return List
*/ */
@Query(value = "SELECT * FROM halo_comment WHERE comment_status = 0 ORDER BY comment_date DESC LIMIT :limit",nativeQuery = true) @Query(value = "SELECT * FROM halo_comment WHERE comment_status = 0 ORDER BY comment_date DESC LIMIT :limit", nativeQuery = true)
List<Comment> getCommentsByLimit(@Param(value = "limit") int limit); List<Comment> getCommentsByLimit(@Param(value = "limit") int limit);
} }

View File

@ -5,7 +5,6 @@ import cc.ryanc.halo.model.domain.Post;
import cc.ryanc.halo.model.domain.Tag; import cc.ryanc.halo.model.domain.Tag;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; 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.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor; import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query; import org.springframework.data.jpa.repository.Query;

View File

@ -63,7 +63,6 @@ public class AttachmentServiceImpl implements AttachmentService {
* *
* *
* @param attachment attachment * @param attachment attachment
*
* @return Attachment * @return Attachment
*/ */
@Override @Override
@ -87,7 +86,6 @@ public class AttachmentServiceImpl implements AttachmentService {
* *
* *
* @param pageable pageable * @param pageable pageable
*
* @return Page * @return Page
*/ */
@Override @Override
@ -99,7 +97,6 @@ public class AttachmentServiceImpl implements AttachmentService {
* id * id
* *
* @param attachId attachId * @param attachId attachId
*
* @return Optional * @return Optional
*/ */
@Override @Override
@ -111,7 +108,6 @@ public class AttachmentServiceImpl implements AttachmentService {
* *
* *
* @param attachId attachId * @param attachId attachId
*
* @return Attachment * @return Attachment
*/ */
@Override @Override
@ -127,7 +123,6 @@ public class AttachmentServiceImpl implements AttachmentService {
* *
* @param file file * @param file file
* @param request request * @param request request
*
* @return Map * @return Map
*/ */
@Override @Override
@ -159,7 +154,6 @@ public class AttachmentServiceImpl implements AttachmentService {
* *
* @param file file * @param file file
* @param request request * @param request request
*
* @return Map * @return Map
*/ */
@Override @Override
@ -251,7 +245,6 @@ public class AttachmentServiceImpl implements AttachmentService {
* *
* @param file file * @param file file
* @param request request * @param request request
*
* @return Map * @return Map
*/ */
@Override @Override
@ -312,7 +305,6 @@ public class AttachmentServiceImpl implements AttachmentService {
* *
* @param file file * @param file file
* @param request request * @param request request
*
* @return Map * @return Map
*/ */
@Override @Override
@ -362,7 +354,6 @@ public class AttachmentServiceImpl implements AttachmentService {
* *
* *
* @param key key * @param key key
*
* @return boolean * @return boolean
*/ */
@Override @Override
@ -391,7 +382,6 @@ public class AttachmentServiceImpl implements AttachmentService {
* *
* *
* @param fileName fileName * @param fileName fileName
*
* @return boolean * @return boolean
*/ */
@Override @Override

View File

@ -10,7 +10,6 @@ import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**

View File

@ -23,11 +23,10 @@ import java.util.Map;
@Service @Service
public class OptionsServiceImpl implements OptionsService { public class OptionsServiceImpl implements OptionsService {
private static final String POSTS_CACHE_NAME = "posts";
@Autowired @Autowired
private OptionsRepository optionsRepository; private OptionsRepository optionsRepository;
private static final String POSTS_CACHE_NAME = "posts";
/** /**
* *
* *

View File

@ -11,7 +11,6 @@ import cc.ryanc.halo.repository.PostRepository;
import cc.ryanc.halo.service.CategoryService; import cc.ryanc.halo.service.CategoryService;
import cc.ryanc.halo.service.PostService; import cc.ryanc.halo.service.PostService;
import cc.ryanc.halo.service.TagService; import cc.ryanc.halo.service.TagService;
import cc.ryanc.halo.utils.HaloUtils;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HtmlUtil; import cn.hutool.http.HtmlUtil;
import org.springframework.beans.factory.annotation.Autowired; 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.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification; import org.springframework.data.jpa.domain.Specification;
import org.springframework.data.jpa.domain.Specifications;
import org.springframework.lang.NonNull; import org.springframework.lang.NonNull;
import org.springframework.lang.Nullable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import javax.persistence.criteria.CriteriaBuilder; import java.util.ArrayList;
import javax.persistence.criteria.CriteriaQuery; import java.util.Date;
import javax.persistence.criteria.Predicate; import java.util.List;
import javax.persistence.criteria.Root; import java.util.Optional;
import java.util.*;
import static org.springframework.data.jpa.domain.Specification.where;
import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS; import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
import static cc.ryanc.halo.model.dto.HaloConst.POSTS_VIEWS; import static cc.ryanc.halo.model.dto.HaloConst.POSTS_VIEWS;
@ -67,7 +60,6 @@ public class PostServiceImpl implements PostService {
* *
* *
* @param post Post * @param post Post
*
* @return Post * @return Post
*/ */
@Override @Override
@ -91,7 +83,6 @@ public class PostServiceImpl implements PostService {
* *
* *
* @param postId postId * @param postId postId
*
* @return Post * @return Post
*/ */
@Override @Override
@ -107,7 +98,6 @@ public class PostServiceImpl implements PostService {
* *
* @param postId postId * @param postId postId
* @param status status * @param status status
*
* @return Post * @return Post
*/ */
@Override @Override
@ -142,7 +132,6 @@ public class PostServiceImpl implements PostService {
* *
* *
* @param postType post or page * @param postType post or page
*
* @return List * @return List
*/ */
@Override @Override
@ -158,7 +147,6 @@ public class PostServiceImpl implements PostService {
* @param postType * @param postType
* @param postStatus * @param postStatus
* @param pageable * @param pageable
*
* @return Page * @return Page
*/ */
@Override @Override
@ -196,7 +184,6 @@ public class PostServiceImpl implements PostService {
* @param status 012 * @param status 012
* @param postType post or page * @param postType post or page
* @param pageable * @param pageable
*
* @return Page * @return Page
*/ */
@Override @Override
@ -213,7 +200,6 @@ public class PostServiceImpl implements PostService {
* *
* *
* @param pageable pageable * @param pageable pageable
*
* @return Page * @return Page
*/ */
@Override @Override
@ -232,7 +218,6 @@ public class PostServiceImpl implements PostService {
* *
* @param status 012 * @param status 012
* @param postType post or page * @param postType post or page
*
* @return List * @return List
*/ */
@Override @Override
@ -245,7 +230,6 @@ public class PostServiceImpl implements PostService {
* *
* *
* @param postId postId * @param postId postId
*
* @return Optional * @return Optional
*/ */
@Override @Override
@ -257,7 +241,6 @@ public class PostServiceImpl implements PostService {
* *
* *
* @param postId postId * @param postId postId
*
* @return Post * @return Post
*/ */
@Override @Override
@ -270,7 +253,6 @@ public class PostServiceImpl implements PostService {
* *
* @param postUrl * @param postUrl
* @param postType post or page * @param postType post or page
*
* @return Post * @return Post
*/ */
@Override @Override
@ -294,7 +276,6 @@ public class PostServiceImpl implements PostService {
* *
* *
* @param postDate postDate * @param postDate postDate
*
* @return Post * @return Post
*/ */
@Override @Override
@ -306,7 +287,6 @@ public class PostServiceImpl implements PostService {
* *
* *
* @param postDate postDate * @param postDate postDate
*
* @return Post * @return Post
*/ */
@Override @Override
@ -359,7 +339,6 @@ public class PostServiceImpl implements PostService {
/** /**
* @return List * @return List
*
* @Author Aquan * @Author Aquan
* @Description * @Description
* @Date 2019.1.4 11:16 * @Date 2019.1.4 11:16
@ -386,7 +365,6 @@ public class PostServiceImpl implements PostService {
* *
* @param year year * @param year year
* @param month month * @param month month
*
* @return List * @return List
*/ */
@Override @Override
@ -399,7 +377,6 @@ public class PostServiceImpl implements PostService {
* *
* *
* @param year year * @param year year
*
* @return List * @return List
*/ */
@Override @Override
@ -414,7 +391,6 @@ public class PostServiceImpl implements PostService {
* @param year year year * @param year year year
* @param month month month * @param month month month
* @param pageable pageable pageable * @param pageable pageable pageable
*
* @return Page * @return Page
*/ */
@Override @Override
@ -432,7 +408,6 @@ public class PostServiceImpl implements PostService {
* *
* @param category category * @param category category
* @param pageable pageable * @param pageable pageable
*
* @return Page * @return Page
*/ */
@Override @Override
@ -451,7 +426,6 @@ public class PostServiceImpl implements PostService {
* *
* @param tag tag * @param tag tag
* @param pageable pageable * @param pageable pageable
*
* @return Page * @return Page
*/ */
@Override @Override
@ -480,7 +454,6 @@ public class PostServiceImpl implements PostService {
* *
* *
* @param post post * @param post post
*
* @return List * @return List
*/ */
@Override @Override
@ -518,7 +491,6 @@ public class PostServiceImpl implements PostService {
* *
* *
* @param status * @param status
*
* @return * @return
*/ */
@Override @Override
@ -546,7 +518,6 @@ public class PostServiceImpl implements PostService {
* @param post post * @param post post
* @param cateList cateList * @param cateList cateList
* @param tagList tagList * @param tagList tagList
*
* @return Post Post * @return Post Post
*/ */
@Override @Override
@ -564,7 +535,6 @@ public class PostServiceImpl implements PostService {
* *
* *
* @param limit * @param limit
*
* @return List * @return List
*/ */
@Override @Override

View File

@ -39,7 +39,6 @@ public class HaloUtils {
* *
* *
* @param dir dir * @param dir dir
*
* @return List * @return List
*/ */
public static List<BackupDto> getBackUps(String dir) { public static List<BackupDto> getBackUps(String dir) {
@ -74,7 +73,6 @@ public class HaloUtils {
* *
* *
* @param size size * @param size size
*
* @return String * @return String
*/ */
public static String parseSize(long size) { public static String parseSize(long size) {
@ -101,7 +99,6 @@ public class HaloUtils {
* *
* *
* @param srcPath * @param srcPath
*
* @return * @return
*/ */
public static Date getCreateTime(String srcPath) { public static Date getCreateTime(String srcPath) {
@ -124,7 +121,6 @@ public class HaloUtils {
* *
* *
* @param file file * @param file file
*
* @return String * @return String
*/ */
public static String getImageWh(File file) { public static String getImageWh(File file) {
@ -186,7 +182,6 @@ public class HaloUtils {
* *
* *
* @param theme theme * @param theme theme
*
* @return List * @return List
*/ */
public static List<String> getTplName(String theme) { public static List<String> getTplName(String theme) {
@ -294,7 +289,6 @@ public class HaloUtils {
* @param blogUrl * @param blogUrl
* @param token token * @param token token
* @param urls * @param urls
*
* @return String * @return String
*/ */
public static String baiduPost(String blogUrl, String token, String urls) { public static String baiduPost(String blogUrl, String token, String urls) {

View File

@ -21,36 +21,36 @@ public class LocaleMessageUtil {
@Autowired @Autowired
private MessageSource messageSource; private MessageSource messageSource;
public String getMessage(String code){ public String getMessage(String code) {
return this.getMessage(code,new Object[]{}); return this.getMessage(code, new Object[]{});
} }
public String getMessage(String code,String defaultMessage){ public String getMessage(String code, String defaultMessage) {
return this.getMessage(code,null,defaultMessage); return this.getMessage(code, null, defaultMessage);
} }
public String getMessage(String code, String defaultMessage, Locale locale){ public String getMessage(String code, String defaultMessage, Locale locale) {
return this.getMessage(code,null,defaultMessage,locale); return this.getMessage(code, null, defaultMessage, locale);
} }
public String getMessage(String code,Locale locale){ public String getMessage(String code, Locale locale) {
return this.getMessage(code,null,"",locale); return this.getMessage(code, null, "", locale);
} }
public String getMessage(String code,Object[] args){ public String getMessage(String code, Object[] args) {
return this.getMessage(code,args,""); return this.getMessage(code, args, "");
} }
public String getMessage(String code,Object[] args,Locale locale){ public String getMessage(String code, Object[] args, Locale locale) {
return this.getMessage(code,args,"",locale); return this.getMessage(code, args, "", locale);
} }
public String getMessage(String code,Object[] args,String defaultMessage){ public String getMessage(String code, Object[] args, String defaultMessage) {
Locale locale = LocaleContextHolder.getLocale(); Locale locale = LocaleContextHolder.getLocale();
return this.getMessage(code,args, defaultMessage,locale); return this.getMessage(code, args, defaultMessage, locale);
} }
public String getMessage(String code,Object[]args,String defaultMessage,Locale locale){ public String getMessage(String code, Object[] args, String defaultMessage, Locale locale) {
return messageSource.getMessage(code,args, defaultMessage,locale); return messageSource.getMessage(code, args, defaultMessage, locale);
} }
} }

View File

@ -43,7 +43,6 @@ public class MarkdownUtils {
* Markdown * Markdown
* *
* @param content content * @param content content
*
* @return String * @return String
*/ */
public static String renderMarkdown(String content) { public static String renderMarkdown(String content) {
@ -55,7 +54,6 @@ public class MarkdownUtils {
* *
* *
* @param content content * @param content content
*
* @return Map * @return Map
*/ */
public static Map<String, List<String>> getFrontMatter(String content) { public static Map<String, List<String>> getFrontMatter(String content) {

View File

@ -20,9 +20,7 @@ public class Md5Util {
* MD5 * MD5
* *
* @param file file * @param file file
*
* @return byte * @return byte
*
* @throws Exception Exception * @throws Exception Exception
*/ */
private static byte[] createChecksum(MultipartFile file) throws Exception { private static byte[] createChecksum(MultipartFile file) throws Exception {
@ -47,9 +45,7 @@ public class Md5Util {
* hash * hash
* *
* @param file file * @param file file
*
* @return String * @return String
*
* @throws Exception Exception * @throws Exception Exception
*/ */
public static String getMD5Checksum(MultipartFile file) throws Exception { public static String getMD5Checksum(MultipartFile file) throws Exception {

View File

@ -19,7 +19,6 @@ public class OwoUtil {
* *
* *
* @param mark * @param mark
*
* @return * @return
*/ */
public static String markToImg(String mark) { public static String markToImg(String mark) {

View File

@ -20,7 +20,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault; import org.springframework.data.web.PageableDefault;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
@ -78,7 +77,7 @@ public class AdminController extends BaseController {
/** /**
* *
* *
* @param model model * @param model model
* @return admin/admin_index * @return admin/admin_index
*/ */
@GetMapping(value = {"", "/index"}) @GetMapping(value = {"", "/index"})
@ -118,7 +117,6 @@ public class AdminController extends BaseController {
* *
* *
* @param session session * @param session session
*
* @return admin/admin_login * @return admin/admin_login
*/ */
@GetMapping(value = "/login") @GetMapping(value = "/login")
@ -137,7 +135,6 @@ public class AdminController extends BaseController {
* @param loginName * @param loginName
* @param loginPwd loginPwd * @param loginPwd loginPwd
* @param session session session * @param session session session
*
* @return JsonResult JsonResult * @return JsonResult JsonResult
*/ */
@PostMapping(value = "/getLogin") @PostMapping(value = "/getLogin")
@ -189,7 +186,6 @@ public class AdminController extends BaseController {
* 退 session * 退 session
* *
* @param session session * @param session session
*
* @return /admin/login * @return /admin/login
*/ */
@GetMapping(value = "/logOut") @GetMapping(value = "/logOut")
@ -209,7 +205,6 @@ public class AdminController extends BaseController {
*/ */
@GetMapping(value = "/logs") @GetMapping(value = "/logs")
public String logs(Model model, @PageableDefault Pageable pageable) { public String logs(Model model, @PageableDefault Pageable pageable) {
final Sort sort = new Sort(Sort.Direction.DESC, "logId");
final Page<Logs> logs = logsService.findAll(pageable); final Page<Logs> logs = logsService.findAll(pageable);
model.addAttribute("logs", logs); model.addAttribute("logs", logs);
return "admin/widget/_logs-all"; return "admin/widget/_logs-all";
@ -278,7 +273,6 @@ public class AdminController extends BaseController {
* *
* @param file file * @param file file
* @param request request * @param request request
*
* @return JsonResult * @return JsonResult
*/ */
@PostMapping(value = "/tools/markdownImport") @PostMapping(value = "/tools/markdownImport")

View File

@ -62,7 +62,6 @@ public class BackupController {
* *
* *
* @param model model * @param model model
*
* @return admin/admin_backup * @return admin/admin_backup
*/ */
@GetMapping @GetMapping
@ -86,7 +85,6 @@ public class BackupController {
* *
* *
* @param type * @param type
*
* @return JsonResult * @return JsonResult
*/ */
@GetMapping(value = "doBackup") @GetMapping(value = "doBackup")
@ -208,7 +206,6 @@ public class BackupController {
* *
* @param fileName * @param fileName
* @param type * @param type
*
* @return JsonResult * @return JsonResult
*/ */
@GetMapping(value = "delBackup") @GetMapping(value = "delBackup")
@ -229,7 +226,6 @@ public class BackupController {
* *
* @param fileName * @param fileName
* @param type * @param type
*
* @return JsonResult * @return JsonResult
*/ */
@GetMapping(value = "sendToEmail") @GetMapping(value = "sendToEmail")

View File

@ -49,7 +49,6 @@ public class CategoryController {
* / * /
* *
* @param category category * @param category category
*
* @return JsonResult * @return JsonResult
*/ */
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ -81,7 +80,6 @@ public class CategoryController {
* *
* *
* @param cateId cateId * @param cateId cateId
*
* @return /admin/category * @return /admin/category
*/ */
@GetMapping(value = "/remove") @GetMapping(value = "/remove")
@ -99,7 +97,6 @@ public class CategoryController {
* *
* @param cateId cateId * @param cateId cateId
* @param model model * @param model model
*
* @return admin/admin_category * @return admin/admin_category
*/ */
@GetMapping(value = "/edit") @GetMapping(value = "/edit")

View File

@ -19,7 +19,6 @@ import cn.hutool.http.HtmlUtil;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault; import org.springframework.data.web.PageableDefault;

View File

@ -52,7 +52,6 @@ public class OptionController {
* *
* *
* @param options options * @param options options
*
* @return JsonResult * @return JsonResult
*/ */
@PostMapping(value = "/save") @PostMapping(value = "/save")

View File

@ -23,7 +23,6 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.propertyeditors.CustomDateEditor; import org.springframework.beans.propertyeditors.CustomDateEditor;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort; import org.springframework.data.domain.Sort;
import org.springframework.data.web.PageableDefault; import org.springframework.data.web.PageableDefault;

View File

@ -68,7 +68,6 @@ public class PostController extends BaseController {
* htmlhtm- * htmlhtm-
* *
* @param url url * @param url url
*
* @return String * @return String
*/ */
private static String urlFilter(String url) { private static String urlFilter(String url) {
@ -125,7 +124,6 @@ public class PostController extends BaseController {
* *
* @param postId * @param postId
* @param model model * @param model model
*
* @return /themes/{theme}/post * @return /themes/{theme}/post
*/ */
@GetMapping(value = "/view") @GetMapping(value = "/view")
@ -150,7 +148,6 @@ public class PostController extends BaseController {
* *
* @param postId * @param postId
* @param model model * @param model model
*
* @return admin/admin_editor * @return admin/admin_editor
*/ */
@GetMapping(value = "/edit") @GetMapping(value = "/edit")
@ -238,7 +235,6 @@ public class PostController extends BaseController {
* *
* *
* @param postId * @param postId
*
* @return /admin/posts * @return /admin/posts
*/ */
@GetMapping(value = "/throw") @GetMapping(value = "/throw")
@ -256,7 +252,6 @@ public class PostController extends BaseController {
* *
* *
* @param postId * @param postId
*
* @return /admin/posts * @return /admin/posts
*/ */
@GetMapping(value = "/revert") @GetMapping(value = "/revert")
@ -275,7 +270,6 @@ public class PostController extends BaseController {
* *
* *
* @param postId * @param postId
*
* @return /admin/posts * @return /admin/posts
*/ */
@GetMapping(value = "/remove") @GetMapping(value = "/remove")
@ -297,7 +291,6 @@ public class PostController extends BaseController {
* *
* *
* @param postSummary * @param postSummary
*
* @return JsonResult * @return JsonResult
*/ */
@GetMapping(value = "/updateSummary") @GetMapping(value = "/updateSummary")
@ -317,7 +310,6 @@ public class PostController extends BaseController {
* *
* *
* @param postUrl * @param postUrl
*
* @return JsonResult * @return JsonResult
*/ */
@GetMapping(value = "/checkUrl") @GetMapping(value = "/checkUrl")
@ -335,7 +327,6 @@ public class PostController extends BaseController {
* *
* *
* @param baiduToken baiduToken * @param baiduToken baiduToken
*
* @return JsonResult * @return JsonResult
*/ */
@GetMapping(value = "/pushAllToBaidu") @GetMapping(value = "/pushAllToBaidu")

View File

@ -48,7 +48,6 @@ public class TagController {
* / * /
* *
* @param tag tag * @param tag tag
*
* @return JsonResult * @return JsonResult
*/ */
@PostMapping(value = "/save") @PostMapping(value = "/save")
@ -80,7 +79,6 @@ public class TagController {
* *
* *
* @param tagId * @param tagId
*
* @return /admin/tag * @return /admin/tag
*/ */
@GetMapping(value = "/remove") @GetMapping(value = "/remove")
@ -98,7 +96,6 @@ public class TagController {
* *
* @param model model * @param model model
* @param tagId * @param tagId
*
* @return admin/admin_tag * @return admin/admin_tag
*/ */
@GetMapping(value = "/edit") @GetMapping(value = "/edit")

View File

@ -66,7 +66,6 @@ public class ThemeController extends BaseController {
* *
* *
* @param model model * @param model model
*
* @return admin/admin_theme * @return admin/admin_theme
*/ */
@GetMapping @GetMapping
@ -83,7 +82,6 @@ public class ThemeController extends BaseController {
* *
* @param siteTheme * @param siteTheme
* @param request request * @param request request
*
* @return JsonResult * @return JsonResult
*/ */
@GetMapping(value = "/set") @GetMapping(value = "/set")
@ -113,7 +111,6 @@ public class ThemeController extends BaseController {
* *
* *
* @param file * @param file
*
* @return JsonResult * @return JsonResult
*/ */
@RequestMapping(value = "/upload", method = RequestMethod.POST) @RequestMapping(value = "/upload", method = RequestMethod.POST)
@ -147,7 +144,6 @@ public class ThemeController extends BaseController {
* *
* *
* @param themeName * @param themeName
*
* @return string /admin/themes * @return string /admin/themes
*/ */
@GetMapping(value = "/remove") @GetMapping(value = "/remove")
@ -179,7 +175,6 @@ public class ThemeController extends BaseController {
* *
* @param remoteAddr * @param remoteAddr
* @param themeName * @param themeName
*
* @return JsonResult * @return JsonResult
*/ */
@PostMapping(value = "/clone") @PostMapping(value = "/clone")
@ -209,7 +204,6 @@ public class ThemeController extends BaseController {
* *
* *
* @param themeName * @param themeName
*
* @return JsonResult * @return JsonResult
*/ */
@GetMapping(value = "/pull") @GetMapping(value = "/pull")
@ -253,7 +247,6 @@ public class ThemeController extends BaseController {
* *
* *
* @param model model * @param model model
*
* @return admin/admin_theme-editor * @return admin/admin_theme-editor
*/ */
@GetMapping(value = "/editor") @GetMapping(value = "/editor")
@ -267,7 +260,6 @@ public class ThemeController extends BaseController {
* *
* *
* @param tplName * @param tplName
*
* @return * @return
*/ */
@GetMapping(value = "/getTpl", produces = "text/text;charset=UTF-8") @GetMapping(value = "/getTpl", produces = "text/text;charset=UTF-8")
@ -296,7 +288,6 @@ public class ThemeController extends BaseController {
* *
* @param tplName * @param tplName
* @param tplContent * @param tplContent
*
* @return JsonResult * @return JsonResult
*/ */
@PostMapping(value = "/editor/save") @PostMapping(value = "/editor/save")

View File

@ -56,7 +56,6 @@ public class UserController {
* *
* @param user user * @param user user
* @param session session * @param session session
*
* @return JsonResult * @return JsonResult
*/ */
@PostMapping(value = "save") @PostMapping(value = "save")
@ -85,7 +84,6 @@ public class UserController {
* @param newPass * @param newPass
* @param userId * @param userId
* @param session session * @param session session
*
* @return JsonResult * @return JsonResult
*/ */
@PostMapping(value = "changePass") @PostMapping(value = "changePass")

View File

@ -32,8 +32,8 @@ public class ApiArchivesController {
* *
* *
* <p> * <p>
* result json: * result json:
* <pre> * <pre>
* { * {
* "code": 200, * "code": 200,
* "msg": "OK", * "msg": "OK",
@ -86,8 +86,8 @@ public class ApiArchivesController {
* *
* *
* <p> * <p>
* result json: * result json:
* <pre> * <pre>
* { * {
* "code": 200, * "code": 200,
* "msg": "OK", * "msg": "OK",
@ -137,11 +137,11 @@ public class ApiArchivesController {
} }
/** /**
* @return JsonResult
* @Author Aquan * @Author Aquan
* @Description * @Description
* @Date 2019.1.4 11:06 * @Date 2019.1.4 11:06
* @Param * @Param
* @return JsonResult
**/ **/
@GetMapping(value = "/all") @GetMapping(value = "/all")
public JsonResult archivesAllPost() { public JsonResult archivesAllPost() {

View File

@ -29,8 +29,8 @@ public class ApiCategoryController {
* *
* *
* <p> * <p>
* result json: * result json:
* <pre> * <pre>
* { * {
* "code": 200, * "code": 200,
* "msg": "OK", * "msg": "OK",
@ -62,8 +62,8 @@ public class ApiCategoryController {
* *
* *
* <p> * <p>
* result json: * result json:
* <pre> * <pre>
* { * {
* "code": 200, * "code": 200,
* "msg": "OK", * "msg": "OK",

View File

@ -51,7 +51,6 @@ public class ApiCommentController {
* @param result result * @param result result
* @param postId postId * @param postId postId
* @param request request * @param request request
*
* @return JsonResult * @return JsonResult
*/ */
@PostMapping(value = "/save") @PostMapping(value = "/save")

View File

@ -30,8 +30,8 @@ public class ApiGalleryController {
* *
* *
* <p> * <p>
* result json: * result json:
* <pre> * <pre>
* { * {
* "code": 200, * "code": 200,
* "msg": "OK", * "msg": "OK",
@ -66,8 +66,8 @@ public class ApiGalleryController {
* *
* *
* <p> * <p>
* result json: * result json:
* <pre> * <pre>
* { * {
* "code": 200, * "code": 200,
* "msg": "OK", * "msg": "OK",

View File

@ -32,8 +32,8 @@ public class ApiLinkController {
* *
* *
* <p> * <p>
* result json: * result json:
* <pre> * <pre>
* { * {
* "code": 200, * "code": 200,
* "msg": "OK", * "msg": "OK",

View File

@ -32,8 +32,8 @@ public class ApiMenuController {
* *
* *
* <p> * <p>
* result json: * result json:
* <pre> * <pre>
* { * {
* "code": 200, * "code": 200,
* "msg": "OK", * "msg": "OK",

View File

@ -48,7 +48,6 @@ public class ApiMetaWeBlog {
/** /**
* @param request request * @param request request
*
* @return String * @return String
*/ */
@PostMapping @PostMapping
@ -126,9 +125,7 @@ public class ApiMetaWeBlog {
/** /**
* @param methodCall * @param methodCall
*
* @return * @return
*
* @throws Exception * @throws Exception
*/ */
private Post parsetPost(final JSONObject methodCall) throws Exception { private Post parsetPost(final JSONObject methodCall) throws Exception {
@ -165,7 +162,6 @@ public class ApiMetaWeBlog {
* *
* *
* @param postId * @param postId
*
* @return xml * @return xml
*/ */
private String getPost(Long postId) { private String getPost(Long postId) {
@ -180,7 +176,6 @@ public class ApiMetaWeBlog {
* *
* *
* @param postId * @param postId
*
* @return xml * @return xml
*/ */
private String buildPost(final Long postId) { private String buildPost(final Long postId) {
@ -248,7 +243,6 @@ public class ApiMetaWeBlog {
* *
* *
* @return xml * @return xml
*
* @throws Exception Exception * @throws Exception Exception
*/ */
private String getCategories() throws Exception { private String getCategories() throws Exception {
@ -265,7 +259,6 @@ public class ApiMetaWeBlog {
* *
* *
* @return xml * @return xml
*
* @throws Exception Exception * @throws Exception Exception
*/ */
private String buildCategories() throws Exception { private String buildCategories() throws Exception {

View File

@ -82,7 +82,6 @@ public class ApiOptionController {
* </p> * </p>
* *
* @param optionName * @param optionName
*
* @return JsonResult * @return JsonResult
*/ */
@GetMapping(value = "/one") @GetMapping(value = "/one")

View File

@ -58,7 +58,6 @@ public class ApiPageController {
* </p> * </p>
* *
* @param postId postId * @param postId postId
*
* @return JsonResult * @return JsonResult
*/ */
@GetMapping(value = "/{postId}") @GetMapping(value = "/{postId}")

View File

@ -29,8 +29,8 @@ public class ApiTagController {
* *
* *
* <p> * <p>
* result json: * result json:
* <pre> * <pre>
* { * {
* "code": 200, * "code": 200,
* "msg": "OK", * "msg": "OK",
@ -61,8 +61,8 @@ public class ApiTagController {
* *
* *
* <p> * <p>
* result json: * result json:
* <pre> * <pre>
* { * {
* "code": 200, * "code": 200,
* "msg": "OK", * "msg": "OK",

View File

@ -30,8 +30,8 @@ public class ApiUserController {
* *
* *
* <p> * <p>
* result json: * result json:
* <pre> * <pre>
* { * {
* "code": 200, * "code": 200,
* "msg": "OK", * "msg": "OK",

View File

@ -23,7 +23,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import static cc.ryanc.halo.model.dto.HaloConst.*; import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
/** /**
* <pre> * <pre>
@ -66,7 +66,6 @@ public class InstallController {
* *
* *
* @param model model * @param model model
*
* @return * @return
*/ */
@GetMapping @GetMapping
@ -92,7 +91,6 @@ public class InstallController {
* @param userEmail * @param userEmail
* @param userPwd * @param userPwd
* @param request request * @param request request
*
* @return JsonResult * @return JsonResult
*/ */
@PostMapping(value = "/do") @PostMapping(value = "/do")

View File

@ -33,8 +33,8 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import static org.springframework.data.domain.Sort.Direction.DESC;
import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS; import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* <pre> * <pre>
@ -61,7 +61,6 @@ public class FrontArchiveController extends BaseController {
* *
* *
* @param model model * @param model model
*
* @return * @return
*/ */
@GetMapping @GetMapping
@ -74,7 +73,6 @@ public class FrontArchiveController extends BaseController {
* *
* @param model model * @param model model
* @param page page * @param page page
*
* @return /themes/{theme}/archives * @return /themes/{theme}/archives
*/ */
@GetMapping(value = "page/{page}") @GetMapping(value = "page/{page}")
@ -98,7 +96,6 @@ public class FrontArchiveController extends BaseController {
* @param model model * @param model model
* @param year year * @param year year
* @param month month * @param month month
*
* @return /themes/{theme}/archives * @return /themes/{theme}/archives
*/ */
@GetMapping(value = "{year}/{month}") @GetMapping(value = "{year}/{month}")
@ -119,7 +116,6 @@ public class FrontArchiveController extends BaseController {
* *
* @param postUrl * @param postUrl
* @param model model * @param model model
*
* @return /themes/{theme}/post * @return /themes/{theme}/post
*/ */
@GetMapping(value = "{postUrl}") @GetMapping(value = "{postUrl}")
@ -193,7 +189,6 @@ public class FrontArchiveController extends BaseController {
* @param postId postId * @param postId postId
* @param postPassword postPassword * @param postPassword postPassword
* @param response response * @param response response
*
* @return String * @return String
*/ */
@PostMapping(value = "/verifyPostPassword") @PostMapping(value = "/verifyPostPassword")

View File

@ -22,8 +22,8 @@ import org.springframework.web.bind.annotation.RequestMapping;
import java.util.List; import java.util.List;
import static org.springframework.data.domain.Sort.Direction.DESC;
import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS; import static cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* <pre> * <pre>

View File

@ -65,7 +65,6 @@ public class FrontCommentController {
* @param comment comment * @param comment comment
* @param post post * @param post post
* @param request request * @param request request
*
* @return JsonResult * @return JsonResult
*/ */
@PostMapping(value = "/newComment") @PostMapping(value = "/newComment")

View File

@ -19,8 +19,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; 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 cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* <pre> * <pre>
@ -43,7 +43,6 @@ public class FrontIndexController extends BaseController {
* *
* *
* @param model model * @param model model
*
* @return * @return
*/ */
@GetMapping @GetMapping

View File

@ -45,9 +45,7 @@ public class FrontOthersController {
* rss * rss
* *
* @param model model * @param model model
*
* @return String * @return String
*
* @throws IOException IOException * @throws IOException IOException
* @throws TemplateException TemplateException * @throws TemplateException TemplateException
*/ */
@ -77,9 +75,7 @@ public class FrontOthersController {
* XML * XML
* *
* @param model model * @param model model
*
* @return String * @return String
*
* @throws IOException IOException * @throws IOException IOException
* @throws TemplateException TemplateException * @throws TemplateException TemplateException
*/ */
@ -103,7 +99,6 @@ public class FrontOthersController {
* HTML * HTML
* *
* @param model model * @param model model
*
* @return String * @return String
*/ */
@GetMapping(value = "sitemap.html", produces = {"text/html"}) @GetMapping(value = "sitemap.html", produces = {"text/html"})
@ -124,9 +119,7 @@ public class FrontOthersController {
* robots * robots
* *
* @param model model * @param model model
*
* @return String * @return String
*
* @throws IOException IOException * @throws IOException IOException
* @throws TemplateException TemplateException * @throws TemplateException TemplateException
*/ */

View File

@ -70,7 +70,6 @@ public class FrontPageController extends BaseController {
* *
* @param postUrl * @param postUrl
* @param model model * @param model model
*
* @return /themes/{theme}/post * @return /themes/{theme}/post
*/ */
@GetMapping(value = "/p/{postUrl}") @GetMapping(value = "/p/{postUrl}")

View File

@ -23,8 +23,8 @@ import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; 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 cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* <pre> * <pre>
@ -47,7 +47,6 @@ public class FrontSearchController extends BaseController {
* *
* @param model model * @param model model
* @param keyword * @param keyword
*
* @return /themes/{theme}/search * @return /themes/{theme}/search
*/ */
@GetMapping @GetMapping
@ -62,7 +61,6 @@ public class FrontSearchController extends BaseController {
* @param model model * @param model model
* @param keyword * @param keyword
* @param page * @param page
*
* @return /themes/{theme}/search * @return /themes/{theme}/search
*/ */
@GetMapping(value = "page/{page}") @GetMapping(value = "page/{page}")

View File

@ -20,8 +20,8 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping; 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 cc.ryanc.halo.model.dto.HaloConst.OPTIONS;
import static org.springframework.data.domain.Sort.Direction.DESC;
/** /**
* <pre> * <pre>