1 Star 7 Fork 0

beatrice / job-app-server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

千锋招聘APP接口文档

1 运行环境说明

// 需要安装的环境
node 
mongodb

2 安装和运行

// 启动数据库
mongod --dbpath d:/data
// 安装项目依赖包
npm install 
// 启动项目
npm start

3 用户注册接口

接口文档

  • 该接口可以注册新用户

接口信息

请求参数

名称 类型 必填 示例值/默认值 说明
user string zhangsan 用户名
pwd string 123456 密码
type string boss/elite 公司/精英

返回示例

// 成功的数据返回
{
    "code": 0,
    "data": {
        "user": "李磊",
        "type": "elite",
        "_id": "6153ca57cf083d2bd8c57c2a"
    }
}
// 失败的数据返回
{
    "code": 1,
    "msg": "用户名重复"
}

4 用户登录接口

接口文档

  • 该接口可以验证用户登录信息

接口信息

请求参数

名称 类型 必填 示例值/默认值 说明
user string zhangsan 用户名
pwd string 123456 密码

返回示例

// 成功的数据返回
{
    "code": 0,
    "data": {
        "_id": "6153ca57cf083d2bd8c57c2a",
        "user": "李磊",
        "type": "elite"
    }
}
// 失败的数据返回
{
    "code": 1,
    "msg": "用户名或密码错误"
}

5 获取用户列表接口

接口文档

  • 该接口可以获取指定类型的所有用户信息

接口信息

请求参数

名称 类型 必填 示例值/默认值 说明
type string boss/elite 公司/精英

返回示例

// 成功的数据返回
{
    "code": 0,
    "data": [
        {
            "_id": "6153c3850e85cb6ad080a323",
            "user": "admin",
            "pwd": "70143fdb832fed0454b677c5cf887c1d",
            "type": "boss",
            "__v": 0
        },
        // ...
    ]
}
// 失败的数据返回
{
    "code": 0,
    "data": []
}

6 鉴权接口

接口文档

  • 该接口可以通过cookie验证用户的合法性

接口信息

返回示例

// 成功的数据返回
{
    "code": 0,
    "data": {
        "_id": "6153ca57cf083d2bd8c57c2a",
        "user": "李磊",
        "type": "elite"
    }
}
// 失败的数据返回
{"code":1}

7 更新用户信息接口

接口文档

  • 可以更新用户个人信息

接口信息

请求参数

  • 请求头里面携带cookie,格式为: {userid:'xxx'}
名称 类型 必填 示例值/默认值 说明
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}

8 发送消息接口

接口文档

  • 该接口可以通过socket发送消息给指定用户

接口信息

  • 接口地址:ws://localhost:7070
  • 支持协议:socket
  • 接口示例:socket.emit('sendmsg',data)

data对象成员

名称 类型 必填 说明
from string 发送方的_id
to string 接收方的_id
msg string 发送的消息

9 接受消息接口

接口文档

  • 该接口可以通过socket把最新消息推送给用户

接口信息

  • 接口地址:ws://localhost:7070
  • 支持协议:socket
  • 接口示例:socket.on('recvmsg',callback)
  • 参数:callback接收新消息对象的函数,使用一个参数-callback函数中接收的新消息对象

data对象成员

名称 类型 说明
from string 发送方的_id
to string 接收方的_id
content string 接收的消息
chatid string [from,to].sort().join('_')
read boolean 是否已读
create_time number 时间戳

10 消息列表接口

接口文档

  • 该接口可以接收和登录用户有关的所有消息

接口信息

返回示例

{
    "code":0,
    "users":{
        "1s5fs5fds5f3f1s7d":{
            "name":"zhangsan",
            "avatar":"cat"
        }
    },
    "msgs":[
        {
            from:"",
            to:"",
            chatid:"",
            content:"",
            read:false,
            create_time:1424324324
        },
        // ...
    ]
}

11 已读消息接口

接口文档

  • 该接口可以接收和以前的所有消息

接口信息

请求参数

名称 类型 必填 示例值 说明
from string 1s5fs5fds5f3f1s7d 发送方_id

返回示例

// 成功
{code:0}
// 失败
{code:1,msg:'修改失败'}

12 获取所有头像接口

接口文档

  • 该接口可以返回所有可选头像数据

接口信息

返回示例

[
    {
        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'
    }
]
MIT License Copyright (c) 2022 beatrice Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

Vue招聘项目后端接口服务器 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/xingbiao7676/qf-chat-server.git
git@gitee.com:xingbiao7676/qf-chat-server.git
xingbiao7676
qf-chat-server
job-app-server
master

搜索帮助