magic-api數據庫存儲方案

建表語句

drop table if exists magic_api_file;
CREATE TABLE `magic_api_file` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `file_path` varchar(512) NOT NULL,
  `file_content` mediumtext,
  PRIMARY KEY (`id`) USING BTREE,
  UNIQUE KEY `magic_api_file_file_path_IDX` (`file_path`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4

導入接口數據到這個表後,點擊右上角刷新按鈕即可!!!

INSERT INTO magic_api_file (file_path,file_content) VALUES 
('/magic-api/api/','this is directory')
,('/magic-api/api/a/','this is directory')
,('/magic-api/api/a/group.json','{
  "properties" : { },
  "id" : "f344e4858ed54c37a825d32742c60a96",
  "name" : "a",
  "type" : "api",
  "parentId" : "0",
  "path" : null,
  "createTime" : 1673841678851,
  "updateTime" : null,
  "createBy" : null,
  "updateBy" : null,
  "paths" : [ ],
  "options" : [ ]
}')
,('/magic-api/api/a/hello.ms','{
  "properties" : { },
  "id" : "00cab53619f244168e44fa59137eb3fc",
  "script" : null,
  "groupId" : "f344e4858ed54c37a825d32742c60a96",
  "name" : "hello",
  "createTime" : 1673841689882,
  "updateTime" : null,
  "lock" : null,
  "createBy" : null,
  "updateBy" : null,
  "path" : "hello",
  "method" : "GET",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : null,
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
return ''Hello magic-api''')
,('/magic-api/datasource/','this is directory')
,('/magic-api/function/','this is directory')
;

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章