提交 faf7fa41 编写于 作者: sq3536's avatar sq3536

文件接口

上级 f2fd4772
package cn.ibizlab.core.disk.extensions.vo;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@JsonInclude(Include.NON_NULL)
@JsonIgnoreProperties(ignoreUnknown = true)
@NoArgsConstructor
public class FileItem
{
private String id;
private String name;
private String fileid;
private String filename;
private long size;
private String ext;
private String authcode;
public FileItem(String id, String name, String fileid, String filename, long size, String ext) {
this.id = id;
this.name = name;
this.fileid = fileid;
this.filename = filename;
this.size = size;
this.ext = ext;
}
public FileItem(String id, String name, String fileid, String filename, long size, String ext,String authcode) {
this.id = id;
this.name = name;
this.fileid = fileid;
this.filename = filename;
this.size = size;
this.ext = ext;
this.authcode = authcode;
}
}
......@@ -3,7 +3,9 @@ package cn.ibizlab.api.rest.extensions;
import cn.ibizlab.core.disk.extensions.service.DiskCoreService;
import cn.ibizlab.core.disk.extensions.vo.FileItem;
import cn.ibizlab.core.disk.service.ISDFileService;
import cn.ibizlab.util.errors.BadRequestAlertException;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -29,6 +31,9 @@ public class DiskCoreResource
@Autowired
private DiskCoreService diskCoreService;
@Autowired
private ISDFileService fileService;
private Hashtable<String, String> type = null;
private String getType(String ext)
{
......@@ -97,6 +102,13 @@ public class DiskCoreResource
this.sendRespose(response, file);
}
@ApiOperation(value = "删除文件", tags = {"文件" }, notes = "删除文件")
@RequestMapping(method = RequestMethod.DELETE, value = "/net-disk/files/{sdfile_id}")
public ResponseEntity<Boolean> remove(@PathVariable("sdfile_id") String sdfile_id) {
return ResponseEntity.status(HttpStatus.OK).body(fileService.remove(sdfile_id));
}
@Value("ibiz.file.proxy.previewpath")
private String previewPath;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册