Skip to content

Commit

Permalink
download test
Browse files Browse the repository at this point in the history
  • Loading branch information
Linyuzai committed Jan 4, 2024
1 parent d351f8c commit 36d984a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions sample/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ dependencies {

implementation 'io.socket:socket.io-server:4.0.1'

//implementation "net.lingala.zip4j:zip4j:${Zip4jVersion}"
implementation "net.lingala.zip4j:zip4j:${Zip4jVersion}"
implementation "org.apache.commons:commons-compress:${CommonsCompressVersion}"

//implementation "com.squareup.okhttp3:okhttp:${OkHttpVersion}"
Expand All @@ -84,8 +84,8 @@ dependencies {

compileOnly 'org.springframework.boot:spring-boot-starter'
//compileOnly 'org.springframework.boot:spring-boot-starter-aop'
//compileOnly 'org.springframework.boot:spring-boot-starter-web'
compileOnly 'org.springframework.boot:spring-boot-starter-webflux'
compileOnly 'org.springframework.boot:spring-boot-starter-web'
//compileOnly 'org.springframework.boot:spring-boot-starter-webflux'
//compileOnly 'org.springframework.boot:spring-boot-starter-websocket'
compileOnly 'org.springframework.boot:spring-boot-starter-amqp'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

import java.io.File;
import java.io.InputStream;
Expand Down Expand Up @@ -103,7 +101,7 @@ public void dir() {

@Download(source = {
"file:/Users/tanghanzheng/IdeaProjects/Github/x/concept/sample/src/main/resources/download",
}, filename = "Password.zip", compressPassword = "123456")
}, filename = "Password.zip", compressPassword = "${download.password}")
@GetMapping("/password")
public void password() {
}
Expand Down Expand Up @@ -201,7 +199,7 @@ public void consumer(File file) {
};
}

@Download
/*@Download
@GetMapping("/mono")
public Mono<String> mono() {
return Mono.just(anyText());
Expand All @@ -211,9 +209,9 @@ public Mono<String> mono() {
@GetMapping("/flux")
public Flux<Object> flux() {
return Flux.fromIterable(list());
}
}*/

@Download
/*@Download
@CompressCache(group = "reactiveAsync", name = "reactiveAsync.zip")
@GetMapping("/reactiveAsync")
public DownloadOptions.Configurer reactiveAsync() {
Expand All @@ -237,7 +235,7 @@ public void consumer(File file) {
});
}
};
}
}*/

@Download(source = "classpath:/download/text.txt", inline = true, charset = "utf-8", contentType = "text/plain;charset=utf-8")
@GetMapping("/text.txt")
Expand Down
2 changes: 2 additions & 0 deletions sample/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ management:
health:
rabbit:
enabled: false
download:
password: qwe123
#spring:
# mvc:
# pathmatch:
Expand Down

0 comments on commit 36d984a

Please sign in to comment.