2
2
3
3
uliweb-apijson is a subset and slightly different variation of[ apijson] ( https://github.com/TommyLemon/APIJSON/blob/master/Document.md )
4
4
5
+ #Difference with original apijson
6
+
7
+ | feature| apijson(java)| uliweb-apijson| comment|
8
+ | --------| -------------| --------------| ------------------------------------------------------------|
9
+ | @combine | ✔️| ✖️| Example: "@combine ":"&key0,&key1,\| key2,key3"|
10
+ | @expr | ✖️| ✔️| Example: "@expr ":[[ "username$","&","email$"] ,"&",[ "!","nickname$"]] |
11
+
12
+
13
+
5
14
#apijson model configuration
6
15
7
16
##example
@@ -13,9 +22,16 @@ user = {
13
22
"secret_fields" : ["password"],
14
23
"GET" : { "roles" : ["ADMIN","OWNER"] },
15
24
"HEAD" : { "roles" : ["ADMIN","OWNER"] },
16
- "POST" : { "roles" : ["ADMIN","OWNER" ] },
25
+ "POST" : { "roles" : ["ADMIN"] },
17
26
"PUT" : { "roles" : ["ADMIN","OWNER"] },
18
- "DELETE" : { "roles" : ["ADMIN","OWNER"] },
27
+ "DELETE" : { "roles" : ["ADMIN"] },
28
+ }
29
+ usergroup = {
30
+ "GET" : { "roles" : ["ADMIN","LOGIN"] },
31
+ "HEAD" : { "roles" : ["ADMIN"] },
32
+ "POST" : { "roles" : ["ADMIN"] },
33
+ "PUT" : { "roles" : ["ADMIN"] },
34
+ "DELETE" : { "roles" : ["ADMIN"] },
19
35
}
20
36
```
21
37
@@ -58,6 +74,48 @@ request types currently support: POST, PUT
58
74
59
75
request configuration currently support: ADD,DISALLOW,NECESSARY (still not fully support[ all the configuration items] ( https://github.com/TommyLemon/APIJSON/wiki#%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86 ) )
60
76
77
+ #apijson table configuration
78
+
79
+ ##example
80
+
81
+ ```
82
+ [APIJSON_TABLES]
83
+ roles = {
84
+ "@model_name" : "role",
85
+ "editable" : "auto",
86
+ "table_fields" : [
87
+ {"title":"#","key":"id","width":80,"component":"id"},
88
+ {"title":"Name","key":"name","component":"name_link"},
89
+ {"title":"Description","key":"description"},
90
+ {"title":"Is reserved","key":"reserve","component":"checkbox"},
91
+ ],
92
+ "viewedit_fields" : [
93
+ {"title":"#","key":"id","editable":False},
94
+ {"title":"Name","key":"name"},
95
+ {"title":"Description","key":"description"},
96
+ {"title":"Is reserved","key":"reserve","component":"checkbox"},
97
+ ],
98
+ "add_fields" : [
99
+ {"title":"Name","key":"name"},
100
+ {"title":"Description","key":"description"},
101
+ {"title":"Is reserved","key":"reserve","component":"checkbox"},
102
+ ],
103
+ }
104
+ ```
105
+
106
+ ##document
107
+
108
+ Provide 2 vue component about table:
109
+
110
+ | | apijson-table| apijson-viewedit|
111
+ | -----------------------| ------------------------------------------------------------| ------------------------------------------------------------|
112
+ | uliweb template include| {{include "vue/inc_apijson_table.html"}}| {{include "vue/inc_apijson_viewedit.html"}}|
113
+ | example:| ``` <apijson-table model_name="permission" :config="tconfig" :custom_tcolumns_render_generator="custom_tcolumns_render_generator" ref="table"></apijson-table> ``` | ``` <apijson-viewedit model_name="permission" request_tag="{{=request_tag}}" :id="id_" :config="tconfig"></apijson-viewedit> ``` |
114
+
115
+
116
+
117
+
118
+
61
119
62
120
#Supported API Examples
63
121