Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请问接口文档是怎么生成的 #85

Closed
Cole-Mu opened this issue Apr 23, 2019 · 15 comments
Closed

请问接口文档是怎么生成的 #85

Cole-Mu opened this issue Apr 23, 2019 · 15 comments

Comments

@Cole-Mu
Copy link

Cole-Mu commented Apr 23, 2019

本地部署了java后台,在官网上测试也请求成功了,但是同样的接口我看官网左边有描述,右边有表的字段文档,而换成我本地接口就都没了。这个要怎么做才能生成呢?

@TommyLemon
Copy link
Collaborator

我去,直接输入 APIJSON Server 的 URL,点左侧按钮 '/" ,有视频的

@Cole-Mu
Copy link
Author

Cole-Mu commented Apr 24, 2019

我去,直接输入 APIJSON Server 的 URL,点左侧按钮 '/" ,有视频的

我知道,我点了,不是和接口结果切换的问题,是切换到文档但是文档里没有表信息

@TommyLemon
Copy link
Collaborator

截屏发下,是不是schema用的不是 sys,右上角设置改下

@shengqiang025210
Copy link

@TommyLemon 你好,还是楼主提的文档生成的问题,我也没弄出来。视频只有生成javabean代码,
image
上图是用案例官网后端地址,右边会有表信息,如果用我自己本地的后端地址,能够查询数据(下图第一个),但是没有相应的文档(下图第二个)
image
image

@TommyLemon
Copy link
Collaborator

TommyLemon commented Apr 26, 2019

你好,请先修改右上角 “设置”>数据库类型,数据库模式 为你自己数据库的配置。
image

然后查看下浏览器控制台信息,刷新网页,看发出的请求回来的结果。
image

image

如果是 MySQL:

{"@database":"MYSQL","[]":{"count":0,"Table":{"table_schema":"sys","table_type":"BASE TABLE","table_name!$":["\\_%","sys\\_%","system\\_%"],"@order":"table_name+","@column":"table_name,table_comment"},"PgClass":null,"[]":{"count":0,"Column":{"table_schema":"sys","table_name@":"[]/Table/table_name","@column":"column_name,column_type,column_comment"},"PgAttribute":null}},"Access[]":{"count":0,"Access":{"@column":"schema,name,alias,get,head,gets,heads,post,put,delete","@order":"date-,name+","name()":"getWithDefault(alias,name)","r0()":"removeKey(alias)"}},"Function[]":{"count":0,"Function":{"@order":"date-,name+","@column":"name,arguments,demo,detail","demo()":"getFunctionDemo()","detail()":"getFunctionDetail()","r0()":"removeKey(name)","r1()":"removeKey(arguments)"}},"Request[]":{"count":0,"Request":{"@order":"version-,method-"}}}

Response:

{"[]":[{"Table":{"table_name":"Access","table_comment":"权限配置"},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":"唯一标识"}},{"Column":{"column_name":"schema","column_type":"varchar(20)","column_comment":"集合空间"}},{"Column":{"column_name":"name","column_type":"varchar(50)","column_comment":"实际表名,例如 apijson_user"}},{"Column":{"column_name":"alias","column_type":"varchar(20)","column_comment":"外部调用的表别名,例如 User"}},{"Column":{"column_name":"get","column_type":"varchar(100)","column_comment":"允许 get 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]\n用 JSON 类型不能设置默认值,反正权限对应的需求是明确的,也不需要自动转 JSONArray。"}},{"Column":{"column_name":"head","column_type":"varchar(100)","column_comment":"允许 head 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]"}},{"Column":{"column_name":"gets","column_type":"varchar(100)","column_comment":"允许 gets 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]"}},{"Column":{"column_name":"heads","column_type":"varchar(100)","column_comment":"允许 heads 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]"}},{"Column":{"column_name":"post","column_type":"varchar(100)","column_comment":"允许 post 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]"}},{"Column":{"column_name":"put","column_type":"varchar(100)","column_comment":"允许 put 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]"}},{"Column":{"column_name":"delete","column_type":"varchar(100)","column_comment":"允许 delete 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]"}},{"Column":{"column_name":"date","column_type":"timestamp","column_comment":"创建时间"}}]},{"Table":{"table_name":"apijson_privacy","table_comment":"用户隐私信息表。\n对安全要求高,不想泄漏真实名称。对外名称为 Privacy"},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":"唯一标识"}},{"Column":{"column_name":"certified","column_type":"tinyint(2)","column_comment":"已认证"}},{"Column":{"column_name":"phone","column_type":"bigint(11)","column_comment":"手机号,仅支持 11 位数的。不支持 +86 这种国家地区开头的。如果要支持就改为 VARCHAR(14)"}},{"Column":{"column_name":"balance","column_type":"decimal(10,2)","column_comment":"余额"}},{"Column":{"column_name":"_password","column_type":"varchar(20)","column_comment":"登录密码"}},{"Column":{"column_name":"_payPassword","column_type":"int(6)","column_comment":"支付密码"}}]},{"Table":{"table_name":"apijson_user","table_comment":"用户公开信息表。\n对安全要求高,不想泄漏真实名称。对外名称为 User"},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":"唯一标识"}},{"Column":{"column_name":"sex","column_type":"tinyint(2)","column_comment":"性别:\n0-男\n1-女"}},{"Column":{"column_name":"name","column_type":"varchar(20)","column_comment":"名称"}},{"Column":{"column_name":"tag","column_type":"varchar(45)","column_comment":"标签"}},{"Column":{"column_name":"head","column_type":"varchar(300)","column_comment":"头像url"}},{"Column":{"column_name":"contactIdList","column_type":"json","column_comment":"联系人id列表"}},{"Column":{"column_name":"pictureList","column_type":"json","column_comment":"照片列表"}},{"Column":{"column_name":"date","column_type":"timestamp","column_comment":"创建日期"}}]},{"Table":{"table_name":"blog","table_comment":""},"[]":[{"Column":{"column_name":"id","column_type":"int(11)","column_comment":""}},{"Column":{"column_name":"title","column_type":"varchar(200)","column_comment":""}},{"Column":{"column_name":"content","column_type":"mediumtext","column_comment":""}}]},{"Table":{"table_name":"Comment","table_comment":"评论"},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":"唯一标识"}},{"Column":{"column_name":"toId","column_type":"bigint(15)","column_comment":"被回复的id"}},{"Column":{"column_name":"userId","column_type":"bigint(15)","column_comment":"评论人id"}},{"Column":{"column_name":"momentId","column_type":"bigint(15)","column_comment":"动态id"}},{"Column":{"column_name":"date","column_type":"timestamp","column_comment":"创建日期"}},{"Column":{"column_name":"content","column_type":"varchar(1000)","column_comment":"内容"}}]},{"Table":{"table_name":"Document","table_comment":"测试用例文档\n后端开发者在测试好后,把选好的测试用例上传,这样就能共享给前端/客户端开发者"},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":"唯一标识"}},{"Column":{"column_name":"userId","column_type":"bigint(15)","column_comment":"用户id\n应该用adminId,只有当登录账户是管理员时才能操作文档。\n需要先建Admin表,新增登录等相关接口。"}},{"Column":{"column_name":"version","column_type":"tinyint(4)","column_comment":"接口版本号\n<=0 - 不限制版本,任意版本都可用这个接口\n>0 - 在这个版本添加的接口"}},{"Column":{"column_name":"name","column_type":"varchar(100)","column_comment":"接口名称"}},{"Column":{"column_name":"url","column_type":"varchar(250)","column_comment":"请求地址"}},{"Column":{"column_name":"request","column_type":"text","column_comment":"请求\n用json格式会导致强制排序,而请求中引用赋值只能引用上面的字段,必须有序。"}},{"Column":{"column_name":"response","column_type":"text","column_comment":"标准返回结果JSON\n用json格式会导致强制排序,而请求中引用赋值只能引用上面的字段,必须有序。"}},{"Column":{"column_name":"date","column_type":"timestamp","column_comment":"创建日期"}}]},{"Table":{"table_name":"Function","table_comment":"远程函数。强制在启动时校验所有demo是否能正常运行通过"},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":""}},{"Column":{"column_name":"userId","column_type":"bigint(15)","column_comment":"管理员用户Id"}},{"Column":{"column_name":"name","column_type":"varchar(20)","column_comment":"方法名"}},{"Column":{"column_name":"arguments","column_type":"varchar(100)","column_comment":"参数列表,每个参数的类型都是 String。\n用 , 分割的字符串 比 [JSONArray] 更好,例如 array,item ,更直观,还方便拼接函数。"}},{"Column":{"column_name":"demo","column_type":"json","column_comment":"可用的示例。"}},{"Column":{"column_name":"detail","column_type":"varchar(1000)","column_comment":"详细描述"}},{"Column":{"column_name":"date","column_type":"timestamp","column_comment":"创建时间"}}]},{"Table":{"table_name":"Login","table_comment":"@deprecated,登录信息存session"},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":"唯一标识"}},{"Column":{"column_name":"userId","column_type":"bigint(15)","column_comment":"用户id"}},{"Column":{"column_name":"type","column_type":"tinyint(2)","column_comment":"类型\n0-密码登录\n1-验证码登录"}},{"Column":{"column_name":"date","column_type":"timestamp","column_comment":"创建日期"}}]},{"Table":{"table_name":"Moment","table_comment":"动态"},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":"唯一标识"}},{"Column":{"column_name":"userId","column_type":"bigint(15)","column_comment":"用户id"}},{"Column":{"column_name":"date","column_type":"timestamp","column_comment":"创建日期"}},{"Column":{"column_name":"content","column_type":"varchar(300)","column_comment":"内容"}},{"Column":{"column_name":"praiseUserIdList","column_type":"json","column_comment":"点赞的用户id列表"}},{"Column":{"column_name":"pictureList","column_type":"json","column_comment":"图片列表"}}]},{"Table":{"table_name":"Praise","table_comment":"如果对Moment写安全要求高,可以将Moment内praiserUserIdList分离到Praise表中,作为userIdList。\n权限注解也改下:\n@MethodAccess(\n\t\tPUT = {OWNER, ADMIN}\n\t\t)\nclass Moment {\n       …\n}\n\n@MethodAccess(\n\t\tPUT = {LOGIN, CONTACT, CIRCLE, OWNER, ADMIN}\n\t\t)\n class Praise {\n       …\n }\n"},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":"动态id"}},{"Column":{"column_name":"momentId","column_type":"bigint(15)","column_comment":"唯一标识"}},{"Column":{"column_name":"userId","column_type":"bigint(15)","column_comment":"用户id"}},{"Column":{"column_name":"date","column_type":"timestamp","column_comment":"点赞时间"}}]},{"Table":{"table_name":"Request","table_comment":"最好编辑完后删除主键,这样就是只读状态,不能随意更改。需要更改就重新加上主键。\n\n每次启动服务器时加载整个表到内存。\n这个表不可省略,model内注解的权限只是客户端能用的,其它可以保证即便服务端代码错误时也不会误删数据。"},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":"唯一标识"}},{"Column":{"column_name":"version","column_type":"tinyint(4)","column_comment":"GET,HEAD可用任意结构访问任意开放内容,不需要这个字段。\n其它的操作因为写入了结构和内容,所以都需要,按照不同的version选择对应的structure。\n\n自动化版本管理:\nRequest JSON最外层可以传  “version”:Integer 。\n1.未传或 <= 0,用最新版。 “@order”:”version-“\n2.已传且 > 0,用version以上的可用版本的最低版本。 “@order”:”version+”, “version{}”:”>={version}”"}},{"Column":{"column_name":"method","column_type":"varchar(10)","column_comment":"只限于GET,HEAD外的操作方法。"}},{"Column":{"column_name":"tag","column_type":"varchar(20)","column_comment":"标签"}},{"Column":{"column_name":"structure","column_type":"json","column_comment":"结构。\nTODO 里面的 PUT 改为 UPDATE,避免和请求 PUT 搞混。"}},{"Column":{"column_name":"detail","column_type":"varchar(10000)","column_comment":"详细说明"}},{"Column":{"column_name":"date","column_type":"timestamp","column_comment":"创建日期"}}]},{"Table":{"table_name":"Response","table_comment":"每次启动服务器时加载整个表到内存。"},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":"唯一标识"}},{"Column":{"column_name":"method","column_type":"varchar(10)","column_comment":"方法"}},{"Column":{"column_name":"model","column_type":"varchar(20)","column_comment":"表名,table是SQL关键词不能用"}},{"Column":{"column_name":"structure","column_type":"json","column_comment":"结构"}},{"Column":{"column_name":"detail","column_type":"varchar(10000)","column_comment":"详细说明"}},{"Column":{"column_name":"date","column_type":"timestamp","column_comment":"创建日期"}}]},{"Table":{"table_name":"Test","table_comment":"测试及验证用的表,可以用 SELECT condition替代 SELECT * FROM Test WHERE condition,这样就不需要这张表了"},"[]":[{"Column":{"column_name":"id","column_type":"tinyint(2)","column_comment":""}}]},{"Table":{"table_name":"TestRecord","table_comment":"测试记录\n主要用于保存自动化接口回归测试"},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":"唯一标识"}},{"Column":{"column_name":"userId","column_type":"bigint(15)","column_comment":"用户id"}},{"Column":{"column_name":"documentId","column_type":"bigint(15)","column_comment":"测试用例文档id"}},{"Column":{"column_name":"response","column_type":"text","column_comment":"接口返回结果JSON"}},{"Column":{"column_name":"date","column_type":"timestamp","column_comment":"创建日期"}},{"Column":{"column_name":"compare","column_type":"text","column_comment":"对比结果"}},{"Column":{"column_name":"standard","column_type":"text","column_comment":"response 的校验标准,是一个 JSON 格式的 AST ,描述了正确 Response 的结构、里面的字段名称、类型、长度、取值范围 等属性。"}}]},{"Table":{"table_name":"Verify","table_comment":""},"[]":[{"Column":{"column_name":"id","column_type":"bigint(15)","column_comment":"唯一标识"}},{"Column":{"column_name":"type","column_type":"int(2)","column_comment":"类型:\n0-登录\n1-注册\n2-修改登录密码\n3-修改支付密码"}},{"Column":{"column_name":"phone","column_type":"bigint(11)","column_comment":"手机号"}},{"Column":{"column_name":"verify","column_type":"int(6)","column_comment":"验证码"}},{"Column":{"column_name":"date","column_type":"timestamp","column_comment":"创建时间"}}]}],"Access[]":[{"schema":"sys","name":"Document","get":"[\"LOGIN\", \"ADMIN\"]","head":"[\"LOGIN\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"OWNER\", \"ADMIN\"]","put":"[\"LOGIN\", \"ADMIN\"]","delete":"[\"OWNER\", \"ADMIN\"]"},{"schema":"sys","name":"Function","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[]","put":"[]","delete":"[]"},{"schema":"sys","name":"Response","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[]","put":"[]","delete":"[]"},{"schema":"sys","name":"Test","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[]","put":"[]","delete":"[]"},{"schema":"sys","name":"TestRecord","get":"[\"LOGIN\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"OWNER\", \"ADMIN\"]","put":"[\"OWNER\", \"ADMIN\"]","delete":"[\"OWNER\", \"ADMIN\"]"},{"schema":"sys","name":"Column","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[]","put":"[]","delete":"[]"},{"schema":"sys","name":"Request","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[]","put":"[]","delete":"[]"},{"schema":"sys","name":"Table","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[]","put":"[]","delete":"[]"},{"schema":"sys","name":"Privacy","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"OWNER\", \"ADMIN\"]","put":"[\"OWNER\", \"ADMIN\"]","delete":"[\"OWNER\", \"ADMIN\"]"},{"schema":"sys","name":"Login","get":"[]","head":"[]","gets":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[ \"ADMIN\"]","put":"[ \"ADMIN\"]","delete":"[\"ADMIN\"]"},{"schema":"sys","name":"Verify","get":"[]","head":"[]","gets":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","put":"[ \"ADMIN\"]","delete":"[\"ADMIN\"]"},{"schema":"sys","name":"Comment","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"OWNER\", \"ADMIN\"]","put":"[\"OWNER\", \"ADMIN\"]","delete":"[\"OWNER\", \"ADMIN\"]"},{"schema":"sys","name":"Moment","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"OWNER\", \"ADMIN\"]","put":"[\"OWNER\", \"ADMIN\"]","delete":"[\"OWNER\", \"ADMIN\"]"},{"schema":"sys","name":"User","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"OWNER\", \"ADMIN\"]","put":"[\"OWNER\", \"ADMIN\"]","delete":"[\"OWNER\", \"ADMIN\"]"}],"Function[]":[{"demo":{"result()":"getFromArray(array,1)","array":[1,2,3]},"detail":"getFromArray(array,position): 根据下标获取数组里的值。position 传数字时直接作为值,而不是从所在对象 request 中取值"},{"demo":{"key":"id","object":{"id":1},"result()":"getFromObject(object,key)"},"detail":"getFromObject(object,key): 根据键获取对象里的值。"},{"demo":{"key":"id","object":{"id":1},"result()":"isContainKey(object,key)"},"detail":"isContainKey(object,key): 判断是否对象包含键。"},{"demo":{"value":1,"object":{"id":1},"result()":"isContainValue(object,value)"},"detail":"isContainValue(object,value): 判断是否对象包含值。"},{"demo":{"array":[1,2,3],"result()":"countArray(array)"},"detail":"countArray(array): 获取数组长度。没写调用键值对,会自动补全 \"result()\": \"countArray(array)\""},{"demo":{"object":{"key1":2,"key0":1},"result()":"countObject(object)"},"detail":"countObject(object): 获取对象长度。"},{"demo":{"array":[1,2,3],"value":2,"result()":"isContain(array,value)"},"detail":"isContain(array,value): 判断是否数组包含值。"}],"Request[]":[{"id":36,"version":2,"method":"PUT","tag":"Document","structure":{"DISALLOW":"userId","NECESSARY":"id"},"date":"2017-11-26 16:35:15.0"},{"id":35,"version":2,"method":"POST","tag":"Document","structure":{"DISALLOW":"id","NECESSARY":"userId,name,url,request"},"date":"2017-11-26 16:34:41.0"},{"id":38,"version":2,"method":"POST","tag":"TestRecord","structure":{"DISALLOW":"id","NECESSARY":"userId,documentId,response"},"date":"2018-06-17 07:44:36.0"},{"id":32,"version":2,"method":"GETS","tag":"Privacy","structure":{"ADD":{"@role":"owner"},"DISALLOW":"_password,_payPassword","NECESSARY":"id"},"date":"2017-06-13 00:05:51.0"},{"id":33,"version":2,"method":"GETS","tag":"Privacy-CIRCLE","structure":{"Privacy":{"DISALLOW":"!","NECESSARY":"id","PUT":{"@column":"phone","@role":"CIRCLE"}}},"date":"2017-06-13 00:05:51.0"},{"id":37,"version":2,"method":"DELETE","tag":"Document","structure":{"ADD":{"@role":"owner"},"DISALLOW":"!","NECESSARY":"id","PUT":{"TestRecord":{"documentId@":"Document/id","@role":"owner"}}},"date":"2017-11-26 08:36:20.0"},{"id":4,"version":1,"method":"PUT","tag":"User","structure":{"ADD":{"@role":"owner"},"DISALLOW":"phone","NECESSARY":"id"},"detail":"必须传id,不允许传phone。ADD当没传@role时用owner补全","date":"2017-02-01 19:19:51.0"},{"id":8,"version":1,"method":"PUT","tag":"User-phone","structure":{"User":{"ADD":{"@role":"owner"},"DISALLOW":"!","NECESSARY":"id,phone,_password","PUT":{"@combine":"_password"}}},"detail":"! 表示其它所有,这里指necessary所有未包含的字段","date":"2017-02-01 19:19:51.0"},{"id":17,"version":1,"method":"PUT","tag":"Moment","structure":{"DISALLOW":"userId,date","NECESSARY":"id"},"date":"2017-02-01 19:19:51.0"},{"id":23,"version":1,"method":"PUT","tag":"Privacy","structure":{"ADD":{"@role":"owner"},"NECESSARY":"id"},"detail":"ADD当没传@role时用owner补全","date":"2017-02-01 19:19:51.0"},{"id":25,"version":1,"method":"PUT","tag":"Praise","structure":{"NECESSARY":"id"},"detail":"必须传id","date":"2017-02-01 19:19:51.0"},{"id":27,"version":1,"method":"PUT","tag":"Comment[]","structure":{"Comment":{"ADD":{"@role":"owner"},"NECESSARY":"id{}"}},"detail":"DISALLOW没必要用于DELETE","date":"2017-02-01 19:19:51.0"},{"id":28,"version":1,"method":"PUT","tag":"Comment","structure":{"ADD":{"@role":"owner"},"NECESSARY":"id"},"detail":"这里省略了Comment,因为tag就是Comment,Parser.getCorrectRequest会自动补全","date":"2017-02-01 19:19:51.0"},{"id":30,"version":1,"method":"PUT","tag":"balance+","structure":{"Privacy":{"VERIFY":{"balance+&{}":">=1,<=100000"},"DISALLOW":"!","NECESSARY":"id,balance+"}},"detail":"验证balance+对应的值是否满足>=1且<=100000","date":"2017-10-21 16:48:34.0"},{"id":31,"version":1,"method":"PUT","tag":"balance-","structure":{"Privacy":{"VERIFY":{"balance-&{}":">=1,<=10000"},"DISALLOW":"!","NECESSARY":"id,balance-,_password","PUT":{"@combine":"_password"}}},"detail":"PUT强制把_password作为WHERE条件","date":"2017-10-21 16:48:34.0"},{"id":1,"version":1,"method":"POST","tag":"register","structure":{"Privacy":{"UNIQUE":"phone","VERIFY":{"phone?":"phone"},"DISALLOW":"id","NECESSARY":"_password,phone"},"User":{"DISALLOW":"id","NECESSARY":"name","PUT":{"id@":"Privacy/id"}}},"detail":"UNIQUE校验phone是否已存在。VERIFY校验phone是否符合手机号的格式","date":"2017-02-01 19:19:51.0"},{"id":2,"version":1,"method":"POST","tag":"Moment","structure":{"ADD":{"praiseUserIdList":[],"@role":"owner","pictureList":[]},"DISALLOW":"id","PUT":{"verifyIdList-()":"verifyIdList(praiseUserIdList)","verifyURLList-()":"verifyURLList(pictureList)"}},"detail":"ADD当没传pictureList和praiseUserIdList时用空数组[]补全,保证不会为null","date":"2017-02-01 19:19:51.0"},{"id":3,"version":1,"method":"POST","tag":"Comment","structure":{"DISALLOW":"id","NECESSARY":"momentId,content","PUT":{"@role":"owner"}},"detail":"必须传userId,momentId,content,不允许传id","date":"2017-02-01 19:19:51.0"},{"id":14,"version":1,"method":"POST","tag":"Verify","structure":{"DISALLOW":"!","NECESSARY":"phone,verify"},"detail":"必须传phone,verify,其它都不允许传","date":"2017-02-18 22:20:43.0"},{"id":16,"version":1,"method":"HEADS","tag":"Verify","structure":{},"detail":"允许任意内容","date":"2017-02-18 22:20:43.0"},{"id":21,"version":1,"method":"HEADS","tag":"Login","structure":{"DISALLOW":"!","NECESSARY":"userId,type"},"date":"2017-02-18 22:20:43.0"},{"id":15,"version":1,"method":"GETS","tag":"Verify","structure":{"NECESSARY":"phone"},"detail":"必须传phone","date":"2017-02-18 22:20:43.0"},{"id":22,"version":1,"method":"GETS","tag":"User","structure":{},"detail":"允许传任何内容,除了表对象","date":"2017-02-18 22:20:43.0"},{"id":29,"version":1,"method":"GETS","tag":"login","structure":{"Privacy":{"DISALLOW":"id","NECESSARY":"phone,_password"}},"date":"2017-10-15 18:04:52.0"},{"id":5,"version":1,"method":"DELETE","tag":"Moment","structure":{"Moment":{"ADD":{"@role":"owner"},"NECESSARY":"id","PUT":{"commentCount()":"deleteCommentOfMoment(id)"}}},"date":"2017-02-01 19:19:51.0"},{"id":6,"version":1,"method":"DELETE","tag":"Comment","structure":{"ADD":{"@role":"owner"},"NECESSARY":"id","PUT":{"childCount()":"deleteChildComment(id)"}},"detail":"disallow没必要用于DELETE","date":"2017-02-01 19:19:51.0"},{"id":26,"version":1,"method":"DELETE","tag":"Comment[]","structure":{"Comment":{"ADD":{"@role":"owner"},"NECESSARY":"id{}"}},"detail":"DISALLOW没必要用于DELETE","date":"2017-02-01 19:19:51.0"}],"code":200,"msg":"success"}

如果是 PostgreSQL:

{"@database":"POSTGRESQL","[]":{"count":0,"Table":{"table_schema":"sys","table_type":"BASE TABLE","table_name!$":["\\_%","sys\\_%","system\\_%"],"@order":"table_name+","@column":"table_name"},"PgClass":{"relname@":"/Table/table_name","@column":"oid;obj_description(oid):table_comment"},"[]":{"count":0,"Column":{"table_schema":"sys","table_name@":"[]/Table/table_name","@column":"column_name,data_type:column_type"},"PgAttribute":{"attrelid@":"[]/PgClass/oid","attname@":"/Column/column_name","attnum>":0,"@column":"col_description(attrelid,attnum):column_comment"}}},"Access[]":{"count":0,"Access":{"@column":"schema,name,alias,get,head,gets,heads,post,put,delete","@order":"date-,name+","name()":"getWithDefault(alias,name)","r0()":"removeKey(alias)"}},"Function[]":{"count":0,"Function":{"@order":"date-,name+","@column":"name,arguments,demo,detail","demo()":"getFunctionDemo()","detail()":"getFunctionDetail()","r0()":"removeKey(name)","r1()":"removeKey(arguments)"}},"Request[]":{"count":0,"Request":{"@order":"version-,method-"}}}

Response:

{"[]":[{"Table":{"table_name":"Access"},"PgClass":{"oid":16386,"table_comment":"权限配置"},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{"column_comment":"唯一标识"}},{"Column":{"column_name":"schema","column_type":"character varying"},"PgAttribute":{"column_comment":"集合空间"}},{"Column":{"column_name":"name","column_type":"character varying"},"PgAttribute":{"column_comment":"实际表名,例如 apijson_user"}},{"Column":{"column_name":"alias","column_type":"character varying"},"PgAttribute":{"column_comment":"外部调用的表别名,例如 User"}},{"Column":{"column_name":"get","column_type":"character varying"},"PgAttribute":{"column_comment":"允许 get 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]\n用 JSON 类型不能设置默认值,反正权限对应的需求是明确的,也不需要自动转 JSONArray。"}},{"Column":{"column_name":"head","column_type":"character varying"},"PgAttribute":{"column_comment":"允许 head 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]"}},{"Column":{"column_name":"gets","column_type":"character varying"},"PgAttribute":{"column_comment":"允许 gets 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]"}},{"Column":{"column_name":"heads","column_type":"character varying"},"PgAttribute":{"column_comment":"允许 heads 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]"}},{"Column":{"column_name":"post","column_type":"character varying"},"PgAttribute":{"column_comment":"允许 post 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]"}},{"Column":{"column_name":"put","column_type":"character varying"},"PgAttribute":{"column_comment":"允许 put 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]"}},{"Column":{"column_name":"delete","column_type":"character varying"},"PgAttribute":{"column_comment":"允许 delete 的角色列表,例如 [\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\"]"}},{"Column":{"column_name":"date","column_type":"timestamp without time zone"},"PgAttribute":{"column_comment":"创建时间"}}]},{"Table":{"table_name":"apijson_privacy"},"PgClass":{"oid":16458,"table_comment":"用户隐私信息表。\n对安全要求高,不想泄漏真实名称。对外名称为 Privacy"},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{"column_comment":"唯一标识"}},{"Column":{"column_name":"certified","column_type":"smallint"},"PgAttribute":{"column_comment":"已认证"}},{"Column":{"column_name":"phone","column_type":"character varying"},"PgAttribute":{"column_comment":"手机号,仅支持 11 位数的。不支持 +86 这种国家地区开头的。如果要支持就改为 VARCHAR(14)"}},{"Column":{"column_name":"balance","column_type":"numeric"},"PgAttribute":{"column_comment":"余额"}},{"Column":{"column_name":"_password","column_type":"character varying"},"PgAttribute":{"column_comment":"登录密码"}},{"Column":{"column_name":"_payPassword","column_type":"character varying"},"PgAttribute":{"column_comment":"支付密码"}}]},{"Table":{"table_name":"apijson_user"},"PgClass":{"oid":16461,"table_comment":"用户公开信息表。\n对安全要求高,不想泄漏真实名称。对外名称为 User"},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{"column_comment":"唯一标识"}},{"Column":{"column_name":"sex","column_type":"smallint"},"PgAttribute":{"column_comment":"性别:\n0-男\n1-女"}},{"Column":{"column_name":"name","column_type":"character varying"},"PgAttribute":{"column_comment":"名称"}},{"Column":{"column_name":"tag","column_type":"character varying"},"PgAttribute":{"column_comment":"标签"}},{"Column":{"column_name":"head","column_type":"character varying"},"PgAttribute":{"column_comment":"头像url"}},{"Column":{"column_name":"contactIdList","column_type":"jsonb"},"PgAttribute":{"column_comment":"联系人id列表"}},{"Column":{"column_name":"pictureList","column_type":"jsonb"},"PgAttribute":{"column_comment":"照片列表"}},{"Column":{"column_name":"date","column_type":"timestamp without time zone"},"PgAttribute":{"column_comment":"创建日期"}}]},{"Table":{"table_name":"Comment"},"PgClass":{"oid":16392,"table_comment":"评论"},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{"column_comment":"唯一标识"}},{"Column":{"column_name":"toId","column_type":"bigint"},"PgAttribute":{"column_comment":"被回复的id"}},{"Column":{"column_name":"userId","column_type":"bigint"},"PgAttribute":{"column_comment":"评论人id"}},{"Column":{"column_name":"momentId","column_type":"bigint"},"PgAttribute":{"column_comment":"动态id"}},{"Column":{"column_name":"date","column_type":"timestamp without time zone"},"PgAttribute":{"column_comment":"创建日期"}},{"Column":{"column_name":"content","column_type":"character varying"},"PgAttribute":{"column_comment":"内容"}}]},{"Table":{"table_name":"Document"},"PgClass":{"oid":16399,"table_comment":"测试用例文档\n后端开发者在测试好后,把选好的测试用例上传,这样就能共享给前端/客户端开发者"},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{"column_comment":"唯一标识"}},{"Column":{"column_name":"userId","column_type":"bigint"},"PgAttribute":{"column_comment":"用户id\n应该用adminId,只有当登录账户是管理员时才能操作文档。\n需要先建Admin表,新增登录等相关接口。"}},{"Column":{"column_name":"version","column_type":"smallint"},"PgAttribute":{"column_comment":"接口版本号\n<=0 - 不限制版本,任意版本都可用这个接口\n>0 - 在这个版本添加的接口"}},{"Column":{"column_name":"name","column_type":"character varying"},"PgAttribute":{"column_comment":"接口名称"}},{"Column":{"column_name":"url","column_type":"character varying"},"PgAttribute":{"column_comment":"请求地址"}},{"Column":{"column_name":"request","column_type":"text"},"PgAttribute":{"column_comment":"请求\n用json格式会导致强制排序,而请求中引用赋值只能引用上面的字段,必须有序。"}},{"Column":{"column_name":"response","column_type":"text"},"PgAttribute":{"column_comment":"标准返回结果JSON\n用json格式会导致强制排序,而请求中引用赋值只能引用上面的字段,必须有序。"}},{"Column":{"column_name":"date","column_type":"timestamp without time zone"},"PgAttribute":{"column_comment":"创建日期"}}]},{"Table":{"table_name":"Function"},"PgClass":{"oid":16407,"table_comment":"远程函数。强制在启动时校验所有demo是否能正常运行通过"},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{}},{"Column":{"column_name":"userId","column_type":"bigint"},"PgAttribute":{"column_comment":"管理员用户Id"}},{"Column":{"column_name":"name","column_type":"character varying"},"PgAttribute":{"column_comment":"方法名"}},{"Column":{"column_name":"arguments","column_type":"character varying"},"PgAttribute":{"column_comment":"参数列表,每个参数的类型都是 String。\n用 , 分割的字符串 比 [JSONArray] 更好,例如 array,item ,更直观,还方便拼接函数。"}},{"Column":{"column_name":"demo","column_type":"text"},"PgAttribute":{"column_comment":"可用的示例。"}},{"Column":{"column_name":"detail","column_type":"character varying"},"PgAttribute":{"column_comment":"详细描述"}},{"Column":{"column_name":"date","column_type":"timestamp without time zone"},"PgAttribute":{"column_comment":"创建时间"}}]},{"Table":{"table_name":"Login"},"PgClass":{"oid":16413,"table_comment":"@deprecated,登录信息存session"},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{"column_comment":"唯一标识"}},{"Column":{"column_name":"userId","column_type":"bigint"},"PgAttribute":{"column_comment":"用户id"}},{"Column":{"column_name":"type","column_type":"smallint"},"PgAttribute":{"column_comment":"类型\n0-密码登录\n1-验证码登录"}},{"Column":{"column_name":"date","column_type":"timestamp without time zone"},"PgAttribute":{"column_comment":"创建日期"}}]},{"Table":{"table_name":"Moment"},"PgClass":{"oid":16416,"table_comment":"动态"},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{"column_comment":"唯一标识"}},{"Column":{"column_name":"userId","column_type":"bigint"},"PgAttribute":{"column_comment":"用户id"}},{"Column":{"column_name":"date","column_type":"timestamp without time zone"},"PgAttribute":{"column_comment":"创建日期"}},{"Column":{"column_name":"content","column_type":"character varying"},"PgAttribute":{"column_comment":"内容"}},{"Column":{"column_name":"praiseUserIdList","column_type":"jsonb"},"PgAttribute":{"column_comment":"点赞的用户id列表"}},{"Column":{"column_name":"pictureList","column_type":"jsonb"},"PgAttribute":{"column_comment":"图片列表"}}]},{"Table":{"table_name":"Praise"},"PgClass":{"oid":16422,"table_comment":"如果对Moment写安全要求高,可以将Moment内praiserUserIdList分离到Praise表中,作为userIdList。\n权限注解也改下:\n@MethodAccess(\n\t\tPUT = {OWNER, ADMIN}\n\t\t)\nclass Moment {\n       …\n}\n\n@MethodAccess(\n\t\tPUT = {LOGIN, CONTACT, CIRCLE, OWNER, ADMIN}\n\t\t)\n class Praise {\n       …\n }\n"},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{"column_comment":"动态id"}},{"Column":{"column_name":"momentId","column_type":"bigint"},"PgAttribute":{"column_comment":"唯一标识"}},{"Column":{"column_name":"userId","column_type":"bigint"},"PgAttribute":{"column_comment":"用户id"}},{"Column":{"column_name":"date","column_type":"timestamp without time zone"},"PgAttribute":{"column_comment":"点赞时间"}}]},{"Table":{"table_name":"Request"},"PgClass":{"oid":16425,"table_comment":"最好编辑完后删除主键,这样就是只读状态,不能随意更改。需要更改就重新加上主键。\n\n每次启动服务器时加载整个表到内存。\n这个表不可省略,model内注解的权限只是客户端能用的,其它可以保证即便服务端代码错误时也不会误删数据。"},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{"column_comment":"唯一标识"}},{"Column":{"column_name":"version","column_type":"smallint"},"PgAttribute":{"column_comment":"GET,HEAD可用任意结构访问任意开放内容,不需要这个字段。\n其它的操作因为写入了结构和内容,所以都需要,按照不同的version选择对应的structure。\n\n自动化版本管理:\nRequest JSON最外层可以传  “version”:Integer 。\n1.未传或 <= 0,用最新版。 “@order”:”version-“\n2.已传且 > 0,用version以上的可用版本的最低版本。 “@order”:”version+”, “version{}”:”>={version}”"}},{"Column":{"column_name":"method","column_type":"character varying"},"PgAttribute":{"column_comment":"只限于GET,HEAD外的操作方法。"}},{"Column":{"column_name":"tag","column_type":"character varying"},"PgAttribute":{"column_comment":"标签"}},{"Column":{"column_name":"structure","column_type":"jsonb"},"PgAttribute":{"column_comment":"结构。\nTODO 里面的 PUT 改为 UPDATE,避免和请求 PUT 搞混。"}},{"Column":{"column_name":"detail","column_type":"character varying"},"PgAttribute":{"column_comment":"详细说明"}},{"Column":{"column_name":"date","column_type":"timestamp without time zone"},"PgAttribute":{"column_comment":"创建日期"}}]},{"Table":{"table_name":"Response"},"PgClass":{"oid":16431,"table_comment":"每次启动服务器时加载整个表到内存。"},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{"column_comment":"唯一标识"}},{"Column":{"column_name":"method","column_type":"character varying"},"PgAttribute":{"column_comment":"方法"}},{"Column":{"column_name":"model","column_type":"character varying"},"PgAttribute":{"column_comment":"表名,table是SQL关键词不能用"}},{"Column":{"column_name":"structure","column_type":"text"},"PgAttribute":{"column_comment":"结构"}},{"Column":{"column_name":"detail","column_type":"character varying"},"PgAttribute":{"column_comment":"详细说明"}},{"Column":{"column_name":"date","column_type":"timestamp without time zone"},"PgAttribute":{"column_comment":"创建日期"}}]},{"Table":{"table_name":"Test"},"PgClass":{"oid":16437,"table_comment":"测试及验证用的表,可以用 SELECT condition替代 SELECT * FROM Test WHERE condition,这样就不需要这张表了"},"[]":[{"Column":{"column_name":"id","column_type":"smallint"},"PgAttribute":{}}]},{"Table":{"table_name":"TestRecord"},"PgClass":{"oid":16440,"table_comment":"测试记录\n主要用于保存自动化接口回归测试"},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{"column_comment":"唯一标识"}},{"Column":{"column_name":"userId","column_type":"bigint"},"PgAttribute":{"column_comment":"用户id"}},{"Column":{"column_name":"documentId","column_type":"bigint"},"PgAttribute":{"column_comment":"测试用例文档id"}},{"Column":{"column_name":"response","column_type":"text"},"PgAttribute":{"column_comment":"接口返回结果JSON"}},{"Column":{"column_name":"date","column_type":"timestamp without time zone"},"PgAttribute":{"column_comment":"创建日期"}},{"Column":{"column_name":"compare","column_type":"text"},"PgAttribute":{"column_comment":"对比结果"}},{"Column":{"column_name":"standard","column_type":"text"},"PgAttribute":{"column_comment":"response 的校验标准,是一个 JSON 格式的 AST ,描述了正确 Response 的结构、里面的字段名称、类型、长度、取值范围 等属性。"}}]},{"Table":{"table_name":"Verify"},"PgClass":{"oid":16451},"[]":[{"Column":{"column_name":"id","column_type":"bigint"},"PgAttribute":{"column_comment":"唯一标识"}},{"Column":{"column_name":"type","column_type":"integer"},"PgAttribute":{"column_comment":"类型:\n0-登录\n1-注册\n2-修改登录密码\n3-修改支付密码"}},{"Column":{"column_name":"phone","column_type":"character varying"},"PgAttribute":{"column_comment":"手机号"}},{"Column":{"column_name":"verify","column_type":"character varying"},"PgAttribute":{"column_comment":"验证码"}},{"Column":{"column_name":"date","column_type":"timestamp without time zone"},"PgAttribute":{"column_comment":"创建时间"}}]}],"Access[]":[{"schema":"sys","name":"Document","get":"[\"LOGIN\", \"ADMIN\"]","head":"[\"LOGIN\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"OWNER\", \"ADMIN\"]","put":"[\"LOGIN\", \"ADMIN\"]","delete":"[\"OWNER\", \"ADMIN\"]"},{"schema":"sys","name":"Function","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[]","put":"[]","delete":"[]"},{"schema":"sys","name":"Response","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[]","put":"[]","delete":"[]"},{"schema":"sys","name":"Test","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[]","put":"[]","delete":"[]"},{"schema":"sys","name":"TestRecord","get":"[\"LOGIN\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"OWNER\", \"ADMIN\"]","put":"[\"OWNER\", \"ADMIN\"]","delete":"[\"OWNER\", \"ADMIN\"]"},{"schema":"sys","name":"Column","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[]","put":"[]","delete":"[]"},{"schema":"sys","name":"Request","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[]","put":"[]","delete":"[]"},{"schema":"sys","name":"Table","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[]","put":"[]","delete":"[]"},{"schema":"sys","name":"Privacy","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"OWNER\", \"ADMIN\"]","put":"[\"OWNER\", \"ADMIN\"]","delete":"[\"OWNER\", \"ADMIN\"]"},{"schema":"sys","name":"Login","get":"[]","head":"[]","gets":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[ \"ADMIN\"]","put":"[ \"ADMIN\"]","delete":"[\"ADMIN\"]"},{"schema":"sys","name":"Verify","get":"[]","head":"[]","gets":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","put":"[ \"ADMIN\"]","delete":"[\"ADMIN\"]"},{"schema":"sys","name":"Comment","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"OWNER\", \"ADMIN\"]","put":"[\"OWNER\", \"ADMIN\"]","delete":"[\"OWNER\", \"ADMIN\"]"},{"schema":"sys","name":"Moment","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"OWNER\", \"ADMIN\"]","put":"[\"OWNER\", \"ADMIN\"]","delete":"[\"OWNER\", \"ADMIN\"]"},{"schema":"sys","name":"User","get":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","head":"[\"UNKNOWN\", \"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","gets":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","heads":"[\"LOGIN\", \"CONTACT\", \"CIRCLE\", \"OWNER\", \"ADMIN\"]","post":"[\"OWNER\", \"ADMIN\"]","put":"[\"OWNER\", \"ADMIN\"]","delete":"[\"OWNER\", \"ADMIN\"]"}],"Function[]":[{"demo":{"array":[1,2,3],"result()":"getFromArray(array,1)"},"detail":"getFromArray(array,position): 根据下标获取数组里的值。position 传数字时直接作为值,而不是从所在对象 request 中取值"},{"demo":{"key":"id","object":{"id":1},"result()":"getFromObject(object,key)"},"detail":"getFromObject(object,key): 根据键获取对象里的值。"},{"demo":{"key":"id","object":{"id":1},"result()":"isContainKey(object,key)"},"detail":"isContainKey(object,key): 判断是否对象包含键。"},{"demo":{"value":1,"object":{"id":1},"result()":"isContainValue(object,value)"},"detail":"isContainValue(object,value): 判断是否对象包含值。"},{"demo":{"array":[1,2,3],"result()":"countArray(array)"},"detail":"countArray(array): 获取数组长度。没写调用键值对,会自动补全 \"result()\": \"countArray(array)\""},{"demo":{"object":{"key0":1,"key1":2},"result()":"countObject(object)"},"detail":"countObject(object): 获取对象长度。"},{"demo":{"array":[1,2,3],"value":2,"result()":"isContain(array,value)"},"detail":"isContain(array,value): 判断是否数组包含值。"}],"Request[]":[{"id":36,"version":2,"method":"PUT","tag":"Document","structure":{"DISALLOW":"userId","NECESSARY":"id"},"date":"2017-11-26 08:35:15.0"},{"id":38,"version":2,"method":"POST","tag":"TestRecord","structure":{"DISALLOW":"id","NECESSARY":"userId,documentId,response"},"date":"2018-06-16 23:44:36.0"},{"id":35,"version":2,"method":"POST","tag":"Document","structure":{"DISALLOW":"id","NECESSARY":"userId,name,url,request"},"date":"2017-11-26 08:34:41.0"},{"id":33,"version":2,"method":"GETS","tag":"Privacy-CIRCLE","structure":{"Privacy":{"PUT":{"@role":"CIRCLE","@column":"phone"},"DISALLOW":"!","NECESSARY":"id"}},"date":"2017-06-12 16:05:51.0"},{"id":32,"version":2,"method":"GETS","tag":"Privacy","structure":{"ADD":{"@role":"owner"},"DISALLOW":"_password,_payPassword","NECESSARY":"id"},"date":"2017-06-12 16:05:51.0"},{"id":37,"version":2,"method":"DELETE","tag":"Document","structure":{"ADD":{"@role":"owner"},"PUT":{"TestRecord":{"@role":"owner","documentId@":"Document/id"}},"DISALLOW":"!","NECESSARY":"id"},"date":"2017-11-26 00:36:20.0"},{"id":23,"version":1,"method":"PUT","tag":"Privacy","structure":{"ADD":{"@role":"owner"},"NECESSARY":"id"},"detail":"ADD当没传@role时用owner补全","date":"2017-02-01 11:19:51.0"},{"id":4,"version":1,"method":"PUT","tag":"User","structure":{"ADD":{"@role":"owner"},"DISALLOW":"phone","NECESSARY":"id"},"detail":"必须传id,不允许传phone。ADD当没传@role时用owner补全","date":"2017-02-01 11:19:51.0"},{"id":8,"version":1,"method":"PUT","tag":"User-phone","structure":{"User":{"ADD":{"@role":"owner"},"PUT":{"@combine":"_password"},"DISALLOW":"!","NECESSARY":"id,phone,_password"}},"detail":"! 表示其它所有,这里指necessary所有未包含的字段","date":"2017-02-01 11:19:51.0"},{"id":17,"version":1,"method":"PUT","tag":"Moment","structure":{"DISALLOW":"userId,date","NECESSARY":"id"},"date":"2017-02-01 11:19:51.0"},{"id":25,"version":1,"method":"PUT","tag":"Praise","structure":{"NECESSARY":"id"},"detail":"必须传id","date":"2017-02-01 11:19:51.0"},{"id":27,"version":1,"method":"PUT","tag":"Comment[]","structure":{"Comment":{"ADD":{"@role":"owner"},"NECESSARY":"id{}"}},"detail":"DISALLOW没必要用于DELETE","date":"2017-02-01 11:19:51.0"},{"id":28,"version":1,"method":"PUT","tag":"Comment","structure":{"ADD":{"@role":"owner"},"NECESSARY":"id"},"detail":"这里省略了Comment,因为tag就是Comment,Parser.getCorrectRequest会自动补全","date":"2017-02-01 11:19:51.0"},{"id":30,"version":1,"method":"PUT","tag":"balance+","structure":{"Privacy":{"VERIFY":{"balance+&{}":">=1,<=100000"},"DISALLOW":"!","NECESSARY":"id,balance+"}},"detail":"验证balance+对应的值是否满足>=1且<=100000","date":"2017-10-21 08:48:34.0"},{"id":31,"version":1,"method":"PUT","tag":"balance-","structure":{"Privacy":{"PUT":{"@combine":"_password"},"VERIFY":{"balance-&{}":">=1,<=10000"},"DISALLOW":"!","NECESSARY":"id,balance-,_password"}},"detail":"PUT强制把_password作为WHERE条件","date":"2017-10-21 08:48:34.0"},{"id":3,"version":1,"method":"POST","tag":"Comment","structure":{"PUT":{"@role":"owner"},"DISALLOW":"id","NECESSARY":"momentId,content"},"detail":"必须传userId,momentId,content,不允许传id","date":"2017-02-01 11:19:51.0"},{"id":14,"version":1,"method":"POST","tag":"Verify","structure":{"DISALLOW":"!","NECESSARY":"phone,verify"},"detail":"必须传phone,verify,其它都不允许传","date":"2017-02-18 14:20:43.0"},{"id":1,"version":1,"method":"POST","tag":"register","structure":{"User":{"PUT":{"id@":"Privacy/id"},"DISALLOW":"id","NECESSARY":"name"},"Privacy":{"UNIQUE":"phone","VERIFY":{"phone?":"phone"},"DISALLOW":"id","NECESSARY":"_password,phone"}},"detail":"UNIQUE校验phone是否已存在。VERIFY校验phone是否符合手机号的格式","date":"2017-02-01 11:19:51.0"},{"id":2,"version":1,"method":"POST","tag":"Moment","structure":{"ADD":{"@role":"owner","pictureList":[],"praiseUserIdList":[]},"PUT":{"verifyIdList-()":"verifyIdList(praiseUserIdList)","verifyURLList-()":"verifyURLList(pictureList)"},"DISALLOW":"id"},"detail":"ADD当没传pictureList和praiseUserIdList时用空数组[]补全,保证不会为null","date":"2017-02-01 11:19:51.0"},{"id":16,"version":1,"method":"HEADS","tag":"Verify","structure":{},"detail":"允许任意内容","date":"2017-02-18 14:20:43.0"},{"id":21,"version":1,"method":"HEADS","tag":"Login","structure":{"DISALLOW":"!","NECESSARY":"userId,type"},"date":"2017-02-18 14:20:43.0"},{"id":15,"version":1,"method":"GETS","tag":"Verify","structure":{"NECESSARY":"phone"},"detail":"必须传phone","date":"2017-02-18 14:20:43.0"},{"id":22,"version":1,"method":"GETS","tag":"User","structure":{},"detail":"允许传任何内容,除了表对象","date":"2017-02-18 14:20:43.0"},{"id":29,"version":1,"method":"GETS","tag":"login","structure":{"Privacy":{"DISALLOW":"id","NECESSARY":"phone,_password"}},"date":"2017-10-15 10:04:52.0"},{"id":26,"version":1,"method":"DELETE","tag":"Comment[]","structure":{"Comment":{"ADD":{"@role":"owner"},"NECESSARY":"id{}"}},"detail":"DISALLOW没必要用于DELETE","date":"2017-02-01 11:19:51.0"},{"id":6,"version":1,"method":"DELETE","tag":"Comment","structure":{"ADD":{"@role":"owner"},"PUT":{"childCount()":"deleteChildComment(id)"},"NECESSARY":"id"},"detail":"disallow没必要用于DELETE","date":"2017-02-01 11:19:51.0"},{"id":5,"version":1,"method":"DELETE","tag":"Moment","structure":{"Moment":{"ADD":{"@role":"owner"},"PUT":{"commentCount()":"deleteCommentOfMoment(id)"},"NECESSARY":"id"}},"date":"2017-02-01 11:19:51.0"}],"code":200,"msg":"success","query:depth/max":"2/5","sql:count/max":"268/1000"}

信息都在 Table 和 Column 里,PostgreSQL 的注释在额外的 PgClass 和 PgAttribute 里

@shengqiang025210
Copy link

好的,我试一下,非常感谢

@Cole-Mu
Copy link
Author

Cole-Mu commented Apr 27, 2019

截屏发下,是不是schema用的不是 sys,右上角设置改下

好了,非常感谢。确实是schema的设置问题,设置完好了。这个感觉需要在文档里特别说明一下,而且官网没有这个设置项,而auto文档里说建议直接用官网测试,我误以为界面与功能与本地完全一致,所以并没有对本地页面做更多探索。ps:再额外吐槽一下这个设置,“数据库模式”这个词不知道是不是业界统一的,个人第一次看到,感觉“数据库schema”或“数据库名称”更直接一些。

@TommyLemon
Copy link
Collaborator

没这个设置项??
image

名称确实有待商榷哈,我也想了好久,改了多次。

@TommyLemon
Copy link
Collaborator

TommyLemon commented Apr 27, 2019

改好了
数据库类型Database
数据库模式Schema
这下应该不会有歧义了。
https://github.com/TommyLemon/APIAuto/blob/master/README.md#%E9%83%A8%E7%BD%B2%E6%96%B9%E6%B3%95

@selfuppen
Copy link

借楼。
请问生成文档的功能,只有在后台是APIJSON 的项目才可以是吧。

@TommyLemon
Copy link
Collaborator

TommyLemon commented Nov 5, 2022

数据库类型Database

对,如果业务项目没有用 APIJSON ,那就单独为 APIAuto 部署一个 APIJSONBoot

@selfuppen
Copy link

数据库类型Database

对,如果业务项目没有用 APIJSON ,那就单独为 APIAuto 部署一个 APIJSONBoot

了解。
那生成的文档,可是说只是对新部署的APIJSONBoot 后台接口的“释义”。对原接口其实的说明其实没有关系对吧。(不妨碍本项目的牛逼。)
个人觉得项目说明可以稍微特别注明一下,可能容易造成误解。

感谢解答。

@TommyLemon
Copy link
Collaborator

数据库类型Database

对,如果业务项目没有用 APIJSON ,那就单独为 APIAuto 部署一个 APIJSONBoot

了解。 那生成的文档,可是说只是对新部署的APIJSONBoot 后台接口的“释义”。对原接口其实的说明其实没有关系对吧。(不妨碍本项目的牛逼。) 个人觉得项目说明可以稍微特别注明一下,可能容易造成误解。

感谢解答。

“原接口” 是指什么?

@selfuppen
Copy link

selfuppen commented Nov 28, 2022

数据库类型Database

对,如果业务项目没有用 APIJSON ,那就单独为 APIAuto 部署一个 APIJSONBoot

了解。 那生成的文档,可是说只是对新部署的APIJSONBoot 后台接口的“释义”。对原接口其实的说明其实没有关系对吧。(不妨碍本项目的牛逼。) 个人觉得项目说明可以稍微特别注明一下,可能容易造成误解。
感谢解答。

“原接口” 是指什么?

"对,如果业务项目没有用 APIJSON ,那就单独为 APIAuto 部署一个 APIJSONBoot"
原接口指在使用 APIAuto 作为ORM框架的之前就存在的老接口。

@TommyLemon
Copy link
Collaborator

数据库类型Database

对,如果业务项目没有用 APIJSON ,那就单独为 APIAuto 部署一个 APIJSONBoot

了解。 那生成的文档,可是说只是对新部署的APIJSONBoot 后台接口的“释义”。对原接口其实的说明其实没有关系对吧。(不妨碍本项目的牛逼。) 个人觉得项目说明可以稍微特别注明一下,可能容易造成误解。
感谢解答。

“原接口” 是指什么?

"对,如果业务项目没有用 APIJSON ,那就单独为 APIAuto 部署一个 APIJSONBoot" 原接口指在使用 APIAuto 作为ORM框架的之前就存在的老接口。

APIAuto 不是 ORM 库,是接口工具。APIJSON 才是 ORM 库。
引入 APIJSON 不影响原接口,可以结合使用。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants