IDEA代码优化
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
package cn.celess.blog.service;
|
||||
|
||||
import cn.celess.blog.entity.Category;
|
||||
import cn.celess.blog.entity.model.CategoryModel;
|
||||
import cn.celess.blog.entity.model.PageData;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : xiaohai
|
||||
* @date : 2019/03/28 22:42
|
||||
|
||||
@@ -3,7 +3,6 @@ package cn.celess.blog.service;
|
||||
import cn.celess.blog.entity.model.CommentModel;
|
||||
import cn.celess.blog.entity.model.PageData;
|
||||
import cn.celess.blog.entity.request.CommentReq;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
package cn.celess.blog.service;
|
||||
|
||||
import cn.celess.blog.entity.Tag;
|
||||
import cn.celess.blog.entity.model.PageData;
|
||||
import cn.celess.blog.entity.model.TagModel;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
package cn.celess.blog.service;
|
||||
|
||||
import cn.celess.blog.entity.User;
|
||||
import cn.celess.blog.entity.model.PageData;
|
||||
import cn.celess.blog.entity.model.UserModel;
|
||||
import cn.celess.blog.entity.request.LoginReq;
|
||||
import cn.celess.blog.entity.request.UserReq;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author : xiaohai
|
||||
@@ -154,8 +149,9 @@ public interface UserService {
|
||||
|
||||
/**
|
||||
* 设置密码
|
||||
* @param pwd pwd
|
||||
* @param newPwd newPwd
|
||||
*
|
||||
* @param pwd pwd
|
||||
* @param newPwd newPwd
|
||||
* @param confirmPwd confirmPwd
|
||||
* @return UserModel
|
||||
*/
|
||||
|
||||
@@ -2,7 +2,6 @@ package cn.celess.blog.service;
|
||||
|
||||
import cn.celess.blog.entity.model.PageData;
|
||||
import cn.celess.blog.entity.model.VisitorModel;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
@@ -2,7 +2,6 @@ package cn.celess.blog.service;
|
||||
|
||||
import cn.celess.blog.entity.model.PageData;
|
||||
import cn.celess.blog.entity.model.WebUpdateModel;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import net.sf.json.JSONObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@@ -10,7 +10,10 @@ import cn.celess.blog.exception.MyException;
|
||||
import cn.celess.blog.mapper.*;
|
||||
import cn.celess.blog.service.ArticleService;
|
||||
import cn.celess.blog.service.UserService;
|
||||
import cn.celess.blog.util.*;
|
||||
import cn.celess.blog.util.ModalTrans;
|
||||
import cn.celess.blog.util.RedisUserUtil;
|
||||
import cn.celess.blog.util.RegexUtil;
|
||||
import cn.celess.blog.util.StringFromHtmlUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.youbenzi.mdtool.tool.MDTool;
|
||||
@@ -22,7 +25,6 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ import cn.celess.blog.mapper.ArticleMapper;
|
||||
import cn.celess.blog.mapper.CommentMapper;
|
||||
import cn.celess.blog.mapper.UserMapper;
|
||||
import cn.celess.blog.service.CommentService;
|
||||
import cn.celess.blog.service.UserService;
|
||||
import cn.celess.blog.util.DateFormatUtil;
|
||||
import cn.celess.blog.util.ModalTrans;
|
||||
import cn.celess.blog.util.RedisUserUtil;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
@@ -23,7 +21,6 @@ import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -76,10 +73,10 @@ public class CommentServiceImpl implements CommentService {
|
||||
@Override
|
||||
public boolean delete(long id) {
|
||||
Comment b = commentMapper.findCommentById(id);
|
||||
if (b == null ) {
|
||||
if (b == null) {
|
||||
throw new MyException(ResponseEnum.COMMENT_NOT_EXIST);
|
||||
}
|
||||
if(b.isDelete()){
|
||||
if (b.isDelete()) {
|
||||
throw new MyException(ResponseEnum.DATA_IS_DELETED);
|
||||
}
|
||||
commentMapper.delete(id);
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.io.InputStream;
|
||||
*/
|
||||
@Service
|
||||
public class QiniuServiceImpl implements QiniuService {
|
||||
private static Configuration cfg = new Configuration(Zone.zone2());
|
||||
private static final Configuration cfg = new Configuration(Zone.zone2());
|
||||
private static UploadManager uploadManager;
|
||||
private static BucketManager bucketManager;
|
||||
private static Auth auth;
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
package cn.celess.blog.service.serviceimpl;
|
||||
|
||||
import cn.celess.blog.enmu.ResponseEnum;
|
||||
import cn.celess.blog.entity.Article;
|
||||
import cn.celess.blog.entity.ArticleTag;
|
||||
import cn.celess.blog.entity.Tag;
|
||||
import cn.celess.blog.entity.TagCategory;
|
||||
import cn.celess.blog.entity.model.ArticleModel;
|
||||
import cn.celess.blog.entity.model.PageData;
|
||||
import cn.celess.blog.entity.model.TagModel;
|
||||
|
||||
Reference in New Issue
Block a user