diff --git a/.gitignore b/.gitignore index 5c6a7d0..63ad64a 100644 --- a/.gitignore +++ b/.gitignore @@ -33,4 +33,5 @@ build/ .vscode/ ### OS ### -/src/main/resources/application.yml \ No newline at end of file +/src/main/resources/application.yml +*.pdf \ No newline at end of file diff --git a/DevelopDocument.md b/doc/FunctionDocument.md similarity index 99% rename from DevelopDocument.md rename to doc/FunctionDocument.md index 105cfbc..b46f09d 100644 --- a/DevelopDocument.md +++ b/doc/FunctionDocument.md @@ -1,4 +1,4 @@ -# SocialResourceDocking 开发者 +# SocialResourceDocking 功能说明文档
Author 筱锋xiao_lfeng | Version: V1.0.0
diff --git a/doc/GlobalDevelopDocument.md b/doc/GlobalDevelopDocument.md new file mode 100644 index 0000000..a1619e4 --- /dev/null +++ b/doc/GlobalDevelopDocument.md @@ -0,0 +1,75 @@ +# SocialResourceDocking 全局开发者文档 + +
Author 筱锋xiao_lfeng | Version: V1.0.0
+ +## 说在前面 + +> 这部分为大部分接口文档通用部分的内容说明,具体每个接口的开发文档请参考 +> +>
———— 筱锋xiao_lfeng
+ + + +## 切面说明 + +> 切面为了更好进行快速开发,并且拒绝重复开发而生。开发时候请务必按照规定和标准化命名方案进行开发。下面会说切面在本开发中具体作用是什么 + +根据不同接口的权限要求不一样,故并非全部页面所需要的切面都一样。对于切面,**每一个切面仅会实现其中一种功能**。而并不是实现**全部功能**。故根据接口需要进行切面开发并且进行切面内容导入! + +### 权限控制切面 + + + +### 时间戳控制切面 + +时间戳控制切面是对输入数据进行时间检验,检查输入的数据是否符合时间范围,保证数据的有效性。 + +另外,第二个时间戳控制切面为对数据表单进行校验。原理如下 + +在页面生成时候前端生成 \
表单 + + + +## 登陆说明 + +对于 `srd_user` 和 `srd_user_ram` 数据表中 `permission` 字段部分json格式如下 + +```json +{ + "group": "String", + "permission": [] +} +``` + +另外,请注意,对于 `srd_user` 数据表中主键 `id` 字段值为 `1` 的用户为 `global` 权限。为整个系统中最高级权限。任何页面都可以访问以及随意切换内容页面 + +其余部分请参考**《功能说明文档》**以及**《SocialResourceDocking 开发者文档》** + +### group 字段说明 + +在 `group` 字段中,具体具有值如下: + +​ - user + +​ - student + +​ - teacher + +​ - admin + +​ - organization + +仅值为 `"organization"` 代表为组织账号,其余字段均为普通账号 + +> 在社会学和管理学领域,组织通常指的是一个有目的、有结构的社会实体,它由一群人共同协作以达到共同的目标。这个实体可以是企业、政府机构、非营利组织、团体等。组织的特征包括人员、结构、文化、目标和资源等。管理学关注如何有效地组织和管理这些实体,以实现其既定的目标。 +> +>
———— 什么是组织
+ +在组织账号中,通过区分统一社会信用码来区分不同组织账号主体类型。具体区分内容参考数据库设计模式 + +### permission 字段说明 + +`permission` 字段表示内容为解决 group 权限组分组带来部分场景下权限组分配不够用,故单独为此用户赋予的额外权限 + +其值样式为 `admin.user.create` 或 `admin.user.*` 。采用点进行权限组类别区分,`*` 为赋予子权限段全部权限 + diff --git a/doc/SocialResourceDocking 开发者文档.md b/doc/SocialResourceDocking 开发者文档.md new file mode 100644 index 0000000..3f26daf --- /dev/null +++ b/doc/SocialResourceDocking 开发者文档.md @@ -0,0 +1,801 @@ +--- +title: SocialResourceDocking +language_tabs: + - shell: Shell + - http: HTTP + - javascript: JavaScript + - ruby: Ruby + - python: Python + - php: PHP + - java: Java + - go: Go +toc_footers: [] +includes: [] +search: true +code_clipboard: true +highlight_theme: darkula +headingLevel: 2 +generator: "@tarslib/widdershins v4.0.20" + +--- + +# SocialResourceDocking + +Base URLs: + +* 开发环境: http://127.0.0.1:8080 + +* 测试环境: http://test-cn.your-api-server.com + +* 正式环境: http://prod-cn.your-api-server.com + +# Authentication + +# UserController + +## GET userGetCurrent + +GET /user/current + +> 获取用户信息 + +### 请求参数 + +|名称|位置|类型|必选|说明| +|---|---|---|---|---| +|token|cookie|string| 是 |Token| +|Timestamp|header|string| 是 |毫秒时间戳| + +> 返回示例 + +> 200 Response + +```json +{ + "output": "string", + "code": 0, + "message": "string", + "data": { + "id": 0, + "username": "string", + "nickname": "string", + "email": "string", + "telCountryArea": 0, + "tel": "string", + "verify": true, + "password": "string", + "oldPassword": "string", + "ram": 0, + "createdAt": "string", + "updatedAt": "string", + "ban": true, + "permission": "string", + "contactQq": "string", + "contactWechat": "string", + "contactOrganization": "string" + } +} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +状态码 **200** + +|名称|类型|必选|约束|中文名|说明| +|---|---|---|---|---|---| +|» output|string|true|none|英文输出|进行检查| +|» code|integer|true|none|错误代码|业务类型错误代码| +|» message|string|true|none|中文解释|none| +|» data|[UserDO](#schemauserdo)|false|none|输出数据|none| +|»» id|integer|true|none|主键|none| +|»» username|string|true|none|用户名|none| +|»» nickname|string|false|none|昵称|none| +|»» email|string|true|none|邮箱|none| +|»» telCountryArea|integer|false|none|国区|none| +|»» tel|string|false|none|电话|none| +|»» verify|boolean|false|none|账号验证|none| +|»» password|string|false|none|密码|none| +|»» oldPassword|string|false|none|旧密码|none| +|»» ram|integer|true|none|子用户|不为空则为子用户| +|»» createdAt|string|true|none|创建时间|none| +|»» updatedAt|string|true|none|修改时间|none| +|»» ban|boolean|true|none|是否被封禁|none| +|»» permission|string|true|none|所属权限|none| +|»» contactQq|string|true|none|联系方式|QQ| +|»» contactWechat|string|true|none|联系方式|Wechat| +|»» contactOrganization|string|true|none|联系方式|组织、企业、学校| + +## PATCH userAddPermission + +PATCH /user/permission/add + +> 添加用户权限 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## DELETE userDelPermission + +DELETE /user/permission/remoeve + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +# TokenController + +## GET tokenGetCurrent + +GET /token/current + +> 获取令牌对应信息 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +# AuthController + +## GET userSignIn + +GET /user/sign/in + +> 用户登陆 + +> Body 请求参数 + +```json +{ + "user": "labore tempor", + "password": "eiusmod" +} +``` + +### 请求参数 + +|名称|位置|类型|必选|中文名|说明| +|---|---|---|---|---|---| +|Timestamp|header|string| 是 ||毫秒时间戳| +|body|body|[AuthLoginEntity](#schemaauthloginentity)| 否 | 登陆模型|none| + +> 返回示例 + +> 200 Response + +```json +{ + "output": "string", + "code": 0, + "message": "string", + "data": { + "id": 0, + "username": "string", + "nickname": "string", + "email": "string", + "telCountryArea": 0, + "tel": "string", + "verify": true, + "password": "string", + "oldPassword": "string", + "ram": 0, + "createdAt": "string", + "updatedAt": "string", + "ban": true, + "permission": "string", + "contactQq": "string", + "contactWechat": "string", + "contactOrganization": "string" + } +} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +状态码 **200** + +|名称|类型|必选|约束|中文名|说明| +|---|---|---|---|---|---| +|» output|string|true|none|英文输出|进行检查| +|» code|integer|true|none|错误代码|业务类型错误代码| +|» message|string|true|none|中文解释|none| +|» data|[UserDO](#schemauserdo)|false|none|输出数据|none| +|»» id|integer|true|none|主键|none| +|»» username|string|true|none|用户名|none| +|»» nickname|string|false|none|昵称|none| +|»» email|string|true|none|邮箱|none| +|»» telCountryArea|integer|false|none|国区|none| +|»» tel|string|false|none|电话|none| +|»» verify|boolean|false|none|账号验证|none| +|»» password|string|false|none|密码|none| +|»» oldPassword|string|false|none|旧密码|none| +|»» ram|integer|true|none|子用户|不为空则为子用户| +|»» createdAt|string|true|none|创建时间|none| +|»» updatedAt|string|true|none|修改时间|none| +|»» ban|boolean|true|none|是否被封禁|none| +|»» permission|string|true|none|所属权限|none| +|»» contactQq|string|true|none|联系方式|QQ| +|»» contactWechat|string|true|none|联系方式|Wechat| +|»» contactOrganization|string|true|none|联系方式|组织、企业、学校| + +## POST userSignUp + +POST /user/sign/up + +> 用户注册 + +> Body 请求参数 + +```json +{ + "username": "string", + "email": "string", + "tel_country": 0, + "telephone": "string", + "password": "string" +} +``` + +### 请求参数 + +|名称|位置|类型|必选|中文名|说明| +|---|---|---|---|---|---| +|Timestamp|header|string| 是 ||毫秒时间戳| +|body|body|[AuthRegisterEntity](#schemaauthregisterentity)| 否 | 注册模型|none| + +> 返回示例 + +> 200 Response + +```json +{ + "output": "string", + "code": 0, + "message": "string", + "data": "string" +} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|[ResponseData](#schemaresponsedata)| + +## PATCH userRamSignPassword + +PATCH /user/ram/sign/password + +> RAM子用户密码重置 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## PATCH userSignPasswordChange + +PATCH /user/sign/password/change + +> 用户修改密码 + +> Body 请求参数 + +```json +{ + "password": "string" +} +``` + +### 请求参数 + +|名称|位置|类型|必选|中文名|说明| +|---|---|---|---|---|---| +|token|cookie|string| 是 ||Token| +|timestamp|header|string| 是 ||毫秒时间戳| +|body|body|[AuthChangePasswordEntity](#schemaauthchangepasswordentity)| 否 | 改密模型|none| + +> 返回示例 + +> 200 Response + +```json +{ + "output": "string", + "code": 0, + "message": "string", + "data": { + "id": 0, + "username": "string", + "nickname": "string", + "email": "string", + "telCountryArea": 0, + "tel": "string", + "verify": true, + "password": "string", + "oldPassword": "string", + "ram": 0, + "createdAt": "string", + "updatedAt": "string", + "ban": true, + "permission": "string", + "contactQq": "string", + "contactWechat": "string", + "contactOrganization": "string" + } +} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +状态码 **200** + +|名称|类型|必选|约束|中文名|说明| +|---|---|---|---|---|---| +|» output|string|true|none|英文输出|进行检查| +|» code|integer|true|none|错误代码|业务类型错误代码| +|» message|string|true|none|中文解释|none| +|» data|[UserDO](#schemauserdo)|false|none|输出数据|none| +|»» id|integer|true|none|主键|none| +|»» username|string|true|none|用户名|none| +|»» nickname|string|false|none|昵称|none| +|»» email|string|true|none|邮箱|none| +|»» telCountryArea|integer|false|none|国区|none| +|»» tel|string|false|none|电话|none| +|»» verify|boolean|false|none|账号验证|none| +|»» password|string|false|none|密码|none| +|»» oldPassword|string|false|none|旧密码|none| +|»» ram|integer|true|none|子用户|不为空则为子用户| +|»» createdAt|string|true|none|创建时间|none| +|»» updatedAt|string|true|none|修改时间|none| +|»» ban|boolean|true|none|是否被封禁|none| +|»» permission|string|true|none|所属权限|none| +|»» contactQq|string|true|none|联系方式|QQ| +|»» contactWechat|string|true|none|联系方式|Wechat| +|»» contactOrganization|string|true|none|联系方式|组织、企业、学校| + +## PATCH userSignPasswordForget + +PATCH /user/sign/password/forget + +> 忘记密码 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## GET userSignVerification + +GET /user/sign/verification + +> 账户校验 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## GET userRamSignIn + +GET /user/ram/sign/in + +> RAM用户登陆 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## POST userRamSignUp + +POST /user/ram/sign/up + +> 注册单个RAM用户 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## DELETE userDelete + +DELETE /user/delete + +> 注销用户 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## DELETE userRamDelete + +DELETE /user/ram/delete + +> RAM子用户注销 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## POST userAdminSignIn + +POST /user/admin/sign/up + +> 管理员注册用户 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## POST userAdminRamSignUp + +POST /user/admin/ram/sign/up + +> 管理员注册RAM用户 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +# OrganizationController + +## POST organizationRegister + +POST /organization/register + +> 组织账号注册 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +## GET organizationGetCurrent + +GET /organization/current + +> 获取组织账户信息 + +> 返回示例 + +> 200 Response + +```json +{} +``` + +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +# 数据模型 + +

AuthChangePasswordEntity

+ + + + + + +```json +{ + "password": "string" +} + +``` + +改密模型 + +### 属性 + +|名称|类型|必选|约束|中文名|说明| +|---|---|---|---|---|---| +|password|string|true|none||none| + +

AuthLoginEntity

+ + + + + + +```json +{ + "user": "string", + "password": "string" +} + +``` + +登陆模型 + +### 属性 + +|名称|类型|必选|约束|中文名|说明| +|---|---|---|---|---|---| +|user|string|true|none|用户|允许使用用户名、邮箱、手机号登陆| +|password|string|true|none|密码|none| + +

UserDO

+ + + + + + +```json +{ + "id": 0, + "username": "string", + "nickname": "string", + "email": "string", + "telCountryArea": 0, + "tel": "string", + "verify": true, + "password": "string", + "oldPassword": "string", + "ram": 0, + "createdAt": "string", + "updatedAt": "string", + "ban": true, + "permission": "string", + "contactQq": "string", + "contactWechat": "string", + "contactOrganization": "string" +} + +``` + +### 属性 + +|名称|类型|必选|约束|中文名|说明| +|---|---|---|---|---|---| +|id|integer|true|none|主键|none| +|username|string|true|none|用户名|none| +|nickname|string|false|none|昵称|none| +|email|string|true|none|邮箱|none| +|telCountryArea|integer|false|none|国区|none| +|tel|string|false|none|电话|none| +|verify|boolean|false|none|账号验证|none| +|password|string|false|none|密码|none| +|oldPassword|string|false|none|旧密码|none| +|ram|integer|true|none|子用户|不为空则为子用户| +|createdAt|string|true|none|创建时间|none| +|updatedAt|string|true|none|修改时间|none| +|ban|boolean|true|none|是否被封禁|none| +|permission|string|true|none|所属权限|none| +|contactQq|string|true|none|联系方式|QQ| +|contactWechat|string|true|none|联系方式|Wechat| +|contactOrganization|string|true|none|联系方式|组织、企业、学校| + +

ResponseData

+ + + + + + +```json +{ + "output": "string", + "code": 0, + "message": "string", + "data": "string" +} + +``` + +通用返回 + +### 属性 + +|名称|类型|必选|约束|中文名|说明| +|---|---|---|---|---|---| +|output|string|true|none|英文输出|进行检查| +|code|integer|true|none|错误代码|业务类型错误代码| +|message|string|true|none|中文解释|none| +|data|string|false|none||none| + +

AuthRegisterEntity

+ + + + + + +```json +{ + "username": "string", + "email": "string", + "tel_country": 0, + "telephone": "string", + "password": "string" +} + +``` + +注册模型 + +### 属性 + +|名称|类型|必选|约束|中文名|说明| +|---|---|---|---|---|---| +|username|string|true|none|用户名|支持正则表达式 ^[0-9A-Za-z-_]{3,40}$| +|email|string|true|none|邮箱|none| +|tel_country|integer|true|none|国区范围|none| +|telephone|string|true|none|手机号|none| +|password|string|true|none|密码|none| + diff --git a/SocialResourceDocking-功能描述.md b/doc/SocialResourceDocking-功能描述.md similarity index 100% rename from SocialResourceDocking-功能描述.md rename to doc/SocialResourceDocking-功能描述.md