Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
代码敲不队
YoubiliProject
提交
30c18aa6
Y
YoubiliProject
项目概览
代码敲不队
/
YoubiliProject
通知
7
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YoubiliProject
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
30c18aa6
编写于
7月 08, 2023
作者:
喷火的神灵
🎱
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
粉丝关注功能实现
上级
78caf0e8
变更
13
显示空白变更内容
内联
并排
Showing
13 changed file
with
166 addition
and
44 deletion
+166
-44
YouBili_front/src/utils/option.js
YouBili_front/src/utils/option.js
+14
-11
YouBili_front/src/views/personal/notify.vue
YouBili_front/src/views/personal/notify.vue
+21
-10
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/common/web/response/RestBean.java
...u/youbiliprojectbackend/common/web/response/RestBean.java
+2
-2
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/core/config/MybatisConfig.java
...tedu/youbiliprojectbackend/core/config/MybatisConfig.java
+5
-1
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/recommend/dao/persist/mapper/thermaMapper.java
...nd/modules/recommend/dao/persist/mapper/thermaMapper.java
+11
-0
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/recommend/pojo/sum/videoSum.java
...liprojectbackend/modules/recommend/pojo/sum/videoSum.java
+19
-0
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/recommend/score/ThermalValue.java
...iprojectbackend/modules/recommend/score/ThermalValue.java
+7
-4
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/social/controller.java
...tedu/youbiliprojectbackend/modules/social/controller.java
+23
-0
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/social/social.md
...va/cn/tedu/youbiliprojectbackend/modules/social/social.md
+7
-1
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/user/follow/pojo/vo/FollowListVO.java
...jectbackend/modules/user/follow/pojo/vo/FollowListVO.java
+0
-15
youbili-project-backend/src/main/resources/mapper/recommend/thermaMapper.xml
...kend/src/main/resources/mapper/recommend/thermaMapper.xml
+17
-0
youbili-project-backend/src/test/java/cn/tedu/youbiliprojectbackend/thermalValue/Strom.java
...ava/cn/tedu/youbiliprojectbackend/thermalValue/Strom.java
+40
-0
设计部分/~$uBili项目文档(1).docx
设计部分/~$uBili项目文档(1).docx
+0
-0
未找到文件。
YouBili_front/src/utils/option.js
浏览文件 @
30c18aa6
...
...
@@ -156,7 +156,7 @@ export function categoryVideo(params) {
export
function
getNotice
(
params
)
{
return
request
({
method
:
"
get
"
,
url
:
"
/
user
/notice/list
"
,
url
:
"
/
social
/notice/list
"
,
data
:
params
})
}
...
...
@@ -166,7 +166,7 @@ export function getNotice(params) {
export
function
postNoticeDelete
(
params
)
{
return
request
({
method
:
"
post
"
,
url
:
"
/
admin
/notice/notifyDelete
"
,
url
:
"
/
social
/notice/notifyDelete
"
,
data
:
params
})
}
...
...
@@ -219,14 +219,16 @@ export function deleteCollection(params) {
//删除粉丝
export
function
deletefan
(
params
)
{
return
deletefan
({
method
:
'
post
'
,
url
:
'
/user/fans/{id}/deletefan
'
,
method
:
'
get
'
,
// url: '/user/fans/{id}/deletefan',
url
:
'
/user/fans/{followID}/deletefan
'
,
data
:
params
})
}
//加载粉丝列表
//加载粉丝列表
-
export
function
fanlist
(
params
)
{
return
fanlist
({
method
:
'
get
'
,
...
...
@@ -236,26 +238,27 @@ export function fanlist(params) {
}
//添加粉丝
//添加粉丝
-
export
function
addfan
(
params
)
{
return
addfan
({
method
:
'
get
'
,
url
:
'
/user/f
ans/{userID}/listfan
'
,
url
:
'
/user/f
ollow/{userID}/addfollow
'
,
data
:
params
})
}
//取消关注
//取消关注
-
export
function
followDelete
(
params
)
{
return
request
({
method
:
'
post
'
,
url
:
'
/user/fans/{followeID}/deletefan
'
,
method
:
'
get
'
,
// url: '/user/fans/{followeID}/deletefan',
url
:
'
/user/follow/{followID}/deletefollow
'
,
data
:
params
})
}
//加载关注列表
//加载关注列表
-
export
function
followList
(
params
)
{
return
request
({
method
:
'
post
'
,
...
...
YouBili_front/src/views/personal/notify.vue
浏览文件 @
30c18aa6
...
...
@@ -136,17 +136,28 @@ export default {
// }
},
created
()
{
getNotice
().
then
(
res
=>
{
if
(
res
.
success
){
this
.
$notify
.
error
({
title
:
'
错误
'
,
position
:
'
bottom-right
'
getNotice
().
then
(
res
=>
{
if
(
res
.
success
){
// alert("成功")
this
.
tableData
=
res
.
data
;
}
else
{
alert
(
res
.
message
)
})
}
})
// getNotice().then(res=>{
// if(res.success){
// // alert("成功")
// this.tableData =res.data;
// }else {
// alert(res.message)
// }
//
// })
},
...
...
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/common/web/response/RestBean.java
浏览文件 @
30c18aa6
...
...
@@ -13,11 +13,11 @@ import lombok.Data;
* @param <T>
*/
@Data
public
class
RestBean
<
T
>
{
public
class
RestBean
<
T
>
{
//list<Object>
private
Integer
status
;
private
boolean
success
;
private
String
message
;
private
T
data
;
private
T
data
;
//list<>OBjet
private
RestBean
(
Integer
status
,
String
message
,
boolean
success
,
T
data
)
{
this
.
status
=
status
;
...
...
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/core/config/MybatisConfig.java
浏览文件 @
30c18aa6
...
...
@@ -9,7 +9,11 @@ import org.springframework.context.annotation.Configuration;
{
"cn.tedu.youbiliprojectbackend.modules.user.register.dao.mapper"
,
"cn.tedu.youbiliprojectbackend.modules.user.account.dao.mapper"
,
"cn.tedu.youbiliprojectbackend.modules.user.favorite.dao.persist.mapper"
"cn.tedu.youbiliprojectbackend.modules.user.favorite.dao.persist.mapper"
,
"cn.tedu.youbiliprojectbackend.modules.orders.dao.mapper"
,
"cn.tedu.youbiliprojectbackend.modules.recommend.dao.persist.mapper"
,
"cn.tedu.youbiliprojectbackend.modules.user.follow.dao.persist.mapper"
,
"cn.tedu.youbiliprojectbackend.modules.user.fan.dao.persist.mapper"
,
})
public
class
MybatisConfig
{
}
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/recommend/dao/persist/mapper/thermaMapper.java
0 → 100644
浏览文件 @
30c18aa6
package
cn.tedu.youbiliprojectbackend.modules.recommend.dao.persist.mapper
;
import
cn.tedu.youbiliprojectbackend.modules.recommend.pojo.sum.videoSum
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
thermaMapper
extends
BaseMapper
<
videoSum
>
{
videoSum
selectByID
(
Long
videoID
);
}
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/recommend/pojo/sum/videoSum.java
0 → 100644
浏览文件 @
30c18aa6
package
cn.tedu.youbiliprojectbackend.modules.recommend.pojo.sum
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 用于查询计算 计算字段值
*/
@Data
public
class
videoSum
implements
Serializable
{
private
Integer
viewCount
;
private
Integer
likeCount
;
private
Integer
favoriteCount
;
private
Integer
dislikeCount
;
private
Integer
barrageCount
;
private
Integer
commentCount
;
}
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/recommend/score/ThermalValue.java
浏览文件 @
30c18aa6
...
...
@@ -7,9 +7,12 @@ package cn.tedu.youbiliprojectbackend.modules.recommend.score;
public
class
ThermalValue
{
public
Integer
Strom
(){
return
1
;
/**
* 通过计算每个视频的 点赞数,收藏数,观看数,弹幕数,评论数 ; 点踩数 ; 以及每个视频上传时间的衰减因子来获取每个视频的热力值;
*
* @return
*/
public
Double
Strom
(){
return
1.0
;
}
}
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/
user/follow/controller/FollowC
ontroller.java
→
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/
social/c
ontroller.java
浏览文件 @
30c18aa6
package
cn.tedu.youbiliprojectbackend.modules.user.follow.controller
;
package
cn.tedu.youbiliprojectbackend.modules.social
;
import
cn.tedu.youbiliprojectbackend.common.security.CurrentPrincipal
;
import
cn.tedu.youbiliprojectbackend.common.web.response.RestBean
;
...
...
@@ -8,28 +9,15 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@Slf4j
@RestController
@RequestMapping
(
"/user/follow"
)
public
class
FollowController
{
FollowController
(){
log
.
debug
(
"创建控制器类: FollowController "
);
}
/**
* 加载当前登录用户的关注列表
* @param principal 当事人ID
* @return 返回当前用户关注的人
*/
@GetMapping
(
"/followlist"
)
public
RestBean
<
Object
>
followList
(
@AuthenticationPrincipal
CurrentPrincipal
principal
){
log
.
debug
(
"开始处理请求 followlist"
);
@RequestMapping
(
"/social/notice"
)
@Slf4j
public
class
controller
{
return
null
;
@GetMapping
(
"list"
)
public
RestBean
<
Object
>
getNoticeList
(
@AuthenticationPrincipal
CurrentPrincipal
principal
){
log
.
debug
(
"开始处理获取通知列表请求 : {}"
,
principal
.
getUsername
());
return
RestBean
.
success
();
}
}
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/social/social.md
浏览文件 @
30c18aa6
### 社交互动模块
### 动态
### 通知
youbili-project-backend/src/main/java/cn/tedu/youbiliprojectbackend/modules/user/follow/pojo/vo/FollowListVO.java
已删除
100644 → 0
浏览文件 @
78caf0e8
package
cn.tedu.youbiliprojectbackend.modules.user.follow.pojo.vo
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
FollowListVO
implements
Serializable
{
private
Long
followID
;
private
Long
userID
;
private
String
nickname
;
private
Integer
fansCount
;
private
Integer
followCount
;
private
String
imgUrl
;
}
youbili-project-backend/src/main/resources/mapper/recommend/thermaMapper.xml
0 → 100644
浏览文件 @
30c18aa6
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.tedu.youbiliprojectbackend.modules.recommend.dao.persist.mapper.thermaMapper"
>
<select
id=
"selectByID"
resultType=
"cn.tedu.youbiliprojectbackend.modules.recommend.pojo.sum.videoSum"
>
SELECT viewCount,
likeCount,
favoriteCount,
dislikeCount,
barrageCount,
commentCount
FROM favorite
WHERE videoID=#{videoID}
</select>
</mapper>
\ No newline at end of file
youbili-project-backend/src/test/java/cn/tedu/youbiliprojectbackend/thermalValue/Strom.java
0 → 100644
浏览文件 @
30c18aa6
package
cn.tedu.youbiliprojectbackend.thermalValue
;
import
cn.tedu.youbiliprojectbackend.modules.recommend.dao.persist.mapper.thermaMapper
;
import
cn.tedu.youbiliprojectbackend.modules.recommend.pojo.sum.videoSum
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.context.SpringBootTest
;
@SpringBootTest
public
class
Strom
{
Double
ViewX
;
Double
LikeX
;
Double
FavoriteX
;
Double
DisLikeX
;
Double
BarrageX
;
Double
CommentX
;
@Autowired
thermaMapper
thermaMapper
;
@Test
Double
View
(){
videoSum
videoSum
=
thermaMapper
.
selectByID
(
1L
);
Double
View
=
ViewX
*
videoSum
.
getViewCount
();
Double
Like
=
LikeX
*
videoSum
.
getLikeCount
();
Double
favorite
=
FavoriteX
*
videoSum
.
getFavoriteCount
();
Double
dislike
=
DisLikeX
*
videoSum
.
getDislikeCount
();
Double
barrage
=
BarrageX
*
videoSum
.
getBarrageCount
();
Double
comment
=
CommentX
*
videoSum
.
getCommentCount
();
Double
Thred
=
View
+
Like
+
favorite
+
dislike
+
barrage
+
comment
;
return
Thred
;
}
@Test
void
apper
(){
System
.
out
.
println
(
thermaMapper
.
selectByID
(
1L
));
}
}
设计部分/~$uBili项目文档(1).docx
0 → 100644
浏览文件 @
30c18aa6
文件已添加
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录