代码拉取完成,页面将自动刷新
// 需要安装的环境
node
mongodb
// 启动数据库
mongod --dbpath d:/data
// 安装项目依赖包
npm install
// 启动项目
npm start
接口文档
接口信息
请求参数
名称 | 类型 | 必填 | 示例值/默认值 | 说明 |
---|---|---|---|---|
user | string | 是 | zhangsan | 用户名 |
pwd | string | 是 | 123456 | 密码 |
type | string | 是 | boss/elite | 公司/精英 |
返回示例
// 成功的数据返回
{
"code": 0,
"data": {
"user": "李磊",
"type": "elite",
"_id": "6153ca57cf083d2bd8c57c2a"
}
}
// 失败的数据返回
{
"code": 1,
"msg": "用户名重复"
}
接口文档
接口信息
{userid:xxxx}
请求参数
名称 | 类型 | 必填 | 示例值/默认值 | 说明 |
---|---|---|---|---|
user | string | 是 | zhangsan | 用户名 |
pwd | string | 是 | 123456 | 密码 |
返回示例
// 成功的数据返回
{
"code": 0,
"data": {
"_id": "6153ca57cf083d2bd8c57c2a",
"user": "李磊",
"type": "elite"
}
}
// 失败的数据返回
{
"code": 1,
"msg": "用户名或密码错误"
}
接口文档
接口信息
请求参数
名称 | 类型 | 必填 | 示例值/默认值 | 说明 |
---|---|---|---|---|
type | string | 是 | boss/elite | 公司/精英 |
返回示例
// 成功的数据返回
{
"code": 0,
"data": [
{
"_id": "6153c3850e85cb6ad080a323",
"user": "admin",
"pwd": "70143fdb832fed0454b677c5cf887c1d",
"type": "boss",
"__v": 0
},
// ...
]
}
// 失败的数据返回
{
"code": 0,
"data": []
}
接口文档
接口信息
{userid:'xxx'}
返回示例
// 成功的数据返回
{
"code": 0,
"data": {
"_id": "6153ca57cf083d2bd8c57c2a",
"user": "李磊",
"type": "elite"
}
}
// 失败的数据返回
{"code":1}
接口文档
接口信息
请求参数
名称 | 类型 | 必填 | 示例值/默认值 | 说明 |
---|---|---|---|---|
avatar | string | 是 | '/img/xxx.png' | 头像url |
desc | string | 是 | 三年工作经验 | 个人简历或者职位介绍 |
title | string | 公司必填 | 前端工程师 | 职位名称 |
company | string | 公司必填 | 华为 | 公司名称 |
money | string | 公司必填 | 15K | 薪资范围 |
返回示例
// 成功的数据返回
{
"code": 0,
"data": {
"user": "李磊",
"type": "elite",
"avatar": "aloe.png",
"desc": "二年前端工作经验 有大项目开发经验 找前端工程师工作"
}
}
// 失败的数据返回
{"code":1}
接口文档
接口信息
socket.emit('sendmsg',data)
data对象成员
名称 | 类型 | 必填 | 说明 |
---|---|---|---|
from | string | 是 | 发送方的_id |
to | string | 是 | 接收方的_id |
msg | string | 是 | 发送的消息 |
接口文档
接口信息
socket.on('recvmsg',callback)
data对象成员
名称 | 类型 | 说明 |
---|---|---|
from | string | 发送方的_id |
to | string | 接收方的_id |
content | string | 接收的消息 |
chatid | string | [from,to].sort().join('_') |
read | boolean | 是否已读 |
create_time | number | 时间戳 |
接口文档
接口信息
{userid:'xxx'}
返回示例
{
"code":0,
"users":{
"1s5fs5fds5f3f1s7d":{
"name":"zhangsan",
"avatar":"cat"
}
},
"msgs":[
{
from:"",
to:"",
chatid:"",
content:"",
read:false,
create_time:1424324324
},
// ...
]
}
接口文档
接口信息
{userid:'xxx'}
请求参数
名称 | 类型 | 必填 | 示例值 | 说明 |
---|---|---|---|---|
from | string | 是 | 1s5fs5fds5f3f1s7d | 发送方_id |
返回示例
// 成功
{code:0}
// 失败
{code:1,msg:'修改失败'}
接口文档
接口信息
返回示例
[
{
url: 'http://localhost:7070/img/aloe.90415559.png',
text: 'aloe'
},
{
url: 'http://localhost:7070/img/boy.e1abc188.png',
text: 'boy'
},
{
url: 'http://localhost:7070/img/cat.2039b670.png',
text: 'cat'
},
{
url: 'http://localhost:7070/img/chicken.f6bb2440.png',
text: 'chicken'
},
{
url: 'http://localhost:7070/img/flower.aaad6d78.png',
text: 'flower'
},
{
url: 'http://localhost:7070/img/footprint.a0db7366.png',
text: 'footprint'
},
{
url: 'http://localhost:7070/img/fox.d1c91ba8.png',
text: 'fox'
},
{
url: 'http://localhost:7070/img/giraffe.0f6086c8.png',
text: 'giraffe'
},
{
url: 'http://localhost:7070/img/girl.fb8e9ea7.png',
text: 'girl'
},
{
url: 'http://localhost:7070/img/horse.f63b78eb.png',
text: 'horse'
},
{
url: 'http://localhost:7070/img/lion.3dca9c71.png',
text: 'lion'
},
{
url: 'http://localhost:7070/img/man.fe5c650f.png',
text: 'man'
},
{
url: 'http://localhost:7070/img/mimosa.7e0a4744.png',
text: 'mimosa'
},
{
url: 'http://localhost:7070/img/mouse.534501ae.png',
text: 'mouse'
},
{
url: 'http://localhost:7070/img/snake.5efad5eb.png',
text: 'snake'
},
{
url: 'http://localhost:7070/img/squirrel.46150ed7.png',
text: 'squirrel'
},
{
url: 'http://localhost:7070/img/tree.0f40f1a3.png',
text: 'tree'
},
{
url: 'http://localhost:7070/img/woman.e69076ed.png',
text: 'woman'
}
]
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。