后台api地址更改
湖南工商大学优秀作品展示系统
Ruby版本
2.3.7
数据库创建
RAILS_ENV=production rake db:create
数据库初始化
RAILS_ENV=production rake db:migrate RAILS_ENV=production rake db:seed
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake db:seed
代码分支
master
线上地址 线上访问地址:http://testgs.educoder.net/works_preview 线上管理员地址:http://testgs.educoder.net/admin/sub-page
线上访问地址:http://testgs.educoder.net/works_preview
线上管理员地址:http://testgs.educoder.net/admin/sub-page
如何上线
前端代码在public下的dist 和 dist2,前端打好包后,替换文件即可 在跳板机上执行脚本: ssh_ymsz 代码在/home/pdl/webhaoran下,在该目录下git pull后 重启nigix /home/pdl/nginx/sbin/nginx -s reload
前端代码在public下的dist 和 dist2,前端打好包后,替换文件即可
在跳板机上执行脚本: ssh_ymsz
代码在/home/pdl/webhaoran下,在该目录下git pull后 重启nigix
/home/pdl/nginx/sbin/nginx -s reload
localhost:3000/users/login
{ "code": 0, "msg": "登录成功", "user": { "id": 1, "name": "admin", "login": "admin" } }
localhost:3000/users/logout
localhost:3000/works
{ "code": 0, "works": [ { "id": 1, "name": "测试作品", "major": "computer_science", "enroll_year": 2020, "client_type": "mobile", "category": "social", "student_names": [ "张三", "李四", "王五", "找刘", "陈七" ] }, { "id": 2, "name": "测试接口", "major": "computer_science", "enroll_year": 2020, "client_type": "mobile", "category": "social", "student_names": [], "attachment_url": "/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.pptx" } ], "top_count": 0, "total_count": 2, "page": 1, "per_page": 4 }
{ "code": 0, "works": [ { "id": 1, "name": "测试作品", "major": "computer_science", "enroll_year": 2020, "client_type": "mobile", "category": "social", "student_names": [ "张三", "李四", "王五", "找刘", "陈七" ] }, { "id": 2, "name": "测试接口", "major": "computer_science", "enroll_year": 2020, "client_type": "mobile", "category": "social", "student_names": [], "attachment_attcover_url": "封面url", "attachment_attcover_name": "封面图片大小", "attachment_file_name": "文件名", "attachment_url": "/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.pptx" } ], "total_count": 2, "page": 1, "per_page": 4 }
localhost:3000/works/:work_id
{ "code": 0, "works": [ { "id": 1, "name": "测试作品", "major": "computer_science", "enroll_year": 2020, "client_type": "mobile", "category": "social", "student_names": [ "张三", "李四", "王五", "找刘", "陈七" ] }, { "id": 2, "name": "测试接口", "major": "computer_science", "enroll_year": 2020, "client_type": "mobile", "category": "social", "student_names": [], "attachment_url": "/rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.pptx" } ], "total_count": 2, "page": 1, "per_page": 4 }
localhost:3000/works/:work_id/lift_to_top
localhost:3000/works/:work_id/cancel_top
localhost:3000/works/:work_id/put_on
localhost:3000/works/:work_id/put_off
http://47.111.130.18:49999/works/2/preview
湖南工商大学作品展示
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
README
湖南工商大学优秀作品展示系统
Ruby版本
2.3.7
数据库创建
RAILS_ENV=production rake db:create
数据库初始化
RAILS_ENV=production rake db:migrate
RAILS_ENV=production rake db:seed
代码分支
master
线上地址
线上访问地址:http://testgs.educoder.net/works_preview
线上管理员地址:http://testgs.educoder.net/admin/sub-page
如何上线
前端代码在public下的dist 和 dist2,前端打好包后,替换文件即可
在跳板机上执行脚本: ssh_ymsz
代码在/home/pdl/webhaoran下,在该目录下git pull后 重启nigix
/home/pdl/nginx/sbin/nginx -s reload
接口文档
用户登录接口
请求URL
localhost:3000/users/login
请求方式
参数
返回示例
用户登出接口
请求URL
localhost:3000/users/logout
请求方式
作品列表接口
请求URL
localhost:3000/works
请求方式
参数
返回示例
创建作品
请求URL
localhost:3000/works
请求方式
参数
返回示例
删除作品
请求URL
localhost:3000/works/:work_id
请求方式
更新作品
请求URL
localhost:3000/works/:work_id
请求方式
参数
返回示例
置顶
请求URL
localhost:3000/works/:work_id/lift_to_top
请求方式
取消置顶
请求URL
localhost:3000/works/:work_id/cancel_top
请求方式
上架
请求URL
localhost:3000/works/:work_id/put_on
请求方式
下架
请求URL
localhost:3000/works/:work_id/put_off
请求方式
作品ppt预览
请求URL
http://47.111.130.18:49999/works/2/preview
请求方式