The aquifer is a java web framework based on jdk11 and netty
Create a basic Maven
or Gradle
project.
Do not create a
webapp
project, Aquiver does not require much trouble.
Run with Maven
:
<dependency>
<groupId>org.aquiver</groupId>
<artifactId>aquiver</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
public class Application {
public static void main(String[] args) {
Aquiver.run(Main.class, args);
}
}
@GET(value = "/get")
public String get() {
//todo
}
@Path(value = "/path",method = PathMethod.GET)
public String path(){
//todo
}
@Path(value = "/path", method = PathMethod.GET)
public String path(@Param String paramName){
//todo
}
@Path(value = "/path", method = PathMethod.GET)
public String path(@Param String cookieName){
//todo
}
@Path(value = "/path", method = PathMethod.POST)
public String path(@Body User user){
//todo
}
@POST(value = "/uploadFile")
public void uploadFile(@FileUpload MultipartFile file) {
log.info("fileName:{}", file.getFileName());
try {
System.out.println(multipartFile.readFileContent());
} catch (IOException e) {
e.printStackTrace();
}
}
@POST(value = "/uploadFiles")
public void uploadFileS(@MultiFileUpload List<MultipartFile> files) {
log.info("file size:{}", files.size());
for (MultipartFile multipartFile : files) {
log.info("fileName:{}", multipartFile.getFileName());
try {
System.out.println(multipartFile.readFileContent());
} catch (IOException e) {
e.printStackTrace();
}
}
}
Copyright (c) 2018-present, Yi (Ever) Wang