实战项目-快速实战-springboot dataway

news/2024/9/16 13:40:37/ 标签: 实战项目, 快速开始, dataway, 源码

最后附项目源码, 开箱即用

访问地址

http://127.0.0.1:8101/interface-ui/#/

效果图

具体怎么用, 大家还是看官网,中文文档
https://www.dataql.net/docs/dataway/ui/ui-list
在这里插入图片描述

项目结构

在这里插入图片描述

代码

DataWayApplication

package com.zero.dataway;import net.hasor.spring.boot.EnableHasor;
import net.hasor.spring.boot.EnableHasorWeb;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;@EnableHasor
@EnableHasorWeb
@SpringBootApplication(scanBasePackages = {"com.zero.hasor"})
public class DataWayApplication {public static void main(String[] args) {SpringApplication.run(DataWayApplication.class, args);}
}

HasorModule

package com.zero.hasor;import net.hasor.core.ApiBinder;
import net.hasor.core.DimModule;
import net.hasor.db.JdbcModule;
import net.hasor.db.Level;
import net.hasor.spring.SpringModule;
import org.springframework.stereotype.Component;import javax.annotation.Resource;
import javax.sql.DataSource;@DimModule
@Component
public class HasorModule implements SpringModule {@Resourceprivate DataSource dataSource;@Overridepublic void loadModule (ApiBinder apiBinder) throws Throwable {apiBinder.installModule(new JdbcModule(Level.Full, this.dataSource));}
}

application.yml

#
server:port: 8101
spring:application:name: dataway-demodatasource:url: jdbc:mysql://localhost:3306/test?characterEncoding=utf-8&useSSL=falseusername: rootpassword: rootdriver-class-name: com.mysql.jdbc.Drivertype: com.alibaba.druid.pool.DruidDataSource# druiddruid:initial-size: 3min-idle: 3max-active: 10max-wait: 60000stat-view-servlet:login-username: adminlogin-password: adminfilter:stat:log-slow-sql: trueslow-sql-millis: 1# 是否启用 Dataway 功能(必选:默认false)
HASOR_DATAQL_DATAWAY: true
# 是否开启 Dataway 后台管理界面(必选:默认false)
HASOR_DATAQL_DATAWAY_ADMIN: true
# dataway  API工作路径(可选,默认:/api/)
HASOR_DATAQL_DATAWAY_API_URL: /api/
# dataway-ui 的工作路径(可选,默认:/interface-ui/)
HASOR_DATAQL_DATAWAY_UI_URL: /interface-ui/
# SQL执行器方言设置(可选,建议设置)
HASOR_DATAQL_FX_PAGE_DIALECT: mysql

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.zero</groupId><artifactId>dataway-demo</artifactId><version>0.0.1</version><properties><maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target></properties><parent><groupId>org.springframework.boot</groupId><version>2.2.7.RELEASE</version><artifactId>spring-boot-starter-parent</artifactId></parent><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><version>2.2.12.RELEASE</version></dependency><dependency><groupId>net.hasor</groupId><artifactId>hasor-spring</artifactId><version>4.1.6</version></dependency><dependency><groupId>net.hasor</groupId><artifactId>hasor-dataway</artifactId><version>4.1.6</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.49</version></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jdbc</artifactId></dependency><dependency><groupId>com.alibaba</groupId><artifactId>druid-spring-boot-starter</artifactId><version>1.2.2</version></dependency></dependencies></project>

初始化脚本

# select * from interface_info;/*访问地址http://127.0.0.1:8101/interface-ui/#/
*/-- auto-generated definition
create table interface_info
(api_id          int auto_increment comment 'ID'primary key,api_method      varchar(12)  not null comment 'HttpMethod:GET、PUT、POST',api_path        varchar(512) not null comment '拦截路径',api_status      varchar(4)   not null comment '状态:-1-删除, 0-草稿,1-发布,2-有变更,3-禁用',api_comment     varchar(255) not null comment '注释',api_type        varchar(24)  not null comment '脚本类型:SQL、DataQL',api_script      mediumtext   not null comment '查询脚本:xxxxxxx',api_schema      mediumtext   not null comment '接口的请求/响应数据结构',api_sample      mediumtext   not null comment '请求/响应/请求头样本数据',api_option      mediumtext   not null comment '扩展配置信息',api_create_time varchar(32)  not null comment '创建时间',api_gmt_time    varchar(32)  not null comment '修改时间',constraint uk_interface_infounique (api_path)
)comment 'Dataway 中的API';-- auto-generated definition
create table interface_release
(pub_id           int auto_increment comment 'Publish ID'primary key,pub_api_id       varchar(64)  not null comment '所属API ID',pub_method       varchar(12)  not null comment 'HttpMethod:GET、PUT、POST',pub_path         varchar(512) not null comment '拦截路径',pub_status       varchar(4)   not null comment '状态:-1-删除, 0-草稿,1-发布,2-有变更,3-禁用',pub_comment      varchar(255) null comment '注释',pub_type         varchar(24)  not null comment '脚本类型:SQL、DataQL',pub_script       mediumtext   not null comment '查询脚本:xxxxxxx',pub_script_ori   mediumtext   not null comment '原始查询脚本,仅当类型为SQL时不同',pub_schema       mediumtext   not null comment '接口的请求/响应数据结构',pub_sample       mediumtext   not null comment '请求/响应/请求头样本数据',pub_option       mediumtext   not null comment '扩展配置信息',pub_release_time varchar(32)  not null comment '发布时间(下线不更新)'
)comment 'Dataway API 发布历史。';create index idx_interface_release_apion interface_release (pub_api_id);create index idx_interface_release_pathon interface_release (pub_path);

项目源码

【金山文档 | WPS云文档】 dataway-demo
https://kdocs.cn/l/cm2uYUv7cKXO


http://www.ppmy.cn/news/1522150.html

相关文章

JS面试真题 part1

JS面试真题 part1 1、说说JavaScript中的数据类型&#xff0c;储存上的差别2、说说你了解的js数据结构3、DOM常见的操作有哪些4、说说你对BOM的理解&#xff0c;常见的BOM对象你了解哪些5、 和 区别&#xff0c;分别在什么情况使用 1、说说JavaScript中的数据类型&#xff0c;…

ceph-iscsi 手动安装过程中的一些问题记录以及解决办法

ceph-iscsi 手动安装教程 安装教程&#xff0c;建议直接看官方文档&#xff0c;猛戳传送门。官方教程是英文版的&#xff08;不知道有没有中文版&#xff09;&#xff0c;都是一些基础英语&#xff0c;问题不大&#xff0c;实在不行找个翻译软件帮帮忙&#xff0c;哈哈哈。 多…

换工作环境后, 开发环境速更步骤

防火墙问题已经解决, windows和linux已经可以链接了 右键PowerShell 关闭所有防火墙: netsh advfirewall set allprofiles state off开启所有防火墙: netsh advfirewall set allprofiles state on两种方案, 网卡, 按照文档, 全一致, 配置, 使用网线 网线,两个 路由器, 直接拉…

【Linux】Linux常用命令80条(含完整命令语句)

【Linux】Linux常用命令80条&#xff08;含完整命令语句&#xff09; 整理一些Linux指令方便大家查阅使用。以下是一些常用的 Linux 命令&#xff1a; 1. 文件和目录操作 ls&#xff1a;列出当前目录中的文件和子目录 lspwd&#xff1a;显示当前工作目录的路径 pwdcd&#xff…

[yolov5] --- yolov5入门实战「土堆视频」

1 项目介绍及环境配置 下载yolov5 tags 5.0源码&#xff0c;https://github.com/ultralytics/yolov5/tree/v5.0&#xff0c;解压 Pycharm 中创建conda虚拟环境 激活conda虚拟环境 根据作者提供的requirements.txt文件&#xff0c;pip install -r requirements.txt 如果作者没有…

pycharm如何安装插件,以及pycharm里面的Python Interpreter(Python解释器)的用途

一、Pycharm如何安转插件 在pycharm下面的plugins可以安装插件&#xff0c;比如图所示&#xff0c;可以安装一个Translation的插件&#xff0c;可以进行翻译。 提示&#xff1a;如果你现在已经打开某个项目了&#xff0c;想要回到图一所展示的界面改怎么做 操作如图2:File>…

如何打造高校实验室教学管理系统?Java SpringBoot助力,MySQL存储优化,2025届必备设计指南

✍✍计算机编程指导师 ⭐⭐个人介绍&#xff1a;自己非常喜欢研究技术问题&#xff01;专业做Java、Python、微信小程序、安卓、大数据、爬虫、Golang、大屏等实战项目。 ⛽⛽实战项目&#xff1a;有源码或者技术上的问题欢迎在评论区一起讨论交流&#xff01; ⚡⚡ Java实战 |…

WebGIS面试题(第九期)

坐标系&#xff1a; 文章目录 **坐标系&#xff1a;**1、如何使用ArcGIS进行GIS坐标系转换&#xff1f;2、Cesium中的Cartesian3坐标系的原点在哪里&#xff1f;它的轴是如何定义的&#xff1f;3、如何在Cesium中使用矩阵进行坐标系转换。4、在Cesium中&#xff0c;如何将屏幕坐…

轻松升级:Ollama + OpenWebUI 安装与配置【AIStarter】

Ollama是一个开源项目&#xff0c;用于构建和训练大规模语言模型&#xff0c;而OpenWebUI则提供了一个方便的前端界面来管理和监控这些模型。本文将指导你如何更新这两个工具&#xff0c;并顺利完成配置。 准备工作 确保你的系统已安装Git和Python环境。安装必要的依赖库&…

自用NAS系列1-设备

拾光坞 拾光坞多账号绑定青龙面板SMBWebdav小雅alist下载到NASDocker安装迅雷功能利用qBittorrentEEJackett打造一站式下载工具安装jackett插件 外网访问内网拾光客户端拾光穿透公网ipv6路由器配置ipv6拾光坞公网验证拾光坞域名验证 拾光坞 多账号绑定 手机注册拾光坞账号&am…

Day 10

232. 用栈实现队列 class MyQueue { private:stack<int> in_stack, out_stack;void in2out(){while (!in_stack.empty()){out_stack.push(in_stack.top());in_stack.pop();}} public:MyQueue(){}void push(int x){in_stack.push(x);}int pop(){if (out_stack.empty()){i…

java导出Excel接口

需求&#xff1a;需要实现一个导出的接口&#xff0c;点导出同时导出5个Excel表格&#xff0c;五种表格的数据筛选不同数据 public String export(MarketReceiveVo query) {Date winApprovalStartDate query.getWinApprovalStartDate();Date winApprovalEndDate query.getWin…

软件工程-图书管理系统的需求分析

软件需求规格说明书 目录 软件需求规格说明书 一、引言 1.1编写目的 1.2背景 1.3定义 1.4参考资料 二、任务概述 2.1目标 2.2用户特点 2.3假定和约束 三、需求规定 3.1功能划分 3.1.1系统功能组成 3.1.2功能编号和优先级 3.2功能描述 3.3性能 3.4输入输出 …

【Git 学习笔记_24】Git 使用冷门操作技巧(四)——更多实用 git 别名设置、交互式新增提交

文章目录 11.8 更多别名设置别名1&#xff1a;只查看当前分支&#xff08;git b&#xff09;别名2&#xff1a;以图表形式显示自定义格式的 git 日志&#xff08;git graph&#xff09;别名3&#xff1a;查看由于合并分支导致的冲突后仍有冲突的、待合并的文件列表&#xff08;…

spring,spring_mybatis集成

Spring概述 Spring 是一个轻量级的,IOC 和 AOP 的一站式 Java 开发框架&#xff0c;是为了简化企 业级应用开发而生的。&#xff08;整个后端框架进行管理&#xff09; Ioc 即 Inversion of Control&#xff08;控制反转 把创建对象的控制权反转给sring框架&#xff09;&…

《CounTR: Transformer-based Generalised Visual Counting》CVPR2023

摘要 本论文考虑了通用视觉对象计数问题&#xff0c;目标是开发一个计算模型&#xff0c;用于计算任意语义类别的对象数量&#xff0c;使用任意数量的“样本”&#xff08;即可能为零样本或少样本计数&#xff09;。作者提出了一个新颖的基于Transformer的架构&#xff0c;称为…

ELK学习笔记(二)——使用K8S部署Kibana8.15.0

上篇文章我们完成了&#xff0c;ES的集群部署&#xff0c;如果还没有看过上篇文章的兄弟&#xff0c;可以去看看。 ELK学习笔记&#xff08;一&#xff09;——使用K8S部署ElasticSearch8.15.0集群 话不多说&#xff0c;接下来直接进入kibana的搭建 一、下载镜像 #1、下载官方…

Echarts中国地图省市区县三级联动

NodeV14.20.0安装 # 历史版本Node下载地址 https://nodejs.org/en/download/prebuilt-installer# NodeV14.20.0配置与部署 https://nodejs.org/dist/v14.20.0/node-v14.20.0-x64.msi构建默认Vue3工程目录 npm install -g vue/cli --registryhttps://registry.npm.taobao.org …

综合案例-数据可视化-折线图

一、json数据格式 1.1 json数据格式的定义与功能 json是一种轻量级的数据交互格式&#xff0c;可以按照json指定的格式去组织和封装数据&#xff0c;json数据格式本质上是一个带有特定格式的字符串。 功能&#xff1a;json就是一种在各个编程语言中流通的数据格式&#xff0…

常用排序算法(上)

目录 前言&#xff1a; 1.排序的概念及其运用 1.1排序的概念 1.2排序运用 1.3 常见的排序算法 2.常见排序算法的实现 2.1 堆排序 2.1 1 向下调整算法 2.1 2 建堆 2.1 3 排序 2.2 插入排序 2.1.1基本思想&#xff1a; 2.1.2直接插入排序&#xff1a; 2.1.3 插…