33333333333

This commit is contained in:
777
2025-02-17 16:50:26 +08:00
parent 2e0d463354
commit 7d0186302e
7 changed files with 61 additions and 0 deletions

View File

@@ -25,6 +25,14 @@ public class UserCount implements Serializable {
*/
@TableId(value = "user_id",type = IdType.INPUT)
private Long userId;
/**
* 新增粉丝数
*/
private Long newFansCount;
/**
* 新增访客数
*/
private Long newVisitorCount;
/**
* 粉丝总数
*/

View File

@@ -16,7 +16,15 @@ public interface UserCountMapper extends BaseMapper<UserCount> {
void starIncs(@Param("userId") Long userId, @Param("fansIncs") int fansIncs, @Param("followIncs") int followIncs);
void newStarIncs(@Param("userId") Long userId);
void resetNewStarIncs(@Param("userId") Long userId);
void visitorIncs(@Param("userId") Long userId, @Param("footIncs") int footIncs, @Param("visitorIncs") int visitorIncs);
void newVisitorIncs(Long userId);
void resetNewVisitorIncs(Long userId);
Page<UserCountAdminVo> pageAdmin(@Param("build") Page<Object> build, @Param("bo") UserCountAdminVo bo);
}

View File

@@ -43,6 +43,7 @@ public class UserCountServiceImpl extends ServiceImpl<UserCountMapper, UserCount
public void star(Long fromUserId, Long toUserId) {
baseMapper.starIncs(fromUserId,0,1);
baseMapper.starIncs(toUserId,1,0);
baseMapper.newStarIncs(toUserId);
}
@Override
@@ -55,6 +56,7 @@ public class UserCountServiceImpl extends ServiceImpl<UserCountMapper, UserCount
public void visitor(Long fromUserId, Long toUserId) {
baseMapper.visitorIncs(fromUserId,1,0);
baseMapper.visitorIncs(toUserId,0,1);
baseMapper.newVisitorIncs(toUserId);
}
@Override

View File

@@ -15,6 +15,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="giveGiftCount" column="give_gift_count"/>
<result property="createTime" column="create_time"/>
</resultMap>
<update id="newStarIncs">
update cai_user_count
set new_fans_count = new_fans_count + 1
where user_id = #{userId}
</update>
<update id="newVisitorIncs">
update cai_user_count
set new_visitor_count = new_visitor_count + 1
where user_id = #{userId}
</update>
<update id="visitorIncs">
update cai_user_count
set
@@ -22,6 +32,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
visitor_count = visitor_count + #{visitorIncs}
where user_id = #{userId}
</update>
<update id="resetNewStarIncs">
update cai_user_count
set new_fans_count = 0
where user_id = #{userId} and new_fans_count > 0
</update>
<update id="resetNewVisitorIncs">
update cai_user_count
set new_visitor_count = 0
where user_id = #{userId} and new_visitor_count > 0
</update>
<select id="starIncs">
update cai_user_count
set