# opennessapi **Repository Path**: kun_gege/opennessapi ## Basic Information - **Project Name**: opennessapi - **Description**: 开放api平台构建 - **Primary Language**: Unknown - **License**: GPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-10-17 - **Last Updated**: 2023-10-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 简介 这个平台的目的是通过api接口查询的方式来执行sql语句,并预览出数据,不需要专业的数据库工作者或者开发人员,只需要我们为操作程序就可以实现 零基础的人也可以轻松的查询到数据库的数据。减少了人力成本的开销。 ## 技术选型 ### 1. 前端 | 名称 | 描述 | 地址 | |-------------|----------|-------| | Vue | 前端快速开发框架 | | | ElementPlus | Ui组件库 | | ### 2. 后端 | 名称 | 描述 | 地址 | |--------------------|-----------| -------- | | SpringBoot | 快速开发框架 | | | SpringCloud | 微服务解决方案 | | | SpringCloud Aibaba | 注册中心,配置中心 | | | Mysql | 持久化 | | | Redis | 分布式缓存 | | ### 3.数据库设计 ```mysql -- 接口组 create table api_group( group_id varchar(64) not null primary key auto_increment comment '组ID' , group_name varchar(255) not null comment '组名称', group_path varchar(64) not null comment '组对应的path', create_time datetime comment '创建时间', update_time datetime comment '修改时间', create_by varchar(32) comment '创建人', update_by varchar(32) comment '修改人' ); -- 组对应的接口 create table group_api( api_id varchar(64) not null primary key auto_increment comment '接口ID' , api_name varchar(255) not null comment '接口名称', api_remark varchar(255) not null comment '接口描述', api_type tinyint(1) not null comment '接口操作类型, [sql,库表]', api_url varchar(64) not null comment '接口对应的路径', api_state tinyint(1) not null comment '接口状态 0 上线 1 下线', api_request_type tinyint(1) not null comment '接口类型 0 get 1 post 2 put 3 delete', api_request_data_type tinyint(1) not null comment '接口数据类型,post[表单,json] get[路径参数]', api_request_params text not null comment '接口对应的请求参数 json [head,输入]参数', api_response_result text not null comment '接口对应的响应参数 json [节点,输出] 参数', group_id varchar(64) not null comment '关联组ID', create_time datetime comment '创建时间', update_time datetime comment '修改时间', create_by varchar(32) comment '创建人', update_by varchar(32) comment '修改人' ); /* 路径重写 /test/queryOne Rewrite /business/query */ create table dy_route( route_id varchar(64) not null primary key comment '路由ID', route text not null comment '路由规则', create_time datetime comment '创建时间', update_time datetime comment '修改时间', create_by varchar(32) comment '创建人', update_by varchar(32) comment '修改人' ); ``` ```text 在创建左侧接口组的同时 调用创建路由 执行我们新建的这个api 会通过路由的重写机制转发到一个固定的处理业务的接口 执行http://localhost:8080/api/test 路由到 http://localhost:8081/business ```