Code Monkey home page Code Monkey logo

jt-framework's Introduction

jt-framework

Jt-808协议服务端。

Docs

ChangeLog

⭐ New Features

  • MsgHandler 可选择性地交给Spring管理,以便于在 MsgHandler 中调用其他的由Spring管理的Bean
  • Jt808SessionManager 重构,支持自定义

🐞 Bug Fixes

  • hylexus#16
    • 默认读写空闲时间改为20分钟
    • 修复示例代码中消息消息的返回值类型
  • hylexus#17
    • 边界情况下默认转义逻辑bug
  • SessionManager#removeBySessionIdAndClose 的bug

🔨 Others

  • 优化 Session#currentFlowId
  • 新增 SessionManager#findBySessionId
  • CommandSender 文档完善

QuickStart

1. 创建工程

创建一个空的 spring-boot 工程。

2. 添加依赖

引入为 808协议 提供的 spring-boot-starter

  • gradle
dependencies {
	// ...
	implementation group: 'io.github.hylexus.jt', name: 'jt-808-server-spring-boot-stater', version: "1.0.6-RELEASE"
    // ...
}
  • maven
<dependency>
    <groupId>io.github.hylexus.jt</groupId>
    <artifactId>jt-808-server-spring-boot-stater</artifactId>
    <version>1.0.6-RELEASE</version>
</dependency>

3. 配置

  • application.yml
jt808:
  print-component-statistics: true
logging:
  level: info
  level.io.github.hylexus: debug
  • @EnableJt808ServerAutoConfig 启用自动配置
@SpringBootApplication
// 启用自动配置
@EnableJt808ServerAutoConfig
public class Jt808ServerSampleBareApplication {

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

}

Features

  • 注解驱动开发
    • 基于注解的请求消息映射
    • 基于注解的Handler,参数自动注入
    • 基于注解的响应消息映射
    • 基于注解的消息下发
  • 支持消息下发
  • 定制化
    • BytesEncoder:自定义转义逻辑
    • RequestMsgDispatcher:自定义 MsgDispatcher
    • RequestMsgQueue:自定义 MsgQueue,内置基于 Google-EventBus 的 MsgQueue
    • RequestMsgQueueListener:自定义 MsgQueueListener,内置基于 Google-EventBus 的 MsgQueueListener
    • ResponseMsgBodyConverter:自定义消息转换器
    • HandlerMethodArgumentResolver:自定义参数解析器,类似于SpringMVC的 HandlerMethodArgumentResolver
    • ……

Building from Source

请事先安装 Lombok 插件。

  • Mac/Linux/Unix-Based System
./gradlew clean build
  • Windows
./gradlew.bat clean build

Modules

.
├── build-script    # gradle用到的构建脚本和checkstyle配置
├── docs            # 文档 (vue-press)
├── gradle
├── jt-808-server-spring-boot-stater
├── jt-808-server-support
├── jt-core
├── jt-spring
└── samples         # 示例项目
    ├── jt-808-server-sample-bare           # 几乎零配置的示例
    ├── jt-808-server-sample-annotation     # 注解相关的示例
    └── jt-808-server-sample-customized     # 定制化示例

Reporting Issues

  • GitHub提交Issue
  • QQ交流群 : 1072477383

Community

QQ交流群

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.