Merge pull request #99 from KKould/wx-dev

style(entity,dto,service,...): 实体等pojo主键变为Long类型
This commit is contained in:
ronger 2022-07-13 22:38:15 +08:00 committed by GitHub
commit 64421a2bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
67 changed files with 409 additions and 312 deletions

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.config; package com.rymcu.forest.config;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.rymcu.forest.core.constant.ShiroConstants; import com.rymcu.forest.core.constant.ShiroConstants;
import com.rymcu.forest.core.exception.CaptchaException; import com.rymcu.forest.core.exception.CaptchaException;
import com.rymcu.forest.entity.Permission; import com.rymcu.forest.entity.Permission;
@ -106,7 +107,8 @@ public class BaseShiroRealm extends AuthorizingRealm {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
private Integer id; // 编号 @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id; // 编号
private String account; // 登录名 private String account; // 登录名
private String name; // 姓名 private String name; // 姓名
private boolean mobileLogin; // 是否手机登录 private boolean mobileLogin; // 是否手机登录
@ -120,7 +122,7 @@ public class BaseShiroRealm extends AuthorizingRealm {
this.mobileLogin = mobileLogin; this.mobileLogin = mobileLogin;
} }
public Integer getId() { public Long getId() {
return id; return id;
} }

View File

@ -0,0 +1,24 @@
package com.rymcu.forest.core.exception;
public class ContentNotExistException extends RuntimeException{
private static final long serialVersionUID = 3206734387536223284L;
public ContentNotExistException() {
}
public ContentNotExistException(String message) {
super(message);
}
public ContentNotExistException(String message, Throwable cause) {
super(message, cause);
}
public ContentNotExistException(Throwable cause) {
super(cause);
}
public ContentNotExistException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}

View File

@ -0,0 +1,25 @@
package com.rymcu.forest.core.exception;
public class DataDuplicationException extends RuntimeException {
private static final long serialVersionUID = 3206744387536223284L;
public DataDuplicationException() {
}
public DataDuplicationException(String message) {
super(message);
}
public DataDuplicationException(String message, Throwable cause) {
super(message, cause);
}
public DataDuplicationException(Throwable cause) {
super(cause);
}
public DataDuplicationException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}

View File

@ -0,0 +1,26 @@
package com.rymcu.forest.core.exception;
public class UltraViresException extends RuntimeException {
private static final long serialVersionUID = 3206744387536228284L;
public UltraViresException() {
super();
}
public UltraViresException(String message) {
super(message);
}
public UltraViresException(String message, Throwable cause) {
super(message, cause);
}
public UltraViresException(Throwable cause) {
super(cause);
}
protected UltraViresException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
super(message, cause, enableSuppression, writableStackTrace);
}
}

View File

@ -90,7 +90,7 @@ public class VisitAspect {
if (StringUtils.isBlank(param) || "undefined".equals(param) || "null".equals(param)) { if (StringUtils.isBlank(param) || "undefined".equals(param) || "null".equals(param)) {
break; break;
} }
Integer id = Integer.parseInt(param); Long id = Long.parseLong(param);
articleService.incrementArticleViewCount(id); articleService.incrementArticleViewCount(id);
break; break;
default: default:

View File

@ -76,7 +76,7 @@ public class AuthorshipAspect {
} }
HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
String idArticle; String idArticle;
Integer idAuthor = 0; Long idAuthor = 0l;
if (isAjax(request)) { if (isAjax(request)) {
Object[] objects = joinPoint.getArgs(); Object[] objects = joinPoint.getArgs();
JSONObject jsonObject; JSONObject jsonObject;

View File

@ -1,6 +1,7 @@
package com.rymcu.forest.dto; package com.rymcu.forest.dto;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@ -11,13 +12,15 @@ import java.util.List;
*/ */
@Data @Data
public class ArticleDTO { public class ArticleDTO {
private Integer idArticle; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticle;
/** 文章标题 */ /** 文章标题 */
private String articleTitle; private String articleTitle;
/** 文章缩略图 */ /** 文章缩略图 */
private String articleThumbnailUrl; private String articleThumbnailUrl;
/** 文章作者id */ /** 文章作者id */
private Integer articleAuthorId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long articleAuthorId;
/** 文章作者 */ /** 文章作者 */
private String articleAuthorName; private String articleAuthorName;
/** 文章作者头像 */ /** 文章作者头像 */

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.dto; package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
/** /**
@ -7,12 +8,13 @@ import lombok.Data;
*/ */
@Data @Data
public class ArticleTagDTO { public class ArticleTagDTO {
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Integer idArticleTag; private Long idArticleTag;
private Integer idTag; private Integer idTag;
private Integer idArticle; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticle;
private String tagTitle; private String tagTitle;
@ -22,5 +24,6 @@ public class ArticleTagDTO {
private String tagIconPath; private String tagIconPath;
private Integer tagAuthorId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long tagAuthorId;
} }

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.dto; package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
/** /**
@ -8,7 +9,8 @@ import lombok.Data;
@Data @Data
public class Author { public class Author {
private Integer idUser; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String userNickname; private String userNickname;

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.dto; package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.rymcu.forest.entity.Notification; import com.rymcu.forest.entity.Notification;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
@ -11,7 +12,8 @@ import lombok.EqualsAndHashCode;
@EqualsAndHashCode(callSuper = false) @EqualsAndHashCode(callSuper = false)
public class NotificationDTO extends Notification { public class NotificationDTO extends Notification {
private Integer idNotification; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idNotification;
private String dataTitle; private String dataTitle;

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.dto; package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
@ -10,11 +11,14 @@ import java.util.List;
@Data @Data
public class PortfolioArticleDTO { public class PortfolioArticleDTO {
private Integer id; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
private Integer idPortfolio; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idPortfolio;
private Integer idArticle; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticle;
private String headImgUrl; private String headImgUrl;

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.dto; package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@ -10,11 +11,13 @@ import java.util.Date;
@Data @Data
public class PortfolioDTO { public class PortfolioDTO {
private Integer idPortfolio; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idPortfolio;
/** 作品集头像 */ /** 作品集头像 */
private String headImgUrl; private String headImgUrl;
/** 作品集作者 */ /** 作品集作者 */
private Integer portfolioAuthorId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long portfolioAuthorId;
/** 作品集作者 */ /** 作品集作者 */
private String portfolioAuthorName; private String portfolioAuthorName;
/** 作品集作者头像 */ /** 作品集作者头像 */

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.dto; package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
/** /**
@ -8,7 +9,8 @@ import lombok.Data;
@Data @Data
public class TokenUser { public class TokenUser {
private Integer idUser; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String account; private String account;

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.dto; package com.rymcu.forest.dto;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
/** /**
@ -8,7 +9,8 @@ import lombok.Data;
@Data @Data
public class UserDTO { public class UserDTO {
private Integer idUser; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String account; private String account;

View File

@ -1,6 +1,7 @@
package com.rymcu.forest.dto; package com.rymcu.forest.dto;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
@ -13,7 +14,8 @@ import java.util.Date;
@Data @Data
public class UserInfoDTO implements Serializable { public class UserInfoDTO implements Serializable {
private Integer idUser; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
private String account; private String account;

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity; package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
@ -19,13 +20,15 @@ public class Article implements Serializable,Cloneable {
@Id @Id
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@Column(name = "id") @Column(name = "id")
private Integer idArticle; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idArticle;
/** 文章标题 */ /** 文章标题 */
private String articleTitle; private String articleTitle;
/** 文章缩略图 */ /** 文章缩略图 */
private String articleThumbnailUrl; private String articleThumbnailUrl;
/** 文章作者id */ /** 文章作者id */
private Integer articleAuthorId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long articleAuthorId;
/** 文章类型 */ /** 文章类型 */
private String articleType; private String articleType;
/** 文章标签 */ /** 文章标签 */

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity; package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
@ -29,7 +30,8 @@ public class ArticleThumbsUp implements Serializable, Cloneable {
/** /**
* 用户表主键 * 用户表主键
*/ */
private Integer idUser; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
/** /**
* 点赞时间 * 点赞时间
*/ */

View File

@ -1,6 +1,7 @@
package com.rymcu.forest.entity; package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
@ -29,7 +30,8 @@ public class BankAccount {
/** 账户余额 */ /** 账户余额 */
private BigDecimal accountBalance; private BigDecimal accountBalance;
/** 账户所有者 */ /** 账户所有者 */
private Integer accountOwner; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long accountOwner;
/** 创建时间 */ /** 创建时间 */
@JSONField(format = "yyyy-MM-dd HH:mm:ss") @JSONField(format = "yyyy-MM-dd HH:mm:ss")
private Date createdTime; private Date createdTime;

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity; package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
@ -19,22 +20,26 @@ public class Comment implements Serializable,Cloneable {
@Id @Id
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@Column(name = "id") @Column(name = "id")
private Integer idComment; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idComment;
/** 评论内容 */ /** 评论内容 */
@Column(name = "comment_content") @Column(name = "comment_content")
private String commentContent; private String commentContent;
/** 作者 id */ /** 作者 id */
@Column(name = "comment_author_id") @Column(name = "comment_author_id")
private Integer commentAuthorId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long commentAuthorId;
/** 文章 id */ /** 文章 id */
@Column(name = "comment_article_id") @Column(name = "comment_article_id")
private Integer commentArticleId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long commentArticleId;
/** 锚点 url */ /** 锚点 url */
@Column(name = "comment_sharp_url") @Column(name = "comment_sharp_url")
private String commentSharpUrl; private String commentSharpUrl;
/** 父评论 id */ /** 父评论 id */
@Column(name = "comment_original_comment_id") @Column(name = "comment_original_comment_id")
private Integer commentOriginalCommentId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long commentOriginalCommentId;
/** 状态 */ /** 状态 */
@Column(name = "comment_status") @Column(name = "comment_status")
private String commentStatus; private String commentStatus;

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity; package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
@ -18,13 +19,16 @@ public class Follow implements Serializable,Cloneable {
@Id @Id
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@Column(name = "id") @Column(name = "id")
private Integer idFollow; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idFollow;
/** 关注者 id */ /** 关注者 id */
@Column(name = "follower_id") @Column(name = "follower_id")
private Integer followerId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long followerId;
/** 关注数据 id */ /** 关注数据 id */
@Column(name = "following_id") @Column(name = "following_id")
private Integer followingId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long followingId;
/** 0用户1标签2帖子收藏3帖子关注 */ /** 0用户1标签2帖子收藏3帖子关注 */
@Column(name = "following_type") @Column(name = "following_type")
private String followingType; private String followingType;

View File

@ -1,6 +1,7 @@
package com.rymcu.forest.entity; package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
@ -22,7 +23,8 @@ public class LoginRecord implements Serializable,Cloneable {
@Id @Id
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@Column(name = "id") @Column(name = "id")
private Integer id; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
/** IP */ /** IP */
@Column(name = "login_ip") @Column(name = "login_ip")
private String loginIp; private String loginIp;
@ -43,7 +45,8 @@ public class LoginRecord implements Serializable,Cloneable {
private String loginBrowser; private String loginBrowser;
/** 用户 id */ /** 用户 id */
@Column(name = "id_user") @Column(name = "id_user")
private Integer idUser; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
/** 创建时间 */ /** 创建时间 */
@Column(name = "created_time") @Column(name = "created_time")
@JSONField(format = "yyyy-MM-dd HH:mm:ss") @JSONField(format = "yyyy-MM-dd HH:mm:ss")

View File

@ -1,6 +1,7 @@
package com.rymcu.forest.entity; package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
@ -23,12 +24,14 @@ public class Notification implements Serializable,Cloneable {
@Id @Id
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@Column(name = "id") @Column(name = "id")
private Integer idNotification; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idNotification;
/** /**
* 用户id * 用户id
*/ */
@Column(name = "id_user") @Column(name = "id_user")
private Integer idUser; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
/** /**
* 数据类型 * 数据类型
*/ */
@ -38,7 +41,8 @@ public class Notification implements Serializable,Cloneable {
* 数据id * 数据id
*/ */
@Column(name = "data_id") @Column(name = "data_id")
private Integer dataId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long dataId;
/** /**
* 数据摘要 * 数据摘要
*/ */

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity; package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.persistence.*; import javax.persistence.*;
@ -15,14 +16,16 @@ public class Portfolio {
@Id @Id
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@Column(name = "id") @Column(name = "id")
private Integer idPortfolio; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idPortfolio;
/** 作品集头像 */ /** 作品集头像 */
@Column(name = "portfolio_head_img_url") @Column(name = "portfolio_head_img_url")
private String headImgUrl; private String headImgUrl;
/** 作品集名称 */ /** 作品集名称 */
private String portfolioTitle; private String portfolioTitle;
/** 作品集作者 */ /** 作品集作者 */
private Integer portfolioAuthorId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long portfolioAuthorId;
/** 作品集介绍 */ /** 作品集介绍 */
private String portfolioDescription; private String portfolioDescription;
/** 作品集介绍 Html */ /** 作品集介绍 Html */

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.entity; package com.rymcu.forest.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.persistence.GeneratedValue; import javax.persistence.GeneratedValue;
@ -28,11 +29,13 @@ public class Sponsor implements Serializable, Cloneable {
/** /**
* 数据主键 * 数据主键
*/ */
private Integer dataId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long dataId;
/** /**
* 赞赏人 * 赞赏人
*/ */
private Integer sponsor; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long sponsor;
/** /**
* 赞赏日期 * 赞赏日期
*/ */

View File

@ -1,6 +1,7 @@
package com.rymcu.forest.entity; package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import org.apache.ibatis.type.JdbcType; import org.apache.ibatis.type.JdbcType;
import tk.mybatis.mapper.annotation.ColumnType; import tk.mybatis.mapper.annotation.ColumnType;
@ -21,7 +22,8 @@ public class User implements Serializable,Cloneable {
@Id @Id
@Column(name = "id") @Column(name = "id")
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
private Integer idUser; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
/** /**
* 登录账号 * 登录账号

View File

@ -13,7 +13,7 @@ import javax.persistence.Table;
public class UserExtend { public class UserExtend {
@Id @Id
private Integer idUser; private Long idUser;
private String github; private String github;

View File

@ -1,6 +1,7 @@
package com.rymcu.forest.entity; package com.rymcu.forest.entity;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data; import lombok.Data;
import javax.persistence.Column; import javax.persistence.Column;
@ -22,7 +23,8 @@ public class Visit implements Serializable,Cloneable {
@Id @Id
@GeneratedValue(generator = "JDBC") @GeneratedValue(generator = "JDBC")
@Column(name = "id") @Column(name = "id")
private Integer id; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long id;
/** 浏览链接 */ /** 浏览链接 */
@Column(name = "visit_url") @Column(name = "visit_url")
private String visitUrl; private String visitUrl;
@ -40,7 +42,8 @@ public class Visit implements Serializable,Cloneable {
private String visitDeviceId; private String visitDeviceId;
/** 浏览者 id */ /** 浏览者 id */
@Column(name = "visit_user_id") @Column(name = "visit_user_id")
private Integer visitUserId; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long visitUserId;
/** 上游链接 */ /** 上游链接 */
@Column(name = "visit_referer_url") @Column(name = "visit_referer_url")
private String visitRefererUrl; private String visitRefererUrl;

View File

@ -1,5 +1,6 @@
package com.rymcu.forest.lucene.model; package com.rymcu.forest.lucene.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.Builder; import lombok.Builder;
import lombok.Data; import lombok.Data;
@ -22,7 +23,8 @@ import javax.persistence.Column;
public class UserLucene { public class UserLucene {
/** 用户编号 */ /** 用户编号 */
private Integer idUser; @JsonFormat(shape = JsonFormat.Shape.STRING)
private Long idUser;
/** 昵称 */ /** 昵称 */
private String nickname; private String nickname;

View File

@ -161,7 +161,7 @@ public class UserLuceneServiceImpl implements UserLuceneService {
} }
resList.add( resList.add(
UserLucene.builder() UserLucene.builder()
.idUser(Integer.valueOf(hitDoc.get("id"))) .idUser(Long.valueOf(hitDoc.get("id")))
.nickname(titleValue.toString()) .nickname(titleValue.toString())
.signature(baikeValue.toString()) .signature(baikeValue.toString())
.score(String.valueOf(score)) .score(String.valueOf(score))

View File

@ -30,7 +30,7 @@ public interface ArticleMapper extends Mapper<Article> {
* @param type * @param type
* @return * @return
*/ */
ArticleDTO selectArticleDTOById(@Param("id") Integer id, @Param("type") int type); ArticleDTO selectArticleDTOById(@Param("id") Long id, @Param("type") int type);
/** /**
* 保存文章内容 * 保存文章内容
@ -39,7 +39,7 @@ public interface ArticleMapper extends Mapper<Article> {
* @param articleContentHtml * @param articleContentHtml
* @return * @return
*/ */
Integer insertArticleContent(@Param("idArticle") Integer idArticle, @Param("articleContent") String articleContent, @Param("articleContentHtml") String articleContentHtml); Integer insertArticleContent(@Param("idArticle") Long idArticle, @Param("articleContent") String articleContent, @Param("articleContentHtml") String articleContentHtml);
/** /**
* 更新文章内容 * 更新文章内容
@ -48,14 +48,14 @@ public interface ArticleMapper extends Mapper<Article> {
* @param articleContentHtml * @param articleContentHtml
* @return * @return
*/ */
Integer updateArticleContent(@Param("idArticle") Integer idArticle, @Param("articleContent") String articleContent, @Param("articleContentHtml") String articleContentHtml); Integer updateArticleContent(@Param("idArticle") Long idArticle, @Param("articleContent") String articleContent, @Param("articleContentHtml") String articleContentHtml);
/** /**
* 获取文章正文内容 * 获取文章正文内容
* @param idArticle * @param idArticle
* @return * @return
*/ */
ArticleContent selectArticleContent(@Param("idArticle") Integer idArticle); ArticleContent selectArticleContent(@Param("idArticle") Long idArticle);
/** /**
* 获取主题下文章列表 * 获取主题下文章列表
@ -76,21 +76,21 @@ public interface ArticleMapper extends Mapper<Article> {
* @param idUser * @param idUser
* @return * @return
*/ */
List<ArticleDTO> selectUserArticles(@Param("idUser") Integer idUser); List<ArticleDTO> selectUserArticles(@Param("idUser") Long idUser);
/** /**
* 删除文章标签 * 删除文章标签
* @param id * @param id
* @return * @return
*/ */
Integer deleteTagArticle(@Param("id") Integer id); Integer deleteTagArticle(@Param("id") Long id);
/** /**
* 获取文章标签列表 * 获取文章标签列表
* @param idArticle * @param idArticle
* @return * @return
*/ */
List<ArticleTagDTO> selectTags(@Param("idArticle") Integer idArticle); List<ArticleTagDTO> selectTags(@Param("idArticle") Long idArticle);
/** /**
* 更新文章浏览数 * 更新文章浏览数
@ -98,28 +98,28 @@ public interface ArticleMapper extends Mapper<Article> {
* @param articleViewCount * @param articleViewCount
* @return * @return
*/ */
Integer updateArticleViewCount(@Param("id") Integer id, @Param("articleViewCount") Integer articleViewCount); Integer updateArticleViewCount(@Param("id") Long id, @Param("articleViewCount") Integer articleViewCount);
/** /**
* 获取草稿列表 * 获取草稿列表
* @param idUser * @param idUser
* @return * @return
*/ */
List<ArticleDTO> selectDrafts(@Param("idUser") Integer idUser); List<ArticleDTO> selectDrafts(@Param("idUser") Long idUser);
/** /**
* 删除未使用的文章标签 * 删除未使用的文章标签
* @param idArticleTag * @param idArticleTag
* @return * @return
*/ */
Integer deleteUnusedArticleTag(@Param("idArticleTag") Integer idArticleTag); Integer deleteUnusedArticleTag(@Param("idArticleTag") Long idArticleTag);
/** /**
* 查询作品集下文章 * 查询作品集下文章
* @param idPortfolio * @param idPortfolio
* @return * @return
*/ */
List<ArticleDTO> selectArticlesByIdPortfolio(@Param("idPortfolio") Integer idPortfolio); List<ArticleDTO> selectArticlesByIdPortfolio(@Param("idPortfolio") Long idPortfolio);
/** /**
* 查询作品集未绑定文章 * 查询作品集未绑定文章
@ -128,14 +128,14 @@ public interface ArticleMapper extends Mapper<Article> {
* @param idUser * @param idUser
* @return * @return
*/ */
List<ArticleDTO> selectUnbindArticlesByIdPortfolio(@Param("idPortfolio") Integer idPortfolio, @Param("searchText") String searchText, @Param("idUser") Integer idUser); List<ArticleDTO> selectUnbindArticlesByIdPortfolio(@Param("idPortfolio") Long idPortfolio, @Param("searchText") String searchText, @Param("idUser") Long idUser);
/** /**
* 查询文章所属作品集列表 * 查询文章所属作品集列表
* @param idArticle * @param idArticle
* @return * @return
*/ */
List<PortfolioArticleDTO> selectPortfolioArticles(@Param("idArticle") Integer idArticle); List<PortfolioArticleDTO> selectPortfolioArticles(@Param("idArticle") Long idArticle);
/** /**
* 更新文章标签 * 更新文章标签
@ -143,21 +143,21 @@ public interface ArticleMapper extends Mapper<Article> {
* @param tags * @param tags
* @return * @return
*/ */
Integer updateArticleTags(@Param("idArticle") Integer idArticle, @Param("tags") String tags); Integer updateArticleTags(@Param("idArticle") Long idArticle, @Param("tags") String tags);
/** /**
* 判断是否有评论 * 判断是否有评论
* @param id * @param id
* @return * @return
*/ */
boolean existsCommentWithPrimaryKey(@Param("id") Integer id); boolean existsCommentWithPrimaryKey(@Param("id") Long id);
/** /**
* 删除关联作品集数据 * 删除关联作品集数据
* @param id * @param id
* @return * @return
*/ */
Integer deleteLinkedPortfolioData(@Param("id") Integer id); Integer deleteLinkedPortfolioData(@Param("id") Long id);
/** /**
* 更新文章连接及预览内容 * 更新文章连接及预览内容
@ -167,7 +167,7 @@ public interface ArticleMapper extends Mapper<Article> {
* @param articlePreviewContent * @param articlePreviewContent
* @return * @return
*/ */
Integer updateArticleLinkAndPreviewContent(@Param("idArticle") Integer idArticle, @Param("articleLink") String articleLink, @Param("articlePermalink") String articlePermalink, @Param("articlePreviewContent") String articlePreviewContent); Integer updateArticleLinkAndPreviewContent(@Param("idArticle") Long idArticle, @Param("articleLink") String articleLink, @Param("articlePermalink") String articlePermalink, @Param("articlePreviewContent") String articlePreviewContent);
/** /**
* 根据专题主键及当前文章排序号获取专题下文章大纲 * 根据专题主键及当前文章排序号获取专题下文章大纲
@ -175,7 +175,7 @@ public interface ArticleMapper extends Mapper<Article> {
* @param sortNo * @param sortNo
* @return * @return
*/ */
List<ArticleDTO> selectPortfolioArticlesByIdPortfolioAndSortNo(@Param("idPortfolio") Integer idPortfolio, @Param("sortNo") Integer sortNo); List<ArticleDTO> selectPortfolioArticlesByIdPortfolioAndSortNo(@Param("idPortfolio") Long idPortfolio, @Param("sortNo") Integer sortNo);
/** /**
* 更新文章优选状态 * 更新文章优选状态
@ -183,13 +183,13 @@ public interface ArticleMapper extends Mapper<Article> {
* @param articlePerfect * @param articlePerfect
* @return * @return
*/ */
int updatePerfect(@Param("idArticle") Integer idArticle, @Param("articlePerfect") String articlePerfect); int updatePerfect(@Param("idArticle") Long idArticle, @Param("articlePerfect") String articlePerfect);
/** /**
* 删除文章关联文章内容表信息 * 删除文章关联文章内容表信息
* @param idArticle * @param idArticle
*/ */
void deleteArticleContent(@Param("idArticle") Integer idArticle); void deleteArticleContent(@Param("idArticle") Long idArticle);
/** /**
* 获取公告 * 获取公告

View File

@ -39,7 +39,7 @@ public interface CommentMapper extends Mapper<Comment> {
* @param commentSharpUrl * @param commentSharpUrl
* @return * @return
*/ */
Integer updateCommentSharpUrl(@Param("idComment") Integer idComment, @Param("commentSharpUrl") String commentSharpUrl); Integer updateCommentSharpUrl(@Param("idComment") Long idComment, @Param("commentSharpUrl") String commentSharpUrl);
/** /**
* 获取评论列表数据 * 获取评论列表数据

View File

@ -18,19 +18,19 @@ public interface FollowMapper extends Mapper<Follow> {
* @param followingType * @param followingType
* @return * @return
*/ */
Boolean isFollow(@Param("followingId") Integer followingId, @Param("followerId") Integer followerId, @Param("followingType") String followingType); Boolean isFollow(@Param("followingId") Integer followingId, @Param("followerId") Long followerId, @Param("followingType") String followingType);
/** /**
* 查询用户粉丝 * 查询用户粉丝
* @param idUser * @param idUser
* @return * @return
*/ */
List<UserDTO> selectUserFollowersByUser(@Param("idUser") Integer idUser); List<UserDTO> selectUserFollowersByUser(@Param("idUser") Long idUser);
/** /**
* 查询用户关注用户 * 查询用户关注用户
* @param idUser * @param idUser
* @return * @return
*/ */
List<UserDTO> selectUserFollowingsByUser(@Param("idUser") Integer idUser); List<UserDTO> selectUserFollowingsByUser(@Param("idUser") Long idUser);
} }

View File

@ -17,14 +17,14 @@ public interface NotificationMapper extends Mapper<Notification> {
* @param idUser * @param idUser
* @return * @return
*/ */
List<Notification> selectUnreadNotifications(@Param("idUser") Integer idUser); List<Notification> selectUnreadNotifications(@Param("idUser") Long idUser);
/** /**
* 获取消息数据 * 获取消息数据
* @param idUser * @param idUser
* @return * @return
*/ */
List<NotificationDTO> selectNotifications(@Param("idUser") Integer idUser); List<NotificationDTO> selectNotifications(@Param("idUser") Long idUser);
/** /**
* 获取消息数据 * 获取消息数据
@ -33,7 +33,7 @@ public interface NotificationMapper extends Mapper<Notification> {
* @param dataType * @param dataType
* @return * @return
*/ */
Notification selectNotification(@Param("idUser") Integer idUser, @Param("dataId") Integer dataId, @Param("dataType") String dataType); Notification selectNotification(@Param("idUser") Long idUser, @Param("dataId") Long dataId, @Param("dataType") String dataType);
/** /**
* 创建消息通知 * 创建消息通知
@ -43,21 +43,21 @@ public interface NotificationMapper extends Mapper<Notification> {
* @param dataSummary * @param dataSummary
* @return * @return
*/ */
Integer insertNotification(@Param("idUser") Integer idUser, @Param("dataId") Integer dataId, @Param("dataType") String dataType, @Param("dataSummary") String dataSummary); Integer insertNotification(@Param("idUser") Long idUser, @Param("dataId") Long dataId, @Param("dataType") String dataType, @Param("dataSummary") String dataSummary);
/** /**
* 标记消息已读 * 标记消息已读
* @param id * @param id
* @return * @return
*/ */
Integer readNotification(@Param("id") Integer id); Integer readNotification(@Param("id") Long id);
/** /**
* 标记所有消息已读 * 标记所有消息已读
* @param idUser * @param idUser
* @return * @return
*/ */
Integer readAllNotification(@Param("idUser") Integer idUser); Integer readAllNotification(@Param("idUser") Long idUser);
/** /**
* 删除相关未读消息 * 删除相关未读消息
@ -65,5 +65,5 @@ public interface NotificationMapper extends Mapper<Notification> {
* @param dataType * @param dataType
* @return * @return
*/ */
Integer deleteUnreadNotification(@Param("dataId") Integer dataId, @Param("dataType") String dataType); Integer deleteUnreadNotification(@Param("dataId") Long dataId, @Param("dataType") String dataType);
} }

View File

@ -16,7 +16,7 @@ public interface PortfolioMapper extends Mapper<Portfolio> {
* @param idUser * @param idUser
* @return * @return
*/ */
List<PortfolioDTO> selectUserPortfoliosByIdUser(@Param("idUser") Integer idUser); List<PortfolioDTO> selectUserPortfoliosByIdUser(@Param("idUser") Long idUser);
/** /**
* 查询作品集 * 查询作品集
@ -24,14 +24,14 @@ public interface PortfolioMapper extends Mapper<Portfolio> {
* @param type * @param type
* @return * @return
*/ */
PortfolioDTO selectPortfolioDTOById(@Param("id") Integer id, @Param("type") Integer type); PortfolioDTO selectPortfolioDTOById(@Param("id") Long id, @Param("type") Integer type);
/** /**
* 统计作品集下文章数 * 统计作品集下文章数
* @param idPortfolio * @param idPortfolio
* @return * @return
*/ */
Integer selectCountArticleNumber(@Param("idPortfolio") Integer idPortfolio); Integer selectCountArticleNumber(@Param("idPortfolio") Long idPortfolio);
/** /**
* 查询文章是否已绑定 * 查询文章是否已绑定
@ -39,7 +39,7 @@ public interface PortfolioMapper extends Mapper<Portfolio> {
* @param idPortfolio * @param idPortfolio
* @return * @return
*/ */
Integer selectCountPortfolioArticle(@Param("idArticle") Integer idArticle, @Param("idPortfolio") Integer idPortfolio); Integer selectCountPortfolioArticle(@Param("idArticle") Long idArticle, @Param("idPortfolio") Long idPortfolio);
/** /**
* 插入文章与作品集绑定数据 * 插入文章与作品集绑定数据
@ -48,14 +48,14 @@ public interface PortfolioMapper extends Mapper<Portfolio> {
* @param maxSortNo * @param maxSortNo
* @return * @return
*/ */
Integer insertPortfolioArticle(@Param("idArticle") Integer idArticle, @Param("idPortfolio") Integer idPortfolio, @Param("maxSortNo") Integer maxSortNo); Integer insertPortfolioArticle(@Param("idArticle") Long idArticle, @Param("idPortfolio") Long idPortfolio, @Param("maxSortNo") Integer maxSortNo);
/** /**
* 查询作品集下最大排序号 * 查询作品集下最大排序号
* @param idPortfolio * @param idPortfolio
* @return * @return
*/ */
Integer selectMaxSortNo(@Param("idPortfolio") Integer idPortfolio); Integer selectMaxSortNo(@Param("idPortfolio") Long idPortfolio);
/** /**
* 更新文章排序号 * 更新文章排序号
@ -64,7 +64,7 @@ public interface PortfolioMapper extends Mapper<Portfolio> {
* @param sortNo * @param sortNo
* @return * @return
*/ */
Integer updateArticleSortNo(@Param("idPortfolio") Integer idPortfolio, @Param("idArticle") Integer idArticle, @Param("sortNo") Integer sortNo); Integer updateArticleSortNo(@Param("idPortfolio") Long idPortfolio, @Param("idArticle") Long idArticle, @Param("sortNo") Integer sortNo);
/** /**
* 取消绑定文章 * 取消绑定文章
@ -72,7 +72,7 @@ public interface PortfolioMapper extends Mapper<Portfolio> {
* @param idArticle * @param idArticle
* @return * @return
*/ */
Integer unbindArticle(@Param("idPortfolio") Integer idPortfolio, @Param("idArticle") Integer idArticle); Integer unbindArticle(@Param("idPortfolio") Long idPortfolio, @Param("idArticle") Long idArticle);
/** /**
* 获取作品集列表数据 * 获取作品集列表数据

View File

@ -8,7 +8,7 @@ import java.util.List;
public interface RoleMapper extends Mapper<Role> { public interface RoleMapper extends Mapper<Role> {
List<Role> selectRoleByIdUser(@Param("id") Integer id); List<Role> selectRoleByIdUser(@Param("id") Long id);
Role selectRoleByInputCode(@Param("inputCode") String inputCode); Role selectRoleByInputCode(@Param("inputCode") String inputCode);

View File

@ -13,5 +13,5 @@ public interface SponsorMapper extends Mapper<Sponsor> {
* @param idArticle * @param idArticle
* @return * @return
*/ */
Integer updateArticleSponsorCount(@Param("idArticle") Integer idArticle); Integer updateArticleSponsorCount(@Param("idArticle") Long idArticle);
} }

View File

@ -18,7 +18,7 @@ public interface TagMapper extends Mapper<Tag> {
* @param idArticle * @param idArticle
* @return * @return
*/ */
Integer insertTagArticle(@Param("idTag") Integer idTag, @Param("idArticle") Integer idArticle); Integer insertTagArticle(@Param("idTag") Integer idTag, @Param("idArticle") Long idArticle);
/** /**
* 统计标签使用数(文章) * 统计标签使用数(文章)
@ -26,7 +26,7 @@ public interface TagMapper extends Mapper<Tag> {
* @param idArticle * @param idArticle
* @return * @return
*/ */
Integer selectCountTagArticleById(@Param("idTag") Integer idTag, @Param("idArticle") Integer idArticle); Integer selectCountTagArticleById(@Param("idTag") Integer idTag, @Param("idArticle") Long idArticle);
/** /**
* 获取用户标签数 * 获取用户标签数
@ -34,7 +34,7 @@ public interface TagMapper extends Mapper<Tag> {
* @param idTag * @param idTag
* @return * @return
*/ */
Integer selectCountUserTagById(@Param("idUser") Integer idUser, @Param("idTag") Integer idTag); Integer selectCountUserTagById(@Param("idUser") Long idUser, @Param("idTag") Integer idTag);
/** /**
* 插入用户标签信息 * 插入用户标签信息
@ -43,7 +43,7 @@ public interface TagMapper extends Mapper<Tag> {
* @param type * @param type
* @return * @return
*/ */
Integer insertUserTag(@Param("idTag") Integer idTag, @Param("idUser") Integer idUser, @Param("type") Integer type); Integer insertUserTag(@Param("idTag") Integer idTag, @Param("idUser") Long idUser, @Param("type") Integer type);
/** /**
* 删除未使用标签 * 删除未使用标签

View File

@ -28,7 +28,7 @@ public interface UserMapper extends Mapper<User> {
* @param idRole * @param idRole
* @return * @return
*/ */
Integer insertUserRole(@Param("idUser") Integer idUser, @Param("idRole") Integer idRole); Integer insertUserRole(@Param("idUser") Long idUser, @Param("idRole") Integer idRole);
/** /**
* 根据账号获取获取用户信息 * 根据账号获取获取用户信息
@ -57,7 +57,7 @@ public interface UserMapper extends Mapper<User> {
* @param idUser * @param idUser
* @return * @return
*/ */
Integer selectRoleWeightsByUser(@Param("idUser") Integer idUser); Integer selectRoleWeightsByUser(@Param("idUser") Long idUser);
/** /**
* 更新用户权限 * 更新用户权限
@ -73,7 +73,7 @@ public interface UserMapper extends Mapper<User> {
* @param status * @param status
* @return * @return
*/ */
Integer updateStatus(@Param("idUser") Integer idUser, @Param("status") String status); Integer updateStatus(@Param("idUser") Long idUser, @Param("status") String status);
/** /**
* 根据昵称获取重名用户数量 * 根据昵称获取重名用户数量
@ -99,7 +99,7 @@ public interface UserMapper extends Mapper<User> {
* @param sex * @param sex
* @return * @return
*/ */
Integer updateUserInfo(@Param("idUser") Integer idUser, @Param("nickname") String nickname, @Param("avatarType") String avatarType, @Param("avatarUrl") String avatarUrl, @Param("signature") String signature, @Param("sex") String sex); Integer updateUserInfo(@Param("idUser") Long idUser, @Param("nickname") String nickname, @Param("avatarType") String avatarType, @Param("avatarUrl") String avatarUrl, @Param("signature") String signature, @Param("sex") String sex);
/** /**
* 验证昵称是否重复 * 验证昵称是否重复
@ -107,20 +107,20 @@ public interface UserMapper extends Mapper<User> {
* @param nickname * @param nickname
* @return * @return
*/ */
Integer checkNicknameByIdUser(@Param("idUser") Integer idUser, @Param("nickname") String nickname); Integer checkNicknameByIdUser(@Param("idUser") Long idUser, @Param("nickname") String nickname);
/** /**
* 根据用户 ID 获取作者信息 * 根据用户 ID 获取作者信息
* @param id * @param id
* @return * @return
*/ */
Author selectAuthor(@Param("id") Integer id); Author selectAuthor(@Param("id") Long id);
/** /**
* 更新用户最后登录时间 * 更新用户最后登录时间
* @param idUser * @param idUser
* @return * @return
*/ */
Integer updateLastLoginTime(@Param("idUser") Integer idUser); Integer updateLastLoginTime(@Param("idUser") Long idUser);
/** /**
* 更换邮箱 * 更换邮箱

View File

@ -29,7 +29,7 @@ public interface ArticleService extends Service<Article> {
* @param type * @param type
* @return * @return
* */ * */
ArticleDTO findArticleDTOById(Integer id, Integer type); ArticleDTO findArticleDTOById(Long id, Integer type);
/** /**
* 查询主题下文章列表 * 查询主题下文章列表
@ -50,7 +50,7 @@ public interface ArticleService extends Service<Article> {
* @param idUser * @param idUser
* @return * @return
* */ * */
List<ArticleDTO> findUserArticlesByIdUser(Integer idUser); List<ArticleDTO> findUserArticlesByIdUser(Long idUser);
/** /**
* 新增/更新文章 * 新增/更新文章
@ -60,7 +60,7 @@ public interface ArticleService extends Service<Article> {
* @throws BaseApiException * @throws BaseApiException
* @return * @return
* */ * */
Map postArticle(ArticleDTO article, HttpServletRequest request) throws UnsupportedEncodingException, BaseApiException; Long postArticle(ArticleDTO article, HttpServletRequest request) throws UnsupportedEncodingException, BaseApiException;
/** /**
* 删除文章 * 删除文章
@ -68,13 +68,13 @@ public interface ArticleService extends Service<Article> {
* @return * @return
* @throws BaseApiException * @throws BaseApiException
* */ * */
Map delete(Integer id) throws BaseApiException; Integer delete(Long id) throws BaseApiException;
/** /**
* 增量文章浏览数 * 增量文章浏览数
* @param id * @param id
*/ */
void incrementArticleViewCount(Integer id); void incrementArticleViewCount(Long id);
/** /**
* 获取分享链接数据 * 获取分享链接数据
@ -82,7 +82,7 @@ public interface ArticleService extends Service<Article> {
* @throws BaseApiException * @throws BaseApiException
* @return * @return
*/ */
Map share(Integer id) throws BaseApiException; public String share(Integer id) throws BaseApiException;
/** /**
* 查询草稿文章类别 * 查询草稿文章类别
@ -96,7 +96,7 @@ public interface ArticleService extends Service<Article> {
* @param idPortfolio * @param idPortfolio
* @return * @return
*/ */
List<ArticleDTO> findArticlesByIdPortfolio(Integer idPortfolio); List<ArticleDTO> findArticlesByIdPortfolio(Long idPortfolio);
/** /**
* 查询作品集下未绑定文章 * 查询作品集下未绑定文章
@ -105,7 +105,7 @@ public interface ArticleService extends Service<Article> {
* @param idUser * @param idUser
* @return * @return
*/ */
List<ArticleDTO> selectUnbindArticles(Integer idPortfolio, String searchText, Integer idUser); List<ArticleDTO> selectUnbindArticles(Long idPortfolio, String searchText, Long idUser);
/** /**
* 更新文章标签 * 更新文章标签
@ -115,7 +115,7 @@ public interface ArticleService extends Service<Article> {
* @throws UnsupportedEncodingException * @throws UnsupportedEncodingException
* @throws BaseApiException * @throws BaseApiException
*/ */
Map updateTags(Integer idArticle, String tags) throws UnsupportedEncodingException, BaseApiException; Boolean updateTags(Long idArticle, String tags) throws UnsupportedEncodingException, BaseApiException;
/** /**
* 更新文章优选状态 * 更新文章优选状态
@ -123,7 +123,7 @@ public interface ArticleService extends Service<Article> {
* @param articlePerfect * @param articlePerfect
* @return * @return
*/ */
Map updatePerfect(Integer idArticle, String articlePerfect); Boolean updatePerfect(Long idArticle, String articlePerfect);
/** /**
* 获取公告列表 * 获取公告列表

View File

@ -24,7 +24,7 @@ public interface BankAccountService extends Service<BankAccount> {
* @param idUser * @param idUser
* @return * @return
*/ */
BankAccountDTO findBankAccountByIdUser(Integer idUser); BankAccountDTO findBankAccountByIdUser(Long idUser);
/** /**
* 根据账户查询银行账户信息 * 根据账户查询银行账户信息

View File

@ -42,7 +42,7 @@ public interface FollowService extends Service<Follow> {
* @param followingId * @param followingId
* @return * @return
*/ */
List<Follow> findByFollowingId(String followType, Integer followingId); List<Follow> findByFollowingId(String followType, Long followingId);

View File

@ -18,7 +18,7 @@ public interface LoginRecordService extends Service<LoginRecord> {
* @param idUser * @param idUser
* @return * @return
*/ */
LoginRecord saveLoginRecord(Integer idUser); LoginRecord saveLoginRecord(Long idUser);
/** /**
* 获取用户登录记录 * 获取用户登录记录

View File

@ -17,14 +17,14 @@ public interface NotificationService extends Service<Notification> {
* @param idUser * @param idUser
* @return * @return
*/ */
List<Notification> findUnreadNotifications(Integer idUser); List<Notification> findUnreadNotifications(Long idUser);
/** /**
* 获取消息数据 * 获取消息数据
* @param idUser * @param idUser
* @return * @return
*/ */
List<NotificationDTO> findNotifications(Integer idUser); List<NotificationDTO> findNotifications(Long idUser);
/** /**
* 获取消息数据 * 获取消息数据
@ -33,7 +33,7 @@ public interface NotificationService extends Service<Notification> {
* @param dataType * @param dataType
* @return * @return
*/ */
Notification findNotification(Integer idUser, Integer dataId, String dataType); Notification findNotification(Long idUser, Long dataId, String dataType);
/** /**
* 创建系统通知 * 创建系统通知
@ -43,14 +43,14 @@ public interface NotificationService extends Service<Notification> {
* @param dataSummary * @param dataSummary
* @return * @return
*/ */
Integer save(Integer idUser, Integer dataId, String dataType, String dataSummary); Integer save(Long idUser, Long dataId, String dataType, String dataSummary);
/** /**
* 标记消息已读 * 标记消息已读
* @param id * @param id
* @return * @return
*/ */
Integer readNotification(Integer id); Integer readNotification(Long id);
/** /**
* 标记所有消息已读 * 标记所有消息已读
@ -65,5 +65,5 @@ public interface NotificationService extends Service<Notification> {
* @param dataType * @param dataType
* @return * @return
*/ */
Integer deleteUnreadNotification(Integer dataId, String dataType); Integer deleteUnreadNotification(Long dataId, String dataType);
} }

View File

@ -27,7 +27,7 @@ public interface PortfolioService extends Service<Portfolio> {
* @param type * @param type
* @return * @return
*/ */
PortfolioDTO findPortfolioDTOById(Integer idPortfolio, Integer type); PortfolioDTO findPortfolioDTOById(Long idPortfolio, Integer type);
/** /**
* 保持/更新作品集 * 保持/更新作品集
@ -47,7 +47,7 @@ public interface PortfolioService extends Service<Portfolio> {
* @throws BaseApiException * @throws BaseApiException
* @return * @return
*/ */
Map findUnbindArticles(Integer page, Integer rows, String searchText, Integer idPortfolio) throws BaseApiException; Map findUnbindArticles(Integer page, Integer rows, String searchText, Long idPortfolio) throws BaseApiException;
/** /**
* 绑定文章 * 绑定文章
@ -69,14 +69,14 @@ public interface PortfolioService extends Service<Portfolio> {
* @param idArticle * @param idArticle
* @return * @return
*/ */
Map unbindArticle(Integer idPortfolio, Integer idArticle); Map unbindArticle(Long idPortfolio, Long idArticle);
/** /**
* 删除作品集 * 删除作品集
* @param idPortfolio * @param idPortfolio
* @return * @return
*/ */
Map deletePortfolio(Integer idPortfolio) throws BaseApiException; Map deletePortfolio(Long idPortfolio) throws BaseApiException;
/** /**
* 获取作品集列表数据 * 获取作品集列表数据

View File

@ -27,7 +27,7 @@ public interface RoleService extends Service<Role> {
* @param idUser * @param idUser
* @return * @return
* */ * */
List<Role> findByIdUser(Integer idUser); List<Role> findByIdUser(Long idUser);
/** /**
* 更新用户状态 * 更新用户状态

View File

@ -36,7 +36,7 @@ public interface TransactionRecordService extends Service<TransactionRecord> {
* @return * @return
* @throws Exception * @throws Exception
*/ */
TransactionRecord userTransfer(Integer toUserId, Integer formUserId, TransactionEnum transactionType) throws Exception; TransactionRecord userTransfer(Long toUserId, Long formUserId, TransactionEnum transactionType) throws Exception;
/** /**
* 社区银行转账/奖励发放 * 社区银行转账/奖励发放
@ -45,7 +45,7 @@ public interface TransactionRecordService extends Service<TransactionRecord> {
* @return * @return
* @throws Exception * @throws Exception
*/ */
TransactionRecord bankTransfer(Integer idUser, TransactionEnum transactionType) throws Exception; TransactionRecord bankTransfer(Long idUser, TransactionEnum transactionType) throws Exception;
/** /**
* 发放新手奖励 * 发放新手奖励

View File

@ -71,7 +71,7 @@ public interface UserService extends Service<User> {
* @param status 状态 * @param status 状态
* @return Map * @return Map
* */ * */
Map updateStatus(Integer idUser, String status); Map updateStatus(Long idUser, String status);
/** /**
* 获取用户信息 * 获取用户信息
@ -93,21 +93,21 @@ public interface UserService extends Service<User> {
* @param nickname * @param nickname
* @return * @return
*/ */
Map checkNickname(Integer idUser, String nickname); Map checkNickname(Long idUser, String nickname);
/** /**
* 获取用户权限 * 获取用户权限
* @param idUser * @param idUser
* @return * @return
*/ */
Integer findRoleWeightsByUser(Integer idUser); Integer findRoleWeightsByUser(Long idUser);
/** /**
* 查询作者信息 * 查询作者信息
* @param idUser * @param idUser
* @return * @return
*/ */
Author selectAuthor(Integer idUser); Author selectAuthor(Long idUser);
/** /**
* 更新用户扩展信息 * 更新用户扩展信息

View File

@ -1,6 +1,9 @@
package com.rymcu.forest.service.impl; package com.rymcu.forest.service.impl;
import com.rymcu.forest.core.constant.NotificationConstant; import com.rymcu.forest.core.constant.NotificationConstant;
import com.rymcu.forest.core.exception.ContentNotExistException;
import com.rymcu.forest.core.exception.DataDuplicationException;
import com.rymcu.forest.core.exception.UltraViresException;
import com.rymcu.forest.core.service.AbstractService; import com.rymcu.forest.core.service.AbstractService;
import com.rymcu.forest.dto.*; import com.rymcu.forest.dto.*;
import com.rymcu.forest.entity.Article; import com.rymcu.forest.entity.Article;
@ -68,7 +71,7 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
} }
@Override @Override
public ArticleDTO findArticleDTOById(Integer id, Integer type) { public ArticleDTO findArticleDTOById(Long id, Integer type) {
ArticleDTO articleDTO = articleMapper.selectArticleDTOById(id, type); ArticleDTO articleDTO = articleMapper.selectArticleDTOById(id, type);
if (articleDTO == null) { if (articleDTO == null) {
return null; return null;
@ -90,7 +93,7 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
} }
@Override @Override
public List<ArticleDTO> findUserArticlesByIdUser(Integer idUser) { public List<ArticleDTO> findUserArticlesByIdUser(Long idUser) {
List<ArticleDTO> list = articleMapper.selectUserArticles(idUser); List<ArticleDTO> list = articleMapper.selectUserArticles(idUser);
list.forEach(articleDTO -> genArticle(articleDTO, 0)); list.forEach(articleDTO -> genArticle(articleDTO, 0));
return list; return list;
@ -98,16 +101,7 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
@Override @Override
@Transactional(rollbackFor = {UnsupportedEncodingException.class, BaseApiException.class}) @Transactional(rollbackFor = {UnsupportedEncodingException.class, BaseApiException.class})
public Map postArticle(ArticleDTO article, HttpServletRequest request) throws UnsupportedEncodingException, BaseApiException { public Long postArticle(ArticleDTO article, HttpServletRequest request) throws UnsupportedEncodingException, BaseApiException {
Map map = new HashMap(1);
if (StringUtils.isBlank(article.getArticleTitle())) {
map.put("message", "标题不能为空!");
return map;
}
if (StringUtils.isBlank(article.getArticleContent())) {
map.put("message", "正文不能为空!");
return map;
}
boolean isUpdate = false; boolean isUpdate = false;
String articleTitle = article.getArticleTitle(); String articleTitle = article.getArticleTitle();
String articleTags = article.getArticleTags(); String articleTags = article.getArticleTags();
@ -122,14 +116,14 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
if (StringUtils.isNotBlank(reservedTag)) { if (StringUtils.isNotBlank(reservedTag)) {
Integer roleWeights = userService.findRoleWeightsByUser(user.getIdUser()); Integer roleWeights = userService.findRoleWeightsByUser(user.getIdUser());
if (roleWeights > ADMIN_ROLE_WEIGHTS) { if (roleWeights > ADMIN_ROLE_WEIGHTS) {
map.put("message", StringEscapeUtils.unescapeJava(reservedTag) + "标签为系统保留标签!"); throw new UltraViresException(StringEscapeUtils.unescapeJava(reservedTag) + "标签为系统保留标签!");
return map;
} else { } else {
notification = true; notification = true;
} }
} }
Article newArticle; Article newArticle;
if (article.getIdArticle() == null || article.getIdArticle() == 0) { Long idArticle = article.getIdArticle();
if (idArticle == null || idArticle == 0) {
newArticle = new Article(); newArticle = new Article();
newArticle.setArticleTitle(articleTitle); newArticle.setArticleTitle(articleTitle);
newArticle.setArticleAuthorId(user.getIdUser()); newArticle.setArticleAuthorId(user.getIdUser());
@ -140,7 +134,7 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
articleMapper.insertSelective(newArticle); articleMapper.insertSelective(newArticle);
articleMapper.insertArticleContent(newArticle.getIdArticle(), articleContent, articleContentHtml); articleMapper.insertArticleContent(newArticle.getIdArticle(), articleContent, articleContentHtml);
} else { } else {
newArticle = articleMapper.selectByPrimaryKey(article.getIdArticle()); newArticle = articleMapper.selectByPrimaryKey(idArticle);
// 如果文章之前状态为草稿则应视为新发布文章 // 如果文章之前状态为草稿则应视为新发布文章
if (DEFAULT_STATUS.equals(newArticle.getArticleStatus())) { if (DEFAULT_STATUS.equals(newArticle.getArticleStatus())) {
isUpdate = true; isUpdate = true;
@ -151,38 +145,38 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
newArticle.setUpdatedTime(new Date()); newArticle.setUpdatedTime(new Date());
articleMapper.updateArticleContent(newArticle.getIdArticle(), articleContent, articleContentHtml); articleMapper.updateArticleContent(newArticle.getIdArticle(), articleContent, articleContentHtml);
} }
Long newArticleId = newArticle.getIdArticle();
// 发送相关通知 // 发送相关通知
if (DEFAULT_STATUS.equals(newArticle.getArticleStatus())) { if (DEFAULT_STATUS.equals(newArticle.getArticleStatus())) {
// 发送系统通知 // 发送系统通知
if (notification) { if (notification) {
NotificationUtils.sendAnnouncement(newArticle.getIdArticle(), NotificationConstant.Article, newArticle.getArticleTitle()); NotificationUtils.sendAnnouncement(newArticleId, NotificationConstant.Article, newArticle.getArticleTitle());
} else { } else {
// 发送关注通知 // 发送关注通知
StringBuilder dataSummary = new StringBuilder(); StringBuilder dataSummary = new StringBuilder();
if (isUpdate) { if (isUpdate) {
dataSummary.append(user.getNickname()).append("更新了文章: ").append(newArticle.getArticleTitle()); dataSummary.append(user.getNickname()).append("更新了文章: ").append(newArticle.getArticleTitle());
NotificationUtils.sendArticlePush(newArticle.getIdArticle(), NotificationConstant.UpdateArticle, dataSummary.toString(), newArticle.getArticleAuthorId()); NotificationUtils.sendArticlePush(newArticleId, NotificationConstant.UpdateArticle, dataSummary.toString(), newArticle.getArticleAuthorId());
} else { } else {
dataSummary.append(user.getNickname()).append("发布了文章: ").append(newArticle.getArticleTitle()); dataSummary.append(user.getNickname()).append("发布了文章: ").append(newArticle.getArticleTitle());
NotificationUtils.sendArticlePush(newArticle.getIdArticle(), NotificationConstant.PostArticle, dataSummary.toString(), newArticle.getArticleAuthorId()); NotificationUtils.sendArticlePush(newArticleId, NotificationConstant.PostArticle, dataSummary.toString(), newArticle.getArticleAuthorId());
} }
} }
// 草稿不更新索引 // 草稿不更新索引
if (isUpdate) { if (isUpdate) {
log.info("更新文章索引id={}", newArticle.getIdArticle()); log.info("更新文章索引id={}", newArticleId);
luceneService.updateArticle(newArticle.getIdArticle().toString()); luceneService.updateArticle(newArticleId.toString());
} else { } else {
log.info("写入文章索引id={}", newArticle.getIdArticle()); log.info("写入文章索引id={}", newArticleId);
luceneService.writeArticle(newArticle.getIdArticle().toString()); luceneService.writeArticle(newArticleId.toString());
} }
// 更新文章链接 // 更新文章链接
newArticle.setArticlePermalink(domain + "/article/" + newArticle.getIdArticle()); newArticle.setArticlePermalink(domain + "/article/" + newArticleId);
newArticle.setArticleLink("/article/" + newArticle.getIdArticle()); newArticle.setArticleLink("/article/" + newArticleId);
} else { } else {
// 更新文章链接 // 更新文章链接
newArticle.setArticlePermalink(domain + "/draft/" + newArticle.getIdArticle()); newArticle.setArticlePermalink(domain + "/draft/" + newArticleId);
newArticle.setArticleLink("/draft/" + newArticle.getIdArticle()); newArticle.setArticleLink("/draft/" + newArticleId);
} }
tagService.saveTagArticle(newArticle, articleContentHtml); tagService.saveTagArticle(newArticle, articleContentHtml);
@ -194,66 +188,24 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
newArticle.setArticlePreviewContent(previewContent); newArticle.setArticlePreviewContent(previewContent);
} }
articleMapper.updateByPrimaryKeySelective(newArticle); articleMapper.updateByPrimaryKeySelective(newArticle);
return newArticleId;
map.put("id", newArticle.getIdArticle());
return map;
}
private String checkTags(String articleTags) {
// 判断文章是否有标签
if (StringUtils.isBlank(articleTags)) {
return "";
}
// 判断是否存在系统配置的保留标签词
Condition condition = new Condition(Tag.class);
condition.createCriteria().andEqualTo("tagReservation", "1");
List<Tag> tags = tagService.findByCondition(condition);
if (tags.isEmpty()) {
return "";
} else {
String[] articleTagArr = articleTags.split(",");
for (Tag tag : tags) {
if (StringUtils.isBlank(tag.getTagTitle())) {
continue;
}
for (String articleTag : articleTagArr) {
if (StringUtils.isBlank(articleTag)) {
continue;
}
if (articleTag.equals(tag.getTagTitle())) {
return tag.getTagTitle();
}
}
}
}
return "";
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map delete(Integer id) throws BaseApiException { public Integer delete(Long id) throws BaseApiException {
Map<String, String> map = new HashMap(1);
int result;
// 判断是否有评论 // 判断是否有评论
boolean isHavComment = articleMapper.existsCommentWithPrimaryKey(id); if (!articleMapper.existsCommentWithPrimaryKey(id)) {
if (isHavComment) {
map.put("message", "已有评论的文章不允许删除!");
} else {
// 删除关联数据(作品集关联关系,标签关联关系) // 删除关联数据(作品集关联关系,标签关联关系)
deleteLinkedData(id); deleteLinkedData(id);
// 删除文章 // 删除文章
result = articleMapper.deleteByPrimaryKey(id); int result = articleMapper.deleteByPrimaryKey(id);
luceneService.deleteArticle(id.toString()); luceneService.deleteArticle(id.toString());
if (result < 1) { return result;
map.put("message", "删除失败!"); } else throw new DataDuplicationException("已有评论的文章不允许删除!");
}
}
return map;
} }
private void deleteLinkedData(Integer id) { private void deleteLinkedData(Long id) {
// 删除关联作品集 // 删除关联作品集
articleMapper.deleteLinkedPortfolioData(id); articleMapper.deleteLinkedPortfolioData(id);
// 删除引用标签记录 // 删除引用标签记录
@ -266,22 +218,20 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public void incrementArticleViewCount(Integer id) { public void incrementArticleViewCount(Long id) {
Article article = articleMapper.selectByPrimaryKey(id); Article article = articleMapper.selectByPrimaryKey(id);
Integer articleViewCount = article.getArticleViewCount() + 1; Integer articleViewCount = article.getArticleViewCount() + 1;
articleMapper.updateArticleViewCount(article.getIdArticle(), articleViewCount); articleMapper.updateArticleViewCount(article.getIdArticle(), articleViewCount);
} }
@Override @Override
public Map share(Integer id) throws BaseApiException { public String share(Integer id) throws BaseApiException {
Article article = articleMapper.selectByPrimaryKey(id); Article article = articleMapper.selectByPrimaryKey(id);
User user = UserUtils.getCurrentUserByToken(); User user = UserUtils.getCurrentUserByToken();
if (Objects.isNull(user)) { if (Objects.isNull(user)) {
throw new BaseApiException(ErrorCode.INVALID_TOKEN); throw new BaseApiException(ErrorCode.INVALID_TOKEN);
} }
Map map = new HashMap(2); return article.getArticlePermalink() + "?s=" + user.getAccount();
map.put("shareUrl", article.getArticlePermalink() + "?s=" + user.getAccount());
return map;
} }
@Override @Override
@ -296,14 +246,14 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
} }
@Override @Override
public List<ArticleDTO> findArticlesByIdPortfolio(Integer idPortfolio) { public List<ArticleDTO> findArticlesByIdPortfolio(Long idPortfolio) {
List<ArticleDTO> list = articleMapper.selectArticlesByIdPortfolio(idPortfolio); List<ArticleDTO> list = articleMapper.selectArticlesByIdPortfolio(idPortfolio);
list.forEach(articleDTO -> genArticle(articleDTO, 0)); list.forEach(articleDTO -> genArticle(articleDTO, 0));
return list; return list;
} }
@Override @Override
public List<ArticleDTO> selectUnbindArticles(Integer idPortfolio, String searchText, Integer idUser) { public List<ArticleDTO> selectUnbindArticles(Long idPortfolio, String searchText, Long idUser) {
List<ArticleDTO> list = articleMapper.selectUnbindArticlesByIdPortfolio(idPortfolio, searchText, idUser); List<ArticleDTO> list = articleMapper.selectUnbindArticlesByIdPortfolio(idPortfolio, searchText, idUser);
list.forEach(articleDTO -> genArticle(articleDTO, 0)); list.forEach(articleDTO -> genArticle(articleDTO, 0));
return list; return list;
@ -311,32 +261,23 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map updateTags(Integer idArticle, String tags) throws UnsupportedEncodingException, BaseApiException { public Boolean updateTags(Long idArticle, String tags) throws UnsupportedEncodingException, BaseApiException {
Map map = new HashMap(2);
Article article = articleMapper.selectByPrimaryKey(idArticle); Article article = articleMapper.selectByPrimaryKey(idArticle);
if (Objects.nonNull(article)) { if (!Objects.nonNull(article)) {
throw new ContentNotExistException("更新失败,文章不存在!");
}
article.setArticleTags(tags); article.setArticleTags(tags);
articleMapper.updateArticleTags(idArticle, tags); articleMapper.updateArticleTags(idArticle, tags);
tagService.saveTagArticle(article, ""); tagService.saveTagArticle(article, "");
map.put("success", true); return true;
} else {
map.put("success", false);
map.put("message", "更新失败,文章不存在!");
}
return map;
} }
@Override @Override
public Map updatePerfect(Integer idArticle, String articlePerfect) { public Boolean updatePerfect(Long idArticle, String articlePerfect) {
Map map = new HashMap(2); if (articleMapper.updatePerfect(idArticle, articlePerfect) == 0) {
int result = articleMapper.updatePerfect(idArticle, articlePerfect); throw new ContentNotExistException("设置优选文章失败!");
if (result == 0) {
map.put("success", false);
map.put("message", "设置优选文章失败!");
} else {
map.put("success", true);
} }
return map; return true;
} }
@Override @Override
@ -387,4 +328,36 @@ public class ArticleServiceImpl extends AbstractService<Article> implements Arti
author.setUserAccount(user.getAccount()); author.setUserAccount(user.getAccount());
return author; return author;
} }
private String checkTags(String articleTags) {
// 判断文章是否有标签
if (StringUtils.isBlank(articleTags)) {
return "";
}
// 判断是否存在系统配置的保留标签词
Condition condition = new Condition(Tag.class);
condition.createCriteria().andEqualTo("tagReservation", "1");
List<Tag> tags = tagService.findByCondition(condition);
if (tags.isEmpty()) {
return "";
} else {
String[] articleTagArr = articleTags.split(",");
for (Tag tag : tags) {
if (StringUtils.isBlank(tag.getTagTitle())) {
continue;
}
for (String articleTag : articleTagArr) {
if (StringUtils.isBlank(articleTag)) {
continue;
}
if (articleTag.equals(tag.getTagTitle())) {
return tag.getTagTitle();
}
}
}
}
return "";
}
} }

View File

@ -37,7 +37,7 @@ public class BankAccountServiceImpl extends AbstractService<BankAccount> impleme
} }
@Override @Override
public BankAccountDTO findBankAccountByIdUser(Integer idUser) { public BankAccountDTO findBankAccountByIdUser(Long idUser) {
BankAccount bankAccount = new BankAccount(); BankAccount bankAccount = new BankAccount();
bankAccount.setAccountOwner(idUser); bankAccount.setAccountOwner(idUser);
String defaultAccountType = "0"; String defaultAccountType = "0";
@ -79,7 +79,7 @@ public class BankAccountServiceImpl extends AbstractService<BankAccount> impleme
BankAccount bankAccount = new BankAccount(); BankAccount bankAccount = new BankAccount();
bankAccount.setIdBank(1); bankAccount.setIdBank(1);
bankAccount.setAccountType("1"); bankAccount.setAccountType("1");
bankAccount.setAccountOwner(2); bankAccount.setAccountOwner(2L);
return bankAccountMapper.selectOne(bankAccount); return bankAccountMapper.selectOne(bankAccount);
} }

View File

@ -51,7 +51,7 @@ public class FollowServiceImpl extends AbstractService<Follow> implements Follow
} }
@Override @Override
public List<Follow> findByFollowingId(String followType, Integer followingId) { public List<Follow> findByFollowingId(String followType, Long followingId) {
Follow follow = new Follow(); Follow follow = new Follow();
follow.setFollowingType(followType); follow.setFollowingType(followType);
follow.setFollowingId(followingId); follow.setFollowingId(followingId);

View File

@ -33,7 +33,7 @@ public class LoginRecordServiceImpl extends AbstractService<LoginRecord> impleme
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public LoginRecord saveLoginRecord(Integer idUser) { public LoginRecord saveLoginRecord(Long idUser) {
HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest(); HttpServletRequest request = ((ServletRequestAttributes) Objects.requireNonNull(RequestContextHolder.getRequestAttributes())).getRequest();
String ip = Utils.getIpAddress(request); String ip = Utils.getIpAddress(request);
String ua = request.getHeader("user-agent"); String ua = request.getHeader("user-agent");

View File

@ -28,12 +28,12 @@ public class NotificationServiceImpl extends AbstractService<Notification> imple
private final static String UN_READ = "0"; private final static String UN_READ = "0";
@Override @Override
public List<Notification> findUnreadNotifications(Integer idUser) { public List<Notification> findUnreadNotifications(Long idUser) {
return notificationMapper.selectUnreadNotifications(idUser); return notificationMapper.selectUnreadNotifications(idUser);
} }
@Override @Override
public List<NotificationDTO> findNotifications(Integer idUser) { public List<NotificationDTO> findNotifications(Long idUser) {
List<NotificationDTO> list = notificationMapper.selectNotifications(idUser); List<NotificationDTO> list = notificationMapper.selectNotifications(idUser);
list.forEach(notification -> { list.forEach(notification -> {
NotificationDTO notificationDTO = NotificationUtils.genNotification(notification); NotificationDTO notificationDTO = NotificationUtils.genNotification(notification);
@ -57,19 +57,19 @@ public class NotificationServiceImpl extends AbstractService<Notification> imple
} }
@Override @Override
public Notification findNotification(Integer idUser, Integer dataId, String dataType) { public Notification findNotification(Long idUser, Long dataId, String dataType) {
return notificationMapper.selectNotification(idUser, dataId, dataType); return notificationMapper.selectNotification(idUser, dataId, dataType);
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Integer save(Integer idUser, Integer dataId, String dataType, String dataSummary) { public Integer save(Long idUser, Long dataId, String dataType, String dataSummary) {
return notificationMapper.insertNotification(idUser, dataId, dataType, dataSummary); return notificationMapper.insertNotification(idUser, dataId, dataType, dataSummary);
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Integer readNotification(Integer id) { public Integer readNotification(Long id) {
return notificationMapper.readNotification(id); return notificationMapper.readNotification(id);
} }
@ -79,7 +79,7 @@ public class NotificationServiceImpl extends AbstractService<Notification> imple
} }
@Override @Override
public Integer deleteUnreadNotification(Integer dataId, String dataType) { public Integer deleteUnreadNotification(Long dataId, String dataType) {
return notificationMapper.deleteUnreadNotification(dataId, dataType); return notificationMapper.deleteUnreadNotification(dataId, dataType);
} }
} }

View File

@ -4,7 +4,6 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.rymcu.forest.core.service.AbstractService; import com.rymcu.forest.core.service.AbstractService;
import com.rymcu.forest.dto.*; import com.rymcu.forest.dto.*;
import com.rymcu.forest.entity.Article;
import com.rymcu.forest.entity.Portfolio; import com.rymcu.forest.entity.Portfolio;
import com.rymcu.forest.entity.User; import com.rymcu.forest.entity.User;
import com.rymcu.forest.lucene.model.PortfolioLucene; import com.rymcu.forest.lucene.model.PortfolioLucene;
@ -53,7 +52,7 @@ public class PortfolioServiceImpl extends AbstractService<Portfolio> implements
} }
@Override @Override
public PortfolioDTO findPortfolioDTOById(Integer idPortfolio, Integer type) { public PortfolioDTO findPortfolioDTOById(Long idPortfolio, Integer type) {
PortfolioDTO portfolio = portfolioMapper.selectPortfolioDTOById(idPortfolio,type); PortfolioDTO portfolio = portfolioMapper.selectPortfolioDTOById(idPortfolio,type);
if (portfolio == null) { if (portfolio == null) {
return new PortfolioDTO(); return new PortfolioDTO();
@ -68,6 +67,7 @@ public class PortfolioServiceImpl extends AbstractService<Portfolio> implements
@Override @Override
public Portfolio postPortfolio(Portfolio portfolio) throws BaseApiException { public Portfolio postPortfolio(Portfolio portfolio) throws BaseApiException {
User user = UserUtils.getCurrentUserByToken(); User user = UserUtils.getCurrentUserByToken();
assert user != null;
if (StringUtils.isNotBlank(portfolio.getHeadImgType())) { if (StringUtils.isNotBlank(portfolio.getHeadImgType())) {
String headImgUrl = UploadController.uploadBase64File(portfolio.getHeadImgUrl(), 0); String headImgUrl = UploadController.uploadBase64File(portfolio.getHeadImgUrl(), 0);
portfolio.setHeadImgUrl(headImgUrl); portfolio.setHeadImgUrl(headImgUrl);
@ -98,7 +98,7 @@ public class PortfolioServiceImpl extends AbstractService<Portfolio> implements
} }
@Override @Override
public Map findUnbindArticles(Integer page, Integer rows, String searchText, Integer idPortfolio) throws BaseApiException { public Map findUnbindArticles(Integer page, Integer rows, String searchText, Long idPortfolio) throws BaseApiException {
Map map = new HashMap(1); Map map = new HashMap(1);
User user = UserUtils.getCurrentUserByToken(); User user = UserUtils.getCurrentUserByToken();
Portfolio portfolio = portfolioMapper.selectByPrimaryKey(idPortfolio); Portfolio portfolio = portfolioMapper.selectByPrimaryKey(idPortfolio);
@ -153,7 +153,7 @@ public class PortfolioServiceImpl extends AbstractService<Portfolio> implements
} }
@Override @Override
public Map unbindArticle(Integer idPortfolio, Integer idArticle) { public Map unbindArticle(Long idPortfolio, Long idArticle) {
Map map = new HashMap(1); Map map = new HashMap(1);
if (idPortfolio == null || idPortfolio.equals(0)) { if (idPortfolio == null || idPortfolio.equals(0)) {
map.put("message", "作品集数据异常"); map.put("message", "作品集数据异常");
@ -171,7 +171,7 @@ public class PortfolioServiceImpl extends AbstractService<Portfolio> implements
} }
@Override @Override
public Map deletePortfolio(Integer idPortfolio) throws BaseApiException { public Map deletePortfolio(Long idPortfolio) throws BaseApiException {
Map map = new HashMap(1); Map map = new HashMap(1);
if (idPortfolio == null || idPortfolio.equals(0)) { if (idPortfolio == null || idPortfolio.equals(0)) {
map.put("message", "作品集数据异常"); map.put("message", "作品集数据异常");

View File

@ -32,7 +32,7 @@ public class RoleServiceImpl extends AbstractService<Role> implements RoleServic
} }
@Override @Override
public List<Role> findByIdUser(Integer idUser) { public List<Role> findByIdUser(Long idUser) {
return roleMapper.selectRoleByIdUser(idUser); return roleMapper.selectRoleByIdUser(idUser);
} }

View File

@ -70,7 +70,7 @@ public class TransactionRecordServiceImpl extends AbstractService<TransactionRec
} }
@Override @Override
public TransactionRecord userTransfer(Integer toUserId, Integer formUserId, TransactionEnum transactionType) throws Exception { public TransactionRecord userTransfer(Long toUserId, Long formUserId, TransactionEnum transactionType) throws Exception {
BankAccountDTO toBankAccount = bankAccountService.findBankAccountByIdUser(toUserId); BankAccountDTO toBankAccount = bankAccountService.findBankAccountByIdUser(toUserId);
BankAccountDTO formBankAccount = bankAccountService.findBankAccountByIdUser(formUserId); BankAccountDTO formBankAccount = bankAccountService.findBankAccountByIdUser(formUserId);
TransactionRecord transactionRecord = new TransactionRecord(); TransactionRecord transactionRecord = new TransactionRecord();
@ -82,7 +82,7 @@ public class TransactionRecordServiceImpl extends AbstractService<TransactionRec
} }
@Override @Override
public TransactionRecord bankTransfer(Integer idUser, TransactionEnum transactionType) throws Exception { public TransactionRecord bankTransfer(Long idUser, TransactionEnum transactionType) throws Exception {
BankAccountDTO toBankAccount = bankAccountService.findBankAccountByIdUser(idUser); BankAccountDTO toBankAccount = bankAccountService.findBankAccountByIdUser(idUser);
Boolean isTrue; Boolean isTrue;
// 校验货币规则 // 校验货币规则

View File

@ -169,7 +169,7 @@ public class UserServiceImpl extends AbstractService<User> implements UserServic
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public Map updateStatus(Integer idUser, String status) { public Map updateStatus(Long idUser, String status) {
Map map = new HashMap(2); Map map = new HashMap(2);
Integer result = userMapper.updateStatus(idUser, status); Integer result = userMapper.updateStatus(idUser, status);
if (result == 0) { if (result == 0) {
@ -231,7 +231,7 @@ public class UserServiceImpl extends AbstractService<User> implements UserServic
} }
@Override @Override
public Map checkNickname(Integer idUser, String nickname) { public Map checkNickname(Long idUser, String nickname) {
Map map = new HashMap(2); Map map = new HashMap(2);
Integer number = userMapper.checkNicknameByIdUser(idUser, nickname); Integer number = userMapper.checkNicknameByIdUser(idUser, nickname);
if (number > 0) { if (number > 0) {
@ -241,12 +241,12 @@ public class UserServiceImpl extends AbstractService<User> implements UserServic
} }
@Override @Override
public Integer findRoleWeightsByUser(Integer idUser) { public Integer findRoleWeightsByUser(Long idUser) {
return userMapper.selectRoleWeightsByUser(idUser); return userMapper.selectRoleWeightsByUser(idUser);
} }
@Override @Override
public Author selectAuthor(Integer idUser) { public Author selectAuthor(Long idUser) {
return userMapper.selectAuthor(idUser); return userMapper.selectAuthor(idUser);
} }

View File

@ -29,7 +29,7 @@ public class NotificationUtils {
private static ArticleService articleService = SpringContextHolder.getBean(ArticleService.class); private static ArticleService articleService = SpringContextHolder.getBean(ArticleService.class);
private static CommentService commentService = SpringContextHolder.getBean(CommentService.class); private static CommentService commentService = SpringContextHolder.getBean(CommentService.class);
public static void sendAnnouncement(Integer dataId, String dataType, String dataSummary) { public static void sendAnnouncement(Long dataId, String dataType, String dataSummary) {
ExecutorService executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); ExecutorService executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
CompletableFuture.supplyAsync(() -> { CompletableFuture.supplyAsync(() -> {
try { try {
@ -44,7 +44,7 @@ public class NotificationUtils {
}, executor); }, executor);
} }
public static void saveNotification(Integer idUser, Integer dataId, String dataType, String dataSummary) { public static void saveNotification(Long idUser, Long dataId, String dataType, String dataSummary) {
ExecutorService executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); ExecutorService executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
CompletableFuture.supplyAsync(() -> { CompletableFuture.supplyAsync(() -> {
try { try {
@ -70,7 +70,7 @@ public class NotificationUtils {
} }
public static void sendArticlePush(Integer dataId, String dataType, String dataSummary, Integer articleAuthorId) { public static void sendArticlePush(Long dataId, String dataType, String dataSummary, Long articleAuthorId) {
ExecutorService executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>()); ExecutorService executor = new ThreadPoolExecutor(1, 1, 0L, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<Runnable>());
CompletableFuture.supplyAsync(() -> { CompletableFuture.supplyAsync(() -> {
try { try {
@ -154,11 +154,9 @@ public class NotificationUtils {
private static String getFollowLink(String followingType, String id) { private static String getFollowLink(String followingType, String id) {
StringBuilder url = new StringBuilder(); StringBuilder url = new StringBuilder();
url.append(Utils.getProperty("resource.domain")); url.append(Utils.getProperty("resource.domain"));
switch (followingType) { if ("0".equals(followingType)) {
case "0": url.append("/user/").append(id);
url = url.append("/user/").append(id); } else {
break;
default:
url.append("/notification"); url.append("/notification");
} }
return url.toString(); return url.toString();

View File

@ -26,8 +26,9 @@ public class AdminArticleController {
private ArticleService articleService; private ArticleService articleService;
@PatchMapping("/update-perfect") @PatchMapping("/update-perfect")
public GlobalResult updatePerfect(@RequestBody Article article) { public GlobalResult<Boolean> updatePerfect(@RequestBody Article article) {
Map map = articleService.updatePerfect(article.getIdArticle(), article.getArticlePerfect()); Long idArticle = article.getIdArticle();
return GlobalResultGenerator.genSuccessResult(map); String articlePerfect = article.getArticlePerfect();
return GlobalResultGenerator.genSuccessResult(articleService.updatePerfect(idArticle, articlePerfect));
} }
} }

View File

@ -54,7 +54,7 @@ public class AdminController {
} }
@GetMapping("/user/{idUser}/role") @GetMapping("/user/{idUser}/role")
public GlobalResult<List<Role>> userRole(@PathVariable Integer idUser){ public GlobalResult<List<Role>> userRole(@PathVariable Long idUser){
List<Role> roles = roleService.findByIdUser(idUser); List<Role> roles = roleService.findByIdUser(idUser);
return GlobalResultGenerator.genSuccessResult(roles); return GlobalResultGenerator.genSuccessResult(roles);
} }

View File

@ -43,61 +43,52 @@ public class ArticleController {
private SponsorService sponsorService; private SponsorService sponsorService;
@GetMapping("/detail/{idArticle}") @GetMapping("/detail/{idArticle}")
public GlobalResult<Map<String, Object>> detail(@PathVariable Integer idArticle, @RequestParam(defaultValue = "2") Integer type) { public GlobalResult<ArticleDTO> detail(@PathVariable Long idArticle, @RequestParam(defaultValue = "2") Integer type) {
ArticleDTO articleDTO = articleService.findArticleDTOById(idArticle, type); ArticleDTO dto = articleService.findArticleDTOById(idArticle, type);
Map map = new HashMap<>(1); return GlobalResultGenerator.genSuccessResult(dto);
map.put("article", articleDTO);
return GlobalResultGenerator.genSuccessResult(map);
} }
@PostMapping("/post") @PostMapping("/post")
public GlobalResult postArticle(@RequestBody ArticleDTO article, HttpServletRequest request) throws BaseApiException, UnsupportedEncodingException { public GlobalResult<Long> postArticle(@RequestBody ArticleDTO article, HttpServletRequest request) throws BaseApiException, UnsupportedEncodingException {
Map map = articleService.postArticle(article, request); return GlobalResultGenerator.genSuccessResult(articleService.postArticle(article, request));
return GlobalResultGenerator.genSuccessResult(map);
} }
@PutMapping("/post") @PutMapping("/post")
@AuthorshipInterceptor(moduleName = Module.ARTICLE) @AuthorshipInterceptor(moduleName = Module.ARTICLE)
public GlobalResult updateArticle(@RequestBody ArticleDTO article, HttpServletRequest request) throws BaseApiException, UnsupportedEncodingException { public GlobalResult<Long> updateArticle(@RequestBody ArticleDTO article, HttpServletRequest request) throws BaseApiException, UnsupportedEncodingException {
Map map = articleService.postArticle(article, request); return GlobalResultGenerator.genSuccessResult(articleService.postArticle(article, request));
return GlobalResultGenerator.genSuccessResult(map);
} }
@DeleteMapping("/delete/{idArticle}") @DeleteMapping("/delete/{idArticle}")
@AuthorshipInterceptor(moduleName = Module.ARTICLE) @AuthorshipInterceptor(moduleName = Module.ARTICLE)
public GlobalResult delete(@PathVariable Integer idArticle) throws BaseApiException { public GlobalResult<Integer> delete(@PathVariable Long idArticle) throws BaseApiException {
Map map = articleService.delete(idArticle); return GlobalResultGenerator.genSuccessResult(articleService.delete(idArticle));
return GlobalResultGenerator.genSuccessResult(map);
} }
@GetMapping("/{idArticle}/comments") @GetMapping("/{idArticle}/comments")
public GlobalResult<Map<String, Object>> commons(@PathVariable Integer idArticle) { public GlobalResult<List<CommentDTO>> commons(@PathVariable Integer idArticle) {
List<CommentDTO> commentDTOList = commentService.getArticleComments(idArticle); return GlobalResultGenerator.genSuccessResult(commentService.getArticleComments(idArticle));
Map map = new HashMap<>(1);
map.put("comments", commentDTOList);
return GlobalResultGenerator.genSuccessResult(map);
} }
@GetMapping("/drafts") @GetMapping("/drafts")
public GlobalResult drafts(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows) throws BaseApiException { public GlobalResult<PageInfo<ArticleDTO>> drafts(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows) throws BaseApiException {
PageHelper.startPage(page, rows); PageHelper.startPage(page, rows);
List<ArticleDTO> list = articleService.findDrafts(); List<ArticleDTO> list = articleService.findDrafts();
PageInfo<ArticleDTO> pageInfo = new PageInfo(list); PageInfo<ArticleDTO> pageInfo = new PageInfo<>(list);
Map map = Utils.getArticlesGlobalResult(pageInfo); return GlobalResultGenerator.genSuccessResult(pageInfo);
return GlobalResultGenerator.genSuccessResult(map);
} }
@GetMapping("/{idArticle}/share") @GetMapping("/{idArticle}/share")
public GlobalResult share(@PathVariable Integer idArticle) throws BaseApiException { public GlobalResult<String> share(@PathVariable Integer idArticle) throws BaseApiException {
Map map = articleService.share(idArticle); return GlobalResultGenerator.genSuccessResult(articleService.share(idArticle));
return GlobalResultGenerator.genSuccessResult(map);
} }
@PostMapping("/update-tags") @PostMapping("/update-tags")
@AuthorshipInterceptor(moduleName = Module.ARTICLE_TAG) @AuthorshipInterceptor(moduleName = Module.ARTICLE_TAG)
public GlobalResult updateTags(@RequestBody Article article) throws BaseApiException, UnsupportedEncodingException { public GlobalResult<Boolean> updateTags(@RequestBody Article article) throws BaseApiException, UnsupportedEncodingException {
Map map = articleService.updateTags(article.getIdArticle(), article.getArticleTags()); Long idArticle = article.getIdArticle();
return GlobalResultGenerator.genSuccessResult(map); String articleTags = article.getArticleTags();
return GlobalResultGenerator.genSuccessResult(articleService.updateTags(idArticle, articleTags));
} }
@PostMapping("/thumbs-up") @PostMapping("/thumbs-up")

View File

@ -43,7 +43,7 @@ public class BankAccountController {
} }
@GetMapping("/{idUser}") @GetMapping("/{idUser}")
public GlobalResult detail(@PathVariable Integer idUser) { public GlobalResult detail(@PathVariable Long idUser) {
BankAccountDTO bankAccount = bankAccountService.findBankAccountByIdUser(idUser); BankAccountDTO bankAccount = bankAccountService.findBankAccountByIdUser(idUser);
return GlobalResultGenerator.genSuccessResult(bankAccount); return GlobalResultGenerator.genSuccessResult(bankAccount);
} }

View File

@ -33,7 +33,7 @@ public class WalletController {
@GetMapping("/{idUser}") @GetMapping("/{idUser}")
@SecurityInterceptor @SecurityInterceptor
public GlobalResult detail(@PathVariable Integer idUser) { public GlobalResult detail(@PathVariable Long idUser) {
BankAccountDTO bankAccount = bankAccountService.findBankAccountByIdUser(idUser); BankAccountDTO bankAccount = bankAccountService.findBankAccountByIdUser(idUser);
return GlobalResultGenerator.genSuccessResult(bankAccount); return GlobalResultGenerator.genSuccessResult(bankAccount);
} }
@ -44,7 +44,7 @@ public class WalletController {
String idUser = request.getParameter("idUser"); String idUser = request.getParameter("idUser");
String startDate = request.getParameter("startDate"); String startDate = request.getParameter("startDate");
String endDate = request.getParameter("endDate"); String endDate = request.getParameter("endDate");
BankAccountDTO bankAccount = bankAccountService.findBankAccountByIdUser(Integer.valueOf(idUser)); BankAccountDTO bankAccount = bankAccountService.findBankAccountByIdUser(Long.valueOf(idUser));
PageHelper.startPage(page, rows); PageHelper.startPage(page, rows);
List<TransactionRecordDTO> list = bankAccountService.findUserTransactionRecords(bankAccount.getBankAccount(), startDate, endDate); List<TransactionRecordDTO> list = bankAccountService.findUserTransactionRecords(bankAccount.getBankAccount(), startDate, endDate);
PageInfo<TransactionRecordDTO> pageInfo = new PageInfo(list); PageInfo<TransactionRecordDTO> pageInfo = new PageInfo(list);

View File

@ -106,11 +106,9 @@ public class CommonApiController {
@GetMapping("/article/{id}") @GetMapping("/article/{id}")
@VisitLogger @VisitLogger
public GlobalResult<Map<String, Object>> article(@PathVariable Integer id) { public GlobalResult<ArticleDTO> article(@PathVariable Long id) {
ArticleDTO articleDTO = articleService.findArticleDTOById(id, 1); ArticleDTO articleDTO = articleService.findArticleDTOById(id, 1);
Map<String, Object> map = new HashMap<>(1); return GlobalResultGenerator.genSuccessResult(articleDTO);
map.put("article", articleDTO);
return GlobalResultGenerator.genSuccessResult(map);
} }
@PatchMapping("/forget-password") @PatchMapping("/forget-password")
@ -121,7 +119,7 @@ public class CommonApiController {
@GetMapping("/portfolio/{id}") @GetMapping("/portfolio/{id}")
@VisitLogger @VisitLogger
public GlobalResult<Map<String, Object>> portfolio(@PathVariable Integer id) { public GlobalResult<Map<String, Object>> portfolio(@PathVariable Long id) {
PortfolioDTO portfolioDTO = portfolioService.findPortfolioDTOById(id, 1); PortfolioDTO portfolioDTO = portfolioService.findPortfolioDTOById(id, 1);
Map<String, Object> map = new HashMap<>(1); Map<String, Object> map = new HashMap<>(1);
map.put("portfolio", portfolioDTO); map.put("portfolio", portfolioDTO);
@ -129,7 +127,7 @@ public class CommonApiController {
} }
@GetMapping("/portfolio/{id}/articles") @GetMapping("/portfolio/{id}/articles")
public GlobalResult articles(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows, @PathVariable Integer id) { public GlobalResult articles(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows, @PathVariable Long id) {
PageHelper.startPage(page, rows); PageHelper.startPage(page, rows);
List<ArticleDTO> list = articleService.findArticlesByIdPortfolio(id); List<ArticleDTO> list = articleService.findArticlesByIdPortfolio(id);
PageInfo<ArticleDTO> pageInfo = new PageInfo(list); PageInfo<ArticleDTO> pageInfo = new PageInfo(list);

View File

@ -57,7 +57,7 @@ public class NotificationController {
} }
@PutMapping("/read/{id}") @PutMapping("/read/{id}")
public GlobalResult read(@PathVariable Integer id) { public GlobalResult read(@PathVariable Long id) {
Integer result = notificationService.readNotification(id); Integer result = notificationService.readNotification(id);
if (result == 0) { if (result == 0) {
return GlobalResultGenerator.genErrorResult("标记已读失败"); return GlobalResultGenerator.genErrorResult("标记已读失败");

View File

@ -26,7 +26,7 @@ public class PortfolioController {
private PortfolioService portfolioService; private PortfolioService portfolioService;
@GetMapping("/detail/{idPortfolio}") @GetMapping("/detail/{idPortfolio}")
public GlobalResult detail(@PathVariable Integer idPortfolio,@RequestParam(defaultValue = "0") Integer type) { public GlobalResult detail(@PathVariable Long idPortfolio,@RequestParam(defaultValue = "0") Integer type) {
PortfolioDTO portfolio = portfolioService.findPortfolioDTOById(idPortfolio, type); PortfolioDTO portfolio = portfolioService.findPortfolioDTOById(idPortfolio, type);
Map map = new HashMap<>(1); Map map = new HashMap<>(1);
map.put("portfolio", portfolio); map.put("portfolio", portfolio);
@ -48,7 +48,7 @@ public class PortfolioController {
@GetMapping("/{idPortfolio}/unbind-articles") @GetMapping("/{idPortfolio}/unbind-articles")
@AuthorshipInterceptor(moduleName = Module.PORTFOLIO) @AuthorshipInterceptor(moduleName = Module.PORTFOLIO)
public GlobalResult unbindArticles(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows, @RequestParam(defaultValue = "") String searchText,@PathVariable Integer idPortfolio) throws BaseApiException { public GlobalResult unbindArticles(@RequestParam(defaultValue = "0") Integer page, @RequestParam(defaultValue = "10") Integer rows, @RequestParam(defaultValue = "") String searchText,@PathVariable Long idPortfolio) throws BaseApiException {
Map map = portfolioService.findUnbindArticles(page, rows, searchText, idPortfolio); Map map = portfolioService.findUnbindArticles(page, rows, searchText, idPortfolio);
return GlobalResultGenerator.genSuccessResult(map); return GlobalResultGenerator.genSuccessResult(map);
} }
@ -69,14 +69,14 @@ public class PortfolioController {
@DeleteMapping("/unbind-article") @DeleteMapping("/unbind-article")
@AuthorshipInterceptor(moduleName = Module.PORTFOLIO) @AuthorshipInterceptor(moduleName = Module.PORTFOLIO)
public GlobalResult unbindArticle(Integer idArticle,Integer idPortfolio) { public GlobalResult unbindArticle(Long idArticle, Long idPortfolio) {
Map map = portfolioService.unbindArticle(idPortfolio,idArticle); Map map = portfolioService.unbindArticle(idPortfolio,idArticle);
return GlobalResultGenerator.genSuccessResult(map); return GlobalResultGenerator.genSuccessResult(map);
} }
@DeleteMapping("/delete") @DeleteMapping("/delete")
@AuthorshipInterceptor(moduleName = Module.PORTFOLIO) @AuthorshipInterceptor(moduleName = Module.PORTFOLIO)
public GlobalResult delete(Integer idPortfolio) throws BaseApiException { public GlobalResult delete(Long idPortfolio) throws BaseApiException {
Map map = portfolioService.deletePortfolio(idPortfolio); Map map = portfolioService.deletePortfolio(idPortfolio);
return GlobalResultGenerator.genSuccessResult(map); return GlobalResultGenerator.genSuccessResult(map);
} }

View File

@ -41,7 +41,7 @@ public class UserInfoController {
@GetMapping("/check-nickname") @GetMapping("/check-nickname")
@SecurityInterceptor @SecurityInterceptor
public GlobalResult checkNickname(@RequestParam Integer idUser, @RequestParam String nickname) { public GlobalResult checkNickname(@RequestParam Long idUser, @RequestParam String nickname) {
Map map = userService.checkNickname(idUser, nickname); Map map = userService.checkNickname(idUser, nickname);
return GlobalResultGenerator.genSuccessResult(map); return GlobalResultGenerator.genSuccessResult(map);
} }

View File

@ -5,7 +5,7 @@
<!-- <!--
WARNING - @mbg.generated WARNING - @mbg.generated
--> -->
<id column="id" jdbcType="INTEGER" property="idArticle"/> <id column="id" jdbcType="BIGINT" property="idArticle"/>
<result column="article_title" property="articleTitle"></result> <result column="article_title" property="articleTitle"></result>
<result column="article_thumbnail_url" property="articleThumbnailUrl"></result> <result column="article_thumbnail_url" property="articleThumbnailUrl"></result>
<result column="article_author_id" property="articleAuthorId"></result> <result column="article_author_id" property="articleAuthorId"></result>