修改postman数据未设置项目名称时生成的json文件导入时会替换postman同名文件夹
This commit is contained in:
parent
ad15c7d366
commit
d403aa718f
|
@ -4,6 +4,9 @@ import com.google.gson.Gson;
|
|||
import com.power.common.util.StringUtil;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.time.temporal.TemporalAccessor;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
|
@ -11,17 +14,16 @@ import java.util.UUID;
|
|||
*/
|
||||
public class InfoBean {
|
||||
|
||||
private String _postman_id;
|
||||
private String _postman_id = UUID.randomUUID().toString();
|
||||
private String name;
|
||||
String schema ;
|
||||
public InfoBean(String name) {
|
||||
if(StringUtils.isBlank(name)){
|
||||
this.name = "smart-doc";
|
||||
this.name = "smart-doc "+ LocalDateTime.now().format(DateTimeFormatter.ofPattern("YYYY-MM-DD HH:MM:SS"));
|
||||
}
|
||||
else {
|
||||
this.name = name;
|
||||
}
|
||||
this._postman_id =UUID.randomUUID().toString();
|
||||
this.schema = "https://schema.getpostman.com/json/collection/v2.0.0/collection.json";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue