修改视频
This commit is contained in:
parent
2b0acc4d01
commit
7d9505bf21
@ -125,11 +125,11 @@ tenant:
|
|||||||
# 排除表
|
# 排除表
|
||||||
excludes:
|
excludes:
|
||||||
- sys_menu
|
- sys_menu
|
||||||
- t_users
|
- cont_users
|
||||||
- t_vlog
|
- cont_vlog
|
||||||
- t_comment
|
- cont_comment
|
||||||
- t_my_liked_vlog
|
- cont_my_liked_vlog
|
||||||
- t_fans
|
- ums_fans
|
||||||
- sys_tenant
|
- sys_tenant
|
||||||
- sys_tenant_package
|
- sys_tenant_package
|
||||||
- aws_system_statistics
|
- aws_system_statistics
|
||||||
|
@ -114,47 +114,53 @@ public class VlogUploadController extends BaseInfoProperties {
|
|||||||
log.info("腾讯云 SearchMedia API 调用成功,总记录数: {}", resp.getTotalCount());
|
log.info("腾讯云 SearchMedia API 调用成功,总记录数: {}", resp.getTotalCount());
|
||||||
|
|
||||||
// 处理响应结果
|
// 处理响应结果
|
||||||
Map<String, Object> result = new HashMap<>();
|
|
||||||
result.put("total", resp.getTotalCount());
|
|
||||||
result.put("current", vlogBO.getCurrent());
|
|
||||||
result.put("size", vlogBO.getSize());
|
|
||||||
result.put("pages", (resp.getTotalCount() + vlogBO.getSize() - 1) / vlogBO.getSize()); // 总页数
|
|
||||||
|
|
||||||
List<Map<String, Object>> mediaList = new ArrayList<>();
|
List<Map<String, Object>> mediaList = new ArrayList<>();
|
||||||
if (resp.getMediaInfoSet() != null) {
|
if (resp.getMediaInfoSet() != null) {
|
||||||
for (MediaInfo mediaInfo : resp.getMediaInfoSet()) {
|
for (MediaInfo mediaInfo : resp.getMediaInfoSet()) {
|
||||||
Map<String, Object> mediaMap = new HashMap<>();
|
Map<String, Object> mediaMap = new HashMap<>();
|
||||||
// 基础信息
|
|
||||||
MediaBasicInfo basicInfo = mediaInfo.getBasicInfo();
|
MediaBasicInfo basicInfo = mediaInfo.getBasicInfo();
|
||||||
mediaMap.put("fileId", mediaInfo.getFileId());
|
|
||||||
mediaMap.put("name", basicInfo.getName());
|
// 1. 映射字段(与表结构一致)
|
||||||
mediaMap.put("description", basicInfo.getDescription());
|
String fileId = mediaInfo.getFileId();
|
||||||
mediaMap.put("createTime", basicInfo.getCreateTime());
|
mediaMap.put("vloger_id", vlogBO.getVlogerId());
|
||||||
mediaMap.put("updateTime", basicInfo.getUpdateTime());
|
mediaMap.put("url", basicInfo.getMediaUrl());
|
||||||
mediaMap.put("coverUrl", basicInfo.getCoverUrl());
|
mediaMap.put("cover", basicInfo.getCoverUrl());
|
||||||
mediaMap.put("type", basicInfo.getType());
|
mediaMap.put("title", basicInfo.getName());
|
||||||
mediaMap.put("mediaUrl", basicInfo.getMediaUrl());
|
mediaMap.put("create_time", basicInfo.getCreateTime());
|
||||||
|
mediaMap.put("update_time", basicInfo.getUpdateTime());
|
||||||
mediaMap.put("status", basicInfo.getStatus());
|
mediaMap.put("status", basicInfo.getStatus());
|
||||||
mediaMap.put("category", basicInfo.getCategory());
|
mediaMap.put("file_id", fileId);
|
||||||
mediaMap.put("title",vlogBO.getTitle());
|
mediaMap.put("first_frame_img", vlogBO.getFirstFrameImg());
|
||||||
mediaMap.put("firstFrameImg",vlogBO.getFirstFrameImg());
|
|
||||||
mediaMap.put("vlogerId",vlogBO.getVlogerId());
|
|
||||||
|
|
||||||
// 获取视频统计信息
|
|
||||||
Map<String, Object> statistics = vlogService.getVlogStatistics(mediaInfo.getFileId());
|
|
||||||
mediaMap.putAll(statistics);
|
|
||||||
|
|
||||||
// 获取视频上传者信息
|
// 2. 点赞数和评论数从Redis获取
|
||||||
Map<String, String> uploaderInfo = vlogService.getVlogUploaderInfo(mediaInfo.getFileId());
|
String likeCountsStr = redis.get(REDIS_VLOG_BE_LIKED_COUNTS + ":" + fileId);
|
||||||
if (uploaderInfo != null) {
|
Integer likeCounts = 0;
|
||||||
mediaMap.put("nickname", uploaderInfo.get("name"));
|
if (StringUtils.isNotBlank(likeCountsStr)) {
|
||||||
mediaMap.put("mobile", uploaderInfo.get("phone"));
|
try {
|
||||||
|
likeCounts = Integer.valueOf(likeCountsStr);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
log.warn("Redis中视频{}的点赞数格式错误: {}", fileId, likeCountsStr);
|
||||||
|
likeCounts = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
mediaMap.put("like_counts", likeCounts);
|
||||||
|
|
||||||
|
String commentCountsStr = redis.get(REDIS_VLOG_COMMENT_COUNTS + ":" + fileId);
|
||||||
|
Integer commentCounts = 0;
|
||||||
|
if (StringUtils.isNotBlank(commentCountsStr)) {
|
||||||
|
try {
|
||||||
|
commentCounts = Integer.valueOf(commentCountsStr);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
log.warn("Redis中视频{}的评论数格式错误: {}", fileId, commentCountsStr);
|
||||||
|
commentCounts = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mediaMap.put("comments_counts", commentCounts);
|
||||||
|
|
||||||
mediaList.add(mediaMap);
|
mediaList.add(mediaMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
result.put("records", mediaList);
|
|
||||||
|
|
||||||
// 构建Page对象
|
// 构建Page对象
|
||||||
Page<Map<String, Object>> page = new Page<>();
|
Page<Map<String, Object>> page = new Page<>();
|
||||||
|
@ -8,7 +8,7 @@ import lombok.Data;
|
|||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@TableName("t_comment")
|
@TableName("cont_comment")
|
||||||
public class Comment {
|
public class Comment {
|
||||||
|
|
||||||
@TableId(type = IdType.ASSIGN_ID)
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@ -10,7 +10,7 @@ import org.dromara.common.tenant.core.TenantEntity;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@TableName("t_my_liked_vlog")
|
@TableName("cont_my_liked_vlog")
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class MyLikedVlog extends BaseAudit {
|
public class MyLikedVlog extends BaseAudit {
|
||||||
|
@ -10,7 +10,7 @@ import org.dromara.common.tenant.core.TenantEntity;
|
|||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName( "r_user_member")
|
@TableName( "cont_user_member")
|
||||||
public class UserMember extends BaseAudit {
|
public class UserMember extends BaseAudit {
|
||||||
private String userId;
|
private String userId;
|
||||||
private String memberId;
|
private String memberId;
|
||||||
|
@ -11,7 +11,7 @@ import org.dromara.common.tenant.core.TenantEntity;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@TableName("t_users")
|
@TableName("cont_users")
|
||||||
@Data
|
@Data
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ -7,7 +7,7 @@ import lombok.Data;
|
|||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import org.dromara.common.core.domain.model.BaseAudit;
|
import org.dromara.common.core.domain.model.BaseAudit;
|
||||||
|
|
||||||
@TableName(value = "t_vlog", autoResultMap = true)
|
@TableName(value = "cont_vlog", autoResultMap = true)
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
|
||||||
|
@ -39,8 +39,8 @@ public interface CommentMapper extends BaseMapper<Comment> {
|
|||||||
* 根据视频ID查询评论列表
|
* 根据视频ID查询评论列表
|
||||||
*/
|
*/
|
||||||
@Select("SELECT c.*, u.nickname as userNickname, u.face as userFace " +
|
@Select("SELECT c.*, u.nickname as userNickname, u.face as userFace " +
|
||||||
"FROM t_comment c " +
|
"FROM cont_comment c " +
|
||||||
"LEFT JOIN t_users u ON c.comment_user_id = u.id " +
|
"LEFT JOIN cont_users u ON c.comment_user_id = u.id " +
|
||||||
"WHERE c.vlog_id = #{vlogId} " +
|
"WHERE c.vlog_id = #{vlogId} " +
|
||||||
"ORDER BY c.create_time DESC")
|
"ORDER BY c.create_time DESC")
|
||||||
List<Map<String, Object>> selectCommentsByVlogId(@Param("vlogId") String vlogId);
|
List<Map<String, Object>> selectCommentsByVlogId(@Param("vlogId") String vlogId);
|
||||||
|
@ -15,9 +15,9 @@ public interface MyLikedVlogMapper extends BaseMapperPlus<MyLikedVlog,MyLikedVlo
|
|||||||
/**
|
/**
|
||||||
* 统计某视频的点赞数
|
* 统计某视频的点赞数
|
||||||
*/
|
*/
|
||||||
@Select("SELECT COUNT(*) FROM t_my_liked_vlog WHERE vlog_id = #{vlogId}")
|
@Select("SELECT COUNT(*) FROM cont_my_liked_vlog WHERE vlog_id = #{vlogId}")
|
||||||
int countLikesByVlogId(@Param("vlogId") String vlogId);
|
int countLikesByVlogId(@Param("vlogId") String vlogId);
|
||||||
|
|
||||||
@Select("SELECT u.nickname, u.face, l.create_time FROM t_my_liked_vlog l LEFT JOIN t_users u ON l.user_id = u.id WHERE l.vlog_id = #{vlogId} ORDER BY l.create_time DESC")
|
@Select("SELECT u.nickname, u.face, l.create_time FROM cont_my_liked_vlog l LEFT JOIN cont_users u ON l.user_id = u.id WHERE l.vlog_id = #{vlogId} ORDER BY l.create_time DESC")
|
||||||
List<Map<String, Object>> selectLikedUsersByVlogId(@Param("vlogId") String vlogId);
|
List<Map<String, Object>> selectLikedUsersByVlogId(@Param("vlogId") String vlogId);
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ public interface VlogMapper extends BaseMapper<Vlog> {
|
|||||||
*/
|
*/
|
||||||
IPage<Map<String, Object>> selectVlogListWithAggregatedData(Page<Map<String, Object>> page, @Param("vlogBO") VlogBO vlogBO);
|
IPage<Map<String, Object>> selectVlogListWithAggregatedData(Page<Map<String, Object>> page, @Param("vlogBO") VlogBO vlogBO);
|
||||||
|
|
||||||
@Select("SELECT COUNT(*) FROM t_vlog where status = 0")
|
@Select("SELECT COUNT(*) FROM cont_vlog where status = 0")
|
||||||
Object countVlog();
|
Object countVlog();
|
||||||
|
|
||||||
|
|
||||||
@ -104,7 +104,7 @@ public interface VlogMapper extends BaseMapper<Vlog> {
|
|||||||
" DATE_FORMAT(create_time, '%Y-%m') AS month, " +
|
" DATE_FORMAT(create_time, '%Y-%m') AS month, " +
|
||||||
" COUNT(*) AS vlog_count " +
|
" COUNT(*) AS vlog_count " +
|
||||||
"FROM " +
|
"FROM " +
|
||||||
" t_vlog " +
|
" cont_vlog " +
|
||||||
"WHERE " +
|
"WHERE " +
|
||||||
" status = 1 " +
|
" status = 1 " +
|
||||||
"GROUP BY " +
|
"GROUP BY " +
|
||||||
@ -135,7 +135,7 @@ public interface VlogMapper extends BaseMapper<Vlog> {
|
|||||||
" v.reason, " +
|
" v.reason, " +
|
||||||
"city_code,"+
|
"city_code,"+
|
||||||
" v.first_frame_img " +
|
" v.first_frame_img " +
|
||||||
"FROM t_vlog v " +
|
"FROM cont_vlog v " +
|
||||||
"WHERE v.status = 1 AND v.is_private = 0 " +
|
"WHERE v.status = 1 AND v.is_private = 0 " +
|
||||||
"ORDER BY v.create_time DESC")
|
"ORDER BY v.create_time DESC")
|
||||||
List<Map<String, Object>> selectAllPublicVlogs();
|
List<Map<String, Object>> selectAllPublicVlogs();
|
||||||
@ -163,7 +163,7 @@ public interface VlogMapper extends BaseMapper<Vlog> {
|
|||||||
" v.reason, " +
|
" v.reason, " +
|
||||||
" v.city_code, " +
|
" v.city_code, " +
|
||||||
" v.first_frame_img " +
|
" v.first_frame_img " +
|
||||||
"FROM t_vlog v " +
|
"FROM cont_vlog v " +
|
||||||
"WHERE v.status = 1 AND v.is_private = 0 " +
|
"WHERE v.status = 1 AND v.is_private = 0 " +
|
||||||
"ORDER BY RAND() " +
|
"ORDER BY RAND() " +
|
||||||
"LIMIT #{limit}")
|
"LIMIT #{limit}")
|
||||||
|
@ -492,22 +492,8 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
|
|||||||
result.put("height",vlog.getHeight());
|
result.put("height",vlog.getHeight());
|
||||||
result.put("reason",vlog.getReason());
|
result.put("reason",vlog.getReason());
|
||||||
|
|
||||||
// 点赞数通过点赞表统计
|
// 注意:点赞数和评论数现在在控制器中直接从Redis获取
|
||||||
int likeCounts = myLikedVlogMapper.countLikesByVlogId(vlog.getId());
|
// 这里不再统计,避免重复计算
|
||||||
result.put("likeCounts", likeCounts);
|
|
||||||
|
|
||||||
// 评论数:优先 Redis,无则 MySQL
|
|
||||||
String commentCountStr = redis.get(REDIS_VLOG_COMMENT_COUNTS + ":" + vlog.getId());
|
|
||||||
Integer commentCount = 0;
|
|
||||||
if (StringUtils.isNotBlank(commentCountStr)) {
|
|
||||||
commentCount = Integer.valueOf(commentCountStr);
|
|
||||||
} else {
|
|
||||||
commentCount = commentMapper.countByVlogId(vlog.getId());
|
|
||||||
if (commentCount != null) {
|
|
||||||
redis.set(REDIS_VLOG_COMMENT_COUNTS + ":" + vlog.getId(), String.valueOf(commentCount));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result.put("commentCounts", commentCount);
|
|
||||||
|
|
||||||
// 获取粉丝数量:优先 Redis,无则 MySQL
|
// 获取粉丝数量:优先 Redis,无则 MySQL
|
||||||
String fansCountsStr = redis.get(REDIS_MY_FANS_COUNTS + ":" + vlog.getVlogerId());
|
String fansCountsStr = redis.get(REDIS_MY_FANS_COUNTS + ":" + vlog.getVlogerId());
|
||||||
@ -523,8 +509,6 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
|
|||||||
result.put("fansCounts", fansCounts);
|
result.put("fansCounts", fansCounts);
|
||||||
} else {
|
} else {
|
||||||
result.put("vlogId", null);
|
result.put("vlogId", null);
|
||||||
result.put("likeCounts", 0);
|
|
||||||
result.put("commentCounts", 0);
|
|
||||||
result.put("reason", null);
|
result.put("reason", null);
|
||||||
result.put("fansCounts", 0);
|
result.put("fansCounts", 0);
|
||||||
}
|
}
|
||||||
@ -551,8 +535,17 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
|
|||||||
List<Map<String, Object>> comments = commentMapper.selectCommentsByVlogId(vlog.getId());
|
List<Map<String, Object>> comments = commentMapper.selectCommentsByVlogId(vlog.getId());
|
||||||
result.put("comments", comments);
|
result.put("comments", comments);
|
||||||
|
|
||||||
// 添加点赞数和点赞用户信息
|
// 从Redis获取点赞数
|
||||||
int likeCounts = myLikedVlogMapper.countLikesByVlogId(vlog.getId());
|
String likeCountsStr = redis.get(REDIS_VLOG_BE_LIKED_COUNTS + ":" + vlog.getId());
|
||||||
|
Integer likeCounts = 0;
|
||||||
|
if (StringUtils.isNotBlank(likeCountsStr)) {
|
||||||
|
try {
|
||||||
|
likeCounts = Integer.valueOf(likeCountsStr);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
log.warn("Redis中视频{}的点赞数格式错误: {}", vlog.getId(), likeCountsStr);
|
||||||
|
likeCounts = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
result.put("likeCounts", likeCounts);
|
result.put("likeCounts", likeCounts);
|
||||||
result.put("vlogId", vlog.getId());
|
result.put("vlogId", vlog.getId());
|
||||||
|
|
||||||
@ -593,7 +586,17 @@ public class VlogServiceImpl extends BaseInfoProperties implements VlogService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getLikeCounts(String vlogId) {
|
public int getLikeCounts(String vlogId) {
|
||||||
return myLikedVlogMapper.countLikesByVlogId(vlogId);
|
// 从Redis获取点赞数
|
||||||
|
String likeCountsStr = redis.get(REDIS_VLOG_BE_LIKED_COUNTS + ":" + vlogId);
|
||||||
|
if (StringUtils.isNotBlank(likeCountsStr)) {
|
||||||
|
try {
|
||||||
|
return Integer.valueOf(likeCountsStr);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
log.warn("Redis中视频{}的点赞数格式错误: {}", vlogId, likeCountsStr);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -17,27 +17,27 @@
|
|||||||
|
|
||||||
<!-- 根据视频ID查询评论列表 -->
|
<!-- 根据视频ID查询评论列表 -->
|
||||||
<select id="selectByVlogId" resultType="com.wzj.soopin.content.domain.po.Comment">
|
<select id="selectByVlogId" resultType="com.wzj.soopin.content.domain.po.Comment">
|
||||||
SELECT * FROM t_comment
|
SELECT * FROM cont_comment
|
||||||
WHERE vlog_id = #{vlogId}
|
WHERE vlog_id = #{vlogId}
|
||||||
ORDER BY create_time DESC
|
ORDER BY create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 根据父评论ID查询子评论列表 -->
|
<!-- 根据父评论ID查询子评论列表 -->
|
||||||
<select id="selectByFatherCommentId" resultType="com.wzj.soopin.content.domain.po.Comment">
|
<select id="selectByFatherCommentId" resultType="com.wzj.soopin.content.domain.po.Comment">
|
||||||
SELECT * FROM t_comment
|
SELECT * FROM cont_comment
|
||||||
WHERE father_comment_id = #{fatherCommentId}
|
WHERE father_comment_id = #{fatherCommentId}
|
||||||
ORDER BY create_time ASC
|
ORDER BY create_time ASC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 根据评论ID查询评论信息 -->
|
<!-- 根据评论ID查询评论信息 -->
|
||||||
<select id="selectByCommentId" resultType="com.wzj.soopin.content.domain.po.Comment">
|
<select id="selectByCommentId" resultType="com.wzj.soopin.content.domain.po.Comment">
|
||||||
SELECT * FROM t_comment
|
SELECT * FROM cont_comment
|
||||||
WHERE id = #{commentId}
|
WHERE id = #{commentId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 根据视频ID统计评论数量 -->
|
<!-- 根据视频ID统计评论数量 -->
|
||||||
<select id="countByVlogId" resultType="java.lang.Integer">
|
<select id="countByVlogId" resultType="java.lang.Integer">
|
||||||
SELECT COUNT(*) FROM t_comment
|
SELECT COUNT(*) FROM cont_comment
|
||||||
WHERE vlog_id = #{vlogId}
|
WHERE vlog_id = #{vlogId}
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
@ -22,8 +22,8 @@
|
|||||||
c.content,
|
c.content,
|
||||||
c.like_counts as likeCounts,
|
c.like_counts as likeCounts,
|
||||||
c.create_time as createTime
|
c.create_time as createTime
|
||||||
FROM t_comment c
|
FROM cont_comment c
|
||||||
LEFT JOIN t_users u ON c.comment_user_id = u.id
|
LEFT JOIN cont_users u ON c.comment_user_id = u.id
|
||||||
<where>
|
<where>
|
||||||
<if test="paramMap.vlogId != null and paramMap.vlogId != ''">
|
<if test="paramMap.vlogId != null and paramMap.vlogId != ''">
|
||||||
AND c.vlog_id = #{paramMap.vlogId}
|
AND c.vlog_id = #{paramMap.vlogId}
|
||||||
@ -52,8 +52,8 @@
|
|||||||
c.content,
|
c.content,
|
||||||
c.like_counts as likeCounts,
|
c.like_counts as likeCounts,
|
||||||
c.create_time as createTime
|
c.create_time as createTime
|
||||||
FROM t_comment c
|
FROM cont_comment c
|
||||||
LEFT JOIN t_users u ON c.comment_user_id = u.id
|
LEFT JOIN cont_users u ON c.comment_user_id = u.id
|
||||||
<where>
|
<where>
|
||||||
c.father_comment_id = '0'
|
c.father_comment_id = '0'
|
||||||
<if test="vlogId != null and vlogId != ''">
|
<if test="vlogId != null and vlogId != ''">
|
||||||
|
@ -11,9 +11,9 @@
|
|||||||
f.is_fan_friend_of_mine as bothFriend,
|
f.is_fan_friend_of_mine as bothFriend,
|
||||||
f.created_time as createdTime
|
f.created_time as createdTime
|
||||||
FROM
|
FROM
|
||||||
t_fans f
|
ums_fans f
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_users u
|
cont_users u
|
||||||
ON
|
ON
|
||||||
f.vloger_id = u.id
|
f.vloger_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
@ -33,9 +33,9 @@
|
|||||||
f.is_fan_friend_of_mine as bothFriend,
|
f.is_fan_friend_of_mine as bothFriend,
|
||||||
f.created_time as createdTime
|
f.created_time as createdTime
|
||||||
FROM
|
FROM
|
||||||
t_fans f
|
ums_fans f
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_users u
|
cont_users u
|
||||||
ON
|
ON
|
||||||
f.fan_id = u.id
|
f.fan_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
<!-- 保存消息,如果未传 id 则使用 uuid 生成 -->
|
<!-- 保存消息,如果未传 id 则使用 uuid 生成 -->
|
||||||
<insert id="save" parameterType="com.wzj.soopin.content.domain.mo.MessageMO">
|
<insert id="save" parameterType="com.wzj.soopin.content.domain.mo.MessageMO">
|
||||||
INSERT INTO t_message
|
INSERT INTO cont_message
|
||||||
(
|
(
|
||||||
id,
|
id,
|
||||||
from_user_id,
|
from_user_id,
|
||||||
@ -55,7 +55,7 @@
|
|||||||
msg_type,
|
msg_type,
|
||||||
msg_content,
|
msg_content,
|
||||||
create_time
|
create_time
|
||||||
FROM t_message
|
FROM cont_message
|
||||||
WHERE to_user_id = #{toUserId}
|
WHERE to_user_id = #{toUserId}
|
||||||
ORDER BY create_time DESC
|
ORDER BY create_time DESC
|
||||||
LIMIT #{pageable.offset}, #{pageable.pageSize}
|
LIMIT #{pageable.offset}, #{pageable.pageSize}
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
t1.description,
|
t1.description,
|
||||||
t1.bg_img,
|
t1.bg_img,
|
||||||
t1.can_imooc_num_be_updated
|
t1.can_imooc_num_be_updated
|
||||||
FROM t_users t1 INNER JOIN
|
FROM cont_users t1 INNER JOIN
|
||||||
r_user_member t2 ON t1.id=t2.user_id
|
r_user_member t2 ON t1.id=t2.user_id
|
||||||
WHERE t2.member_id=#{memberId}
|
WHERE t2.member_id=#{memberId}
|
||||||
</select>
|
</select>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<mapper namespace="com.wzj.soopin.content.mapper.VlogMapper">
|
<mapper namespace="com.wzj.soopin.content.mapper.VlogMapper">
|
||||||
<!-- 通用更新 -->
|
<!-- 通用更新 -->
|
||||||
<update id="dynamicUpdate">
|
<update id="dynamicUpdate">
|
||||||
UPDATE t_vlog
|
UPDATE cont_vlog
|
||||||
<set>
|
<set>
|
||||||
<foreach collection="updateFields" index="key" item="value" separator=",">
|
<foreach collection="updateFields" index="key" item="value" separator=",">
|
||||||
${key} = #{value}
|
${key} = #{value}
|
||||||
@ -14,7 +14,7 @@
|
|||||||
</update>
|
</update>
|
||||||
|
|
||||||
<update id="updateVlogByConditions">
|
<update id="updateVlogByConditions">
|
||||||
UPDATE t_vlog
|
UPDATE cont_vlog
|
||||||
<set>
|
<set>
|
||||||
<foreach collection="updates" item="value" index="key" separator=",">
|
<foreach collection="updates" item="value" index="key" separator=",">
|
||||||
${key} = #{value}
|
${key} = #{value}
|
||||||
@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
<!-- 单条插入 -->
|
<!-- 单条插入 -->
|
||||||
<insert id="dynamicInsert">
|
<insert id="dynamicInsert">
|
||||||
INSERT INTO t_vlog
|
INSERT INTO cont_vlog
|
||||||
<foreach collection="vlogData.keys" item="key" open="(" separator="," close=")">
|
<foreach collection="vlogData.keys" item="key" open="(" separator="," close=")">
|
||||||
${key}
|
${key}
|
||||||
</foreach>
|
</foreach>
|
||||||
@ -57,7 +57,7 @@
|
|||||||
|
|
||||||
<!-- 批量插入 -->
|
<!-- 批量插入 -->
|
||||||
<insert id="dynamicBatchInsert">
|
<insert id="dynamicBatchInsert">
|
||||||
INSERT INTO t_vlog
|
INSERT INTO cont_vlog
|
||||||
<foreach collection="vlogList[0].keys" item="key" open="(" separator="," close=")">
|
<foreach collection="vlogList[0].keys" item="key" open="(" separator="," close=")">
|
||||||
${key}
|
${key}
|
||||||
</foreach>
|
</foreach>
|
||||||
@ -91,9 +91,9 @@
|
|||||||
v.first_frame_img as firstFrameImg,
|
v.first_frame_img as firstFrameImg,
|
||||||
v.id as vlogId
|
v.id as vlogId
|
||||||
FROM
|
FROM
|
||||||
t_vlog v
|
cont_vlog v
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_users u
|
cont_users u
|
||||||
ON
|
ON
|
||||||
v.vloger_id = u.id
|
v.vloger_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
@ -146,9 +146,9 @@
|
|||||||
v.first_frame_img as firstFrameImg,
|
v.first_frame_img as firstFrameImg,
|
||||||
v.id as vlogId
|
v.id as vlogId
|
||||||
FROM
|
FROM
|
||||||
t_vlog v
|
cont_vlog v
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_users u
|
cont_users u
|
||||||
ON
|
ON
|
||||||
v.vloger_id = u.id
|
v.vloger_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
@ -169,7 +169,7 @@
|
|||||||
<!-- 根据fileId查询Vlog信息 -->
|
<!-- 根据fileId查询Vlog信息 -->
|
||||||
<select id="selectByFileId" parameterType="String" resultType="com.wzj.soopin.content.domain.po.Vlog">
|
<select id="selectByFileId" parameterType="String" resultType="com.wzj.soopin.content.domain.po.Vlog">
|
||||||
/* @SqlParser(filter=true) */
|
/* @SqlParser(filter=true) */
|
||||||
SELECT * FROM t_vlog WHERE file_id = #{fileId}
|
SELECT * FROM cont_vlog WHERE file_id = #{fileId}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="selectByMobileAndVlogId" resultType="com.wzj.soopin.content.domain.vo.CommentVO">
|
<select id="selectByMobileAndVlogId" resultType="com.wzj.soopin.content.domain.vo.CommentVO">
|
||||||
@ -185,8 +185,8 @@
|
|||||||
c.content,
|
c.content,
|
||||||
c.like_counts as likeCounts,
|
c.like_counts as likeCounts,
|
||||||
c.create_time as createTime
|
c.create_time as createTime
|
||||||
FROM t_comment c
|
FROM cont_comment c
|
||||||
LEFT JOIN t_users u ON c.comment_user_id = u.id
|
LEFT JOIN cont_users u ON c.comment_user_id = u.id
|
||||||
<where>
|
<where>
|
||||||
c.father_comment_id = '0'
|
c.father_comment_id = '0'
|
||||||
<if test="vlogId != null and vlogId != ''">
|
<if test="vlogId != null and vlogId != ''">
|
||||||
@ -222,13 +222,13 @@
|
|||||||
u.nickname,
|
u.nickname,
|
||||||
u.mobile
|
u.mobile
|
||||||
FROM
|
FROM
|
||||||
t_vlog v
|
cont_vlog v
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_users u ON v.vloger_id = u.id
|
cont_users u ON v.vloger_id = u.id
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_my_liked_vlog mlv ON v.id = mlv.vlog_id
|
cont_my_liked_vlog mlv ON v.id = mlv.vlog_id
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_comment c ON v.id = c.vlog_id AND (c.father_comment_id = '0' OR c.father_comment_id IS NULL)
|
cont_comment c ON v.id = c.vlog_id AND (c.father_comment_id = '0' OR c.father_comment_id IS NULL)
|
||||||
<where>
|
<where>
|
||||||
<if test="vlogBO.mobile != null and vlogBO.mobile != ''">
|
<if test="vlogBO.mobile != null and vlogBO.mobile != ''">
|
||||||
AND u.mobile LIKE CONCAT('%', #{vlogBO.mobile}, '%')
|
AND u.mobile LIKE CONCAT('%', #{vlogBO.mobile}, '%')
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
v.first_frame_img as firstFrameImg,
|
v.first_frame_img as firstFrameImg,
|
||||||
v.id as vlogId
|
v.id as vlogId
|
||||||
FROM
|
FROM
|
||||||
t_vlog v
|
cont_vlog v
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_users u
|
cont_users u
|
||||||
ON
|
ON
|
||||||
v.vloger_id = u.id
|
v.vloger_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
@ -84,9 +84,9 @@
|
|||||||
v.first_frame_img as firstFrameImg,
|
v.first_frame_img as firstFrameImg,
|
||||||
v.id as vlogId
|
v.id as vlogId
|
||||||
FROM
|
FROM
|
||||||
t_vlog v
|
cont_vlog v
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_users u
|
cont_users u
|
||||||
ON
|
ON
|
||||||
v.vloger_id = u.id
|
v.vloger_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
@ -116,13 +116,13 @@
|
|||||||
v.first_frame_img as firstFrameImg,
|
v.first_frame_img as firstFrameImg,
|
||||||
v.id as vlogId
|
v.id as vlogId
|
||||||
FROM
|
FROM
|
||||||
t_vlog v
|
cont_vlog v
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_my_liked_vlog mlv
|
cont_my_liked_vlog mlv
|
||||||
ON
|
ON
|
||||||
v.id = mlv.vlog_id
|
v.id = mlv.vlog_id
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_users u
|
cont_users u
|
||||||
ON
|
ON
|
||||||
mlv.user_id = u.id
|
mlv.user_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
@ -168,13 +168,13 @@
|
|||||||
v.first_frame_img as firstFrameImg,
|
v.first_frame_img as firstFrameImg,
|
||||||
v.id as vlogId
|
v.id as vlogId
|
||||||
FROM
|
FROM
|
||||||
t_vlog v
|
cont_vlog v
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_fans f
|
cont_fans f
|
||||||
ON
|
ON
|
||||||
v.vloger_id = f.vloger_id
|
v.vloger_id = f.vloger_id
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_users u
|
cont_users u
|
||||||
ON
|
ON
|
||||||
f.vloger_id = u.id
|
f.vloger_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
@ -209,13 +209,13 @@
|
|||||||
v.first_frame_img as firstFrameImg,
|
v.first_frame_img as firstFrameImg,
|
||||||
v.id as vlogId
|
v.id as vlogId
|
||||||
FROM
|
FROM
|
||||||
t_vlog v
|
cont_vlog v
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_fans f
|
ums_fans f
|
||||||
ON
|
ON
|
||||||
v.vloger_id = f.fan_id
|
v.vloger_id = f.fan_id
|
||||||
LEFT JOIN
|
LEFT JOIN
|
||||||
t_users u
|
cont_users u
|
||||||
ON
|
ON
|
||||||
f.fan_id = u.id
|
f.fan_id = u.id
|
||||||
WHERE
|
WHERE
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.wzj.soopin.member.controller;
|
package com.wzj.soopin.member.controller;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.wzj.soopin.member.domain.bo.AccountDetailQueryBO;
|
import com.wzj.soopin.member.domain.bo.AccountDetailQueryBO;
|
||||||
import com.wzj.soopin.member.domain.vo.AccountDetailVO;
|
import com.wzj.soopin.member.domain.vo.AccountDetailVO;
|
||||||
import com.wzj.soopin.member.service.IAccountDetailService;
|
import com.wzj.soopin.member.service.IAccountDetailService;
|
||||||
@ -29,9 +30,14 @@ public class AccountDetailController {
|
|||||||
/**
|
/**
|
||||||
* 分页查询账户明细
|
* 分页查询账户明细
|
||||||
*/
|
*/
|
||||||
@Operation(summary = "分页查询账户明细")
|
@Operation(summary = "根据account_id分页查询账户明细")
|
||||||
@PostMapping("/page")
|
@PostMapping("/page")
|
||||||
public R<IPage<AccountDetailVO>> queryAccountDetailPage(@Validated @RequestBody AccountDetailQueryBO queryBO) {
|
public R<IPage<AccountDetailVO>> queryAccountDetailPage(@RequestBody AccountDetailQueryBO queryBO,
|
||||||
|
@RequestBody Page<?> page) {
|
||||||
|
if (page != null) {
|
||||||
|
queryBO.setPageNum(page.getCurrent());
|
||||||
|
queryBO.setPageSize(page.getSize());
|
||||||
|
}
|
||||||
IPage<AccountDetailVO> result = accountDetailService.queryAccountDetailPage(queryBO);
|
IPage<AccountDetailVO> result = accountDetailService.queryAccountDetailPage(queryBO);
|
||||||
return R.ok(result);
|
return R.ok(result);
|
||||||
}
|
}
|
||||||
|
@ -2,13 +2,18 @@
|
|||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.wzj.soopin.member.mapper.MemberAccountChangeRecordMapper">
|
<mapper namespace="com.wzj.soopin.member.mapper.MemberAccountChangeRecordMapper">
|
||||||
|
|
||||||
<!-- 分页查询账户明细(关联账户表获取账户类型) -->
|
<!-- 分页查询账户明细(关联会员账户表和租户账户表获取账户类型) -->
|
||||||
<select id="selectAccountDetailPage" resultType="com.wzj.soopin.member.domain.vo.AccountDetailVO">
|
<select id="selectAccountDetailPage" resultType="com.wzj.soopin.member.domain.vo.AccountDetailVO">
|
||||||
SELECT
|
SELECT
|
||||||
r.id,
|
r.id,
|
||||||
r.member_id as memberId,
|
r.member_id as memberId,
|
||||||
r.account_id as accountId,
|
r.account_id as accountId,
|
||||||
a.type as accountType,
|
COALESCE(ma.type, ta.type) as accountType,
|
||||||
|
CASE
|
||||||
|
WHEN ma.id IS NOT NULL THEN 2 -- 会员
|
||||||
|
WHEN ta.id IS NOT NULL THEN 1 -- 租户
|
||||||
|
ELSE 2 -- 默认会员
|
||||||
|
END as userType,
|
||||||
r.money_balance as moneyBalance,
|
r.money_balance as moneyBalance,
|
||||||
r.before_balance as beforeBalance,
|
r.before_balance as beforeBalance,
|
||||||
r.after_balance as afterBalance,
|
r.after_balance as afterBalance,
|
||||||
@ -18,7 +23,8 @@
|
|||||||
r.source,
|
r.source,
|
||||||
r.create_time as createTime
|
r.create_time as createTime
|
||||||
FROM ums_account_change_record r
|
FROM ums_account_change_record r
|
||||||
LEFT JOIN ums_account a ON r.account_id = a.id
|
LEFT JOIN ums_account ma ON r.account_id = ma.member_id
|
||||||
|
LEFT JOIN sys_tenant_account ta ON r.account_id = ta.tenant_id
|
||||||
<where>
|
<where>
|
||||||
<if test="memberId != null">
|
<if test="memberId != null">
|
||||||
AND r.member_id = #{memberId}
|
AND r.member_id = #{memberId}
|
||||||
@ -38,6 +44,7 @@
|
|||||||
<if test="endTime != null and endTime != ''">
|
<if test="endTime != null and endTime != ''">
|
||||||
AND r.create_time <= #{endTime}
|
AND r.create_time <= #{endTime}
|
||||||
</if>
|
</if>
|
||||||
|
AND (ma.id IS NOT NULL OR ta.id IS NOT NULL)
|
||||||
</where>
|
</where>
|
||||||
ORDER BY r.create_time DESC
|
ORDER BY r.create_time DESC
|
||||||
</select>
|
</select>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user