# rrBmBackEnd **Repository Path**: wncf/rr-bm-back-end ## Basic Information - **Project Name**: rrBmBackEnd - **Description**: 人人书签项目后端 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-11-18 - **Last Updated**: 2021-11-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 人人书签项目 #### 安装教程 1. 请先使用 npm i 安装补齐mode_modules内依赖文件再进行协作 #### 项目架构 项目架构说明 > 基于nodejs的后端接口项目 插件/模块 - express - joi - jsonwebtoken(jwt) - cors - md5 - multer - mysql #### 项目目录/文件介绍 1. router --路由目录 1. user.js --用户路由 2. app.js --nodejs主文件 3. schema --验证规则文件夹 - user.js --用户验证规则 4. sql --项目数据库文件 5. app.js --项目主文件 6. md5.js --md5加密模块 7. jwt.js --token验证模块 8. pool.js --链接池模块 #### 接口文档 1. 用户相关接口 `/user` 1. **用户登录** - **接口状态:** `开发中` - **接口URL:** `http://localhost:4981/user/ureg` - **请求方式:** `POST` - **Content-Type:** `application/x-www-form-urlencoded` #### body参数及说明 | 参数名 | 示例值 | 参数类型 | 是否必填 | 参数描述 | | :------- | :-------- | :------- | :------- | :---------------------------------------- | | uname | wncf1314 | string | 是 | `用户名4-10位,字符串格式` | | upwd | 123456789 | string | 是 | `密码6-12位,字符串格式` | | remember | true | string | 是 | `是否记住密码,字符串格式的true或者false` | 响应案例 ````json { "status": 200, "msg": "登陆成功", "remember": "false", "token": "xxxxxxxxxxxxxxx" } ```` 2. **用户验证** - **接口状态:** `开发中` - **接口URL:** `http://localhost:4981/user/news` - **请求方式:** `POST` - **Content-Type:** `application/x-www-form-urlencoded` 响应案例 ````json { "ok": 1, "uname": "miku", "avatar": "default_avatar.png" } ```` 3. **用户添加书签** - **接口状态:** `开发中` - **接口URL:** `http://localhost:4981/user/addbm` - **请求方式:** `POST` - **Content-Type:** `application/x-www-form-urlencoded` #### body参数及说明 | 参数名 | 示例值 | 参数类型 | 是否必填 | 参数描述 | | :----- | :--------------- | :------- | :------- | :------- | | bmname | baidu | string | 是 | `-` | | bmurl | http://google.hk | string | 是 | `-` | | fname | 学习 | string | 是 | `-` | 成功响应案例 ````json { "status": 200, "msg": "添加成功" } ```` 4. **获取分类** - **接口状态:** `开发中` - **接口URL:** `http://localhost:4981/user/ubmfamily` - **请求方式:** `POST` - **Content-Type:** `application/x-www-form-urlencoded` **响应成功案例** ````json { "ok": 1, "msg": "获取书签分类成功", "result": [ "学习" ] } ```` 5. **获取分类名对应的书签列表** - **接口状态:** `开发中` - **接口URL:** `http://localhost:4981/user/getubm` - **请求方式:** `POST` - **Content-Type:** `application/x-www-form-urlencoded` **请求参数** | 参数名 | 示例值 | 参数类型 | 是否必填 | 参数描述 | | :----- | :----- | :------- | :------- | :------- | | fname | 学习 | string | 是 | `-` | **响应成功案例** ````json { "ok": 1, "result": [ {"bmName": "谷歌", "bmurl": "http://google.hk" } ] } ```` 6. **获取无分类书签** - **接口状态:** `开发中` - **接口URL:** `http://localhost:4981/user/ubmlist` - **请求方式:** `POST` - **Content-Type:** `multipart/form-data` **成功响应案例** ````json { "ok": 1, "msg": "获取成功", "result": [ { "bmName": "baidu", "bmurl": "http://google.hk" } ] } ````