2 Star 3 Fork 1

Ben / commons

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

Tony Stark

向我的偶像,最牛程序员 Tony Stark(1970-2019) 致敬!

使用

  1. 在 pom.xml 中添加仓库
<repositories>
    <repository>
        <id>eastsoft-snapshots</id>
        <name>Eastsoft Snapshots</name>
        <url>http://218.58.62.115:18081/nexus/repository/snapshots/</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
</repositories>
  1. 在 pom.xml 中添加坐标
<!-- 公共方法包 -->
<dependency>
    <groupId>com.stark.commons</groupId>
    <artifactId>commons-lang</artifactId>
    <version>1.1.0-SNAPSHOT</version>
</dependency>
<!-- Spring 核心配置 -->
<dependency>
    <groupId>com.stark.commons</groupId>
    <artifactId>commons-spring-core</artifactId>
    <version>1.1.0-SNAPSHOT</version>
</dependency>
<!-- Spring Web 配置 -->
<dependency>
    <groupId>com.stark.commons</groupId>
    <artifactId>commons-spring-web</artifactId>
    <version>1.1.0-SNAPSHOT</version>
</dependency>

功能

commons-spring-core

多数据源路由

配置

  1. yml 中指定 spring.datasource.multiple=true ,开启自动配置
spring:
  datasource:
    multiple: true
  1. yml 中配置多数据源
spring:
  datasource:
    druid:
      ds1:
        driver-class-name: net.sourceforge.jtds.jdbc.Driver
        url: jdbc:jtds:sybase://129.1.50.194:8888/escloud;charset=cp936
        username: escloud
        password: fpSPcx5kfoNl+aZalQQcaJq0WQ3OkikNzYjBpUquEQEpCEg6AxJZWZMyts1YPIn97PYD3843FQh8j/7xdSE7Eg==
        initial-size: 10
        min-idle: 10
        max-active: 20
        keep-alive: true
        validation-query: select count(*) from S_COURT
        validation-query-timeout: 0
        filters: config,stat,slf4j
        connection-properties: config.decrypt=true;config.decrypt.key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIxnQJmAfL8vCTtuKViDH5FVEPC5Ao1gNOsBHgv+e6ccWV5CLJoAy1+pZPW5RWGCFYikTg6Q11oCUuC6kJAW0GcCAwEAAQ==
      ds2:
        driver-class-name: net.sourceforge.jtds.jdbc.Driver
        url: jdbc:jtds:sybase://129.1.50.194:8888/escourt6;charset=cp936
        username: escourt6
        password: fpSPcx5kfoNl+aZalQQcaJq0WQ3OkikNzYjBpUquEQEpCEg6AxJZWZMyts1YPIn97PYD3843FQh8j/7xdSE7Eg==
        initial-size: 10
        min-idle: 10
        max-active: 20
        validation-query: select count(*) from S_COURT
        validation-query-timeout: 0
        filters: config,stat,slf4j
        connection-properties: config.decrypt=true;config.decrypt.key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAIxnQJmAfL8vCTtuKViDH5FVEPC5Ao1gNOsBHgv+e6ccWV5CLJoAy1+pZPW5RWGCFYikTg6Q11oCUuC6kJAW0GcCAwEAAQ==
      web-stat-filter:
        enabled: true
        url-pattern: /*
        exclusions: '*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*'
      stat-view-servlet:
        enabled: true
        url-pattern: /druid/*
        login-username: eastsoft
        login-password: eastsoft.cn
  1. 实现 com.stark.commons.spring.core.support.sql.RoutingDataSource 接口,返回数据源 bean
@Configuration
public class DataSourcesConfig {

    @Bean
    @ConfigurationProperties("spring.datasource.druid.ds1")
    public RoutingDataSource escloudDataSource() {
        DruidDataSource druidDataSource = DruidDataSourceBuilder.create().build();
        return new DruidRoutingDataSource(druidDataSource, "ds1", true);
    }

    @Bean
    @ConfigurationProperties("spring.datasource.druid.ds2")
    public RoutingDataSource esshare6DataSource() {
        DruidDataSource druidDataSource = DruidDataSourceBuilder.create().build();
        return new DruidRoutingDataSource(druidDataSource, "ds2", false);
    }
    
}

通过 @DataSource("lookupKey") 注解切换数据源

  • 方法级别,方法执行前将切换至目标数据源
public class DataSourcesConfig {

    @DataSource("ds2")
    public void function() {
        // ...
    }
    
}
  • 类级别,类中所有的方法执行前都将切换至目标数据源
@DataSource("ds2")
public class DataSourcesConfig {
    
    public void function1() {
        // ...
    }

    public void function2() {
        // ...
    }
    
}

注意

  • 支持 单一数据源 事务,不支持 跨数据源 事务(分布式事务);
  • 多数据源分布式事务请参考 Atomikos JTA 分布式事务

事务切面

yml 配置

spring:
  transaction:
    aop:
      base-packages: com.stark.demo.service.impl                      # 显示指定包扫描位置,开启自动配置
      read-only-methods: get*,find*,query*,select*,count*             # 只读事务方法,支持通配符,多个以 "," 隔开,默认值 ""
      required-methods: insert*,add*,save*,update*,delete*,remove*    # 写事务方法,支持通配符,多个以 "," 隔开,默认值 "*"
      timeout: -1                                                     # 超时回滚时间,默认值 -1 不回滚

事务注解优先

  • @Transactional@NonTransactional 注解的方法,事务按照注解的逻辑执行,不受切面控制
  • @NonTransactional 等同于 @Transactional(propagation = Propagation.NOT_SUPPORTED)

事务时间开销

  • 事务开启关闭一次大约需要 10ms 的时间
  • 非写事务和必要的只读事务,尽量通过 @NonTransactional@Transactional(propagation = Propagation.NOT_SUPPORTED) 注解关闭事务
  • 建议按照 spring.transaction.aop.read-only-methodsspring.transaction.aop.required-methods 的约定定义方法名

Atomikos JTA 分布式事务

配置

  1. 引入 spring-boot-starter-jta-atomikos 包;
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-jta-atomikos</artifactId>
    <version>${springboot.version}</version>
</dependency>
  1. yml 中指定 spring.jta.enabled=true ,开启自动配置
spring:
  jta:
    enabled: true    # 显示指定 true ,开启自动配置
    log-dir: ./      # 日志文件目录

注意

  • 事务切面、注解两种方式的事务均为 分布式事务 ,分组事务需要通过事务的传播属性来设计实现,见分组事务
  • 开启事务切面后,repository 中自定义的增、删、改方法,需要手动添加 @Transactional 注解

分组事务

  • 业务场景

用户 user 、用户信息 userInfo 在一个事务,部门 dept 在一个事务,两个事务相互独立。

  • 代码设计
@Service("userService")
public class UserService {

    @Autowired
    private UserInfoService userInfoService;
    @Autowired
    private DeptService deptService;
    
    // 事务切面织入事务
    public void add(User user, UserInfo userInfo, Dept dept) {
        // 通过 @Transactional(propagation = Propagation.REQUIRES_NEW) 新起事务
        userInfoService.addUserAndUserInfo(user, userInfo);
        // 继承父方法的事务
        deptService.add(dept);
    }
    
}

@Service("userInfoService")
public class UserInfoService {

    @Autowired
    private UserRepository userRepository;
    @Autowired
    private UserInfoRepository userInfoRepository;
    
    // 新起一个事务
    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void addUserAndUserInfo(User user, UserInfo userInfo) {
        userRepository.save(user);
        userInfoRepository.save(userInfo);
    }
    
}

@Service("deptService")
public class DeptService {

    @Autowired
    private DeptRepository deptRepository;
    
    // 事务切面织入事务
    public void add(Dept dept) {
        deptRepository.save(dept);
    }
    
}

Elasticsearch 整合 X-Pack

版本

Elasticsearch 6.8 和 7.1 以上。

配置

  1. 引入依赖
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    <version>${springboot.version}</version>
    <exclusions>
        <exclusion>
            <groupId>org.elasticsearch.client</groupId>
            <artifactId>transport</artifactId>
        </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>org.elasticsearch.client</groupId>
    <artifactId>x-pack-transport</artifactId>
    <version>${elasticsearch.version}</version>
</dependency>
  1. yml 中配置:
spring:
  data:
    elasticsearch:
      cluster-name: elasticsearch
      cluster-nodes: es1.stark.com:9300,es2.stark.com:9300
      xpack:
        security-transport-ssl-enabled: true
        security-user: elastic
        security-password: 123456
        ssl-verification-mode: certificate
        ssl-keystore-path: classpath:certs/dev-qd/elastic-certificates.p12
        ssl-truststore-path: classpath:certs/dev-qd/elastic-certificates.p12
        ssl-keystore-password: 123456
        ssl-truststore-password: 123456

Elasticsearch 整合 Search Guard

配置

  1. 引入依赖;
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-elasticsearch</artifactId>
    <version>${springboot.version}</version>
</dependency>
<dependency>
    <groupId>com.floragunn</groupId>
    <artifactId>search-guard-ssl</artifactId>
    <version>${elasticsearch.version}-25.6</version>
</dependency>
  1. yml 中配置:
spring:
  data:
    elasticsearch:
      cluster-name: elasticsearch
      cluster-nodes: es1.stark.com:9300,es2.stark.com:9300
      search-guard:
        ssl-transport-pemtrustedcas-filepath: classpath:elk/dev/root-ca.pem
        ssl-transport-pemcert-filepath: classpath:elk/dev/elk-server.pem
        ssl-transport-pemkey-filepath: classpath:elk/dev/elk-server.key
        ssl-transport-pemkey-password: 123456

注意

  • elasticsearchtransportsearch-guard-ssl 三者版本必须一致

日志切面

  1. 在应用配置类中增加 @EnableAspectJAutoProxy 开启切面注解支持;
  2. 在应用系统中实现 com.stark.commons.spring.core.support.log.LogService 接口,开启日志切面自动配置;
  3. 在方法上添加 @Log(type = {int}, businessKey = "{String}", message = "{String}") 注解, String 类型参数支持 spel 表达式。
@Service
public class UserService {

    @Log(type = LogType.TABLE_INSERT, businessKey = "#user.id", message = "'新增用户:id=' + #user.id")
    public User add(User user) {
        // ...
    }
    
    @Log(type = LogType.TABLE_DELETE, businessKey = "#id", message = "'删除用户:id=' + #id")
    public int delete(Long id) {
        // ...
    }
	
    @Log(type = LogType.TABLE_UPDATE, businessKey = "#user.id", message = "'修改用户:id=' + #user.id")
    public User update(User user) {
        // ...
    }

    @Log(type = LogType.TABLE_SELECT, businessKey = "#id", message = "'查询用户:id=' + #p0")
    public User get(Long id) {
        // ...
    }

}

线程池

yml 配置

spring:
  task:
    execution:     # 任务执行器,多线程操作使用
      thread-name-prefix: task-            # 线程名前缀,打印日志时使用
      pool:
        core-size: 8                       # 核心线程数,默认 8
        max-size: 2147483647               # 最大线程数,默认 Integer.MAX_VALUE
        queue-capacity: 2147483647         # 队列容量,默认 Integer.MAX_VALUE
        keep-alive: 60s                    # 空闲线程存活时间
        allow-core-thread-timeout: true    # 是否保持 core-size 数
    scheduling:    # 任务调度器, job 执行时使用
      thread-name-prefix: scheduling-      # 线程名前缀,打印日志时使用
      pool:
        size: 1                            # 线程数,默认 1 同时只能运行一个 job 作业

通用缓存接口

目的

提供一套通用的缓存接口,在某些场景下,比通过 @Cacheable 系列注解的方式更方便的使用缓存。

内置实现

  • redis
  • ehcache

使用方法

自动注入 com.stark.commons.spring.core.support.cache.CacheService

@Autowired
private CacheService cacheService;

MinIO

  1. yml 配置
spring:
  minio:
    endpoint: http://192.168.22.100:9000    # 服务器地址,集群需提供一个代理地址
    port: 9000                              # 端口
    secure: false                           # 是否使用 https 协议
    access-key: minio                       # 用户名
    secret-key: 12345678                    # 密码
    region: china-shandong-1                # 区域
  1. 代码中自动注入 io.minio.MinioClient 并使用。

commons-spring-web

eureka

事件监听

  1. 开启监听
eureka:
  server:
    enable-registered-event-listener: true    # 服务上线(注册)事件监听,默认 true ,以 WARN 级别打印日志
    enable-renewed-event-listener: true       # 服务续约事件监听,默认 true ,以 INFO 级别打印日志
    enable-canceled-event-listener: true      # 服务下线监听,默认 true ,以 WARN 级别打印日志
  1. 自定义事件处理
  • 实现 com.stark.commons.spring.web.support.eureka.RegisteredEventHandler 接口,定义上线事件处理器
@Component
public class MyRegisteredEventHandler implements RegisteredEventHandler {

    @Override
    public void handle(EurekaInstanceRegisteredEvent event) {
        if (!event.isReplication()) {
            // TODO: 业务逻辑
        }
    }

}
  • 实现 com.stark.commons.spring.web.support.eureka.RenewedEventHandler 接口,定义续约事件处理器
@Component
public class MyRenewedEventHandler implements RenewedEventHandler {

    @Override
    public void handle(EurekaInstanceRenewedEvent event) {
        if (!event.isReplication() && event.getInstanceInfo() != null) {
            // TODO: 业务逻辑
        }
    }

}
  • 实现 com.stark.commons.spring.web.support.eureka.CanceledEventHandler 接口,定义下线事件处理器
@Component
public class MyCanceledEventHandler implements CanceledEventHandler {

    @Override
    public void handle(EurekaInstanceCanceledEvent event) {
        if (!event.isReplication()) {
            // TODO: 业务逻辑
        }
    }

}

feign

携带请求头

feign:
  headers-include: Authorization    # 多个以 "," 隔开,将从 request 中复制请求头

错误码标记业务异常不降级

feign:
  decode-codes:
    400:                    # 为空代表取 exception.message
    404:                    # 为空代表取 exception.message
    401: '未登录或登录超时'
    403: '没有权限'
    499: '客户端关闭连接'

支持分页

  1. org.springframework.data.domain.Pageableorg.springframework.data.domain.Sort 作为接口参数时,不要加 @SpringQueryMap 注解;

  2. 自动配置的 com.stark.commons.spring.web.support.page.PageCombinedSerializer 负责 org.springframework.data.domain.Page 的序列化和反序列化。

zuul

uri 接口级别超时配置

zuul:
  routes:
    manager:
      service-id: escloud-service-manager
      path: /manager/**
  route-timeout:
  - service-id: escloud-service-manager    # 微服务 ID
    uri-timeout:
    - uri: /user                           # URI
      method: post                         # 请求方法,默认 get
      connect-timeout: 1000                # 连接超时毫秒数,默认 1000
      read-timeout: 3000                   # 读取数据超时毫秒数,默认 1000
    - uri: /user/{id}
      method: get
      connect-timeout: 1000
      read-timeout: 1000
    - uri: /user/{id}
      method: put
      connect-timeout: 1000
      read-timeout: 3000

全局异常处理

内置的异常处理器

  • com.stark.commons.spring.web.support.exception.BindExceptionHandler

    处理 org.springframework.validation.BindException 异常

  • com.stark.commons.spring.web.support.exception.ConstraintViolationExceptionHandler

    处理 javax.validation.ConstraintViolationException 异常

  • com.stark.commons.spring.web.support.exception.HttpMessageConversionExceptionHandler

    处理 org.springframework.http.converter.HttpMessageConversionException 异常

  • com.stark.commons.spring.web.support.exception.HttpRequestMethodNotSupportedExceptionHandler

    处理 org.springframework.web.HttpRequestMethodNotSupportedException 异常

  • com.stark.commons.spring.web.support.exception.InvalidGrantExceptionHandler

    处理 org.springframework.security.oauth2.common.exceptions.InvalidGrantException 异常

  • com.stark.commons.spring.web.support.exception.MethodArgumentNotValidExceptionHandler

    处理 org.springframework.web.bind.MethodArgumentNotValidException 异常

  • com.stark.commons.spring.web.support.exception.MethodArgumentTypeMismatchExceptionHandler

    处理 org.springframework.web.method.annotation.MethodArgumentTypeMismatchException 异常

  • com.stark.commons.spring.web.support.exception.ServletRequestBindingExceptionHandler

    处理 org.springframework.web.bind.ServletRequestBindingException 异常

注意: 继承内置异常处理器并注入 IOC 容器,可覆盖默认的异常处理器。

自定义异常处理器

  • 实现 com.stark.commons.spring.web.support.exception.ExceptionHandler 接口,处理指定异常,如 KnownException
public class KnownExceptionHandler implements ExceptionHandler {

    /**
     * 当前异常处理器是否可以处理传入的异常。
     * @param ex 异常对象。
     * @return 可以处理异常返回 {@literal true} ,否则返回 {@literal false} 。
     */
    @Override
    public boolean instanceofException(Exception ex) {
        return ex instanceof KnownException;
    }

    /**
     * 处理异常并返回响应内容。
     * @param ex 异常对象。
     * @return 响应内容,包含状态码、异常信息。
     */
    @Override
    public ResponseEntity<String> handle(Exception ex) {
        return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(((KnownException) ex).getMessage());
    }

}
  • 把异常处理器注入 IOC 容器
@Configuration
public class MyConfig {

    @Bean
    public KnownExceptionHandler knownExceptionHandler() {
        return new KnownExceptionHandler();
    }
    
}

自定义异常处理

  • 自定义的异常继承 com.stark.commons.lang.exception.KnownException
public class UserNotFoundException extends KnownException {
    // ...
}
  • 内置处理器将返回 400 状态码和异常信息

未知的异常将返回 500 状态码和异常信息

跨域

yml 配置

web:
  cors:
    enabled: false          # 是否允许跨域,默认 false
    path-pattern: /**       # 允许的请求路径,默认 /**
    allowed-origins: '*'    # 允许的域名,默认 *
    allowed-methods: '*'    # 允许的请求方式,默认 *
    max-age: 1800           # 允许客户端缓存响应头有效时间,单位秒,默认 1800

安全

yml 配置

web:
  security-check: true

功能

  • 防止 sql 注入
  • 防止 xss 攻击

注意

  • 会降低性能

性能监控

yml 配置

web:
  monitor-standard: 3000    # 响应标准时间,单位毫秒

功能

  • controller 响应时间超过标准值(默认 3s),以 warn 级别打印日志
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.

简介

Spring Boot 、 Spring Cloud 整合工具类 展开 收起
Java
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/jarvis-lib/commons.git
git@gitee.com:jarvis-lib/commons.git
jarvis-lib
commons
commons
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891