bird-java 项目使用教程

bird-java 项目使用教程

bird-javabird-java是以Spring Boot为基础的开发增强组件包。项目地址:https://gitcode.com/gh_mirrors/bi/bird-java

1. 项目的目录结构及介绍

bird-java
├── bird-core
├── bird-dependencies
├── bird-eventbus
├── bird-lock
├── bird-service-support
├── bird-statemachine
├── bird-trace
├── bird-web-file
├── bird-web-sso
├── bird-web-support
├── bird-websocket-support
├── gitignore
├── LICENSE
├── README.md
├── build.bat
├── deploy.bat
└── pom.xml
  • bird-core: 核心模块,包含项目的基础功能。
  • bird-dependencies: 依赖管理模块,统一管理项目的依赖。
  • bird-eventbus: 事件总线模块,支持RocketMQ、Kafka、RabbitMQ。
  • bird-lock: 分布式锁模块,统一抽象 Redis 分布式锁适配。
  • bird-service-support: 服务支持模块,提供服务层开发指南。
  • bird-statemachine: 状态机模块,自研状态机,支持分布式环境。
  • bird-trace: 执行链路追踪模块,提供 Trace 功能。
  • bird-web-file: 文件上传模块。
  • bird-web-sso: 单点登录模块。
  • bird-web-support: Web 支持模块。
  • bird-websocket-support: WebSocket 支持模块。
  • gitignore: Git 忽略文件配置。
  • LICENSE: 项目许可证。
  • README.md: 项目说明文档。
  • build.bat: 构建脚本。
  • deploy.bat: 部署脚本。
  • pom.xml: Maven 项目配置文件。

2. 项目的启动文件介绍

项目的启动文件通常位于 bird-corebird-web-support 模块中。以下是一个典型的启动类示例:

package com.example.bird;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class BirdApplication {
    public static void main(String[] args) {
        SpringApplication.run(BirdApplication.class, args);
    }
}
  • @SpringBootApplication: 这是一个组合注解,包含了 @Configuration@EnableAutoConfiguration@ComponentScan,用于启动 Spring Boot 应用程序。

3. 项目的配置文件介绍

项目的配置文件通常位于 src/main/resources 目录下,以下是一些常见的配置文件:

  • application.properties: 主要的配置文件,包含数据库连接、服务器端口等配置。
server.port=8080
spring.datasource.url=jdbc:mysql://localhost:3306/bird
spring.datasource.username=root
spring.datasource.password=123456
  • application-dev.properties: 开发环境配置文件,通常包含开发环境的特定配置。
logging.level.root=DEBUG
  • application-prod.properties: 生产环境配置文件,通常包含生产环境的特定配置。
logging.level.root=INFO
  • logback.xml: 日志配置文件,用于配置日志输出格式和级别。
<configuration>
    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss} %-5level %logger{36} - %msg%n</pattern>
        </encoder>
    </appender>

    <root level="info">
        <appender-ref ref="STDOUT" />
    </root>
</configuration>

通过以上配置文件,可以灵活地调整项目的运行环境和行为。

bird-javabird-java是以Spring Boot为基础的开发增强组件包。项目地址:https://gitcode.com/gh_mirrors/bi/bird-java

  • 3
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

邵娇湘

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值