@Download(source = "classpath:/download/README.txt")
@GetMapping("/classpath")
public void classpath() {
}
@Download
@GetMapping("/file")
public File file() {
return new File("/Users/Shared/README.txt");
}
@Download
@GetMapping("/http")
public String http() {
return "http://127.0.0.1:8080/concept-download/image.jpg";
}
@Download(filename = "二维码.zip")
@GetMapping("/download")
public List<Device> download() {
return deviceService.all();
}
public class Device {
//设备名称
private String name;
//设备二维码
//注解表示该http地址是需要下载的数据
@SourceObject
private String qrCodeUrl;
//注解表示文件名称
@SourceName
public String getQrCodeName() {
return name + ".png";
}
/