当前位置:网站首页>Tiktok practice ~ public / private short video interchange
Tiktok practice ~ public / private short video interchange
2022-06-27 12:56:00 【gblfy】


List of articles
One 、 Demand analysis
1. Public to private ~ flow chart

2. Public to private ~ Process brief
- Recommend from the home page ~ Short video list watch a short video
- Click the right side of the short video to share
- Choose to be private
- 4. Home page recommendation ~ There is no private video in the short video list
- 5. The video goes to the personal center ~ Private video list
3. Private to public ~ flow chart

4. Private to public ~ Process brief
- From the personal Center ~ Private video list , Click a short video to enter the details of the short video
- Click the right side of the short video to share
- Select make public
- 4. Home page recommendation ~ Refresh in the short video list , You can see the short video that has just been made public
Two 、 Code combat
- front end
2.1. Public to private
// Users change public video to private video
changeVlogToPrivate() {
var vlogId = this.thisVlogId;
var me = this;
var userId = getApp().getUserInfoSession().id;
var serverUrl = app.globalData.serverUrl;
uni.request({
method: "POST",
header: {
headerUserId: userId,
headerUserToken: app.getUserSessionToken()
},
url: serverUrl + "/vlog/changeToPrivate?userId=" + userId + "&vlogId=" + vlogId,
success(result) {
console.log(result);
if (result.data.status == 200) {
uni.showToast({
title: " Setup complete ~"
})
}
}
});
}
2.2. Private to public
// Users change private video to public video
changeVlogToPublic() {
var vlogId = this.thisVlogId;
var me = this;
var userId = getApp().getUserInfoSession().id;
var serverUrl = app.globalData.serverUrl;
uni.request({
method: "POST",
header: {
headerUserId: userId,
headerUserToken: app.getUserSessionToken()
},
url: serverUrl + "/vlog/changeToPublic?userId=" + userId + "&vlogId=" + vlogId,
success(result) {
console.log(result);
if (result.data.status == 200) {
uni.showToast({
title: " Setup complete ~"
})
}
}
});
}
- Back end
2.3. Public to private
/**
* Users change the video to public / Private video
*
* @param userId With the head of the household key ID
* @param vlogId Video primary key ID
* @return
*/
@PostMapping("changeToPublic")
public GraceJSONResult changeToPublic(@RequestParam String userId,
@RequestParam String vlogId) {
vlogService.changeToPrivateOrPublic(userId,
vlogId,
YesOrNo.NO.type);
return GraceJSONResult.ok();
}
2.4. Short video details
List video click one to jump to short video details , The principle is the same as that of the short video list on the home page and the short video list search , It uses an interface
2.5. Private to public
/**
* Users change the video to public / Private video
*
* @param userId With the head of the household key ID
* @param vlogId Video primary key ID
* @return
*/
@PostMapping("changeToPrivate")
public GraceJSONResult changeToPrivate(@RequestParam String userId,
@RequestParam String vlogId) {
vlogService.changeToPrivateOrPublic(userId,
vlogId,
YesOrNo.YES.type);
return GraceJSONResult.ok();
}
3、 ... and 、 Appreciation of works
3.1. Public short video to private
Short video recommended on the home page

Sharing turns private

3.2. Private short video to public
Personal center private short video list

Short video details

Private to public
Recommended short videos on the home page , After drop-down refresh , There is more private to public video

边栏推荐
猜你喜欢
随机推荐
【TcaplusDB知识库】TcaplusDB-tcapsvrmgr工具介绍(三)
GCC compiling dynamic and static libraries
Interview shock 60: what will cause MySQL index invalidation?
不一样的习惯
再懂已是曲中人
【Acwing】第57场周赛 题解
[medical segmentation] unet3+
Make learning pointer easier (2)
How to download pictures with hyperlinks
带你认识图数据库性能和场景测试利器LDBC SNB
Industry insight - how should brand e-commerce reshape growth under the new retail format?
使用bitnamiredis-sentinel部署Redis 哨兵模式
浏览器输入url地址,到页面渲染发生了什么
socket阻塞和非阻塞模式
Vs debugging skills
Three traversal methods of binary tree
微服务之配置管理中心
云原生(三十) | Kubernetes篇之应用商店-Helm
Local visualization tool connects to redis of Alibaba cloud CentOS server
Mybaitis generator details









