JSONField

This commit is contained in:
bwcx_jzy 2019-08-28 02:05:25 -05:00
parent 68dc286a6d
commit 7ba61385aa
2 changed files with 1 additions and 23 deletions

View File

@ -32,7 +32,7 @@ public class OutGivingModel extends BaseModel {
/**
* 临时缓存
*/
@JSONField(serialize = false)
@JSONField(serialize = false, deserialize = false)
private Map<NodeModel, JSONObject> tempCacheMap;
/**
* 是否为单独创建的分发项目

View File

@ -1,7 +1,6 @@
package io.jpom.service.node;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.jpom.common.BaseOperService;
import io.jpom.model.data.OutGivingModel;
import io.jpom.model.data.OutGivingNodeProject;
@ -25,27 +24,6 @@ public class OutGivingServer extends BaseOperService<OutGivingModel> implements
super(ServerConfigBean.OUTGIVING);
}
@Override
public void addItem(OutGivingModel outGivingModel) {
// 不保存临时数据
JSONObject jsonObject = outGivingModel.toJson();
jsonObject.remove("tempCacheMap");
OutGivingModel newData = jsonObject.toJavaObject(OutGivingModel.class);
newData.setTempCacheMap(null);
// 保存
super.addItem(newData);
}
@Override
public void updateItem(OutGivingModel outGivingModel) {
// 不保存临时数据
JSONObject jsonObject = outGivingModel.toJson();
jsonObject.remove("tempCacheMap");
OutGivingModel newData = jsonObject.toJavaObject(OutGivingModel.class);
newData.setTempCacheMap(null);
super.updateItem(newData);
}
public boolean checkNode(String nodeId) {
List<OutGivingModel> list = list();
if (list == null || list.isEmpty()) {