当前位置:网站首页>抖音实战~公开/私密短视频互转
抖音实战~公开/私密短视频互转
2022-06-27 12:38:00 【gblfy】


文章目录
一、需求分析
1. 公开转私密~流程图

2. 公开转私密~流程简述
- 从首页推荐~短视频列表观看某一个短视频
- 点击短视频右侧分享
- 选择转为私密
- 4.首页推荐~短视频列表中暂无转为私密的视频
- 5.视频到了个人中心~私密视频列表中
3. 私密转公开~流程图

4. 私密转公开~流程简述
- 从个人中心~私密视频列表中,点击某一个短视频进入短视频详情
- 点击短视频右侧分享
- 选择转为公开
- 4.首页推荐~短视频列表中刷新,就可以看到刚转为公开的短视频
二、代码实战
- 前端
2.1. 公开转私密
// 用户把公开视频改为私密的视频
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: "设置完毕~"
})
}
}
});
}
2.2. 私密转公开
// 用户把私密视频改为公开的视频
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: "设置完毕~"
})
}
}
});
}
- 后端
2.3. 公开转私密
/**
* 用户把视频改为公开/私密的视频
*
* @param userId 用户主键ID
* @param vlogId 视频主键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. 短视频详情
列表视频点击某一个跳转短视频详情,和首页短视频列表以及搜索短视频列表点击某一个进行短视频详情原理一样,用的是一个接口
2.5. 私密转公开
/**
* 用户把视频改为公开/私密的视频
*
* @param userId 用户主键ID
* @param vlogId 视频主键ID
* @return
*/
@PostMapping("changeToPrivate")
public GraceJSONResult changeToPrivate(@RequestParam String userId,
@RequestParam String vlogId) {
vlogService.changeToPrivateOrPublic(userId,
vlogId,
YesOrNo.YES.type);
return GraceJSONResult.ok();
}
三、作品鉴赏
3.1. 公开短视频转私密
首页推荐短视频

分享转私密

3.2. 私密短视频转公开
个人中心私密短视频列表

短视频详情

私密转公开
首页推荐短视频列表中,下拉刷新后,有多了这个私密转公开的视频

边栏推荐
- 行业洞察 | 新零售业态下,品牌电商应如何重塑增长?
- Vs debugging skills
- Uniapp drop-down layer selection box effect demo (sorting)
- esp32s3 IPERF例程测试 esp32s3吞吐量测试
- Configuration of YML
- AI for Science: scientific research paradigm, open source platform and industrial form
- 硬件开发笔记(七): 硬件开发基本流程,制作一个USB转RS232的模块(六):创建0603封装并关联原理图元器件
- 诗歌一首看看
- Stack calculation (whether the order of entering and leaving the stack is legal) - Code
- uniapp下拉弹层选择框效果demo(整理)
猜你喜欢
随机推荐
与生活握手言和
JSON.stringify用法
不一样的习惯
hibernate操作oracle数据库 主键自增
AI for Science: scientific research paradigm, open source platform and industrial form
picocli-入门
Threejs' ambient light + point light + parallel light + spherical light and Hepler understanding + shadow ()
uni-app开发微信小程序动态渲染页面,动态改变页面组件模块顺序
LeetCode_快速幂_递归_中等_50.Pow(x, n)
nifi从入门到实战(保姆级教程)——身份认证
socket阻塞和非阻塞模式
Steps for win10 to completely and permanently turn off automatic updates
ssh服务器配置文件sshd_config 及操作
Configuration management center of microservices
Thymeleaf的配置
How to download pictures with hyperlinks
Nmcli team bridge basic configuration
Uni app develops wechat applet to dynamically render pages and dynamically change the order of page component modules
Configuration of thymeleaf
Database Series: MySQL index optimization and performance improvement summary (comprehensive version)









