feat: add table

This commit is contained in:
jhonliu 2022-05-06 21:12:08 +08:00
parent bb5a97cff5
commit ef166ccc99
6 changed files with 74 additions and 73 deletions

View File

@ -53,6 +53,7 @@
"Amis",
"Konva",
"Thing",
"Table",
"Menu",
"Topic",
"Dashboard",

View File

@ -84,6 +84,10 @@ do_request(get_dlinkjson, #{<<"type">> := <<"swaggerTree">>}, _Context, _Req) ->
{ok, SwaggerTree} = dgiot_swagger:tree(),
{200, SwaggerTree};
do_request(get_dlinkjson, #{<<"type">> := <<"Table">>}, _Context, _Req) ->
{ok, Tables} = dgiot_parse:get_schemas(),
{200, Tables};
do_request(get_dlinkjson, #{<<"type">> := Type}, _Context, _Req) ->
DlinkJson = dgiot_utils:get_JsonFile(?MODULE, <<Type/binary, ".json">>),
{200, DlinkJson};

View File

@ -270,7 +270,6 @@
},
"/graphql": {
"post": {
"security": [],
"summary": "graphql",
"description": "graphql",
"parameters": [
@ -338,35 +337,6 @@
"Basic"
]
}
},
"/table": {
"get": {
"security": [],
"summary": "获取parse表名",
"description": "获取parse表名",
"parameters": [
],
"responses": {
"200": {
"description": "Returns operation status"
},
"400": {
"description": "Bad Request"
},
"401": {
"description": "Unauthorized"
},
"403": {
"description": "Forbidden"
},
"500": {
"description": "Server Internal error"
}
},
"tags": [
"Data"
]
}
}
}
}

View File

@ -6,18 +6,18 @@
}
],
"definitions": {
"Token":{
"type":"object",
"properties":{
"Token": {
"type": "object",
"properties": {
"appid": {
"description": "app secret",
"type": "string",
"example":"gEsTiaPAjv"
"example": "gEsTiaPAjv"
},
"secret": {
"description": "app secret",
"type": "string",
"example":"VzY0Mjc5NDQxNTg1ODI4NDk1MzYx"
"example": "VzY0Mjc5NDQxNTg1ODI4NDk1MzYx"
}
}
}
@ -125,27 +125,37 @@
"objectId": {
"description": "角色ID",
"type": "string",
"example":"tXcMOOJFA1"
"example": "tXcMOOJFA1"
},
"menus": {
"description": "菜单列表",
"type": "array",
"example":["项目管理","访问权限"]
"example": [
"项目管理",
"访问权限"
]
},
"roles": {
"description": "父角色列表",
"type": "array",
"example":["admin"]
"example": [
"admin"
]
},
"rules": {
"description": "API列表",
"type": "array",
"example":["GET_USERS_ID", "GET_USERS_ME"]
"example": [
"GET_USERS_ID",
"GET_USERS_ME"
]
},
"users": {
"description": "用户列表",
"type": "array",
"example":["test"]
"example": [
"test"
]
}
}
}
@ -225,27 +235,37 @@
"objectId": {
"description": "角色ID",
"type": "string",
"example":"tXcMOOJFA1"
"example": "tXcMOOJFA1"
},
"menus": {
"description": "菜单列表",
"type": "array",
"example":["项目管理","访问权限"]
"example": [
"项目管理",
"访问权限"
]
},
"roles": {
"description": "父角色列表",
"type": "array",
"example":["admin"]
"example": [
"admin"
]
},
"rules": {
"description": "API列表",
"type": "array",
"example":["GET_USERS_ID", "GET_USERS_ME"]
"example": [
"GET_USERS_ID",
"GET_USERS_ME"
]
},
"users": {
"description": "用户列表",
"type": "array",
"example":["test"]
"example": [
"test"
]
}
}
}
@ -287,27 +307,27 @@
"name": {
"description": "名称",
"type": "string",
"example":"dgiot"
"example": "dgiot"
},
"desc": {
"description": "描述",
"type": "string",
"example":"Project"
"example": "Project"
},
"parent": {
"description": "父亲ID",
"type": "string",
"example":"cBdwcIdp0n"
"example": "cBdwcIdp0n"
},
"depname": {
"description": "部门名称",
"type": "string",
"example":"运维部"
"example": "运维部"
},
"tempname": {
"description": "角色模版名称",
"type": "string",
"example":"pump模版"
"example": "pump模版"
}
}
}

View File

@ -6,18 +6,18 @@
}
],
"definitions": {
"Token":{
"type":"object",
"properties":{
"Token": {
"type": "object",
"properties": {
"appid": {
"description": "app secret",
"type": "string",
"example":"gEsTiaPAjv"
"example": "gEsTiaPAjv"
},
"secret": {
"description": "app secret",
"type": "string",
"example":"VzY0Mjc5NDQxNTg1ODI4NDk1MzYx"
"example": "VzY0Mjc5NDQxNTg1ODI4NDk1MzYx"
}
}
}
@ -42,12 +42,12 @@
"username": {
"required": true,
"type": "string",
"example":"username"
"example": "username"
},
"password": {
"required": true,
"type": "string",
"example":"password"
"example": "password"
}
}
}
@ -439,17 +439,25 @@
"userid": {
"description": "用户id",
"type": "string",
"example":"6H7kpYpIin"
"example": "6H7kpYpIin"
},
"delfilter": {
"description": "删除角色用户条件",
"type": "object",
"example":{"where":{"name":"test"}}
},
"addfilter": {
"delfilter": {
"description": "删除角色用户条件",
"type": "object",
"example": {
"where": {
"name": "test"
}
}
},
"addfilter": {
"description": "新增角色用户条件",
"type": "object",
"example":{"where":{"name":"test2"}}
"example": {
"where": {
"name": "test2"
}
}
}
}
}
@ -491,12 +499,16 @@
"userid": {
"description": "用户id",
"type": "string",
"example":"tnFJKWVOGY"
"example": "tnFJKWVOGY"
},
"filter": {
"description": "过滤条件eg: {\"where\":{\"name\":\"test\"}}",
"type": "object",
"example":{"where":{"name":"test"}}
"example": {
"where": {
"name": "test"
}
}
}
}
}

View File

@ -106,12 +106,6 @@ do_request(post_batch, Body, #{base_path := BasePath} = _Context, Req) ->
do_request(get_health, _Body, _Context, Req) ->
{200, #{<<"content-type">> => <<"text/plain">>}, <<"ok">>, Req};
%% OperationId:get_table
%% :GET /iotapi/table
do_request(get_table, _Args, _Context, _Req) ->
io:format("~s ~p ~p ~n",[?FILE, ?LINE,_Args]),
dgiot_parse:get_schemas();
%% API接口
do_request(_OperationId, _Args, _Context, _Req) ->
?LOG(debug, "_Args ~p", [_Args]),