Commit 95262b2f authored by yanzg's avatar yanzg

文件处理

parent 022c826b
...@@ -13,17 +13,29 @@ import io.swagger.annotations.ApiModelProperty; ...@@ -13,17 +13,29 @@ import io.swagger.annotations.ApiModelProperty;
public class YzgFileMoveItemReqVo extends BaseVo { public class YzgFileMoveItemReqVo extends BaseVo {
/** /**
* 来源路径,当目标路径存在时,则认为已经移动成功 * 移动文件的来源路径,当目标路径存在时,则认为已经移动成功
*/ */
@ApiModelProperty(notes = "来源路径,当目标路径存在时,则认为已经移动成功", position = 1000) @ApiModelProperty(notes = "移动文件的来源路径,当目标路径存在时,则认为已经移动成功", position = 1000)
private String from; private String from;
/** /**
* 目标路径 * 移动文件的目标路径
*/ */
@ApiModelProperty(notes = "目标路径", position = 1010) @ApiModelProperty(notes = "移动文件的目标路径", position = 1010)
private String to; private String to;
public YzgFileMoveItemReqVo() {
}
public YzgFileMoveItemReqVo(String from) {
this.from = from;
}
public YzgFileMoveItemReqVo(String from, String to) {
this.from = from;
this.to = to;
}
public String getFrom() { public String getFrom() {
return from; return from;
} }
......
package com.yanzuoguang.cloud.file.vo;
import com.yanzuoguang.util.vo.BaseVo;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotNull;
/**
* 获取文件的大小
*
* @author 颜佐光
*/
public class YzgFileVideoImageItemReqVo extends BaseVo {
/**
* 高质量品质
*/
public static final YzgFileVideoImageItemReqVo VIDEO_TYPE_HIGH = new YzgFileVideoImageItemReqVo(1D, 1D, 1920, 1080);
/**
* 常规品质
*/
public static final YzgFileVideoImageItemReqVo VIDEO_TYPE_COMMON = new YzgFileVideoImageItemReqVo(1D, 1D, 800, 600);
/**
* 低质量品质
*/
public static final YzgFileVideoImageItemReqVo VIDEO_TYPE_LOW = new YzgFileVideoImageItemReqVo(1D, 1D, 960, 0);
@ApiModelProperty(notes = "目标文件")
private String toFile;
@ApiModelProperty(notes = "压缩尺寸比例,默认为1,范围在0~1之间.")
private double size = 1D;
@ApiModelProperty(notes = "质量压缩比例,默认为1,范围在0~1之间.")
private double quote = 1D;
@ApiModelProperty(notes = "分辨率x,如: 1920*1080中的1920.")
private double x = 0;
@ApiModelProperty(notes = "分辨率x,如: 1920*1080中的1080.")
private double y = 0;
public YzgFileVideoImageItemReqVo() {
}
private YzgFileVideoImageItemReqVo(double size, double quote, double x, double y) {
this.size = size;
this.quote = quote;
this.x = x;
this.y = y;
}
public YzgFileVideoImageItemReqVo(String toFile, @NotNull YzgFileVideoImageItemReqVo from) {
this(from.size, from.quote, from.x, from.y);
this.toFile = toFile;
}
public YzgFileVideoImageItemReqVo(String toFile, double size, double quote, double x, double y) {
this(size, quote, x, y);
this.toFile = toFile;
}
public String getToFile() {
return toFile;
}
public void setToFile(String toFile) {
this.toFile = toFile;
}
public double getSize() {
return size;
}
public void setSize(double size) {
this.size = size;
}
public double getQuote() {
return quote;
}
public void setQuote(double quote) {
this.quote = quote;
}
public double getX() {
return x;
}
public void setX(double x) {
this.x = x;
}
public double getY() {
return y;
}
public void setY(double y) {
this.y = y;
}
}
package com.yanzuoguang.cloud.file.vo;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* 设置需要移动,并且对移动后的文件进行压缩
*
* @author 颜佐光
*/
public class YzgFileVideoImageReqVo extends YzgFileMoveItemReqVo {
/**
* 压缩后的文件参数集合
*/
@ApiModelProperty(notes = "压缩后的文件参数集合", position = 10000)
private List<YzgFileVideoImageReqVo> list = new ArrayList<>();
public YzgFileVideoImageReqVo() {
}
public YzgFileVideoImageReqVo(String from, YzgFileVideoImageReqVo... list) {
super(from);
this.list.addAll(Arrays.asList(list));
}
public YzgFileVideoImageReqVo(String from, String to, YzgFileVideoImageReqVo... list) {
super(from, to);
this.list.addAll(Arrays.asList(list));
}
public YzgFileVideoImageReqVo(String from, List<YzgFileVideoImageReqVo> list) {
super(from);
this.list = list;
}
public YzgFileVideoImageReqVo(String from, String to, List<YzgFileVideoImageReqVo> list) {
super(from, to);
this.list = list;
}
public List<YzgFileVideoImageReqVo> getList() {
return list;
}
public void setList(List<YzgFileVideoImageReqVo> list) {
this.list = list;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment