package com.tejia.lijin.app.entity.common;
|
|
import java.io.File;
|
import java.io.Serializable;
|
import java.util.ArrayList;
|
import java.util.List;
|
|
public class ImageShowEntity implements Serializable {
|
//文件路径
|
private String filePath;
|
//图片链接
|
private String url;
|
|
public ImageShowEntity(String filePath, String url) {
|
this.filePath = filePath;
|
this.url = url;
|
}
|
|
public String getFilePath() {
|
return filePath;
|
}
|
|
public void setFilePath(String filePath) {
|
this.filePath = filePath;
|
}
|
|
public String getUrl() {
|
return url;
|
}
|
|
public void setUrl(String url) {
|
this.url = url;
|
}
|
|
public static List<ImageShowEntity> create(List<String> urlList) {
|
List<ImageShowEntity> list = new ArrayList<>();
|
if (urlList != null)
|
for (String url : urlList)
|
list.add(new ImageShowEntity(null, url));
|
return list;
|
}
|
|
public static List<ImageShowEntity> create(File f) {
|
List<ImageShowEntity> list = new ArrayList<>();
|
if (f != null)
|
list.add(new ImageShowEntity(f.getAbsolutePath(), null));
|
return list;
|
}
|
}
|