Giter VIP home page Giter VIP logo

third-party-api's Introduction

Contributors Forks Stargazers Issues Apache 2.0 License Latest Commit Releases REUSE status Build Status CircleCI codecov


Logo

第三方API(third-party-api)

第三方API集成(Third party api integration)!
报告Bug(Report Bug) · 请求功能(Request Feature)

目录(Table of Contents)
  1. 关于该项目(About The Project)
  2. 入门指南(Getting Started)
  3. 用法(Usage)
  4. 路线图(Roadmap)
  5. 贡献(Contributing)
  6. 许可证(License)
  7. 联系方式(Contact)
  8. 致谢(Acknowledgements)

关于该项目 About The Project

Product Name Screen Shot

GitHub上有很多很棒的第三方接口集成,但是我找不到真正适合我需要的,因此我创建了这个我认为比较优雅的实现。 我想创建一个第三方接口集成,如此出色,以至于它将成为您需要的最后一个-我想就是这样。

设计理念

  • 尽量领域驱动设计
  • 尽量代码规范
  • 尽量单元测试
  • 尽量使用官方sdk或者声明式HTTP(feign)
  • 尽量事件驱动

特点

  • 高度抽象,统一接口,模块化设计,方法使用更优雅
  • 支持多种可插拔机制,扩展性好,可按需使用
  • 支持纯java使用,也支持多种框架内使用(一般会自动配置)
  • 支持多配置参数,支持多配置参数方式
  • 支持发布事件
  • 详细可参考用法(Usage)

当然,由于您的需求可能不同,因此没有一个项目可以为所有项目提供服务。 因此,我将在不久的将来添加更多内容。 您也可以通过分叉此存储库并创建请求请求或打开问题来提出更改建议。 感谢所有为该项目的扩展做出贡献的人们!

致谢中列出了一些我认为有用的常用资源。

用什么构建 Built With

本节列出在构建项目时使用的所有主要框架。在致谢(Acknowledgements)部分留下任何附加组件/插件。

入门指南 Getting Started

安装 Installation

  • Maven

    <dependency>
      <groupId>cn.shishuihao</groupId>
      <artifactId>third-party-api</artifactId>
      <version>latest</version>
    </dependency>
  • Gradle

    compile 'cn.shishuihao:third-party-api:latest'
    

用法 Usage

  • 可插拔方式
    • SPI机制 如:AliYunSmsApiChannel的spi机制实现
      cn.shishuihao.thirdparty.api.sms.aliyun.AliYunSmsApiChannel
      
    • 通过注入容器,再从容器获取
      • springboot 如注入容器

        @Bean
        @ConditionalOnMissingBean
        protected ApiPropertiesRepository propertiesRepository(ApiPropertiesEntityJpaRepository jpaRepository) {
            return new ApiPropertiesJpaRepository(jpaRepository);
        }
        
  • 配置属性配置方式
    • 代码 如:
      AliYunSmsApiProperties properties = new AliYunSmsApiProperties();
      properties.setAccessKeyId("AccessKeyId");
      properties.setAccessSecret("AccessSecret");
      ApiRegistry.PROPERTIES_REPOSITORY.add(properties);
      
    • 容器
      • springboot
        • 代码
          @Bean
          @ConditionalOnMissingBean
          protected AliYunSmsApiProperties defaultAliYunSmsApiProperties() {
              AliYunSmsApiProperties properties = new AliYunSmsApiProperties();
              properties.setAccessKeyId("AccessKeyId");
              properties.setAccessSecret("AccessSecret");
              return properties;
          }
          
        • yml(自定义)
          sms: 
            aliyun: 
              - access-key-id: AccessKeyId1
                access-secret: AccessSecret1
              - access-key-id: AccessKeyId2
                access-secret: AccessSecret2
    • 数据库配置方式
      • spring-boot-jpa
        @Bean
        @ConditionalOnMissingBean
        protected ApiPropertiesRepository propertiesRepository(ApiPropertiesEntityJpaRepository jpaRepository) {
            return new ApiPropertiesJpaRepository(jpaRepository);
        }
        
      • spring-boot-mybatis-plus
        @Bean
        @ConditionalOnMissingBean
        protected ApiPropertiesRepository propertiesRepository(ApiPropertiesEntityMybatisPlusMapper mybatisPlusMapper) {
            return new ApiPropertiesMybatisPlusRepository(mybatisPlusMapper);
        }
        
      • spring-boot-redis
        @Bean
        @ConditionalOnMissingBean
        protected ApiPropertiesRepository propertiesRepository(RedisTemplate<String, ApiProperties> redisTemplate) {
            return new ApiPropertiesRedisRepository(redisTemplate);
        }
        
      • spring-boot-mongodb
        @Bean
        @ConditionalOnMissingBean
        protected ApiPropertiesRepository propertiesRepository(ApiPropertiesDocumentMongoRepository mongoRepository) {
            return new ApiPropertiesMongodbRepository(mongoRepository);
        }
        
  • 发布事件
  • SMS集成(sms integration)
  • 推送集成(push integration)
  • 支付集成(pay integration)
  • 登录集成
  • 分享集成

路线图 Roadmap

  • 请参阅未解决的问题,以获取提出了功能(和已知问题)的列表。
  • See the open issues for a list of proposed features (and known issues).

贡献 Contributing

  1. 复刻该项目(Fork the Project)
  2. 创建您的功能分支(Create your Feature Branch) (git checkout -b feature/AmazingFeature)
  3. 提交您的更改(Commit your Changes) (git commit -m 'Add some AmazingFeature')
  4. 推到分支(Push to the Branch) (git push origin feature/AmazingFeature)
  5. 提交拉取请求(Open a Pull Request)

许可证 License

联系方式 Contact

shishuihao - - [email protected]

下面链接(Project Link): https://github.com/shishuihao/third-party-api

致谢 Acknowledgements

捐助 Donate

如果您觉得我的项目对您有帮助,并且您愿意给予我一点小小的支持,您可以通过以下方式向我捐助,这样可以维持项目持续地发展,灰常感谢!(/ω\)

支付宝(Alipay) 微信(Wechat)

❤❤❤

捐助者名单 Donor list

(如果这里还没有你的名字?请发邮件至 [email protected] 告诉我)

捐助日期 捐助者 捐助金额

third-party-api's People

Contributors

shishuihao avatar

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.