feat: 更新
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
package com.schisandra.share.common.enums;
|
||||
|
||||
public enum TypeName {
|
||||
/**
|
||||
* 阿里oss
|
||||
*/
|
||||
阿里云OSS("ali"),
|
||||
/**
|
||||
* Minio oss
|
||||
*/
|
||||
MinIO("minio"),
|
||||
/**
|
||||
* 又拍OSS
|
||||
*/
|
||||
又拍云USS("up"),
|
||||
/**
|
||||
* SFTP
|
||||
*/
|
||||
sftp("sftp"),
|
||||
/**
|
||||
* 腾讯OSS
|
||||
*/
|
||||
腾讯云COS("tencent"),
|
||||
/**
|
||||
* 百度OSS
|
||||
*/
|
||||
百度云BOS("baidu"),
|
||||
/**
|
||||
* 华为OSS
|
||||
*/
|
||||
华为云OBS("huawei"),
|
||||
/**
|
||||
* 网易 OSS
|
||||
*/
|
||||
网易云NOS("wangyi"),
|
||||
/**
|
||||
* 七牛 oss
|
||||
*/
|
||||
七牛云Kodo("qiniu");
|
||||
|
||||
|
||||
public String type;
|
||||
|
||||
|
||||
TypeName(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
public static TypeName getByType(String type) {
|
||||
for (TypeName resultKeyEnum : TypeName.values()) {
|
||||
if (resultKeyEnum.type.equals(type)) {
|
||||
return resultKeyEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
@@ -1,6 +1,6 @@
|
||||
package com.schisandra.share.infra.basic.service.impl;
|
||||
|
||||
import com.schisandra.share.infra.basic.entity.SchisandraShareTags;
|
||||
import com.schisandra.share.common.enums.TypeName;
|
||||
import com.schisandra.share.infra.basic.entity.SchisandraShareUrl;
|
||||
import com.schisandra.share.infra.basic.dao.SchisandraShareUrlDao;
|
||||
import com.schisandra.share.infra.basic.service.SchisandraShareUrlService;
|
||||
@@ -72,6 +72,11 @@ public class SchisandraShareUrlServiceImpl implements SchisandraShareUrlService
|
||||
|
||||
@Override
|
||||
public int insertBatch(List<SchisandraShareUrl> schisandraShareUrls) {
|
||||
for (SchisandraShareUrl schisandraShareUrl : schisandraShareUrls) {
|
||||
if(schisandraShareUrl.getTypeName()!=null){
|
||||
schisandraShareUrl.setTypeName(String.valueOf(TypeName.getByType(schisandraShareUrl.getTypeName())));
|
||||
}else continue;
|
||||
}
|
||||
return this.schisandraShareUrlDao.insertBatch(schisandraShareUrls);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user