Code Monkey home page Code Monkey logo

douyin-dm's Introduction

douyin team: beautifyDm

运行前安装一下依赖

go mod tidy

运行

rm dev >> /dev/null
go build -o dev && ./dev

课程资料大全

参考

接口分配

principal interface state
war3dgjddhh /douyin/feed doing
war3dgjddhh /douyin/user/regiser done
war3dgjddhh /douyin/user/login done
war3dgjddhh /douyin/user/ done
war3dgjddhh /douyin/publish/action/ doing
war3dgjddhh /douyin/publish/list/ doing
null /douyin/favorite/action/ wait charge
null /douyin/favorite/list/ wait charge
null /douyin/comment/action/ wait charge
null /douyin/comment/list/ wait charge
null /douyin/relation/action/ wait charge
null /douyin/relation/follow/list/ wait charge
null /douyin/friend/list wait charge
null /douyin/message/chat wait charge
null /douyin/message/list wait charge

详细说明请移动docs

功能说明

接口功能不完善

  • 视频上传后会保存到本地 video 目录中,访问时用 127.0.0.1:8080/static/video_name 即可

测试

test 目录下为不同场景的功能测试case,可用于验证功能实现正确性

其中 common.go 中的 serverAddr 为服务部署的地址,默认为本机地址,可以根据实际情况修改

测试数据写在 demo_data.go 中,用于列表接口的 mock 测试

快速启动

安装mysql [ x ]

创建一个database douyin

create database if not exists douyin

修改 repository/db_init.go 里面的init方法,配置一下相关信息, e.g user, password, port 改成你本机的

安装抖声app,下载地址 安装好之后快速点击我的两次就会出现配置页面填入本机局域网ip

douyin-dm 项目结构

注意的小点

每个go package 里面的go func name, name 大写字母开头表示,是可以在被引入的时候访问到的,小写字母开头表示只能package里面访问

找到局域网ip addr

win, cmd 输入 ipconfig /all 一般能找到

linux, terminal 输入 ip addr 一般能找到

├── common                             # 公共工具目录
│   └── jwt.go
├── controller                         # 类似spring那一套 controller 层
│   ├── comment.go
│   ├── common.go
│   ├── demo_data.go
│   ├── favorite.go
│   ├── feed.go
│   ├── message.go
│   ├── publish.go
│   ├── relation.go
│   └── user.go
├── dev                               # 打包的可执行文件
├── dev.sh                            # dev 脚本
├── docs                              # docs 目录
├── go.mod                            # go 依赖
├── go.sum
├── main.go                           # 入口
├── middleware                        # 中间件, 类似 spring那一套过滤器
│   └── AuthMiddleware.go             # auth, 并存放user信息到gin上下文
├── public                            
│   ├── bear.mp4
│   └── data
├── README.md
├── repository                        # 类似spring model + service层
│   ├── db_init.go
│   └── user.go
├── router.go                         # go 路由, 配置访问请求对应的处理方法
├── service                           # 其他服务, 可能搞 一个 socket来搞message
│   └── message.go
├── test                              # 测试, 
│   ├── base_api_test.go
│   ├── common.go
│   ├── interact_api_test.go
│   ├── message_server_test.go
│   └── social_api_test.go

douyin-dm's People

Contributors

ylyhappy-hello avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.