dataway使用

跟大家分享一个开源工具,Dataway 是基于 DataQL 服务聚合能力,为应用提供的一个接口配置工具。使得使用者无需开发任何代码就配置一个满足需求的接口。整个接口配置、测试、冒烟、发布。一站式都通过 Dataway 提供的 UI 界面完成。UI 会以 Jar 包方式提供并集成到应用中并和应用共享同一个 http 端口,应用无需单独为 Dataway 开辟新的管理端口。

这种内嵌集成方式模式的优点是,可以使得大部分老项目都可以在无侵入的情况下直接应用 Dataway。进而改进老项目的迭代效率,大大减少企业项目研发成本。

Dataway 工具化的提供 DataQL 配置能力。这种研发模式的变革使得,相当多的需求开发场景只需要配置即可完成交付。从而避免了从数据存取到前端接口之间的一系列开发任务,例如:Mapper、BO、VO、DO、DAO、Service、Controller 统统不在需要。

Dataway 是 Hasor 生态中的一员,因此在 Spring 中使用 Dataway 首先要做的就是打通两个生态。根据官方文档中推荐的方式我们将 Hasor 和 Spring Boot 整合起来

第一步:引入相关jar包

<dependency>
            <groupId>net.hasor</groupId>
            <artifactId>hasor-dataway</artifactId>
            <version>${hasor.version}</version>
        </dependency>
        <dependency>
            <groupId>net.hasor</groupId>
            <artifactId>hasor-spring</artifactId>
            <version>${hasor.version}</version>
        </dependency>

第二步:配置打他way,初始化数据表

# 是否启用 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

Dataway 需要两个数据表才能工作,下面是这两个数据表的简表语句:

CREATE TABLE `interface_info` (
    `api_id`          int(11)      NOT NULL AUTO_INCREMENT   COMMENT 'ID',
    `api_method`      varchar(12)  NOT NULL                  COMMENT 'HttpMethod:GET、PUT、POST',
    `api_path`        varchar(512) NOT NULL                  COMMENT '拦截路径',
    `api_status`      int(2)       NOT NULL                  COMMENT '状态:0草稿,1发布,2有变更,3禁用',
    `api_comment`     varchar(255)     NULL                  COMMENT '注释',
    `api_type`        varchar(24)  NOT NULL                  COMMENT '脚本类型:SQL、DataQL',
    `api_script`      mediumtext   NOT NULL                  COMMENT '查询脚本:xxxxxxx',
    `api_schema`      mediumtext       NULL                  COMMENT '接口的请求/响应数据结构',
    `api_sample`      mediumtext       NULL                  COMMENT '请求/响应/请求头样本数据',
    `api_option`      mediumtext       NULL                  COMMENT '扩展配置信息',
    `api_create_time` datetime     DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `api_gmt_time`    datetime     DEFAULT CURRENT_TIMESTAMP COMMENT '修改时间',
    PRIMARY KEY (`api_id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 COMMENT='Dataway 中的API';

CREATE TABLE `interface_release` (
    `pub_id`          int(11)      NOT NULL AUTO_INCREMENT   COMMENT 'Publish ID',
    `pub_api_id`      int(11)      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`      int(2)       NOT NULL                  COMMENT '状态:0有效,1无效(可能被下线)',
    `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       NULL                  COMMENT '接口的请求/响应数据结构',
    `pub_sample`      mediumtext       NULL                  COMMENT '请求/响应/请求头样本数据',
    `pub_option`      mediumtext       NULL                  COMMENT '扩展配置信息',
    `pub_release_time`datetime     DEFAULT CURRENT_TIMESTAMP COMMENT '发布时间(下线不更新)',
    PRIMARY KEY (`pub_id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 COMMENT='Dataway API 发布历史。';

create index idx_interface_release on interface_release (pub_api_id);

第三步:配置数据源

<dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.2.2</version>
        </dependency>

        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
        </dependency>

springboot配置文件增加数据源配置

server.port=8080
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://172.16.10.105:3306/test_dataway?serverTimezone=UTC&useUnicode=true&characterEncoding=utf-8
spring.datasource.username=root
spring.datasource.password=jiaojun
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
spring.datasource.initialSize=5
spring.datasource.minIdle=5
spring.datasource.maxActive=20
spring.datasource.maxWait=60000
spring.datasource.timeBetweenEvictionRunsMillis=60000
spring.datasource.minEvictableIdleTimeMillis=300000
spring.datasource.validationQuery=SELECT 1 FROM DUAL
spring.datasource.testWhileIdle=true
spring.datasource.testOnBorrow=false
spring.datasource.testOnReturn=false
spring.datasource.poolPreparedStatements=true
spring.datasource.filters=stat,wall
spring.datasource.maxPoolPreparedStatementPerConnectionSize=20
spring.datasource.useGlobalDataSourceStat=true
spring.datasource.connectionProperties=druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500

第四部:将数据源设置到Hasor容器中

@DimModule
@Component
public class DatawayModule implements SpringModule {

    private DataSource dataSource;

    public DatawayModule(DataSource dataSource) {
        this.dataSource = dataSource;
    }

    @Override
    public void loadModule(ApiBinder apiBinder) throws Throwable {
        apiBinder.installModule(new JdbcModule(Level.Full, this.dataSource));

       // apiBinder.bindSpiListener(LoginPerformChainSpi.class, AuthLoginPerformChainSpi.class);
    }

     第五步:在SprintBoot 中启用 Hasor

@EnableHasor()    // 在Spring 中启用 Hasor
@EnableHasorWeb() // 将 hasor-web 配置到 Spring 环境中,Dataway 的 UI 是通过 hasor-web 提供服务。
@SpringBootApplication
public class DatawayApplication {

    public static void main(String[] args) {
        SpringApplication.run(DatawayApplication.class, args);
    }

第六步:启动应用测试

/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/bin/java -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:55083,suspend=y,server=n -XX:TieredStopAtLevel=1 -noverify -Dspring.output.ansi.enabled=always -Dcom.sun.management.jmxremote -Dspring.jmx.enabled=true -Dspring.liveBeansView.mbeanDomain -Dspring.application.admin.enabled=true -javaagent:/Users/xiejie/Library/Caches/JetBrains/IntelliJIdea2021.3/captureAgent/debugger-agent.jar -Dfile.encoding=UTF-8 -classpath /Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/cat.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/charsets.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext/cldrdata.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext/crs-agent.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext/dnsns.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext/jaccess.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext/legacy8ujsse.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext/localedata.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext/nashorn.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext/openjsse.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext/sunec.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext/sunjce_provider.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext/sunpkcs11.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/ext/zipfs.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/jce.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/jfr.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/jsse.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/management-agent.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/resources.jar:/Library/Java/JavaVirtualMachines/zulu-8.jdk/Contents/Home/jre/lib/rt.jar:/Users/xiejie/IdeaProjects/dataway-demo/target/classes:/Users/xiejie/.m2/repository/org/springframework/boot/spring-boot-starter-web/2.4.1/spring-boot-starter-web-2.4.1.jar:/Users/xiejie/.m2/repository/org/springframework/boot/spring-boot-starter/2.4.1/spring-boot-starter-2.4.1.jar:/Users/xiejie/.m2/repository/org/springframework/boot/spring-boot/2.4.1/spring-boot-2.4.1.jar:/Users/xiejie/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.4.1/spring-boot-autoconfigure-2.4.1.jar:/Users/xiejie/.m2/repository/jakarta/annotation/jakarta.annotation-api/1.3.5/jakarta.annotation-api-1.3.5.jar:/Users/xiejie/.m2/repository/org/springframework/spring-core/5.3.2/spring-core-5.3.2.jar:/Users/xiejie/.m2/repository/org/springframework/spring-jcl/5.3.2/spring-jcl-5.3.2.jar:/Users/xiejie/.m2/repository/org/yaml/snakeyaml/1.27/snakeyaml-1.27.jar:/Users/xiejie/.m2/repository/org/springframework/boot/spring-boot-starter-json/2.4.1/spring-boot-starter-json-2.4.1.jar:/Users/xiejie/.m2/repository/com/fasterxml/jackson/core/jackson-databind/2.11.3/jackson-databind-2.11.3.jar:/Users/xiejie/.m2/repository/com/fasterxml/jackson/core/jackson-annotations/2.11.3/jackson-annotations-2.11.3.jar:/Users/xiejie/.m2/repository/com/fasterxml/jackson/core/jackson-core/2.11.3/jackson-core-2.11.3.jar:/Users/xiejie/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jdk8/2.11.3/jackson-datatype-jdk8-2.11.3.jar:/Users/xiejie/.m2/repository/com/fasterxml/jackson/datatype/jackson-datatype-jsr310/2.11.3/jackson-datatype-jsr310-2.11.3.jar:/Users/xiejie/.m2/repository/com/fasterxml/jackson/module/jackson-module-parameter-names/2.11.3/jackson-module-parameter-names-2.11.3.jar:/Users/xiejie/.m2/repository/org/springframework/boot/spring-boot-starter-tomcat/2.4.1/spring-boot-starter-tomcat-2.4.1.jar:/Users/xiejie/.m2/repository/org/apache/tomcat/embed/tomcat-embed-core/9.0.41/tomcat-embed-core-9.0.41.jar:/Users/xiejie/.m2/repository/org/glassfish/jakarta.el/3.0.3/jakarta.el-3.0.3.jar:/Users/xiejie/.m2/repository/org/apache/tomcat/embed/tomcat-embed-websocket/9.0.41/tomcat-embed-websocket-9.0.41.jar:/Users/xiejie/.m2/repository/org/springframework/spring-web/5.3.2/spring-web-5.3.2.jar:/Users/xiejie/.m2/repository/org/springframework/spring-beans/5.3.2/spring-beans-5.3.2.jar:/Users/xiejie/.m2/repository/org/springframework/spring-webmvc/5.3.2/spring-webmvc-5.3.2.jar:/Users/xiejie/.m2/repository/org/springframework/spring-aop/5.3.2/spring-aop-5.3.2.jar:/Users/xiejie/.m2/repository/org/springframework/spring-context/5.3.2/spring-context-5.3.2.jar:/Users/xiejie/.m2/repository/org/springframework/spring-expression/5.3.2/spring-expression-5.3.2.jar:/Users/xiejie/.m2/repository/net/hasor/hasor-dataway/4.2.5/hasor-dataway-4.2.5.jar:/Users/xiejie/.m2/repository/net/hasor/hasor-web/4.2.5/hasor-web-4.2.5.jar:/Users/xiejie/.m2/repository/net/hasor/hasor-db/4.2.5/hasor-db-4.2.5.jar:/Users/xiejie/.m2/repository/org/slf4j/slf4j-api/1.7.30/slf4j-api-1.7.30.jar:/Users/xiejie/.m2/repository/net/hasor/hasor-commons/4.2.5/hasor-commons-4.2.5.jar:/Users/xiejie/.m2/repository/net/hasor/hasor-dataql/4.2.5/hasor-dataql-4.2.5.jar:/Users/xiejie/.m2/repository/org/antlr/antlr4-runtime/4.7.2/antlr4-runtime-4.7.2.jar:/Users/xiejie/.m2/repository/net/hasor/hasor-dataql-fx/4.2.5/hasor-dataql-fx-4.2.5.jar:/Users/xiejie/.m2/repository/com/alibaba/fastjson/1.2.67/fastjson-1.2.67.jar:/Users/xiejie/.m2/repository/net/hasor/hasor-spring/4.2.5/hasor-spring-4.2.5.jar:/Users/xiejie/.m2/repository/net/hasor/hasor-core/4.2.5/hasor-core-4.2.5.jar:/Users/xiejie/.m2/repository/com/alibaba/druid/1.2.2/druid-1.2.2.jar:/Users/xiejie/.m2/repository/mysql/mysql-connector-java/8.0.22/mysql-connector-java-8.0.22.jar:/Users/xiejie/.m2/repository/org/springframework/boot/spring-boot-starter-log4j2/2.4.1/spring-boot-starter-log4j2-2.4.1.jar:/Users/xiejie/.m2/repository/org/apache/logging/log4j/log4j-slf4j-impl/2.13.3/log4j-slf4j-impl-2.13.3.jar:/Users/xiejie/.m2/repository/org/apache/logging/log4j/log4j-api/2.13.3/log4j-api-2.13.3.jar:/Users/xiejie/.m2/repository/org/apache/logging/log4j/log4j-core/2.13.3/log4j-core-2.13.3.jar:/Users/xiejie/.m2/repository/org/apache/logging/log4j/log4j-jul/2.13.3/log4j-jul-2.13.3.jar:/Users/xiejie/.m2/repository/org/slf4j/jul-to-slf4j/1.7.30/jul-to-slf4j-1.7.30.jar:/Users/xiejie/.m2/repository/org/projectlombok/lombok/1.18.16/lombok-1.18.16.jar:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar com.geostar.yyq.DatawayApplication
Connected to the target VM, address: '127.0.0.1:55083', transport: 'socket'

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.4.1)

01:56:21.751 [main] INFO  com.geostar.yyq.DatawayApplication - Starting DatawayApplication using Java 1.8.0_322 on xiejiedeMacBook-Pro.local with PID 12356 (/Users/xiejie/IdeaProjects/dataway-demo/target/classes started by xiejie in /Users/xiejie/IdeaProjects/dataway-demo)
01:56:21.759 [main] INFO  com.geostar.yyq.DatawayApplication - No active profile set, falling back to default profiles: default
01:56:23.090 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 10520 (http)
01:56:23.100 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-10520"]
01:56:23.101 [main] INFO  org.apache.catalina.core.StandardService - Starting service [Tomcat]
01:56:23.101 [main] INFO  org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.41]
01:56:23.149 [main] INFO  org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
01:56:23.150 [main] INFO  org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 1248 ms
01:56:26.247 [main] INFO  net.hasor.spring.boot.BasicHasorConfiguration - 
 _    _                        ____              _
| |  | |                      |  _ \            | |
| |__| | __ _ ___  ___  _ __  | |_) | ___   ___ | |_
|  __  |/ _` / __|/ _ \| '__| |  _ < / _ \ / _ \| __|
| |  | | (_| \__ \ (_) | |    | |_) | (_) | (_) | |_
|_|  |_|\__,_|___/\___/|_|    |____/ \___/ \___/ \__|

01:56:26.257 [main] INFO  net.hasor.core.Hasor - runMode at Full ,runPath at /Users/xiejie/IdeaProjects/dataway-demo
01:56:26.261 [main] INFO  net.hasor.core.setting.StandardContextSettings - addConfig '/META-INF/hasor-framework/db-hconfig.xml' in 'jar:file:/Users/xiejie/.m2/repository/net/hasor/hasor-db/4.2.5/hasor-db-4.2.5.jar!/META-INF/hasor.schemas'
01:56:26.262 [main] INFO  net.hasor.core.setting.StandardContextSettings - addConfig '/META-INF/hasor-framework/dataql-hconfig.xml' in 'jar:file:/Users/xiejie/.m2/repository/net/hasor/hasor-dataql/4.2.5/hasor-dataql-4.2.5.jar!/META-INF/hasor.schemas'
01:56:26.262 [main] INFO  net.hasor.core.setting.StandardContextSettings - addConfig '/META-INF/hasor-framework/dataway-hconfig.xml' in 'jar:file:/Users/xiejie/.m2/repository/net/hasor/hasor-dataway/4.2.5/hasor-dataway-4.2.5.jar!/META-INF/hasor.schemas'
01:56:26.262 [main] INFO  net.hasor.core.setting.StandardContextSettings - addConfig '/META-INF/hasor-framework/dataql-fx-hconfig.xml' in 'jar:file:/Users/xiejie/.m2/repository/net/hasor/hasor-dataql-fx/4.2.5/hasor-dataql-fx-4.2.5.jar!/META-INF/hasor.schemas'
01:56:26.263 [main] INFO  net.hasor.core.setting.StandardContextSettings - addConfig '/META-INF/hasor-framework/core-hconfig.xml' in 'jar:file:/Users/xiejie/.m2/repository/net/hasor/hasor-core/4.2.5/hasor-core-4.2.5.jar!/META-INF/hasor.schemas'
01:56:26.263 [main] INFO  net.hasor.core.setting.StandardContextSettings - addConfig '/META-INF/hasor-framework/web-hconfig.xml' in 'jar:file:/Users/xiejie/.m2/repository/net/hasor/hasor-web/4.2.5/hasor-web-4.2.5.jar!/META-INF/hasor.schemas'
01:56:26.306 [main] INFO  net.hasor.core.environment.AbstractEnvironment - loadPackages = com.*, net.*, net.hasor.*, net.hasor.dataql.*, net.hasor.dataql.fx.*, net.hasor.dataway.*, net.hasor.db.*, net.hasor.web.*, org.*
01:56:26.448 [main] INFO  net.hasor.core.context.TemplateAppContext - loadModule class net.hasor.dataway.config.DatawayModule
01:56:26.449 [main] INFO  net.hasor.dataway.config.DatawayModule - dataway '/api/docs/swagger2.json' is enable.
01:56:26.474 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[ea74f6eeaa6a45139585daf67032d47d] -> bindType 'class net.hasor.dataway.web.Swagger2Controller' mappingTo: '[/interface-ui/api/docs/swagger2.json]'.
01:56:26.475 [main] INFO  net.hasor.dataway.config.DatawayModule - dataway api workAt /api/
01:56:26.480 [main] INFO  net.hasor.dataway.config.DatawayModule - dataway admin workAt /interface-ui/
01:56:26.484 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[3e3eb6d236164574a2b18ac0fb79d938] -> bindType 'class net.hasor.dataway.web.GlobalConfigController' mappingTo: '[/interface-ui/api/global-config]'.
01:56:26.486 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[56131cca5cb54b2c9727600a36986b76] -> bindType 'class net.hasor.dataway.web.ApiDetailController' mappingTo: '[/interface-ui/api/api-detail]'.
01:56:26.487 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[e8e8ff47b85f407f92ca43650df535c5] -> bindType 'class net.hasor.dataway.web.ApiHistoryListController' mappingTo: '[/interface-ui/api/api-history]'.
01:56:26.488 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[38d8b47321bd49bca97376ba2dc48b4c] -> bindType 'class net.hasor.dataway.web.ApiInfoController' mappingTo: '[/interface-ui/api/api-info]'.
01:56:26.489 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[27a45ff8407b422e83e4ef2523d0decb] -> bindType 'class net.hasor.dataway.web.ApiListController' mappingTo: '[/interface-ui/api/api-list]'.
01:56:26.489 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[41cacf889ea5414b8de7308be2679786] -> bindType 'class net.hasor.dataway.web.ApiHistoryGetController' mappingTo: '[/interface-ui/api/get-history]'.
01:56:26.497 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[44951656c5c54e62abbdf0e8ab7f59f4] -> bindType 'class net.hasor.dataway.web.DisableController' mappingTo: '[/interface-ui/api/disable]'.
01:56:26.497 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[ad2b316dc7084d5c9041db99774bd8f2] -> bindType 'class net.hasor.dataway.web.SmokeController' mappingTo: '[/interface-ui/api/smoke]'.
01:56:26.498 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[0ff3acc78d84495da0cd6be84bc2cd5c] -> bindType 'class net.hasor.dataway.web.SaveApiController' mappingTo: '[/interface-ui/api/save-api]'.
01:56:26.500 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[f8f936c35b31407c936058d121ea8b3a] -> bindType 'class net.hasor.dataway.web.PublishController' mappingTo: '[/interface-ui/api/publish]'.
01:56:26.500 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[0a1e6d7d337b4c5396ab6acd930f0a18] -> bindType 'class net.hasor.dataway.web.PerformController' mappingTo: '[/interface-ui/api/perform]'.
01:56:26.501 [main] INFO  net.hasor.core.binder.ApiBinderWrap - mapingTo[23b1a24d1865404ead0f808c64458714] -> bindType 'class net.hasor.dataway.web.DeleteController' mappingTo: '[/interface-ui/api/delete]'.
01:56:26.506 [main] INFO  net.hasor.dataway.config.DatawayModule - use 'db' as the dataAccessLayer, provider = net.hasor.dataway.dal.providers.db.DataBaseApiDataAccessLayerCreator
01:56:26.508 [main] INFO  net.hasor.core.context.TemplateAppContext - loadModule class net.hasor.dataway.config.NacosDiscoveryModule
01:56:26.509 [main] INFO  net.hasor.dataway.config.NacosDiscoveryModule - nacos Discovery is disable.
01:56:26.509 [main] WARN  net.hasor.core.context.TemplateAppContext - loadModule class net.hasor.dataway.config.NacosDiscoveryModule ignore start/stop
01:56:26.509 [main] INFO  net.hasor.core.context.TemplateAppContext - loadModule class net.hasor.web.render.RenderWebPlugin
01:56:26.510 [main] INFO  net.hasor.core.context.TemplateAppContext - loadModule class net.hasor.core.exts.startup.StartupModule
01:56:26.511 [main] INFO  net.hasor.core.context.TemplateAppContext - loadModule class net.hasor.core.exts.aop.AopModule
01:56:26.513 [main] INFO  net.hasor.core.context.TemplateAppContext - loadModule class net.hasor.dataql.fx.FxModule
01:56:26.514 [main] INFO  net.hasor.dataql.fx.FxModule - bindFragment 'sql' to net.hasor.dataql.fx.db.runsql.SqlFragment
01:56:26.514 [main] INFO  net.hasor.dataql.fx.FxModule - bindFragment 'mybatis' to net.hasor.dataql.fx.db.likemybatis.MybatisFragment
01:56:26.514 [main] INFO  net.hasor.core.context.TemplateAppContext - loadModule class com.geostar.yyq.config.DatawayModule
01:56:26.515 [main] INFO  net.hasor.core.context.TemplateAppContext$1 - installModule ->net.hasor.db.JdbcModule@2d746ce4
01:56:26.521 [main] INFO  net.hasor.core.context.TemplateAppContext - loadModule class net.hasor.spring.boot.BasicHasorConfiguration$$Lambda$438/1687087217
01:56:26.546 [main] INFO  net.hasor.web.render.RenderInvokerFilter - RenderPlugin init -> useLayout=false, layoutPath=/layout, templatePath=/templates, placeholder=content_placeholder, defaultLayout=default.html
01:56:26.560 [main] INFO  net.hasor.dataway.config.InnerApiDalCreator - create 'net.hasor.dataway.dal.providers.db.DataBaseApiDataAccessLayerCreator'
01:56:27.314 [main] INFO  com.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited
01:56:27.318 [main] INFO  net.hasor.dataway.dal.providers.db.DataBaseApiDataAccessLayer - dataway dbType is mysql ,table names = interface_info, interface_release
01:56:27.329 [main] INFO  net.hasor.core.context.TemplateAppContext - Hasor StartCompleted!
01:56:27.336 [main] INFO  net.hasor.spring.boot.WebHasorConfiguration - @EnableHasorWeb -> filterPath=[/*], filterOrder='0', filterWorkAt='Controller'
01:56:27.377 [main] INFO  net.hasor.web.startup.RuntimeListener - ServletContext Attribut is net.hasor.core.AppContext
01:56:27.549 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.Swagger2Controller' mappingTo: '/interface-ui/api/docs/swagger2.json'.
01:56:27.549 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.GlobalConfigController' mappingTo: '/interface-ui/api/global-config'.
01:56:27.549 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.ApiDetailController' mappingTo: '/interface-ui/api/api-detail'.
01:56:27.549 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.ApiHistoryListController' mappingTo: '/interface-ui/api/api-history'.
01:56:27.549 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.ApiInfoController' mappingTo: '/interface-ui/api/api-info'.
01:56:27.549 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.ApiListController' mappingTo: '/interface-ui/api/api-list'.
01:56:27.549 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.ApiHistoryGetController' mappingTo: '/interface-ui/api/get-history'.
01:56:27.549 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.DisableController' mappingTo: '/interface-ui/api/disable'.
01:56:27.549 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.SmokeController' mappingTo: '/interface-ui/api/smoke'.
01:56:27.549 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.SaveApiController' mappingTo: '/interface-ui/api/save-api'.
01:56:27.549 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.PublishController' mappingTo: '/interface-ui/api/publish'.
01:56:27.549 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.PerformController' mappingTo: '/interface-ui/api/perform'.
01:56:27.550 [main] INFO  net.hasor.web.invoker.InvokerContext - mapingTo -> type 'class net.hasor.dataway.web.DeleteController' mappingTo: '/interface-ui/api/delete'.
01:56:27.556 [main] INFO  net.hasor.web.startup.RuntimeFilter - RuntimeFilter started, at Apache Tomcat/9.0.41
01:56:27.628 [main] INFO  org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService 'applicationTaskExecutor'
01:56:27.757 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-10520"]
01:56:27.777 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 10520 (http) with context path ''
01:56:27.792 [main] INFO  com.geostar.yyq.DatawayApplication - Started DatawayApplication in 6.447 seconds (JVM running for 8.532)

                                                                                                                                                                                                                                                                                                                                                                                                                                       

第七步:访问http://127.0.0.1:8080/interface-ui/,进入dataway操作后台

第八步:新建一个inteface,使用sql模式查询表数据

 完成。。打卡

想了解的小伙伴可以参考下面的文档链接:

Dataway 官方手册:https://www.hasor.net/web/dataway/about.html
Dataway 在 OSC 上的项目地址,欢迎收藏:https://www.oschina.net/p/dataway
DataQL 手册地址:https://www.hasor.net/web/dataql/what_is_dataql.html
Hasor 项目的首页:https://www.hasor.net/web/index.html        

要登录Dataway,您可以按照以下步骤进行操作: 1. 在ruoyi-admin模块下的application.yml或者application.properties配置文件中,启用Dataway功能。您可以在配置文件中添加以下内容: ``` # 启用Dataway功能(默认不启用) HASOR_DATAQL_DATAWAY: true ``` 2. 在启动类中开启Hasor。您可以在启动类上添加`@EnableHasor`注解。 3. 访问Dataway登录页面。默认情况下,Dataway的登录页面地址为`/api/interface-ui/`。您可以在配置文件中配置ui的工作路径,确保该路径有效。例如: ``` # ui的工作路径,只有开启ui管理功能后才有效 HASOR_DATAQL_DATAWAY_UI_URL: /api/interface-ui/ ``` 4. 使用初始登录账号登录。您可以在Hasor Dataway的配置文件中找到初始登录账号信息。 请注意,为了确保生产环境的安全,您应该将`HASOR_DATAQL_DATAWAY_ADMIN`设置为`false`,以避免潜在的安全问题。 #### 引用[.reference_title] - *1* *2* [springboot整合hasor-dataway](https://blog.csdn.net/weixin_42402326/article/details/127449765)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [SpringBoot集成Hasor dataway,实现轻便数据查询接口](https://blog.csdn.net/weixin_44752033/article/details/115588348)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值