关注粉丝列表
This commit is contained in:
parent
599696d68c
commit
305bc4eb86
@ -8,6 +8,8 @@ import com.dd.admin.business.author.entity.Author;
|
|||||||
import com.dd.admin.business.author.service.AuthorService;
|
import com.dd.admin.business.author.service.AuthorService;
|
||||||
import com.dd.admin.business.file.entity.File;
|
import com.dd.admin.business.file.entity.File;
|
||||||
import com.dd.admin.business.file.service.FileService;
|
import com.dd.admin.business.file.service.FileService;
|
||||||
|
import com.dd.admin.business.follow.domain.FollowDto;
|
||||||
|
import com.dd.admin.business.follow.domain.FollowVo;
|
||||||
import com.dd.admin.business.follow.entity.Follow;
|
import com.dd.admin.business.follow.entity.Follow;
|
||||||
import com.dd.admin.business.follow.service.FollowService;
|
import com.dd.admin.business.follow.service.FollowService;
|
||||||
import com.dd.admin.business.note.domain.NoteDto;
|
import com.dd.admin.business.note.domain.NoteDto;
|
||||||
@ -32,6 +34,7 @@ import com.dd.admin.business.upReplys.entity.UpReplys;
|
|||||||
import com.dd.admin.business.upReplys.service.UpReplysService;
|
import com.dd.admin.business.upReplys.service.UpReplysService;
|
||||||
import com.dd.admin.common.aop.operationLog.aop.OperLog;
|
import com.dd.admin.common.aop.operationLog.aop.OperLog;
|
||||||
import com.dd.admin.common.aop.operationLog.aop.OperType;
|
import com.dd.admin.common.aop.operationLog.aop.OperType;
|
||||||
|
import com.dd.admin.common.exception.ApiException;
|
||||||
import com.dd.admin.common.model.result.ResultBean;
|
import com.dd.admin.common.model.result.ResultBean;
|
||||||
import com.dd.admin.common.utils.AddressUtils;
|
import com.dd.admin.common.utils.AddressUtils;
|
||||||
import com.dd.admin.common.utils.CommonUtil;
|
import com.dd.admin.common.utils.CommonUtil;
|
||||||
@ -154,7 +157,6 @@ public class AuthApi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "获取所有点赞笔记")
|
@ApiOperation(value = "获取所有点赞笔记")
|
||||||
@ApiOperationSupport(order = 1)
|
@ApiOperationSupport(order = 1)
|
||||||
@GetMapping("/api/auth/getUpNotes")
|
@GetMapping("/api/auth/getUpNotes")
|
||||||
@ -190,9 +192,90 @@ public class AuthApi {
|
|||||||
public ResultBean<Author> getMine() {
|
public ResultBean<Author> getMine() {
|
||||||
String authorId = String.valueOf(request.getAttribute("authorId"));
|
String authorId = String.valueOf(request.getAttribute("authorId"));
|
||||||
Author author = authorService.getById(authorId);
|
Author author = authorService.getById(authorId);
|
||||||
|
//关注我的列表
|
||||||
|
List<FollowVo> followMes = followService.selectFollowList(new FollowDto().setAuthorId(author.getAuthorId()));
|
||||||
|
List<FollowVo> myFollows = followService.selectFollowList(new FollowDto().setFollowId(author.getAuthorId()));
|
||||||
|
|
||||||
|
author.setFollow(Long.valueOf(myFollows.size()));
|
||||||
|
author.setFans(Long.valueOf(followMes.size()));
|
||||||
|
author.setFollowMes(followMes);
|
||||||
|
author.setMyFollows(myFollows);
|
||||||
|
Long upAndStarTotalCount = authorService.selectAuthorUpAndStarTotalCount(authorId);
|
||||||
|
author.setUpAndStarCount(upAndStarTotalCount);
|
||||||
return ResultBean.success(author);
|
return ResultBean.success(author);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取关注目标作者的所有粉丝")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@GetMapping("/api/auth/getFollowMes")
|
||||||
|
@OperLog(operModule = "获取关注目标作者的所有粉丝",operType = OperType.QUERY,operDesc = "获取关注目标作者的所有粉丝")
|
||||||
|
public ResultBean getFollowMes(String authorId) {
|
||||||
|
//关注我的列表
|
||||||
|
List<FollowVo> followMes = followService.selectFollowMeList(authorId);
|
||||||
|
followMes.stream().forEach(followVo -> {
|
||||||
|
followVo.setIsFollowMe(Boolean.TRUE);
|
||||||
|
});
|
||||||
|
return ResultBean.success(followMes);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取关注目标作者的关注的所有博主")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@GetMapping("/api/auth/getMyFollows")
|
||||||
|
@OperLog(operModule = "getMyFollows",operType = OperType.QUERY,operDesc = "获取关注目标作者的所有粉丝")
|
||||||
|
public ResultBean getMyFollows(String authorId) {
|
||||||
|
//关注我的列表
|
||||||
|
List<FollowVo> myFollows = followService.selectMyFollowList(authorId);
|
||||||
|
return ResultBean.success(myFollows);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取作者信息")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@GetMapping("/api/auth/getAuthor")
|
||||||
|
@OperLog(operModule = "获取作者信息",operType = OperType.QUERY,operDesc = "获取作者信息")
|
||||||
|
public ResultBean<Author> getAuthor(String authorId) {
|
||||||
|
String followId = String.valueOf(request.getAttribute("authorId"));
|
||||||
|
|
||||||
|
Author author = authorService.getById(authorId);
|
||||||
|
//我是否关注过
|
||||||
|
Follow isFollow= followService.selectOneByFollowId(authorId, followId);
|
||||||
|
if(isFollow!=null){
|
||||||
|
author.setIsFollow(Boolean.TRUE);
|
||||||
|
}
|
||||||
|
//是否关注过我
|
||||||
|
Follow isFollowMe= followService.selectOneByFollowId(followId, authorId);
|
||||||
|
if(isFollowMe!=null){
|
||||||
|
author.setIsFollowMe(Boolean.TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
|
//关注我的列表
|
||||||
|
List<FollowVo> followMes = followService.selectFollowList(new FollowDto().setAuthorId(author.getAuthorId()));
|
||||||
|
List<FollowVo> myFollows = followService.selectFollowList(new FollowDto().setFollowId(author.getAuthorId()));
|
||||||
|
|
||||||
|
author.setFollow(Long.valueOf(myFollows.size()));
|
||||||
|
author.setFans(Long.valueOf(followMes.size()));
|
||||||
|
author.setFollowMes(followMes);
|
||||||
|
author.setMyFollows(myFollows);
|
||||||
|
Long upAndStarTotalCount = authorService.selectAuthorUpAndStarTotalCount(authorId);
|
||||||
|
author.setUpAndStarCount(upAndStarTotalCount);
|
||||||
|
return ResultBean.success(author);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "获取目标博主笔记")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@GetMapping("/api/auth/getAuthorNotes")
|
||||||
|
@OperLog(operModule = "获取目标博主笔记",operType = OperType.QUERY,operDesc = "获取目标博主笔记")
|
||||||
|
public ResultBean<IPage<NoteVo>> getAuthorNotes(String authorId) {
|
||||||
|
String followId = String.valueOf(request.getAttribute("authorId"));
|
||||||
|
NoteDto noteDto = new NoteDto();
|
||||||
|
noteDto.setFollowId(followId);
|
||||||
|
noteDto.setAuthorId(authorId);
|
||||||
|
IPage<NoteVo> pageInfo = noteService.selectNotePage(noteDto);
|
||||||
|
return ResultBean.success(pageInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "获取当前博主笔记")
|
@ApiOperation(value = "获取当前博主笔记")
|
||||||
@ApiOperationSupport(order = 1)
|
@ApiOperationSupport(order = 1)
|
||||||
@ -207,6 +290,60 @@ public class AuthApi {
|
|||||||
return ResultBean.success(pageInfo);
|
return ResultBean.success(pageInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation(value = "关注博主")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@PostMapping("/api/auth/followAuthor")
|
||||||
|
@OperLog(operModule = "关注博主",operType = OperType.ADD,operDesc = "关注博主")
|
||||||
|
public ResultBean followAuthor(@RequestBody FollowDto followDto) {
|
||||||
|
String followId = String.valueOf(request.getAttribute("authorId"));
|
||||||
|
Author follow = authorService.getById(followId);
|
||||||
|
//查看在不在点赞列表
|
||||||
|
Follow oneByFollow= followService.selectOneByFollowId(followDto.getAuthorId(), followId);
|
||||||
|
//不在证明是点赞
|
||||||
|
if(oneByFollow==null){
|
||||||
|
String authorId = followDto.getAuthorId();
|
||||||
|
Author author = authorService.getById(authorId);
|
||||||
|
|
||||||
|
oneByFollow = new Follow();
|
||||||
|
oneByFollow.setAuthorId(author.getAuthorId());
|
||||||
|
oneByFollow.setAuthorName(author.getAuthorName());
|
||||||
|
oneByFollow.setFollowId(follow.getAuthorId());
|
||||||
|
oneByFollow.setFollowName(follow.getAuthorName());
|
||||||
|
followService.save(oneByFollow);
|
||||||
|
}else{
|
||||||
|
throw new ApiException("已经关注过了~");
|
||||||
|
}
|
||||||
|
return ResultBean.success();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ApiOperation(value = "取消关注博主")
|
||||||
|
@ApiOperationSupport(order = 1)
|
||||||
|
@PostMapping("/api/auth/cancelfollowAuthor")
|
||||||
|
@OperLog(operModule = "取消关注博主",operType = OperType.ADD,operDesc = "取消关注博主")
|
||||||
|
public ResultBean cancelfollowAuthor(@RequestBody FollowDto followDto) {
|
||||||
|
String followId = String.valueOf(request.getAttribute("authorId"));
|
||||||
|
Author follow = authorService.getById(followId);
|
||||||
|
//查看在不在关注列表
|
||||||
|
Follow oneByFollow= followService.selectOneByFollowId(followDto.getAuthorId(), followId);
|
||||||
|
//不为空证明关注过
|
||||||
|
if(oneByFollow!=null){
|
||||||
|
String authorId = followDto.getAuthorId();
|
||||||
|
Author author = authorService.getById(authorId);
|
||||||
|
|
||||||
|
oneByFollow.setAuthorId(author.getAuthorId());
|
||||||
|
oneByFollow.setAuthorName(author.getAuthorName());
|
||||||
|
oneByFollow.setFollowId(follow.getAuthorId());
|
||||||
|
oneByFollow.setFollowName(follow.getAuthorName());
|
||||||
|
followService.removeById(oneByFollow);
|
||||||
|
}else{
|
||||||
|
throw new ApiException("你还未关注博主~");
|
||||||
|
}
|
||||||
|
return ResultBean.success();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "点赞笔记")
|
@ApiOperation(value = "点赞笔记")
|
||||||
@ApiOperationSupport(order = 1)
|
@ApiOperationSupport(order = 1)
|
||||||
|
@ -2,6 +2,8 @@ package com.dd.admin.business.author.entity;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import com.baomidou.mybatisplus.annotation.Version;
|
import com.baomidou.mybatisplus.annotation.Version;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
@ -9,6 +11,10 @@ import com.baomidou.mybatisplus.annotation.FieldFill;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.dd.admin.business.follow.domain.FollowDto;
|
||||||
|
import com.dd.admin.business.follow.domain.FollowVo;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@ -142,4 +148,19 @@ public class Author implements Serializable {
|
|||||||
|
|
||||||
@TableField(exist = false)
|
@TableField(exist = false)
|
||||||
private String token;
|
private String token;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean isFollow = Boolean.FALSE;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Boolean isFollowMe = Boolean.FALSE;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
List<FollowVo> followMes = new ArrayList<>();
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
List<FollowVo> myFollows = new ArrayList<>();
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
private Long upAndStarCount;
|
||||||
}
|
}
|
||||||
|
@ -25,4 +25,6 @@ public interface AuthorMapper extends BaseMapper<Author> {
|
|||||||
IPage<AuthorVo> selectAuthorPage(Page<AuthorVo> page, @Param("authorDto") AuthorDto authorDto);
|
IPage<AuthorVo> selectAuthorPage(Page<AuthorVo> page, @Param("authorDto") AuthorDto authorDto);
|
||||||
|
|
||||||
List<AuthorVo> selectAuthorList(@Param("authorDto") AuthorDto authorDto);
|
List<AuthorVo> selectAuthorList(@Param("authorDto") AuthorDto authorDto);
|
||||||
|
|
||||||
|
Long selectAuthorUpAndStarTotalCount(@Param("authorId") String authorId);
|
||||||
}
|
}
|
||||||
|
@ -49,4 +49,15 @@
|
|||||||
*
|
*
|
||||||
from business_author where 1 = 1
|
from business_author where 1 = 1
|
||||||
</select>
|
</select>
|
||||||
|
<select id="selectAuthorUpAndStarTotalCount" resultType="java.lang.Long">
|
||||||
|
|
||||||
|
SELECT IFNULL(SUM(subquery_counts.count_value), 0) AS total_count
|
||||||
|
FROM (
|
||||||
|
SELECT COUNT(*) AS count_value FROM business_up_notes WHERE AUTHOR_ID = #{authorId}
|
||||||
|
UNION ALL
|
||||||
|
SELECT COUNT(*) AS count_value FROM business_star_notes WHERE AUTHOR_ID = #{authorId}
|
||||||
|
UNION ALL
|
||||||
|
SELECT COUNT(*) AS count_value FROM business_up_replys WHERE AUTHOR_ID = #{authorId}
|
||||||
|
) AS subquery_counts;
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -5,6 +5,8 @@ import com.dd.admin.business.author.entity.Author;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.dd.admin.business.author.domain.AuthorVo;
|
import com.dd.admin.business.author.domain.AuthorVo;
|
||||||
import com.dd.admin.business.author.domain.AuthorDto;
|
import com.dd.admin.business.author.domain.AuthorDto;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -27,4 +29,7 @@ public interface AuthorService extends IService<Author> {
|
|||||||
|
|
||||||
Author createNewAuthor(String phoneNumber);
|
Author createNewAuthor(String phoneNumber);
|
||||||
|
|
||||||
|
Long selectAuthorUpAndStarTotalCount(String authorId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -69,4 +69,9 @@ public class AuthorServiceImpl extends ServiceImpl<AuthorMapper, Author> impleme
|
|||||||
this.save(author);
|
this.save(author);
|
||||||
return author;
|
return author;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Long selectAuthorUpAndStarTotalCount(String authorId) {
|
||||||
|
return baseMapper.selectAuthorUpAndStarTotalCount(authorId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import com.dd.admin.common.model.UpdateGroup;
|
import com.dd.admin.common.model.UpdateGroup;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -26,9 +27,9 @@ import com.dd.admin.common.model.UpdateGroup;
|
|||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@ApiModel(value="关注表接收对象")
|
@ApiModel(value="关注表接收对象")
|
||||||
|
@Accessors(chain = true)
|
||||||
public class FollowDto {
|
public class FollowDto {
|
||||||
|
|
||||||
|
|
||||||
@NotBlank(message = "关注表id不能为空",groups = UpdateGroup.class)
|
@NotBlank(message = "关注表id不能为空",groups = UpdateGroup.class)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
|
@ -34,6 +34,12 @@ public class FollowVo {
|
|||||||
@ApiModelProperty(value = "被关注名字")
|
@ApiModelProperty(value = "被关注名字")
|
||||||
private String authorName;
|
private String authorName;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "头像地址")
|
||||||
|
private String avatarUrl;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "简介")
|
||||||
|
private String description;
|
||||||
|
|
||||||
@ApiModelProperty(value = "关注者")
|
@ApiModelProperty(value = "关注者")
|
||||||
private String followId;
|
private String followId;
|
||||||
|
|
||||||
@ -43,5 +49,6 @@ public class FollowVo {
|
|||||||
@ApiModelProperty(value = "创建时间")
|
@ApiModelProperty(value = "创建时间")
|
||||||
private Date createTime;
|
private Date createTime;
|
||||||
|
|
||||||
|
private Boolean isFollowMe = Boolean.FALSE;
|
||||||
|
private Boolean isFollow = Boolean.FALSE;
|
||||||
}
|
}
|
||||||
|
@ -8,10 +8,13 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
import com.dd.admin.business.upNotes.entity.UpNotes;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@ -25,7 +28,8 @@ import lombok.EqualsAndHashCode;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@TableName("business_follow")
|
@TableName("business_follow")
|
||||||
@ApiModel(value="Follow对象", description="关注表")
|
@ApiModel(value="Follow对象", description="关注表")
|
||||||
public class Follow implements Serializable {
|
@Accessors(chain = true)
|
||||||
|
public class Follow implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@ -25,4 +25,9 @@ public interface FollowMapper extends BaseMapper<Follow> {
|
|||||||
IPage<FollowVo> selectFollowPage(Page<FollowVo> page, @Param("followDto") FollowDto followDto);
|
IPage<FollowVo> selectFollowPage(Page<FollowVo> page, @Param("followDto") FollowDto followDto);
|
||||||
|
|
||||||
List<FollowVo> selectFollowList(@Param("followDto") FollowDto followDto);
|
List<FollowVo> selectFollowList(@Param("followDto") FollowDto followDto);
|
||||||
|
|
||||||
|
List<FollowVo> selectMyFollowList(@Param("authorId") String authorId);
|
||||||
|
List<FollowVo> selectFollowMeList(@Param("authorId") String authorId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,9 +23,71 @@
|
|||||||
from business_follow where 1 = 1
|
from business_follow where 1 = 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectFollowList" resultType="com.dd.admin.business.follow.domain.FollowVo">
|
<select id="selectFollowList" resultType="com.dd.admin.business.follow.domain.FollowVo">
|
||||||
select
|
select
|
||||||
*
|
*
|
||||||
from business_follow where 1 = 1
|
from business_follow where 1 = 1
|
||||||
|
<if test="followDto.authorId != null and followDto.authorId != ''">
|
||||||
|
and AUTHOR_ID = #{followDto.authorId}
|
||||||
|
</if>
|
||||||
|
<if test="followDto.followId != null and followDto.followId != ''">
|
||||||
|
and FOLLOW_ID = #{followDto.followId}
|
||||||
|
</if>
|
||||||
|
order by create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMyFollowList" resultType="com.dd.admin.business.follow.domain.FollowVo">
|
||||||
|
SELECT
|
||||||
|
b.AUTHOR_ID,
|
||||||
|
b.AUTHOR_NAME,
|
||||||
|
b.AVATAR_URL,
|
||||||
|
b.DESCRIPTION,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
count(1)
|
||||||
|
FROM
|
||||||
|
business_follow
|
||||||
|
WHERE
|
||||||
|
follow_id = b.AUTHOR_ID
|
||||||
|
AND author_id = #{authorId}
|
||||||
|
) AS isFollowMe
|
||||||
|
FROM
|
||||||
|
business_follow a
|
||||||
|
LEFT JOIN business_author b ON a.author_id = b.author_id
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
AND a.FOLLOW_ID = #{authorId}
|
||||||
|
ORDER BY
|
||||||
|
a.create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 查询关注我的所有列表信息 并在查询的时候设置子查询 查询当前用户作为关注者的时候有没有关注对方-->
|
||||||
|
<select id="selectFollowMeList" resultType="com.dd.admin.business.follow.domain.FollowVo">
|
||||||
|
SELECT
|
||||||
|
b.AUTHOR_ID,
|
||||||
|
b.AUTHOR_NAME,
|
||||||
|
b.AVATAR_URL,
|
||||||
|
b.DESCRIPTION,
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
count(1)
|
||||||
|
FROM
|
||||||
|
business_follow
|
||||||
|
WHERE
|
||||||
|
follow_id = #{authorId}
|
||||||
|
AND author_id = b.AUTHOR_ID
|
||||||
|
) AS isFollow
|
||||||
|
FROM
|
||||||
|
business_follow a
|
||||||
|
LEFT JOIN business_author b ON a.follow_id = b.author_id
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
|
AND a.AUTHOR_ID = #{authorId}
|
||||||
|
ORDER BY
|
||||||
|
a.create_time DESC
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -5,6 +5,8 @@ import com.dd.admin.business.follow.entity.Follow;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.dd.admin.business.follow.domain.FollowVo;
|
import com.dd.admin.business.follow.domain.FollowVo;
|
||||||
import com.dd.admin.business.follow.domain.FollowDto;
|
import com.dd.admin.business.follow.domain.FollowDto;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,4 +27,11 @@ public interface FollowService extends IService<Follow> {
|
|||||||
|
|
||||||
List<Follow> selectFollowListByFollowId(String followId);
|
List<Follow> selectFollowListByFollowId(String followId);
|
||||||
|
|
||||||
|
Follow selectOneByFollowId(String authorId,String followId);
|
||||||
|
|
||||||
|
|
||||||
|
List<FollowVo> selectMyFollowList( String authorId);
|
||||||
|
List<FollowVo> selectFollowMeList(String authorId);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package com.dd.admin.business.follow.service.impl;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.dd.admin.business.upNotes.entity.UpNotes;
|
||||||
import com.dd.admin.common.model.PageFactory;
|
import com.dd.admin.common.model.PageFactory;
|
||||||
import com.dd.admin.business.follow.entity.Follow;
|
import com.dd.admin.business.follow.entity.Follow;
|
||||||
import com.dd.admin.business.follow.mapper.FollowMapper;
|
import com.dd.admin.business.follow.mapper.FollowMapper;
|
||||||
@ -41,4 +42,23 @@ public class FollowServiceImpl extends ServiceImpl<FollowMapper, Follow> impleme
|
|||||||
queryWrapper.eq(Follow::getFollowId,followId);
|
queryWrapper.eq(Follow::getFollowId,followId);
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Follow selectOneByFollowId(String authorId, String followId) {
|
||||||
|
LambdaQueryWrapper<Follow> queryWrapper = new LambdaQueryWrapper();
|
||||||
|
queryWrapper.eq(Follow::getAuthorId,authorId);
|
||||||
|
queryWrapper.eq(Follow::getFollowId,followId);
|
||||||
|
return this.getOne(queryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FollowVo> selectMyFollowList(String authorId) {
|
||||||
|
return baseMapper.selectMyFollowList(authorId);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<FollowVo> selectFollowMeList(String authorId) {
|
||||||
|
return baseMapper.selectFollowMeList(authorId);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -77,7 +77,7 @@
|
|||||||
AND a.AUTHOR_ID = #{noteDto.authorId}
|
AND a.AUTHOR_ID = #{noteDto.authorId}
|
||||||
</if>
|
</if>
|
||||||
<if test="noteDto.authorIds!= null and noteDto.authorIds!= ''">
|
<if test="noteDto.authorIds!= null and noteDto.authorIds!= ''">
|
||||||
AND a.AUTHOR_ID IN ${noteDto.authorIds}
|
AND a.AUTHOR_ID IN (${noteDto.authorIds})
|
||||||
</if>
|
</if>
|
||||||
<if test="noteDto.ipRealAddress!= null and noteDto.ipRealAddress!= ''">
|
<if test="noteDto.ipRealAddress!= null and noteDto.ipRealAddress!= ''">
|
||||||
AND a.IP_REAL_ADDRESS = #{noteDto.ipRealAddress}
|
AND a.IP_REAL_ADDRESS = #{noteDto.ipRealAddress}
|
||||||
|
@ -10,6 +10,9 @@ spring:
|
|||||||
url: jdbc:p6spy:mysql://127.0.0.1:3306/ddxhs?useSSL=false&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
|
url: jdbc:p6spy:mysql://127.0.0.1:3306/ddxhs?useSSL=false&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: root
|
||||||
password: admin
|
password: admin
|
||||||
|
# url: jdbc:p6spy:mysql://8.146.211.120:3306/ddxhs?useSSL=false&autoReconnect=true&useUnicode=true&characterEncoding=utf-8&serverTimezone=GMT%2B8
|
||||||
|
# username: root
|
||||||
|
# password: wxlwxl12
|
||||||
|
|
||||||
jackson:
|
jackson:
|
||||||
#配置日期返回格式
|
#配置日期返回格式
|
||||||
@ -54,4 +57,4 @@ mybatis-plus:
|
|||||||
#================================================= mybatis-plus end ===================================================
|
#================================================= mybatis-plus end ===================================================
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 8080
|
port: 8080
|
||||||
|
41
web/src/api/business/reply/reply.js
Normal file
41
web/src/api/business/reply/reply.js
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function getReplyPage(params) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/reply/page',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function getReplyList(params) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/reply/list',
|
||||||
|
method: 'get',
|
||||||
|
params
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function addReply(data) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/reply/add',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function editReply(data) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/reply/update',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function deleteReply(replyId) {
|
||||||
|
return request({
|
||||||
|
url: '/admin/reply/delete/' + replyId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
171
web/src/views/business/reply/addReply.vue
Normal file
171
web/src/views/business/reply/addReply.vue
Normal file
@ -0,0 +1,171 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
top="8vh"
|
||||||
|
width="40%"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
center
|
||||||
|
@close="handleCancel"
|
||||||
|
>
|
||||||
|
<div class="el-dialog-div">
|
||||||
|
<el-form
|
||||||
|
:rules="rules"
|
||||||
|
ref="dataForm"
|
||||||
|
:model="temp"
|
||||||
|
label-position="right"
|
||||||
|
label-width="120px"
|
||||||
|
style="height: 90%;"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-form-item label="回复id" prop="replyId" class="is-required">
|
||||||
|
<el-input v-model="temp.replyId" placeholder="回复id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="笔记id" prop="noteId" class="is-required">
|
||||||
|
<el-input v-model="temp.noteId" placeholder="笔记id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="笔记标题" prop="noteTitile" class="is-required">
|
||||||
|
<el-input v-model="temp.noteTitile" placeholder="笔记标题" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="作者id" prop="authorId" class="is-required">
|
||||||
|
<el-input v-model="temp.authorId" placeholder="作者id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="作者名" prop="authorName" class="is-required">
|
||||||
|
<el-input v-model="temp.authorName" placeholder="作者名" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="上级id" prop="parentId" class="is-required">
|
||||||
|
<el-input v-model="temp.parentId" placeholder="上级id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="回复内容" prop="replayContent" class="is-required">
|
||||||
|
<el-input v-model="temp.replayContent" placeholder="回复内容" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="回复图片id" prop="replayImgId" class="is-required">
|
||||||
|
<el-input v-model="temp.replayImgId" placeholder="回复图片id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="回复图片Url" prop="replayImgUrl" class="is-required">
|
||||||
|
<el-input v-model="temp.replayImgUrl" placeholder="回复图片Url" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
|
||||||
|
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="创建时间" prop="createTime" class="is-required">
|
||||||
|
<el-input v-model="temp.createTime" placeholder="创建时间" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="ip地址" prop="ipAddress" class="is-required">
|
||||||
|
<el-input v-model="temp.ipAddress" placeholder="ip地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="真实ip地址" prop="ipRealAddress" class="is-required">
|
||||||
|
<el-input v-model="temp.ipRealAddress" placeholder="真实ip地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="是首评 0不是 1是" prop="firstReplay" class="is-required">
|
||||||
|
<el-input v-model="temp.firstReplay" placeholder="是首评 0不是 1是" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="是作者 0不是 1是" prop="authorReplay" class="is-required">
|
||||||
|
<el-input v-model="temp.authorReplay" placeholder="是作者 0不是 1是" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="0正常 1折叠" prop="replayStatus" class="is-required">
|
||||||
|
<el-input v-model="temp.replayStatus" placeholder="0正常 1折叠" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="0文字 1图片" prop="replayType" class="is-required">
|
||||||
|
<el-input v-model="temp.replayType" placeholder="0文字 1图片" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="点赞数" prop="upCount" class="is-required">
|
||||||
|
<el-input v-model="temp.upCount" placeholder="点赞数" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="头像地址" prop="avatarUrl" class="is-required">
|
||||||
|
<el-input v-model="temp.avatarUrl" placeholder="头像地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="handleCancel">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submit">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {addReply} from "@/api/business/reply/reply";
|
||||||
|
import {setRequiredFields} from "@/utils";
|
||||||
|
const requiredFields = []
|
||||||
|
export default {
|
||||||
|
name: "addForm",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
rules: setRequiredFields(requiredFields),
|
||||||
|
dialogVisible: false,
|
||||||
|
temp: {
|
||||||
|
replyId:'',
|
||||||
|
noteId:'',
|
||||||
|
noteTitile:'',
|
||||||
|
authorId:'',
|
||||||
|
authorName:'',
|
||||||
|
parentId:'',
|
||||||
|
replayContent:'',
|
||||||
|
replayImgId:'',
|
||||||
|
replayImgUrl:'',
|
||||||
|
deleted:'',
|
||||||
|
createTime:'',
|
||||||
|
ipAddress:'',
|
||||||
|
ipRealAddress:'',
|
||||||
|
firstReplay:'',
|
||||||
|
authorReplay:'',
|
||||||
|
replayStatus:'',
|
||||||
|
replayType:'',
|
||||||
|
upCount:'',
|
||||||
|
avatarUrl:'',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
addReply(this.temp).then(response =>{
|
||||||
|
this.handleCancel()
|
||||||
|
this.$emit('ok', response.data)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('error submit!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
//初始化
|
||||||
|
this.temp = this.$options.data().temp
|
||||||
|
this.dialogVisible = false
|
||||||
|
this.$refs['dataForm'].resetFields();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
172
web/src/views/business/reply/editReply.vue
Normal file
172
web/src/views/business/reply/editReply.vue
Normal file
@ -0,0 +1,172 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-dialog
|
||||||
|
:close-on-click-modal="false"
|
||||||
|
top="8vh"
|
||||||
|
width="40%"
|
||||||
|
:visible.sync="dialogVisible"
|
||||||
|
center
|
||||||
|
@close="handleCancel"
|
||||||
|
>
|
||||||
|
<div class="el-dialog-div">
|
||||||
|
<el-form
|
||||||
|
:rules="rules"
|
||||||
|
ref="dataForm"
|
||||||
|
:model="temp"
|
||||||
|
label-position="right"
|
||||||
|
label-width="120px"
|
||||||
|
style="height: 90%;"
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-form-item label="回复id" prop="replyId" class="is-required">
|
||||||
|
<el-input v-model="temp.replyId" placeholder="回复id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="笔记id" prop="noteId" class="is-required">
|
||||||
|
<el-input v-model="temp.noteId" placeholder="笔记id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="笔记标题" prop="noteTitile" class="is-required">
|
||||||
|
<el-input v-model="temp.noteTitile" placeholder="笔记标题" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="作者id" prop="authorId" class="is-required">
|
||||||
|
<el-input v-model="temp.authorId" placeholder="作者id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="作者名" prop="authorName" class="is-required">
|
||||||
|
<el-input v-model="temp.authorName" placeholder="作者名" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="上级id" prop="parentId" class="is-required">
|
||||||
|
<el-input v-model="temp.parentId" placeholder="上级id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="回复内容" prop="replayContent" class="is-required">
|
||||||
|
<el-input v-model="temp.replayContent" placeholder="回复内容" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="回复图片id" prop="replayImgId" class="is-required">
|
||||||
|
<el-input v-model="temp.replayImgId" placeholder="回复图片id" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="回复图片Url" prop="replayImgUrl" class="is-required">
|
||||||
|
<el-input v-model="temp.replayImgUrl" placeholder="回复图片Url" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="0正常 1删除" prop="deleted" class="is-required">
|
||||||
|
<el-input v-model="temp.deleted" placeholder="0正常 1删除" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="创建时间" prop="createTime" class="is-required">
|
||||||
|
<el-input v-model="temp.createTime" placeholder="创建时间" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="ip地址" prop="ipAddress" class="is-required">
|
||||||
|
<el-input v-model="temp.ipAddress" placeholder="ip地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="真实ip地址" prop="ipRealAddress" class="is-required">
|
||||||
|
<el-input v-model="temp.ipRealAddress" placeholder="真实ip地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="是首评 0不是 1是" prop="firstReplay" class="is-required">
|
||||||
|
<el-input v-model="temp.firstReplay" placeholder="是首评 0不是 1是" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="是作者 0不是 1是" prop="authorReplay" class="is-required">
|
||||||
|
<el-input v-model="temp.authorReplay" placeholder="是作者 0不是 1是" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="0正常 1折叠" prop="replayStatus" class="is-required">
|
||||||
|
<el-input v-model="temp.replayStatus" placeholder="0正常 1折叠" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="0文字 1图片" prop="replayType" class="is-required">
|
||||||
|
<el-input v-model="temp.replayType" placeholder="0文字 1图片" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="点赞数" prop="upCount" class="is-required">
|
||||||
|
<el-input v-model="temp.upCount" placeholder="点赞数" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-form-item label="头像地址" prop="avatarUrl" class="is-required">
|
||||||
|
<el-input v-model="temp.avatarUrl" placeholder="头像地址" />
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
</el-form>
|
||||||
|
</div>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button @click="handleCancel">取 消</el-button>
|
||||||
|
<el-button type="primary" @click="submit">确 定</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { editReply } from "@/api/business/reply/reply";
|
||||||
|
import {setRequiredFields} from "@/utils";
|
||||||
|
const requiredFields = []
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "editForm",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
rules: setRequiredFields(requiredFields),
|
||||||
|
dialogVisible: false,
|
||||||
|
temp: {
|
||||||
|
replyId:'',
|
||||||
|
noteId:'',
|
||||||
|
noteTitile:'',
|
||||||
|
authorId:'',
|
||||||
|
authorName:'',
|
||||||
|
parentId:'',
|
||||||
|
replayContent:'',
|
||||||
|
replayImgId:'',
|
||||||
|
replayImgUrl:'',
|
||||||
|
deleted:'',
|
||||||
|
createTime:'',
|
||||||
|
ipAddress:'',
|
||||||
|
ipRealAddress:'',
|
||||||
|
firstReplay:'',
|
||||||
|
authorReplay:'',
|
||||||
|
replayStatus:'',
|
||||||
|
replayType:'',
|
||||||
|
upCount:'',
|
||||||
|
avatarUrl:'',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
open(row) {
|
||||||
|
this.temp = this.$options.data().temp
|
||||||
|
this.temp = row
|
||||||
|
this.dialogVisible = true
|
||||||
|
},
|
||||||
|
submit() {
|
||||||
|
this.$refs['dataForm'].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
editReply(this.temp).then(response => {
|
||||||
|
this.handleCancel()
|
||||||
|
this.$emit('ok', response.data)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
console.log('error submit!!');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
handleCancel() {
|
||||||
|
//初始化
|
||||||
|
this.temp = this.$options.data().temp
|
||||||
|
this.dialogVisible = false
|
||||||
|
this.$refs['dataForm'].resetFields()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
373
web/src/views/business/reply/replyList.vue
Normal file
373
web/src/views/business/reply/replyList.vue
Normal file
@ -0,0 +1,373 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
|
||||||
|
<div class="filter-container">
|
||||||
|
<el-input
|
||||||
|
v-model="listQuery.keyword"
|
||||||
|
size="small"
|
||||||
|
placeholder="请输入关键词"
|
||||||
|
clearable
|
||||||
|
class="filter-item"
|
||||||
|
style="width: 200px;margin-left: 10px;"
|
||||||
|
/>
|
||||||
|
<el-button-group style="margin-left: 10px;">
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-search"
|
||||||
|
@click="search"
|
||||||
|
>
|
||||||
|
搜索
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-refresh"
|
||||||
|
@click="refresh"
|
||||||
|
>
|
||||||
|
重置
|
||||||
|
</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
<el-button
|
||||||
|
size="small"
|
||||||
|
class="filter-item"
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-plus"
|
||||||
|
style="margin-left: 10px;"
|
||||||
|
@click="add"
|
||||||
|
>
|
||||||
|
新增
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<el-table
|
||||||
|
v-loading="listLoading"
|
||||||
|
:data="list"
|
||||||
|
element-loading-text="Loading"
|
||||||
|
border
|
||||||
|
fit
|
||||||
|
height="100%"
|
||||||
|
class="table-container"
|
||||||
|
highlight-current-row
|
||||||
|
>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="序号"
|
||||||
|
width="150"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.$index+1 }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
label="回复id"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.replyId }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="笔记id"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.noteId }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="笔记标题"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.noteTitile }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="作者id"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.authorId }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="作者名"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.authorName }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="上级id"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.parentId }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="回复内容"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.replayContent }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="回复图片id"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.replayImgId }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="回复图片Url"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.replayImgUrl }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="0正常 1删除"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.deleted }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="创建时间"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.createTime }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="ip地址"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.ipAddress }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="真实ip地址"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.ipRealAddress }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="是首评 0不是 1是"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.firstReplay }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="是作者 0不是 1是"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.authorReplay }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="0正常 1折叠"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.replayStatus }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="0文字 1图片"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.replayType }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="点赞数"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.upCount }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
label="头像地址"
|
||||||
|
width="160"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ scope.row.avatarUrl }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column
|
||||||
|
fixed="right"
|
||||||
|
label="操作"
|
||||||
|
width="200"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button-group>
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
@click="edit(scope)"
|
||||||
|
>
|
||||||
|
修改
|
||||||
|
</el-button>
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
@click="del(scope)"
|
||||||
|
>
|
||||||
|
删除
|
||||||
|
</el-button>
|
||||||
|
</el-button-group>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
:total="total"
|
||||||
|
:page.sync="listQuery.page"
|
||||||
|
:limit.sync="listQuery.limit"
|
||||||
|
@pagination="fetchData"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<add-form ref="addForm" @ok="addOk" />
|
||||||
|
<edit-form ref="editForm" @ok="editOk" />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {getReplyPage,deleteReply} from "@/api/business/reply/reply";
|
||||||
|
import {deepClone,success} from "@/utils";
|
||||||
|
|
||||||
|
import confirm from "@/utils/confirm";
|
||||||
|
import Pagination from '@/components/Pagination'
|
||||||
|
import addForm from "@/views/business/reply/addReply";
|
||||||
|
import editForm from "@/views/business/reply/editReply";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'reply',
|
||||||
|
components: {addForm,editForm,Pagination},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
total: 0,
|
||||||
|
list: [],
|
||||||
|
listLoading: true,
|
||||||
|
listQuery: {
|
||||||
|
page: 1,
|
||||||
|
limit: 50,
|
||||||
|
keyword: ''
|
||||||
|
},
|
||||||
|
temp: {},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
search() {
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
refresh() {
|
||||||
|
this.listQuery = this.$options.data().listQuery
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
fetchData() {
|
||||||
|
this.listLoading = true
|
||||||
|
getReplyPage(this.listQuery).then(response => {
|
||||||
|
const { records, total } = response.data
|
||||||
|
this.list = records
|
||||||
|
this.total = total
|
||||||
|
this.listLoading = false
|
||||||
|
})
|
||||||
|
},
|
||||||
|
add(){
|
||||||
|
this.$refs.addForm.open()
|
||||||
|
},
|
||||||
|
addOk(){
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
edit(scope) {
|
||||||
|
const temp = deepClone(scope.row)
|
||||||
|
this.$refs.editForm.open(temp)
|
||||||
|
},
|
||||||
|
editOk(){
|
||||||
|
this.fetchData()
|
||||||
|
},
|
||||||
|
del(scope) {
|
||||||
|
confirm("确定要删除吗?").then(res=>{
|
||||||
|
if(res){
|
||||||
|
deleteReply(scope.row.replyId).then(response => {
|
||||||
|
console.log(response)
|
||||||
|
success('删除成功')
|
||||||
|
this.fetchData()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
Loading…
x
Reference in New Issue
Block a user