接口

12114

接口总览

_resource结构

  1. CREATE TABLE `_resource` (
  2. `id` int(11) NOT NULL AUTO_INCREMENT,
  3. `accessControlTable` varchar(255) DEFAULT NULL COMMENT '数据规则控制表',
  4. `resourceHook` text COMMENT '[ "before": {"service": "xx", "serviceFunction": "xxx"}, "after": [] }',
  5. `pageId` varchar(255) DEFAULT NULL COMMENT 'page id; E.g: index',
  6. `actionId` varchar(255) DEFAULT NULL COMMENT 'action id; E.g: selectXXXByXXX',
  7. `desc` varchar(255) DEFAULT NULL COMMENT '描述',
  8. `resourceType` varchar(255) DEFAULT NULL COMMENT 'resource 类型; E.g: auth service sql',
  9. `appDataSchema` text COMMENT 'appData 参数校验',
  10. `resourceData` text COMMENT 'resource 数据; { "service": "auth", "serviceFunction": "passwordLogin" } or { "table": "${tableName}", "action": "select", "whereCondition": ".where(function() {this.whereNot( { recordStatus: \\"active\\" })})" }',
  11. `requestDemo` text COMMENT '请求Demo',
  12. `responseDemo` text COMMENT '响应Demo',
  13. `operation` varchar(255) DEFAULT 'insert' COMMENT '操作; insert, update, jhInsert, jhUpdate, jhDelete jhRestore',
  14. `operationByUserId` varchar(255) DEFAULT NULL COMMENT '操作者userId',
  15. `operationByUser` varchar(255) DEFAULT NULL COMMENT '操作者用户名',
  16. `operationAt` varchar(255) DEFAULT NULL COMMENT '操作时间; E.g: 2021-05-28T10:24:54+08:00 ',
  17. PRIMARY KEY (`id`) USING BTREE
  18. ) ENGINE = InnoDB AUTO_INCREMENT = 444 DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_bin COMMENT = '请求资源表; 软删除未启用; resourceId=`${appId}.${pageId}.${actionId}`'

_resource 内容

id desc pageId actionId resourceType resourceHook resourceData
231 ✅登陆 login passwordLogin service { "service": "user", "serviceFunction": "passwordLogin" }
251 ✅登出 allPage logout service { "service": "user", "serviceFunction": "logout" }
253 ✅获取用户信息 allPage userInfo service { "service": "user", "serviceFunction": "userInfo" }
258 ✅查询常量 allPage getConstantList sql { "table": "_constant", "operation": "select" }
439 ✅查询列表 calendarManagement selectItemList sql { "table": "calendar", "operation": "select" }
440 ✅添加 calendarManagement insertItem sql {
  1. "before": [{
  2. "service": "calendar", "serviceFunction": "fillInsertItemParamsBeforeHook"
  3. }]

} | { "table": "calendar", "operation": "insert" } |
| 441 | ✅更新 | calendarManagement | updateItem | sql | | { "table": "calendar", "operation": "jhUpdate" } |
| 442 | ✅删除 | calendarManagement | deleteItem | sql | | { "table": "calendar", "operation": "jhDelete" } |
| 443 | ✅查询列表 | calendarEventView | selectItemList | sql | | { "table": "calendar", "operation": "select" } |

_resource语句

  1. INSERT INTO _resource (id, accessControlTable, resourceHook, pageId, actionId, desc, resourceType, appDataSchema, resourceData, requestDemo, responseDemo, operation, operationByUserId, operationByUser, operationAt) VALUES (231, NULL, NULL, 'login', 'passwordLogin', '✅登陆', 'service', '{}', '{ "service": "user", "serviceFunction": "passwordLogin" }', '', '', 'insert', NULL, NULL, NULL);
  2. INSERT INTO _resource (id, accessControlTable, resourceHook, pageId, actionId, desc, resourceType, appDataSchema, resourceData, requestDemo, responseDemo, operation, operationByUserId, operationByUser, operationAt) VALUES (251, NULL, NULL, 'allPage', 'logout', '✅登出', 'service', '{}', '{ "service": "user", "serviceFunction": "logout" }', '', '', 'insert', NULL, NULL, NULL);
  3. INSERT INTO _resource (id, accessControlTable, resourceHook, pageId, actionId, desc, resourceType, appDataSchema, resourceData, requestDemo, responseDemo, operation, operationByUserId, operationByUser, operationAt) VALUES (253, NULL, NULL, 'allPage', 'userInfo', '✅获取用户信息', 'service', '{}', '{ "service": "user", "serviceFunction": "userInfo" }', '', '', 'insert', NULL, NULL, NULL);
  4. INSERT INTO _resource (id, accessControlTable, resourceHook, pageId, actionId, desc, resourceType, appDataSchema, resourceData, requestDemo, responseDemo, operation, operationByUserId, operationByUser, operationAt) VALUES (258, NULL, NULL, 'allPage', 'getConstantList', '✅查询常量', 'sql', '{}', '{ "table": "_constant", "operation": "select" }', '', '', 'insert', NULL, NULL, NULL);
  5. INSERT INTO _resource (id, accessControlTable, resourceHook, pageId, actionId, desc, resourceType, appDataSchema, resourceData, requestDemo, responseDemo, operation, operationByUserId, operationByUser, operationAt) VALUES (439, NULL, NULL, 'calendarManagement', 'selectItemList', '✅查询列表', 'sql', '{}', '{ "table": "calendar", "operation": "select" }', NULL, NULL, 'insert', NULL, NULL, NULL);
  6. INSERT INTO _resource (id, accessControlTable, resourceHook, pageId, actionId, desc, resourceType, appDataSchema, resourceData, requestDemo, responseDemo, operation, operationByUserId, operationByUser, operationAt) VALUES (440, NULL, '{
  7. "before": [{
  8. "service": "calendar", "serviceFunction": "fillInsertItemParamsBeforeHook"
  9. }]
  10. }', 'calendarManagement', 'insertItem', '✅添加', 'sql', '{}', '{ "table": "calendar", "operation": "insert" }', NULL, NULL, 'insert', NULL, NULL, NULL);
  11. INSERT INTO _resource (id, accessControlTable, resourceHook, pageId, actionId, desc, resourceType, appDataSchema, resourceData, requestDemo, responseDemo, operation, operationByUserId, operationByUser, operationAt) VALUES (441, NULL, NULL, 'calendarManagement', 'updateItem', '✅更新', 'sql', '{}', '{ "table": "calendar", "operation": "jhUpdate" }', NULL, NULL, 'insert', NULL, NULL, NULL);
  12. INSERT INTO _resource (id, accessControlTable, resourceHook, pageId, actionId, desc, resourceType, appDataSchema, resourceData, requestDemo, responseDemo, operation, operationByUserId, operationByUser, operationAt) VALUES (442, NULL, NULL, 'calendarManagement', 'deleteItem', '✅删除', 'sql', '{}', '{ "table": "calendar", "operation": "jhDelete" }', NULL, NULL, 'insert', NULL, NULL, NULL);
  13. INSERT INTO _resource (id, accessControlTable, resourceHook, pageId, actionId, desc, resourceType, appDataSchema, resourceData, requestDemo, responseDemo, operation, operationByUserId, operationByUser, operationAt) VALUES (443, NULL, NULL, 'calendarEventView', 'selectItemList', '✅查询列表', 'sql', '{}', '{ "table": "calendar", "operation": "select" }', NULL, NULL, 'insert', NULL, NULL, NULL);