Cloud Starter Stateful


License

License

GroupId

GroupId

com.minlia.cloud.starter
ArtifactId

ArtifactId

cloud-starter-stateful
Last Version

Last Version

2.0.0.RELEASE
Release Date

Release Date

Type

Type

jar
Description

Description

Cloud Starter Stateful
Cloud Starter Stateful
Source Code Management

Source Code Management

https://github.com/minlia-projects/cloud-starter-stateful

Download cloud-starter-stateful

How to add to project

<!-- https://jarcasting.com/artifacts/com.minlia.cloud.starter/cloud-starter-stateful/ -->
<dependency>
    <groupId>com.minlia.cloud.starter</groupId>
    <artifactId>cloud-starter-stateful</artifactId>
    <version>2.0.0.RELEASE</version>
</dependency>
// https://jarcasting.com/artifacts/com.minlia.cloud.starter/cloud-starter-stateful/
implementation 'com.minlia.cloud.starter:cloud-starter-stateful:2.0.0.RELEASE'
// https://jarcasting.com/artifacts/com.minlia.cloud.starter/cloud-starter-stateful/
implementation ("com.minlia.cloud.starter:cloud-starter-stateful:2.0.0.RELEASE")
'com.minlia.cloud.starter:cloud-starter-stateful:jar:2.0.0.RELEASE'
<dependency org="com.minlia.cloud.starter" name="cloud-starter-stateful" rev="2.0.0.RELEASE">
  <artifact name="cloud-starter-stateful" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.minlia.cloud.starter', module='cloud-starter-stateful', version='2.0.0.RELEASE')
)
libraryDependencies += "com.minlia.cloud.starter" % "cloud-starter-stateful" % "2.0.0.RELEASE"
[com.minlia.cloud.starter/cloud-starter-stateful "2.0.0.RELEASE"]

Dependencies

compile (6)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter Optional jar
org.projectlombok : lombok Optional jar 1.16.18
com.fasterxml.jackson.core : jackson-annotations jar
com.fasterxml.jackson.core : jackson-databind jar
org.apache.commons : commons-lang3 jar
io.swagger : swagger-annotations Optional jar 1.5.13

test (1)

Group / Artifact Type Version
org.springframework.boot : spring-boot-starter-test jar

Project Modules

There are no modules declared in this project.

API状态化

为避免杂乱无章的 API 结构,规范化请求与返回体,返回message已输出国际化后的结果

Maven Central Apache License 2 Build Status Waffle.io - Columns and their card count

项目结构说明

body          请求体与返回体
code          API 业务返回码定义
generator     生成器
localization  本地化

集成到自已的项目时添加依赖项

<dependency>
  <groupId>com.minlia.cloud.starter</groupId>
  <artifactId>cloud-starter-stateful</artifactId>
  <version>2.0.0.RELEASE</version>
</dependency>

后端Endpoint层代码

  @PostMapping(value = "/api/status/post")
  @ApiOperation(value = "状态", notes = "测试提交", httpMethod = "POST")
  public StatefulBody postStatus(@Valid  @RequestBody WithIdBody body) {
    return SuccessResponseBody.builder().build();
  }

返回报文示例

{
  "payload":{
    "id":33333333333,
    "balance":228866.00
  }
  "code": 1,//业务返回码
  "message": "OK",//业务返回释义
  "requestId": "cZCu5aAftUn2ivn2rcKb2YUhb6N7ijP420180402212405106502",//当前请求编号
  "status": 200,//请求的http状态码
  "timestamp": 1522675445311//当前请求时间戳
}

演示

com.minlia.cloud.starter

MINLIA

Versions

Version
2.0.0.RELEASE