项目作者: ForteScarlet

项目描述 :
a springboot starter for component-cqhttp
高级语言: Java
项目地址: git://github.com/ForteScarlet/simple-robot-component-cqhttp-springboot-starter.git
创建时间: 2020-03-27T13:49:04Z
项目社区:https://github.com/ForteScarlet/simple-robot-component-cqhttp-springboot-starter

开源协议:Apache License 2.0

下载


CQ HTTP组件 Springboot快速启动器

img


codebeat badge

项目地址

Github or Gitee

使用

首先,引入依赖;

https://search.maven.org/artifact/io.github.ForteScarlet.simple-robot/component-cqhttp-spring-boot-starter

Maven

  1. <dependency>
  2. <groupId>io.github.ForteScarlet.simple-robot</groupId>
  3. <artifactId>component-cqhttp-spring-boot-starter</artifactId>
  4. <version>${version}</version>
  5. </dependency>

Gradle

  1. implementation 'io.github.ForteScarlet.simple-robot:component-cqhttp-spring-boot-starter:${version}'

然后编写好配置类(与Springboot公用一个application.properties配置类)
配置编好后在启动类上使用@SimpleRobotSpringBootApplication代替@SpringbootApplication注解,并启动Springboot即可。

  1. @SimpleRobotSpringBootApplication
  2. public class TestApplication {
  3. public static void main(String[] args) {
  4. SpringApplication.run(Test1.class, args);
  5. }
  6. }

其中,@SimpleRobotSpringBootApplication核心启动器所提供的,如果切换官方启动器,理论上不需要变更代码。

1.9.1之后,不再需要更替启动注解了。像往常一样即可。

  1. @SpringBootApplication
  2. public class RunApplication {
  3. public static void main(String[] args) {
  4. SpringApplication.run(RunApplication.class, args);
  5. }
  6. }

核心启动器

每一个组件启动器中一般来说都包含一个核心启动器。

正常情况下,你无需手动导入此坐标。

核心启动器的坐标为:

仓库地址:https://search.maven.org/artifact/io.github.ForteScarlet.simple-robot/core-spring-boot-starter

  1. <dependency>
  2. <groupId>io.github.ForteScarlet.simple-robot</groupId>
  3. <artifactId>core-spring-boot-starter</artifactId>
  4. <version>${version}</version>
  5. </dependency>

但是,假如:组件启动器的版本为1.9.1,而前缀同为1.9的核心启动器的最新一个版本是1.9.2,那么你可以选择手动导入这个更新一个版本的核心来升级内部的核心启动器。

其他链接

快速启动器的Demo项目

https://github.com/ForteScarlet/simple-robot-demo-cqhttp-sbstarter

核心

https://github.com/ForteScarlet/simple-robot-core

CQ HTTP组件

https://github.com/ForteScarlet/simple-robot-component-coolHttpApi

核心Springboot启动器

https://github.com/ForteScarlet/simple-robot-core-springboot-starter

更新日志

查看UPDATE.md文件