add apidoc

This commit is contained in:
bwcx_jzy 2022-02-28 19:18:57 +08:00
parent 44546c738a
commit 19f6b7575e
No known key found for this signature in database
GPG Key ID: 5E48E9372088B9E5
5 changed files with 42 additions and 7 deletions

View File

@ -1,3 +1,7 @@
https://apidocjs.com/index.html#demo
https://github.com/apidoc/apidoc/blob/master/example/_apidoc.js
``` ```
apidoc -c docs/apidoc.json -i modules/server/src/ -o docs/apidoc apidoc -c docs/apidoc.json -i modules/server/src/ -o docs/apidoc
``` ```

View File

@ -0,0 +1,36 @@
package io.jpom;
/**
* @author bwcx_jzy
* @since 2022/2/28
*/
public class ApiDoc {
/**
* @author bwcx_jzy
* @apiDefine loginUser
* @apiUse defResultJson
* @apiHeader {String} Authorization 用户token
* @apiPermission login-user
* @apiSuccess (800) {none} data 需要登录
* @apiSuccess (801) {none} data 登录信息过期,但是可以续期
* @apiSuccess (302) {none} data 当前用户没有操作权限
* @apiSuccess (999) {none} data 当前 IP 不能访问
*/
private void loginUser() {
}
/**
* @author bwcx_jzy
* @apiDefine defResultJson
* @apiSuccessExample {json} Success-Response:
* HTTP/1.1 200 OK
* {
* "code": "200",
* "msg": "成功",
* "data": {},
* }
*/
private void defResultJson() {
}
}

View File

@ -47,13 +47,6 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
* *
* @author jiangzeyin * @author jiangzeyin
* @date 2017/9/14 * @date 2017/9/14
* @apiDefine loginUser
* @apiHeader {String} Authorization 用户token
* @apiPermission login-user
* @apiSuccess (800) {none} data 需要登录
* @apiSuccess (801) {none} data 登录信息过期,但是可以续期
* @apiSuccess (302) {none} data 当前用户没有操作权限
* @apiSuccess (999) {none} data 当前 IP 不能访问
*/ */
@SpringBootApplication @SpringBootApplication
@ServletComponentScan @ServletComponentScan

View File

@ -157,6 +157,7 @@ public class IndexControl extends BaseServerController {
* check if need to init system * check if need to init system
* @api {get} check-system 检查是否需要初始化系统 * @api {get} check-system 检查是否需要初始化系统
* @apiGroup index * @apiGroup index
* @apiUse defResultJson
* @apiSuccess {String} routerBase 二级地址 * @apiSuccess {String} routerBase 二级地址
* @apiSuccess {String} name 系统名称 * @apiSuccess {String} name 系统名称
* @apiSuccess {String} subTitle 主页面副标题 * @apiSuccess {String} subTitle 主页面副标题

View File

@ -75,6 +75,7 @@ public class InstallController extends BaseServerController {
* @return json * @return json
* @api {post} install_submit.json 初始化提交 * @api {post} install_submit.json 初始化提交
* @apiGroup index * @apiGroup index
* @apiUse defResultJson
* @apiParam {String} userName 系统管理员登录名 * @apiParam {String} userName 系统管理员登录名
* @apiParam {String} userPwd 设置的登录密码 sha1 后传入 * @apiParam {String} userPwd 设置的登录密码 sha1 后传入
* @apiSuccess {JSON} data.tokenData token 相关信息 * @apiSuccess {JSON} data.tokenData token 相关信息