1、获取关注、粉丝列表、消息详细 返回参数统一
2、管理员系统 按用户名或用户邮箱 查询用户design频率
This commit is contained in:
@@ -51,7 +51,8 @@ public class ConvenientInquiryController {
|
|||||||
|
|
||||||
@ApiOperation("获取指定时间区间内所有用户design的使用情况")
|
@ApiOperation("获取指定时间区间内所有用户design的使用情况")
|
||||||
@GetMapping("/getDesignStatistic")
|
@GetMapping("/getDesignStatistic")
|
||||||
public Response<List<UserDesignStatisticDTO>> getDesignStatistic(@RequestParam String startTime, @RequestParam String endTime) {
|
public Response<List<UserDesignStatisticDTO>> getDesignStatistic(@RequestParam String startTime, @RequestParam String endTime,
|
||||||
|
@RequestParam(required = false) String userName, @RequestParam(required = false) String email) {
|
||||||
Long accountId = UserContext.getUserHolder().getId();
|
Long accountId = UserContext.getUserHolder().getId();
|
||||||
if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L) || accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)) {
|
if (accountId.equals(31L) || accountId.equals(87L) || accountId.equals(83L) || accountId.equals(6L) || accountId.equals(4L) || accountId.equals(73L)) {
|
||||||
if (StringUtil.isNullOrEmpty(startTime)) startTime = "2024-02-01 00:00:00";
|
if (StringUtil.isNullOrEmpty(startTime)) startTime = "2024-02-01 00:00:00";
|
||||||
@@ -60,7 +61,7 @@ public class ConvenientInquiryController {
|
|||||||
Date date = new Date();
|
Date date = new Date();
|
||||||
endTime = simpleDateFormat.format(date);
|
endTime = simpleDateFormat.format(date);
|
||||||
}
|
}
|
||||||
List<UserDesignStatisticDTO> designStatistic = designMapper.getDesignStatistic(startTime, endTime);
|
List<UserDesignStatisticDTO> designStatistic = designMapper.getDesignStatistic(startTime, endTime, userName, email);
|
||||||
return Response.success(designStatistic);
|
return Response.success(designStatistic);
|
||||||
} else {
|
} else {
|
||||||
return Response.fail("Sorry, you don't have permission");
|
return Response.fail("Sorry, you don't have permission");
|
||||||
|
|||||||
@@ -18,5 +18,5 @@ public interface DesignMapper extends CommonMapper<Design> {
|
|||||||
//返回插入数据后生成的主键
|
//返回插入数据后生成的主键
|
||||||
Long insertDesign(Design design);
|
Long insertDesign(Design design);
|
||||||
|
|
||||||
List<UserDesignStatisticDTO> getDesignStatistic(String startTime, String endTime);
|
List<UserDesignStatisticDTO> getDesignStatistic(String startTime, String endTime, String userName, String email);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,14 +11,23 @@ import java.time.LocalDateTime;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class AccountFollowVO {
|
public class AccountFollowVO {
|
||||||
private Long userId;
|
/**
|
||||||
|
* userId
|
||||||
|
*/
|
||||||
|
private Long senderId;
|
||||||
|
|
||||||
private String userName;
|
private String userName;
|
||||||
|
|
||||||
private String avatar;
|
private String avatar;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* followTime
|
||||||
|
*/
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
|
||||||
private LocalDateTime followTime;
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
private Integer mutualFollowing;
|
/**
|
||||||
|
* mutualFollowing 互粉
|
||||||
|
*/
|
||||||
|
private Integer isFollow;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,13 +8,19 @@ import lombok.EqualsAndHashCode;
|
|||||||
@Data
|
@Data
|
||||||
public class NotificationVO extends Notification {
|
public class NotificationVO extends Notification {
|
||||||
|
|
||||||
private String senderUserName;
|
/**
|
||||||
|
* senderUserName
|
||||||
|
*/
|
||||||
|
private String userName;
|
||||||
|
|
||||||
private String senderUserAvatar;
|
// private String senderUserAvatar;
|
||||||
|
|
||||||
private String portfolioName;
|
private String portfolioName;
|
||||||
|
|
||||||
private String senderAvatar;
|
/**
|
||||||
|
* sender头像
|
||||||
|
*/
|
||||||
|
private String avatar;
|
||||||
|
|
||||||
private Integer isFollow;
|
private Integer isFollow;
|
||||||
|
|
||||||
|
|||||||
@@ -82,8 +82,8 @@ public class MessageCenterServiceImpl extends ServiceImpl<NotificationMapper, No
|
|||||||
IPage<NotificationVO> convert = notificationPage.convert(o -> {
|
IPage<NotificationVO> convert = notificationPage.convert(o -> {
|
||||||
NotificationVO notificationVO = CopyUtil.copyObject(o, NotificationVO.class);
|
NotificationVO notificationVO = CopyUtil.copyObject(o, NotificationVO.class);
|
||||||
Account senderAccount = accountService.getById(notificationVO.getSenderId());
|
Account senderAccount = accountService.getById(notificationVO.getSenderId());
|
||||||
notificationVO.setSenderUserName(senderAccount.getUserName());
|
notificationVO.setUserName(senderAccount.getUserName());
|
||||||
notificationVO.setSenderUserAvatar(StringUtils.isNullOrEmpty(senderAccount.getAvatar()) ? null : minioUtil.getPreSignedUrl(senderAccount.getAvatar(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
// notificationVO.setSenderUserAvatar(StringUtils.isNullOrEmpty(senderAccount.getAvatar()) ? null : minioUtil.getPreSignedUrl(senderAccount.getAvatar(), CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||||
notificationVO.setPortfolioName(Objects.isNull(notificationVO.getPortfolioId()) ? null : portfolioService.getById(notificationVO.getPortfolioId()).getPortfolioName());
|
notificationVO.setPortfolioName(Objects.isNull(notificationVO.getPortfolioId()) ? null : portfolioService.getById(notificationVO.getPortfolioId()).getPortfolioName());
|
||||||
// 设置单个人 系统消息是否已读
|
// 设置单个人 系统消息是否已读
|
||||||
if (notificationVO.getType().equals("system")){
|
if (notificationVO.getType().equals("system")){
|
||||||
@@ -94,7 +94,7 @@ public class MessageCenterServiceImpl extends ServiceImpl<NotificationMapper, No
|
|||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
String avatar = StringUtil.isNullOrEmpty(senderAccount.getAvatar()) ? CommonConstant.DEFAULT_AVATAR : senderAccount.getAvatar();
|
String avatar = StringUtil.isNullOrEmpty(senderAccount.getAvatar()) ? CommonConstant.DEFAULT_AVATAR : senderAccount.getAvatar();
|
||||||
notificationVO.setSenderAvatar(minioUtil.getPreSignedUrl(avatar, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
notificationVO.setAvatar(minioUtil.getPreSignedUrl(avatar, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||||
}
|
}
|
||||||
return notificationVO;
|
return notificationVO;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1062,8 +1062,8 @@ public class PortfolioServiceImpl extends ServiceImpl<PortfolioMapper, Portfolio
|
|||||||
followerList.forEach(follower -> {
|
followerList.forEach(follower -> {
|
||||||
String avatar = StringUtil.isNullOrEmpty(follower.getAvatar()) ? CommonConstant.DEFAULT_AVATAR : follower.getAvatar();
|
String avatar = StringUtil.isNullOrEmpty(follower.getAvatar()) ? CommonConstant.DEFAULT_AVATAR : follower.getAvatar();
|
||||||
follower.setAvatar(minioUtil.getPreSignedUrl(avatar, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
follower.setAvatar(minioUtil.getPreSignedUrl(avatar, CommonConstant.MINIO_IMAGE_EXPIRE_TIME));
|
||||||
follower.setMutualFollowing(Objects.isNull(followeeMap.get(follower.getUserId())) ? 0 : 1);
|
follower.setIsFollow(Objects.isNull(followeeMap.get(follower.getSenderId())) ? 0 : 1);
|
||||||
follower.setFollowTime(followeeMap.get(follower.getUserId()));
|
// follower.setFollowTime(followeeMap.get(follower.getUserId()));
|
||||||
});
|
});
|
||||||
return followerList;
|
return followerList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,6 +39,12 @@
|
|||||||
</where>
|
</where>
|
||||||
and b.create_date not like '%:01'
|
and b.create_date not like '%:01'
|
||||||
and b.create_date not like '%:02'
|
and b.create_date not like '%:02'
|
||||||
|
<if test="userName != null and userName != '' ">
|
||||||
|
and a.user_name = #{userName}
|
||||||
|
</if>
|
||||||
|
<if test="email != null and email != '' ">
|
||||||
|
and a.user_email = #{email}
|
||||||
|
</if>
|
||||||
GROUP BY b.account_id
|
GROUP BY b.account_id
|
||||||
ORDER BY b.account_id asc) d
|
ORDER BY b.account_id asc) d
|
||||||
left join trial_order c on d.user_email = c.email
|
left join trial_order c on d.user_email = c.email
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<!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.ai.da.mapper.primary.UserFollowMapper">
|
<mapper namespace="com.ai.da.mapper.primary.UserFollowMapper">
|
||||||
<select id="getFolloweeListByFollower" resultType="com.ai.da.model.vo.AccountFollowVO">
|
<select id="getFolloweeListByFollower" resultType="com.ai.da.model.vo.AccountFollowVO">
|
||||||
SELECT a.id as user_id, a.user_name AS user_name, a.avatar AS avatar, b.create_time AS follow_time
|
SELECT a.id as sender_id, a.user_name AS user_name, a.avatar AS avatar, b.create_time AS create_time
|
||||||
FROM t_account a
|
FROM t_account a
|
||||||
INNER JOIN t_user_follow b ON a.id = b.followee_id
|
INNER JOIN t_user_follow b ON a.id = b.followee_id
|
||||||
WHERE b.follower_id = #{followerAccountId}
|
WHERE b.follower_id = #{followerAccountId}
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
LIMIT #{limit} OFFSET #{offset}
|
LIMIT #{limit} OFFSET #{offset}
|
||||||
</select>
|
</select>
|
||||||
<select id="getFollowerListByFollowee" resultType="com.ai.da.model.vo.AccountFollowVO">
|
<select id="getFollowerListByFollowee" resultType="com.ai.da.model.vo.AccountFollowVO">
|
||||||
SELECT a.id as user_id, a.user_name AS user_name, a.avatar AS avatar, b.create_time AS follow_time
|
SELECT a.id as sender_id, a.user_name AS user_name, a.avatar AS avatar, b.create_time AS create_time
|
||||||
FROM t_account a
|
FROM t_account a
|
||||||
INNER JOIN t_user_follow b ON a.id = b.follower_id
|
INNER JOIN t_user_follow b ON a.id = b.follower_id
|
||||||
WHERE b.followee_id = #{followeeAccountId}
|
WHERE b.followee_id = #{followeeAccountId}
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getFolloweeListByName" resultType="com.ai.da.model.vo.AccountFollowVO">
|
<select id="getFolloweeListByName" resultType="com.ai.da.model.vo.AccountFollowVO">
|
||||||
SELECT a.id as user_id, a.user_name, a.avatar, b.create_time as follow_time
|
SELECT a.id as sender_id, a.user_name, a.avatar, b.create_time as create_time
|
||||||
FROM t_account a
|
FROM t_account a
|
||||||
INNER JOIN t_user_follow b ON a.id = b.followee_id
|
INNER JOIN t_user_follow b ON a.id = b.followee_id
|
||||||
WHERE b.follower_id = #{followerId}
|
WHERE b.follower_id = #{followerId}
|
||||||
@@ -37,7 +37,7 @@
|
|||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getFollowerListByName" resultType="com.ai.da.model.vo.AccountFollowVO">
|
<select id="getFollowerListByName" resultType="com.ai.da.model.vo.AccountFollowVO">
|
||||||
SELECT a.id as user_id, a.user_name, a.avatar, b.create_time as follow_time
|
SELECT a.id as sender_id, a.user_name, a.avatar, b.create_time as create_time
|
||||||
FROM t_account a
|
FROM t_account a
|
||||||
INNER JOIN t_user_follow b ON a.id = b.follower_id
|
INNER JOIN t_user_follow b ON a.id = b.follower_id
|
||||||
WHERE b.followee_id = #{followeeId}
|
WHERE b.followee_id = #{followeeId}
|
||||||
|
|||||||
Reference in New Issue
Block a user