4 Star 7 Fork 3

慕容小草 / acp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

Application Construction Platform (acp)

Maven central Spring Boot Spring Cloud Spring Cloud Alibaba Kotlin Jvm Gradle License Security Status

v2023.0.1.0 版本更新日志
  • Application Construction Platform 应用构建平台
  • 该项目是用Kotlin和Java语言混编封装的脚手架。本人会密切关注业界最新动态,并使用最新技术持续更新优化。
  • 使用该脚手架可快速搭建基于Kotlin或Java语言的普通应用、SpringBoot应用和SpringCloud应用。
  • v2021.0.1.0 开始,版本号命名规范改变,前三位大版本号与所使用的SpringCloud版本号一致,第三位小版本号迭代更新,同时将发布至Maven Central
  • v2021.0.4.3 开始,仅支持java 11版本,不再提供java 1.8版本
    • tips: 如需java 1.8版本,自行下载源码编译,project.properties中修改为javaVersion=1.8
  • v2022.0.0.0 开始,最低要求java 17版本
  • v2022.0.4.x 最后一个版本为2022.0.4.6,不再有2022.0.5.x版本,之前的2022.0.5.0-Mx 预览版内容已全部合并进入2022.0.4.6

版本对应关系

Acp Spring Cloud Spring Boot Alibaba Spring Boot JVM New features
2023.0.1.x 2023.0.1 2023.0.0.0 3.2.x 17+
  • acp-core-common去除xml配置基类BaseXml
2023.0.0.x 2023.0.0 2023.0.0.0 3.2.x 17+
  • RestClient替换RestTemplate
  • hc5替换OKHttp
2022.0.4.6 2022.0.4 2022.0.0.0 3.1.x 17+
  • 新增WebSocket服务端与客户端
  • 动态热更新定时任务
2022.0.4.1~5 2022.0.4 2022.0.0.0 3.1.x 17+
  • 新增国密SM2/SM3/SM4
  • 优化加解密工具类
2022.0.3.x 2022.0.3 2022.0.0.0 3.1.x 17+
  • 调整工程结构
  • 重写自定义异常处理
  • 兼容WebFlux
2022.0.2.x 2022.0.2 2022.0.0.0-RC2 3.1.x 17+
  • xml支持
  • 新增acp-spring-cloud-starter-resource-server
2022.0.1.x 2022.0.1 2022.0.0.0-RC1 3.0.x 17+
2021.0.5.x 2021.0.5 2021.0.4.x 2.7.x 1.8+
2021.0.4.x 2021.0.4 2021.0.4.x 2.7.x 1.8+
2021.0.3.x 2021.0.3 2021.0.1.x 2.7.x 1.8+
2021.0.2.x 2021.0.2 2021.0.1.x 2.6.x 1.8+
2021.0.1.x 2021.0.1 2021.0.1.x 2.6.x 1.8+
6.7.x 2020.0.4 2.2.x.RELEASE 2.5.x 1.8+
6.6.x 2020.0.3 2.2.x.RELEASE 2.5.x 1.8+
6.5.x 2020.0.0~2020.0.2 2.2.x.RELEASE 2.4.x 1.8+

技术栈

  • joda-time
  • netty
  • hibernate
  • jackson
  • poi
  • freemarker
  • flying-saucer-pdf-itext5
  • knife4j
  • junit5
  • spring-boot
    • spring-boot-starter-webflux
    • spring-boot-starter-undertow
    • spring-boot-starter-actuator
    • spring-boot-starter-validation
    • spring-boot-starter-aop
    • spring-boot-starter-websocket
    • spring-boot-starter-security
    • spring-boot-starter-data-jpa
    • spring-boot-starter-data-redis
    • spring-boot-starter-data-redis-reactive
    • spring-boot-starter-oauth2-resource-server
    • spring-boot-starter-oauth2-authorization-server
  • spring-boot-admin-server
  • spring-cloud-alibaba
    • spring-cloud-starter-alibaba-nacos-discovery
    • spring-cloud-starter-alibaba-nacos-config
    • spring-cloud-starter-alibaba-sentinel
    • sentinel-datasource-nacos
  • spring-cloud
    • spring-cloud-starter-loadbalancer
    • spring-cloud-starter-gateway
    • spring-cloud-starter-stream-kafka
    • spring-cloud-stream-binder-kafka-streams
    • spring-cloud-starter-bus-kafka
    • spring-cloud-starter-openfeign
  • feign-hc5

一、环境要求及开发语言

  • java 17+
  • gradle 7.5+
  • kotlin 1.6+

二、gradle 脚本配置及使用

(一)配置文件

1.gradle/dependencies.gradle

定义外部依赖版本号

2.gradle/globalTask.gradle

全局自定义任务配置,适用于顶层项目

3.gradle/commonTask.gradle

公共自定义任务配置,适用于所有项目模块

4.gradle/publish.gradle

发布任务配置,适用于所有项目模块

5.settings.gradle

定义项目/模块结构

6.project.properties

gradle全局参数:

  • gradleVersion:gradle版本号
  • group:对应打包时的最外层groupid,最终的groupid还会加上模块路径,例如groupid.acp
  • version:版本号
  • encoding:编译字符集
  • mavenCentralUrl:maven中央仓库地址
  • javaVersion:jdk版本号
4.build.gradle

公共构建脚本

5.模块根路径/build.gradle

单个模块特有的构建脚本

(二)自定义任务

  • 全局自定义任务
    • publishAll 发布所有构建至maven中央仓库,linux系统适用
    • publishToMavenLocalAll 发布所有构建至maven本地仓库,linux系统适用
  • 公共自定义任务
    • clearPj 清理所有输出文件
    • release 编译、打包并输出
      • 如需编译打包对应环境,命令中使用参数 active,例如
      gradlew project:release -Pactive=test

(三)发布至maven仓库

1、发布至本地仓库
  • 执行 publishToMavenLocal 任务
    • publishToMavenLocalAll
2、发布至私服
  • 项目根路径下创建 gradle.properties 并添加如下参数(参数值根据实际情况修改)
mavenUploadUrlRelease=https://maven.com/repositories/releases/
mavenUploadUrlSnapshot=https://maven.com/repositories/snapshot/
mavenUserName=username
mavenPassword=password
  • 执行 publish 任务
    • publishAll
3、发布至中央仓库
  • 项目根路径下创建 gradle.properties 并添加如下参数(参数值根据实际情况修改)
mavenUploadUrlRelease=https://maven.com/repositories/releases/
mavenUploadUrlSnapshot=https://maven.com/repositories/snapshot/
mavenUserName=username
mavenPassword=password
signing.keyId=shortId
signing.password=keyPassword
signing.secretKeyRingFile=keyFile
  • 执行 publish 任务
    • publishAll

(四)升级命令

gradlew wrapper --gradle-distribution-url=https://mirrors.cloud.tencent.com/gradle/gradle-8.6-all.zip

三、工程说明

  • 工程结构
acp                     -------工程根目录,root模块
├─ acp-dependency       -------dependency 模块
├─ doc                  -------文档
├─ gradle               -------gradle脚本
├─ modules              -------子模块路径
│    ├─ core            -------核心模块
│    ├─ spring-boot     -------spring boot 适配模块
│    └─ spring-cloud    -------spring cloud 适配模块
└─ test                 -------测试模块根目录
     ├─ cloud           -------spring cloud 测试模块
     ├─ testkotlin      -------Kotlin 测试模块
     └─ testspringboot  -------spring boot 测试模块
  • api document url : /doc.html

四、开发 SpringBoot 应用

引入 acp 下相应模块包,使用 acp-dependency 进行版本管理,例如:

dependencyManagement {
    imports {
        mavenBom("io.gitee.zhangbinhub.acp:acp-dependency:version")
    }
}

(一)模块说明

1. acp-core-common
  • 核心包
  • 封装了常用工具类,配置文件解析(xml、properties)、加解密算法、线程池、定时任务、四则运算、字符串处理
2. acp-core-packet
  • 通讯打解包组件
  • 依赖 acp-core-common
  • 封装了http数据包、iso8583报文、xml报文的打解包操作
3. acp-core-file
  • 文件处理组件包
  • 依赖 acp-core-common
  • 封装了excel、pdf、word、html、freemarker模板文件的读写转换等操作
4. acp-spring-boot-starter
  • springboot 应用扩展组件

  • 依赖 acp-core-packet

  • 在 springboot 基础上整合大量底层功能,扩展支持 tcp、udp 等协议服务端配置;同时封装定时任务

  • 提供一个 Spring Boot 的InfoContributor,例如: curl http://localhost:8080/actuator/info

    {
      "acp": {
        "version": "version no"
      }
    }
6. acp-spring-boot-starter-ftp
  • springboot 应用扩展组件
  • 依赖 acp-spring-boot-starter
  • 扩展支持 ftp、sftp 等协议服务端自动配置
测试模块
1. test/testspringboot
  • 依赖boot:acp-spring-boot-starterboot:acp-spring-boot-starter-ftp
  • java语言开发demo
  • 提供简单的http、tcp、udp、ftp等开发demo
  • 提供spring data jpa多数据源demo
2. test/testreactive
  • 依赖boot:acp-spring-boot-starter
  • 基于webflux的demo
3. test/testskotlin
  • 依赖boot:acp-spring-boot-starter
  • kotlin语言开发demo

(二)快速开发 springboot 应用

全局说明
  • 统一注入 io.gitee.zhangbinhub.acp.boot.interfaces.LogAdapter 进行日志记录
1. 开发说明
  • (1)参考 test/testspringboot
  • (2)依赖 acp-spring-boot-starter
  • (3)src/main/java/resources 中增加配置文件(测试配置文件在 src/test/resources)config 下的文件和 acp.properties 为选用
  • (4)yml配置文件中增加数据源配置(单数据源或多数据源),数据库操作遵循 spring-data-jpa 标准,使用 hibernate 进行实例化
  • (5)单数据源应用的话无需增加额外配置类,正常编写domain、repo、entity即可
  • (6)多数据源应用需要增加对应每个数据源的 Jpa 配置类,并创建对应数据源的 repo、entity 包,之后再在对应包中编写 repo 和 entity
  • (7)定时任务参考 test/testspringboot 模块 io.gitee.zhangbinhub.acp.test.application.task.Task1,继承 io.gitee.zhangbinhub.acp.boot.base.BaseSpringBootScheduledTask 类,并在 yml 配置文件中增加对应执行规则
  • (8)自定义系统初始化任务,新增任务类,继承 io.gitee.zhangbinhub.acp.boot.base.BaseInitialization 类
  • (9)自定义可控制监听器,新增监听器类,实现 io.gitee.zhangbinhub.acp.boot.interfaces.Listener 接口
  • (10)参考 test/testspringboot 模块,io.gitee.zhangbinhub.acp.test.application.test 包中有 tcp、udp 服务端开发demo,并在 application-dev.xml 中增加相应配置
  • (11)如有需要,可选择引入 acp-file、acp-message、acp-spring-boot-starter-ftp 等包
  • (12)开发TCP服务端:自定义报文处理Bean,继承io.gitee.zhangbinhub.acp.boot.socket.base.TcpServerHandle ;自定义粘包拆包解码器Bean,继承io.netty.handler.codec.ByteToMessageDecoder
  • (13)开发UDP服务端:自定义报文处理Bean,继承io.gitee.zhangbinhub.acp.boot.socket.base.UdpServerHandle

(14)开发TCP/UDP客户端:参考TestClient

  • (15)开发FTP服务端:自定义用户工厂Bean,实现io.gitee.zhangbinhub.acp.core.ftp.user.UserFactory

(16)开发FTP/SFTP客户端:参考TestClient

  • (17)默认是基于servlet的MVC模式,如需开发基于webflux的应用,启动方法设置webApplicationType即可,参考 test/testreactive
@SpringBootApplication
class TestReactiveApplication

fun main(args: Array<String>) {
    SpringApplication(TestReactiveApplication::class.java).apply {
        this.webApplicationType = WebApplicationType.REACTIVE
        this.run(*args)
    }
}
  • (18)基于servlet的应用,开发WebSocket服务端:自定义WebSocket Endpoint,继承io.gitee.zhangbinhub.acp.boot.websocket.servlet.AcpWebSocketServerServlet ;参考TestWebSocketServerServlet
  • (19)基于webflux的应用,开发WebSocket服务端:自定义WebSocket Endpoint,继承io.gitee.zhangbinhub.acp.boot.websocket.reactive.AcpWebSocketServerReactive ;参考TestWebSocketServerReactive
  • (20)基于servlet的应用,开发WebSocket客户端:自定义WebSocket Client,继承io.gitee.zhangbinhub.acp.boot.websocket.servlet.AcpWebSocketClient ;参考TestClient
  • (21)基于webflux的应用,开发WebSocket客户端:自定义WebSocket Client,继承io.gitee.zhangbinhub.acp.boot.websocket.reactive.AcpWebSocketClient ;参考TestClient
  • (22)自定义web异常处理
    • 自定义类实现接口io.gitee.zhangbinhub.acp.boot.exceptions.AcpWebExceptionHandler
    • 实现方法identify,用于判断指定的异常是否需要进行处理
    • 实现方法handle,将异常信息进行转换
    • 实现方法getOrder,设置异常处理类的调用顺序
    • 自定义类注册为Bean
2. 配置说明
  • 定制开发的 api 接口,开启文档
springdoc:
  api-docs:
    enabled: true
  • 配置定时任务
acp:
  schedule:
    cron:
      task1: 0 0/1 * * * ?

key-value 形式(可配置多个),其中 task1 为任务的 beanName;0 0/1 * * * ? 为定时执行规则cron表达式。

  • 输出 controller 日志
acp:
  controller-log:
    enabled: true        #是否开启controller日志输出,默认true
    no-log-uri-regular:
      - /oauth/.*        #不进行日志输出的 url 正则表达式,可配置多个
  • tcp 服务端
acp:
  tcp-server:
    listeners:
      - name: testSocket             #监听服务名称
        enabled: true                #是否启用,默认false
        keepAlive: false             #是否为长连接,默认false;TCP服务有效
        readerIdleTime: 10000        #读等待时间单位毫秒,默认10000;TCP服务有效
        writerIdleTime: 0            #写等待时间单位毫秒,默认0;TCP服务有效
        idleTime: 0                  #连接进入空闲状态的等待时间单位毫秒,默认0;TCP服务有效
        messageDecoder: ""           #粘包拆包解码器类全限定名称,默认不设置;TCP服务有效
        threadNumber: 100            #接收报文处理的最大线程数,为0或不设置则使用系统默认线程数;TCP服务有效
        hex: false                   #接收报文是否是十六进制机器码,默认false
        port: 9999                   #监听端口号
        handleBean: testTcpHandle    #报文接收处理 Bean 的 Name
        responsible: true            #报文是否需要进行原路响应,默认true
        charset: gbk                 #服务使用字符集,为空或不设置则系统默认字符集
  • udp 服务端
acp:
  udp-server:
    listeners:
      - name: testSocket             #监听服务名称
        enabled: true                #是否启用,默认false
        hex: false                   #接收报文是否是十六进制机器码,默认false
        port: 9999                   #监听端口号
        handleBean: testUdpHandle    #报文接收处理 Bean 的 Name
        responsible: true            #报文是否需要进行原路响应,默认true
        charset: gbk
  • ftp 服务端
acp:
  ftp-server:
    listeners:
      - name: "测试ftp服务器"                                                 #服务名车鞥
        enabled: true                                                        #可空,是否启用,默认false
        port: 221                                                            #服务端口号
        pwd-encrypt-mode: MD5                                                #可空,用户密码加密方式(支持MD5、SHA1、SHA256),默认MD5
        login-failure-delay: 30                                              #可空,默认30
        max-login-failures: 20                                               #可空,默认20
        max-logins: 10                                                       #可空,默认10
        max-anonymous-logins: 20                                             #可空,默认20
        max-threads: 10                                                      #可空,默认10
        default-home-directory: "abs:D:\\个人\\测试ftp"                       #默认根路径
        anonymous-login-enabled: false                                       #可空,是否允许匿名用户登录,默认false
        anonymous-write-permission: false                                    #可空,是否允许匿名用户写操作,默认false
        user-factory-class: testUserFactory                                  #用户工厂 Bean 的 Name
  • 配置项附录
模块 配置项 数据类型 默认值 说明
core acp.core.deleteFileWaitTime Long 1200000 延迟删除文件等待时间(单位毫秒),默认:1200000
acp.core.absPathPrefix String abs: 绝对路径前缀,默认:"abs:"
acp.core.userPathPrefix String user: 用户路径前缀,默认:"user:"
acp.core.fontPath String files/resource/font 字体文件夹路径,默认:"files/resource/font"
controller-log acp.controller-log.enabled Boolean true 是否启用,默认:true
acp.controller-log.noLogUriRegular List<String> empty 不进行日志记录的url正则表达式数组
schedule acp.schedule.cron Map<String,String> empty 是否进行动态热重启
acp.schedule.auto-restart Boolean true cron表达式Map。key=Bean名称,value=cron表达式
tcp-server acp.tcp-server.listeners List<SocketListenerConfiguration> empty Socket TCP 监听列表
udp-server acp.tcp-server.listeners List<SocketListenerConfiguration> empty Socket UDP 监听列表
SocketListenerConfiguration; prefix:acp.tcp-server.listeners or acp.tcp-server.listeners name String Default Socket Listener 名称
threadNumber Integer 0 线程数
enabled Boolean false 是否启用
keepAlive Boolean false 是否长连接
idletime Long 10000 空闲等待时间(单位毫秒)
port Integer 0 监听端口
hex Boolean false 是否16进制报文
messageDecoder String 消息解码器Bean名称
handleBean String 消息处理Bean名称
responsible Boolean true 是否需要响应
charset String utf-8 字符编码
ftp-server acp.ftp-server.listeners List<FtpListener> empty Ftp服务监听配置列表
FtpListener; prefix:acp.ftp-server.listeners name String 服务名
enabled Boolean false 是否启用,默认false
port Integer 0 服务端口号
anonymousLoginEnabled Boolean false 可空,是否允许匿名用户登录,默认false
pwdEncryptMode String MD5 用户密码加密方式(支持MD5、SHA1、SHA256),默认MD5
loginFailureDelay Integer 30
maxLoginFailures Integer 20
maxLogins Integer 10
maxAnonymousLogins Integer 20
maxThreads Integer 10
defaultHomeDirectory String 默认根路径
anonymousWritePermission Boolean false 可空,是否允许匿名用户写操作,默认false
userFactoryBean String 用户工厂Bean名称

(三)启停 springboot 应用

命令 描述
./server.sh 查看可用参数
./server.sh status 查看系统运行状态
./server.sh start 启动应用
./server.sh stop 停止应用
./server.sh restart 重启应用

五、开发 SpringCloud 应用

demo 位于 test/cloud 下,使用 acp-dependency 进行版本管理,例如:

dependencyManagement {
    imports {
        mavenBom("io.gitee.zhangbinhub.acp:acp-dependency:version")
    }
}

(一)模块说明

1. acp-spring-cloud-starter

原子服务公共模块:

  • (1)自定义程序入口注解
  • (2)自定义 feign 并发策略、自定义 feign 请求拦截
  • (3)封装日志服务客户端,发送日志消息至 kafka
2. acp-spring-cloud-starter-resource-server

资源服务自动配置模块:

  • (1)自定义程序入口注解
  • (2)自动配置资源服务安全策略
测试模块
1. test/cloud/admin-server

监控界面

2. test/cloud/gateway-server

网关服务

3. test/cloud/oauth-server

统一认证服务:token 存储于 Redis,user 及 client 信息可扩展配置

url 描述
/oauth/authorize 申请授权,basic认证保护
/oauth/token 获取token的服务,url中没有client_id和client_secret的,走basic认证保护
/oauth/check_token 资源服务器用来校验token,basic认证保护
/oauth/confirm_access 授权确认,basic认证保护
/oauth/error 认证失败,无认证保护

查看认证过程

4. test/cloud/log-server

日志服务,使用 kafka 作为日志消息队列

5. test/cloud/helloworld

原子服务,分别调用 hello 和 world

6. test/cloud/helloworld-reactive

原子服务,分别调用 hello 和 world

7. test/cloud/hello

原子服务

8. test/cloud/world

原子服务

(二)基础中间件环境搭建

  • 必要基础中间件包括:nacos、redis、redisinsight、zookeeper、kafka、kafka-eagle、zipkin
  • 可选基础中间件包括:elasticsearch、logstash、kibana
  • 参考对应的docker-compose文件

(三)组件开发

全局说明
  • 统一注入 io.gitee.zhangbinhub.acp.boot.interfaces.LogAdapter 进行日志记录
1. 可视化监控
  • test/cloud/admin-server
  • (1)依赖 acp-spring-cloud-starter
  • (2)无需改动代码
  • (3)修改 yml 配置即可
2. 网关服务
  • test/cloud/gateway-server
  • (1)需自定义限流策略(需依赖 Redis)
  • (2)修改 yml 进行路由配置;若没有 Redis 请不要配置限流策略
3. 认证服务
  • test/cloud/oauth-server
  • (1)依赖
    • acp-spring-cloud-starter-resource-server
    • org.springframework.security:spring-security-oauth2-authorization-server
    • org.springframework.boot:spring-boot-starter-data-redis
  • (2)入口类增加注解 @AcpCloudAtomApplication
  • (3)基于 spring-security-oauth2-authorization-server 深度定制 grant_type=password 模式
4. 日志服务(依赖 kafka)
  • (1)依赖 acp-spring-cloud-starter-resource-server
  • (2)入口类增加注解 @AcpCloudResourceServerApplication
  • (3)如需自定义日志消息处理,新增Bean实现 io.gitee.zhangbinhub.acp.cloud.log.consumer.LogProcess 接口,并且增加 @Primary 注解
  • (4)根据各服务配置的日志类型(默认为"ALL"),在 logback-spring.xml 中参照 ALL 和 ALL-LOGSTASH 进行配置
  • a. 配置两个 appender(一个输出到本地文件,一个输出到logstash;单独配置的目的是为了将不同类型的日志写入不同名称的文件并在elasticsearch中创建不同的索引)
  • b. 之后再配置一个 logger (name属性为某个日志类型),包含之前配置的两个 appender
  • c. 强烈建议 logback-spring.xml 中配置的本地日志文件路径需与 yml 中的 logging.file.path 一致,方便统一管理
  • (5)增加配置
    acp:
      cloud:
        log-server:
          enabled: true #是否开启日志服务
5. 原子服务
  • (1)依赖 acp-spring-cloud-starter-resource-server
  • (2)参考 四、开发 SpringBoot 应用
  • (3)原子服务即 SpringBoot 应用,引入额外的 spring-cloud 包,并在 yml 中增加相应配置
  • (4)参考 test/cloud/hello、test/cloud/world、test/cloud/helloworld,入口类增加注解 @AcpCloudResourceServerApplication
  • (5)进行日志服务配置
    acp:
      cloud:
        log-server:
          client:
            enabled: true #是否启用日志服务
            log-type: ALL #当前服务的日志类型,默认ALL,也自定义;自定义的类型需要在日志服务中参照ALL配置appender和logger
  • (6)如有特殊需要不进行认证的url(例如"/customer"),则增加permit-all-path配置;如有需要进行认证的url(例如" /customer2" ),则增加security-path配置
    acp:
     cloud:
       resource-server:
         permit-all-path: 
           - /customer
         security-path:
           - /customer2
  • (7)cloud:acp-spring-cloud-starter-resource-server中强制开启了Http Basic认证,保护/actuator接口
    • 认证用户名和密码使用acp.cloud.resource-server.client-idacp.cloud.resource-server.client-secret配置项
    • 注册服务时需要将这两个配置项以源数据的形势user.nameuser.password 上送给注册中心,以便监控系统能够正常访问/actuator(例如Spring Boot Admin
  • (8)如果原子服务不需要加入统一认证体系中,即不需要进行访问权限验证。
    • cloud:acp-spring-cloud-starter-resource-server依赖改为cloud:acp-spring-cloud-starter
    • 入口类注解AcpCloudResourceServerApplication改为AcpCloudAtomApplication
6. 配置附录
模块 配置项 数据类型 默认值 说明
log server acp.cloud.log-server.groupId String acp_cloud_log_server_group_id 消费日志消息的组id,多个日志服务使用相同的组id,能够保证日志消息不被重复消费,默认:"acp_cloud_log_server_group_id"
acp.cloud.log-server.enabled Boolean false 当前服务是否是日志服务,默认:false
acp.cloud.log-server.destination String acp_cloud_log_server_message_topic 日志消息的topic名称(队列名称),默认:"acp_cloud_log_server_message_topic"
acp.cloud.log-server.client.enabled Boolean enabled 是否启用日志服务客户端,默认:false
acp.cloud.log-server.client.logType String ALL 日志类型,默认:"ALL"
acp.cloud.resource-server.client-id String acp_cloud_resource_server_client_id 资源服务认证使用的clientId
acp.cloud.resource-server.client-secret String acp_cloud_resource_server_client_secret 资源服务认证使用的clientSecret
acp.cloud.resource-server.permit-all-path List<String> empty 不进行权限校验的 url path
acp.cloud.resource-server.security-path List<String> empty 进行权限保护的 url path
7. postman 测试

Acp Test Cloud.postman_collection.json

六、打包为 docker 镜像

  • 打包:buildImage
  • 打包并上传:pushImage

七、Sentinel 动态数据源配置

Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

Application Construction Platform 应用构建平台。该项目是用Kotlin和Java语言混编封装的脚手架。本人会密切关注业界最新动态,并使用最新技术持续更新优化。使用该脚手架可快速搭建基于Kotlin或Java语言的普通应用、SpringBoot应用和SpringCloud应用。 展开 收起
Kotlin 等 5 种语言
Apache-2.0
取消

发行版 (44)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Kotlin
1
https://gitee.com/zhangbinhub/acp.git
git@gitee.com:zhangbinhub/acp.git
zhangbinhub
acp
acp
master

搜索帮助