Code Monkey home page Code Monkey logo

j360-microservice's Introduction

j360-microservice

j360系列之spring-boot微服务架构和docker部署 ##介绍##

  • j360-order底层服务提供接口 使用restAPI提供服务
  • j360-deliver提供UI操作界面,调用底层j360-order提供服务

构建

  • Java 1.7+(官方建议1.8)

  • Maven 3.2+

  • Spring 4.1.3

  • Spring-boot 1.3.0.BUILD-SNAPSHOT

  • j360 1.0.0.BUILD-SNAPSHOT

##j360-order##

  • 直接使用Spring data jpa,省点力气写dao :)

###两种rest风格###

  • @RepositoryRestResource(collectionResourceRel = "expresss", path = "expresses")
  • +spring.data.rest.base-path=/api
  • @RestController+@RequestMapping("/expresses")
  • 也可以使用hateoas来实现超媒体的rest效果
<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-hateoas</artifactId>
</dependency>

##j360-deliver##

  • RestTemplate作为restAPI调用工具,需要定义@Bean
  • ExpressApiService使用netflix.hystrix确保分布式系统的持久性

###测试##

  • 单元测试
    • ExperssServiceTest
      • 测试api接口调用实现
      • 测试Hystrix在远程调用中的封装
使用restapi或许order的map属性
      1、expressServiceTest 直接或许
      2、expressApiTest 封装hystrix进行读取
      3、通过aop-hystrix无侵入式读取
  • MockMvc测试
    • 测试用户界面调用接口

##j360-profile##

  • hateoas演示案例
  • hateoas restful

j360-microservice's People

Contributors

xuminwlt avatar

Watchers

 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.