/go-bbs

🏠一个基本功能完整的CLD分层项目 ,由Go语言开发。项目主要功能有:基于MD5加密与加盐密码存储方式 ,登录验证。 实现登录状态检查 ,为游客与已登录用戶展⽰不同界面与功能。支持上传头像 ,实现发布帖子 ,添加好友 ,私信 ,帖子 点赞等功能。利用Docker配置MySQL主从数据库、后端服务、Nginx实现动静分离 ,负载均衡与高可用 Redis集群等服 务。

Primary LanguageGo

指南

请按如下顺序启动项目

  1. 请根据你的实际情况修改 conf/config.yaml 文件中 MySQL 和 Redis 部分的配置!!!
  2. 连接上你的MySQL数据库,按顺序依次执行项目中SQL文件夹中的sql文件,完成建库、建表和导入初始数据
    1. init.sql
    2. go_bbs_user.sql
    3. go_bbs_community.sql
    4. go_bbs_post.sql
    5. go_bbs_sms_messages.sql
    6. go_bbs_private_messages.sql
    7. go_bbs_groups.sql
    8. go_bbs_group_messages.sql
    9. go_bbs__group_members.sql
    10. go_bbs_friend_relationship.sql
    11. go_bbs__comment.sql
  3. 执行 go build -o ./bin/go_bbs,编译可执行文件至项目的bin目录
  4. 执行 ./bin/go_bbs conf/config.yaml,启动程序
  5. 打开你的浏览器输入 http://127.0.0.1:8084,默认端口是 8084,你可以在配置文件中修改

注意事项

  1. 确保你的MySQL配置是正确的
  2. 确保你的Redis配置是正确的
  3. 确保你的RabbitMQ配置是正确的
  4. 可点击右上角自行注册测试账号

常见错误

如果本地编译遇到以下报错,请在终端执行 go get -u golang.org/x/sys 命令。

# golang.org/x/sys/unix
../../../../learngo/pkg/mod/golang.org/x/sys@v0.0.0-20200905004654-be1d3432aa8f/unix/syscall_darwin.1_13.go:29:3: //go:linkname must refer to declared function or variable
../../../../learngo/pkg/mod/golang.org/x/sys@v0.0.0-20200905004654-be1d3432aa8f/unix/zsyscall_darwin_amd64.1_13.go:27:3: //go:linkname must refer to declared function or variable
../../../../learngo/pkg/mod/golang.org/x/sys@v0.0.0-20200905004654-be1d3432aa8f/unix/zsyscall_darwin_amd64.1_13.go:40:3: //go:linkname must refer to declared function or variable
../../../../learngo/pkg/mod/golang.org/x/sys@v0.0.0-20200905004654-be1d3432aa8f/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable
../../../../learngo/pkg/mod/golang.org/x/sys@v0.0.0-20200905004654-be1d3432aa8f/unix/zsyscall_darwin_amd64.go:43:3: //go:linkname must refer to declared function or variable
../../../../learngo/pkg/mod/golang.org/x/sys@v0.0.0-20200905004654-be1d3432aa8f/unix/zsyscall_darwin_amd64.go:59:3: //go:linkname must refer to declared function or variable
../../../../learngo/pkg/mod/golang.org/x/sys@v0.0.0-20200905004654-be1d3432aa8f/unix/zsyscall_darwin_amd64.go:75:3: //go:linkname must refer to declared function or variable
../../../../learngo/pkg/mod/golang.org/x/sys@v0.0.0-20200905004654-be1d3432aa8f/unix/zsyscall_darwin_amd64.go:90:3: //go:linkname must refer to declared function or variable
../../../../learngo/pkg/mod/golang.org/x/sys@v0.0.0-20200905004654-be1d3432aa8f/unix/zsyscall_darwin_amd64.go:105:3: //go:linkname must refer to declared function or variable
../../../../learngo/pkg/mod/golang.org/x/sys@v0.0.0-20200905004654-be1d3432aa8f/unix/zsyscall_darwin_amd64.go:121:3: //go:linkname must refer to declared function or variable
../../../../learngo/pkg/mod/golang.org/x/sys@v0.0.0-20200905004654-be1d3432aa8f/unix/zsyscall_darwin_amd64.go:121:3: too many errors