当前位置:网站首页>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 publicRecommended short videos on the home page , After drop-down refresh , There is more private to public video
边栏推荐
- Quanzhi A13 tossing memo
- 二叉树的三种遍历方式
- ssh服务器配置文件sshd_config 及操作
- ViewPager2使用记录
- The browser enters the URL address, and what happens to the page rendering
- 今日睡眠质量记录78分
- Uni app sends request instructions using the escook / request miniprogram plug-in
- L June training (day 27) - figure
- 执行 npm 指令失败,提示ssh: ... Permission denied
- It is so simple to remove the payment restrictions on VIP, YuQue and Zhihu in Baidu Library
猜你喜欢
MySQL high level statements (I)
【动态规划】—— 背包问题
ThreadLocal 源码全详解(ThreadLocalMap)
阿胖的操作记录
【粉丝福利】今天给大家介绍一个白捡钱的方法-可转债,本人亲自验证,每年每人能获利1500元
OpenFeign服务接口调用
Sword finger offer 04 Find in 2D array
The world's fastest download tool XDM
大小端字节序
Uni app develops wechat applet to dynamically render pages and dynamically change the order of page component modules
随机推荐
Principle of printf indefinite length parameter
SSH workflow and principle
Configuration of thymeleaf
【医学分割】unet3+
[medical segmentation] unet3+
让学指针变得更简单(二)
Unzip log. GZ file
深信服X计划-系统基础总结
Database Series: MySQL index optimization and performance improvement summary (comprehensive version)
How to open an account for CSI 500 stock index futures, what are the regular domestic stock index futures platforms, and where is the safest place to open an account?
yml的配置
隐私计算FATE-离线预测
PyCharm汉化
What is the next step in the recommendation system? Alispacetime aggregates GNN, and the effect is to sling lightgcn!
全志A13折腾备忘
build.gradle 配置
Local visualization tool connects to redis of Alibaba cloud CentOS server
动态规划
消息队列的使用
[fans' welfare] today, I'd like to introduce a method to collect money for nothing - convertible bonds. I personally verified that each person can earn 1500 yuan a year