修改--产品管理获取热门作者榜添加用户作品数
This commit is contained in:
parent
93dbcd4f65
commit
4e41b95b61
@ -54,6 +54,9 @@ public class SysSourceController extends BaseController {
|
||||
@Autowired
|
||||
private IUserInfoService userInfoService;
|
||||
|
||||
@Autowired
|
||||
private IUserWorkService userWorkService;
|
||||
|
||||
|
||||
// 设置各景区默认价格和北京图片
|
||||
@Autowired
|
||||
@ -258,14 +261,14 @@ public class SysSourceController extends BaseController {
|
||||
|
||||
|
||||
|
||||
// 热门作者榜单--以user_info中的 receive_rockets 为基准排序, 返回前10 然后在查他们的作品数
|
||||
// 热门作者榜单--以user_info中的 receive_rockets 为基准排序, 返回前6 然后再查他们的作品数
|
||||
// 作品数 ----暂定都查询--连带着草稿都查询
|
||||
@GetMapping("/getHotAuthor")
|
||||
public AjaxResult getHotAuthor() {
|
||||
|
||||
List<HotAuthorDto> hotAuthorDtoList = new ArrayList<>();
|
||||
|
||||
// 获取前10名
|
||||
// 获取前6名
|
||||
List<HotAuthorDto> userInfoList = userInfoService.getHotAuthor();
|
||||
|
||||
for(HotAuthorDto userInfo : userInfoList){
|
||||
@ -275,8 +278,10 @@ public class SysSourceController extends BaseController {
|
||||
hotAuthorDto.setUserId(userInfo.getUserId());
|
||||
hotAuthorDto.setNickName(userInfo.getNickName());
|
||||
hotAuthorDto.setReceiveRockets(userInfo.getReceiveRockets());
|
||||
|
||||
Long userWorkCount = userWorkService.getUserWorkCountByUserId(userInfo.getUserId());
|
||||
// 作品数这里还要去查每个人的作品??--先不做
|
||||
hotAuthorDto.setWorkCount(1200L);
|
||||
hotAuthorDto.setWorkCount(userWorkCount);
|
||||
hotAuthorDtoList.add(hotAuthorDto);
|
||||
|
||||
}
|
||||
|
||||
@ -7,15 +7,15 @@ spring:
|
||||
druid:
|
||||
# 主库数据源
|
||||
master:
|
||||
# url: jdbc:mysql://localhost:3306/wenlvapp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
url: jdbc:mysql://localhost:3306/wenlvapp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
|
||||
# url: jdbc:mysql://172.17.0.7:3306/wenlvapp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # 腾讯云
|
||||
url: jdbc:mysql://172.17.0.3:3306/wenlvapp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # 火山云
|
||||
# url: jdbc:mysql://172.17.0.3:3306/wenlvapp?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 # 火山云
|
||||
# url: jdbc:mysql://localhost:3306/xingming?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
# url: jdbc:mysql://172.17.0.7:3306/wenlvapp?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai&useSSL=false
|
||||
username: root
|
||||
# password: root
|
||||
password: dnxxkj
|
||||
password: root
|
||||
# password: dnxxkj
|
||||
# 从库数据源
|
||||
slave:
|
||||
# 从数据源开关/默认关闭
|
||||
|
||||
@ -9,20 +9,20 @@ ruoyi:
|
||||
# 实例演示开关
|
||||
demoEnabled: true
|
||||
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
|
||||
# profile: D:/ruoyi/uploadPath
|
||||
#
|
||||
# # 保存身份证文件地址
|
||||
# idCardPath: D:/ruoyi/IdCard
|
||||
# domain: http://10.0.0.17:8081
|
||||
profile: D:/ruoyi/uploadPath
|
||||
|
||||
# 保存身份证文件地址
|
||||
idCardPath: D:/ruoyi/IdCard
|
||||
domain: http://10.0.0.17:8081
|
||||
|
||||
# 腾讯云
|
||||
# domain: http://82.156.153.112:8081
|
||||
|
||||
# 火山云
|
||||
domain: http://14.103.162.172:8081
|
||||
|
||||
idCardPath: /home/IdCard
|
||||
profile: /home/uploadPath
|
||||
# domain: http://14.103.162.172:8081
|
||||
#
|
||||
# idCardPath: /home/IdCard
|
||||
# profile: /home/uploadPath
|
||||
# 获取ip地址开关
|
||||
addressEnabled: false
|
||||
# 验证码类型 math 数组计算 char 字符验证
|
||||
@ -86,9 +86,9 @@ spring:
|
||||
# redis 配置
|
||||
redis:
|
||||
# 地址
|
||||
# host: localhost
|
||||
host: localhost
|
||||
## host: 172.17.0.3 # 腾讯云
|
||||
host: 172.17.0.2 #火山云
|
||||
# host: 172.17.0.2 #火山云
|
||||
|
||||
# 端口,默认为6379
|
||||
port: 6379
|
||||
|
||||
@ -98,4 +98,10 @@ public interface UserWorkMapper
|
||||
* */
|
||||
public List<GetUserPublishWorkDto> getUserPublishWork(@Param("userId") Long userId);
|
||||
|
||||
/**
|
||||
*
|
||||
* 根据用户id获取用户作品数量
|
||||
* */
|
||||
public Long getUserWorkCountByUserId(@Param("userId") Long userId);
|
||||
|
||||
}
|
||||
|
||||
@ -99,4 +99,10 @@ public interface IUserWorkService
|
||||
* */
|
||||
public List<GetUserPublishWorkDto> getUserPublishWork(Long userId);
|
||||
|
||||
/**
|
||||
*
|
||||
* 根据用户id获取用户作品数量
|
||||
* */
|
||||
public Long getUserWorkCountByUserId(Long userId);
|
||||
|
||||
}
|
||||
|
||||
@ -149,4 +149,13 @@ public class UserWorkServiceImpl implements IUserWorkService
|
||||
public List<GetUserPublishWorkDto> getUserPublishWork(Long userId){
|
||||
return userWorkMapper.getUserPublishWork(userId);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 根据用户id获取用户作品数量
|
||||
* */
|
||||
@Override
|
||||
public Long getUserWorkCountByUserId(Long userId){
|
||||
return userWorkMapper.getUserWorkCountByUserId(userId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -249,4 +249,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where user_id = #{userId} and work_status = '3'
|
||||
order by create_time desc
|
||||
</select>
|
||||
<select id="getUserWorkCountByUserId" resultType="java.lang.Long">
|
||||
select count(*) from user_work where user_id = #{userId} and work_status = '3'
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue
Block a user