从"Blog"仓库中分离出来
This commit is contained in:
58
src/main/java/cn/celess/blog/mapper/ArticleMapper.java
Normal file
58
src/main/java/cn/celess/blog/mapper/ArticleMapper.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package cn.celess.blog.mapper;
|
||||
|
||||
import cn.celess.blog.entity.Article;
|
||||
import org.apache.ibatis.annotations.*;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: 小海
|
||||
* @Date: 2019/06/27 20:43
|
||||
* @Description:
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface ArticleMapper {
|
||||
|
||||
int insert(Article a);
|
||||
|
||||
int delete(long id);
|
||||
|
||||
int update(Article a);
|
||||
|
||||
int updateNextArticleId(long targetArticleID, long nextArticleID);
|
||||
|
||||
int updatePreArticleId(long targetArticleID, long preArticleID);
|
||||
|
||||
long getLastestArticleId();
|
||||
|
||||
Article getLastestArticle();
|
||||
|
||||
Article findArticleById(long id);
|
||||
|
||||
boolean existsByTitle(String title);
|
||||
|
||||
boolean existsById(long id);
|
||||
|
||||
List<Article> findAllByAuthorId(long authorID);
|
||||
|
||||
List<Article> findAllByOpen(boolean isOpen);
|
||||
|
||||
String getTitleById(long id);
|
||||
|
||||
List<Article> findAllByCategoryId(long id);
|
||||
|
||||
List<Article> findAll();
|
||||
|
||||
Article getSimpleInfo(long id);
|
||||
|
||||
List<Article> getSimpleInfoByCategory(long categoryId);
|
||||
|
||||
List<Article> getSimpleInfoByTag(List<String> idList);
|
||||
|
||||
int setReadingNumber(long number, long id);
|
||||
|
||||
long count();
|
||||
|
||||
}
|
||||
42
src/main/java/cn/celess/blog/mapper/CategoryMapper.java
Normal file
42
src/main/java/cn/celess/blog/mapper/CategoryMapper.java
Normal file
@@ -0,0 +1,42 @@
|
||||
package cn.celess.blog.mapper;
|
||||
|
||||
import cn.celess.blog.entity.Category;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: 小海
|
||||
* @Date: 2019/06/30 12:56
|
||||
* @Description:
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface CategoryMapper {
|
||||
int insert(Category c);
|
||||
|
||||
int delete(long id);
|
||||
|
||||
int update(Category c);
|
||||
|
||||
boolean existsByName(String name);
|
||||
|
||||
boolean existsById(long id);
|
||||
|
||||
Category findCategoryByName(String name);
|
||||
|
||||
Category findCategoryById(long id);
|
||||
|
||||
List<Category> findAll();
|
||||
|
||||
List<String> getAllName();
|
||||
|
||||
String getNameById(long id);
|
||||
|
||||
Long getIDByName(String name);
|
||||
|
||||
Category getLastestCategory();
|
||||
|
||||
long count();
|
||||
}
|
||||
48
src/main/java/cn/celess/blog/mapper/CommentMapper.java
Normal file
48
src/main/java/cn/celess/blog/mapper/CommentMapper.java
Normal file
@@ -0,0 +1,48 @@
|
||||
package cn.celess.blog.mapper;
|
||||
|
||||
import cn.celess.blog.entity.Comment;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: 小海
|
||||
* @Date: 2019/06/30 16:19
|
||||
* @Description:
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface CommentMapper {
|
||||
int insert(Comment c);
|
||||
|
||||
int updateContent(String content, long id);
|
||||
|
||||
int updateResponder(String responder, long id);
|
||||
|
||||
int delete(long id);
|
||||
|
||||
int deleteByArticleId(long articleId);
|
||||
|
||||
boolean existsById(long id);
|
||||
|
||||
Comment findCommentById(long id);
|
||||
|
||||
Comment getLastestComment();
|
||||
|
||||
List<Comment> findAllByAuthorIDAndType(long id, boolean isComment);
|
||||
|
||||
List<Comment> findAllByPId(long pid);
|
||||
|
||||
List<Comment> findAllByArticleID(long articleId);
|
||||
|
||||
List<Comment> findAllByArticleIDAndPId(long articleID, long pid);
|
||||
|
||||
List<Comment> findCommentsByTypeAndPId(boolean isComment, long pid);
|
||||
|
||||
List<Comment> findAllByPId(int pid);
|
||||
|
||||
List<Comment> findAllByType(boolean isComment);
|
||||
|
||||
long countByType(boolean isComment);
|
||||
}
|
||||
40
src/main/java/cn/celess/blog/mapper/PartnerMapper.java
Normal file
40
src/main/java/cn/celess/blog/mapper/PartnerMapper.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package cn.celess.blog.mapper;
|
||||
|
||||
import cn.celess.blog.entity.PartnerSite;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: 小海
|
||||
* @Date: 2019/07/03 00:22
|
||||
* @Description:
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface PartnerMapper {
|
||||
int insert(PartnerSite site);
|
||||
|
||||
int delete(long id);
|
||||
|
||||
int update(PartnerSite site);
|
||||
|
||||
boolean existsById(long id);
|
||||
|
||||
boolean existsByName(String name);
|
||||
|
||||
boolean existsByUrl(String url);
|
||||
|
||||
PartnerSite findById(long id);
|
||||
|
||||
PartnerSite findByName(String name);
|
||||
|
||||
PartnerSite findByUrl(String url);
|
||||
|
||||
PartnerSite getLastest();
|
||||
|
||||
List<PartnerSite> findAll();
|
||||
|
||||
|
||||
}
|
||||
38
src/main/java/cn/celess/blog/mapper/TagMapper.java
Normal file
38
src/main/java/cn/celess/blog/mapper/TagMapper.java
Normal file
@@ -0,0 +1,38 @@
|
||||
package cn.celess.blog.mapper;
|
||||
|
||||
import cn.celess.blog.entity.Tag;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: 小海
|
||||
* @Date: 2019/06/29 22:00
|
||||
* @Description:
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface TagMapper {
|
||||
int insert(Tag tag);
|
||||
|
||||
int update(Tag tag);
|
||||
|
||||
int delete(long id);
|
||||
|
||||
Tag findTagById(long id);
|
||||
|
||||
Tag findTagByName(String name);
|
||||
|
||||
Boolean existsByName(String name);
|
||||
|
||||
Long getIDByName(String name);
|
||||
|
||||
String getNameById(long id);
|
||||
|
||||
Tag getLastestTag();
|
||||
|
||||
List<Tag> findAll();
|
||||
|
||||
long count();
|
||||
}
|
||||
58
src/main/java/cn/celess/blog/mapper/UserMapper.java
Normal file
58
src/main/java/cn/celess/blog/mapper/UserMapper.java
Normal file
@@ -0,0 +1,58 @@
|
||||
package cn.celess.blog.mapper;
|
||||
|
||||
import cn.celess.blog.entity.User;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: 小海
|
||||
* @Date: 2019/07/03 00:23
|
||||
* @Description:
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface UserMapper {
|
||||
|
||||
int addUser(String email, String pwd);
|
||||
|
||||
int updateInfo(String desc, String displayName, long id);
|
||||
|
||||
int updateAvatarImgUrl(String avatarImgUrl, long id);
|
||||
|
||||
int updateLoginTime(String email, Date date);
|
||||
|
||||
int updateEmailStatus(String email, boolean status);
|
||||
|
||||
int updatePwd(String email, String pwd);
|
||||
|
||||
String getPwd(String email);
|
||||
|
||||
boolean existsByEmail(String email);
|
||||
|
||||
User findByEmail(String email);
|
||||
|
||||
User findById(long id);
|
||||
|
||||
String getAvatarImgUrlById(long id);
|
||||
|
||||
String getEmail(long id);
|
||||
|
||||
String getDisPlayName(long id);
|
||||
|
||||
String getRoleByEmail(String email);
|
||||
|
||||
String getRoleById(long id);
|
||||
|
||||
long count();
|
||||
|
||||
int delete(long id);
|
||||
|
||||
int setUserRole(Long uid, String role);
|
||||
|
||||
List<User> findAll();
|
||||
|
||||
int update(User user);
|
||||
}
|
||||
24
src/main/java/cn/celess/blog/mapper/VisitorMapper.java
Normal file
24
src/main/java/cn/celess/blog/mapper/VisitorMapper.java
Normal file
@@ -0,0 +1,24 @@
|
||||
package cn.celess.blog.mapper;
|
||||
|
||||
import cn.celess.blog.entity.Visitor;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: 小海
|
||||
* @Date: 2019/07/03 00:23
|
||||
* @Description:
|
||||
*/
|
||||
@Repository
|
||||
@Mapper
|
||||
public interface VisitorMapper {
|
||||
int insert(Visitor visitor);
|
||||
|
||||
int delete(long id);
|
||||
|
||||
List<Visitor> findAll();
|
||||
|
||||
long count();
|
||||
}
|
||||
31
src/main/java/cn/celess/blog/mapper/WebUpdateInfoMapper.java
Normal file
31
src/main/java/cn/celess/blog/mapper/WebUpdateInfoMapper.java
Normal file
@@ -0,0 +1,31 @@
|
||||
package cn.celess.blog.mapper;
|
||||
|
||||
import cn.celess.blog.entity.WebUpdate;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author: 小海
|
||||
* @Date: 2019/07/03 00:24
|
||||
* @Description:
|
||||
*/
|
||||
@Mapper
|
||||
@Repository
|
||||
public interface WebUpdateInfoMapper {
|
||||
int insert(WebUpdate webUpdate);
|
||||
|
||||
int delete(long id);
|
||||
|
||||
int update(long id, String info);
|
||||
|
||||
boolean existsById(long id);
|
||||
|
||||
WebUpdate findById(long id);
|
||||
|
||||
List<WebUpdate> findAll();
|
||||
|
||||
Date getLastestOne();
|
||||
}
|
||||
Reference in New Issue
Block a user