Getting Started

Overview

restful-return is a result powered by springBoot.

You can learn more project in the Why restful-return section.

Adding restful-return to your Project

<dependency>
  <groupId>io.github.xiaoxunyao</groupId>
  <artifactId>restful-return</artifactId>
  <version>0.0.3</version>
</dependency>
implementation 'io.github.xiaoxunyao:restful-return:0.0.3'

Examples

@GetMapping("/demo")
public Result demo(){
	List<String> list = new ArrayList<>();
	for (int i = 0; i < 10; i++){
		list.add(String.valueOf(i));
	}
	return Result.internalServerError(list);
}
@GetMapping("/demo1")
public Result demo1(){
	List<String> list = new ArrayList<>();
	for (int i = 0; i < 10; i++) {
		list.add(String.valueOf(i));
	}
	return Result.status(HttpStatus.CONTINUE).body(list);
}

Using Unreleased Commits

If you can't wait for a new release to test the latest features, you will need to clone the restful-return repoopen in new window to your local machine and then build and link it yourself (mavenopen in new window is required):

git clone git@github.com:xiaoxunyao/restful-return.git
cd restful-return
maven install
1
2
3