@@ -0,0 +1,2376 @@
+package com.testclient.service;%0A%0Aimport java.io.File;%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.Map.Entry;%0A%0Aimport org.apache.log4j.Logger;%0Aimport org.codehaus.jackson.map.ObjectMapper;%0Aimport org.springframework.stereotype.Service;%0A%0Aimport com.testclient.factory.JsonObjectMapperFactory;%0Aimport com.testclient.httpmodel.DataGridJson;%0Aimport com.testclient.httpmodel.Json;%0Aimport com.testclient.httpmodel.MixActionSettingContainer;%0Aimport com.testclient.httpmodel.MixActionSettingInfo;%0A%0A@Service(%22mixActionService%22)%0Apublic class MixActionService %7B%0A%09private static final Logger logger = Logger.getLogger(MixActionService.class);%0A%09%0A%09public Json addMixActionSetting(String path,String filename,MixActionSettingInfo item)%7B%0A%09%09item.setId(String.valueOf(System.currentTimeMillis()));%0A%09%09Json j=new Json();%0A%09%09File f=new File(path+%22/%22+filename);%0A%09%09MixActionSettingContainer c=new MixActionSettingContainer();%0A%09%09ObjectMapper mapper = JsonObjectMapperFactory.getObjectMapper();%0A%09%09try%7B%0A%09%09%09if(f.exists())%7B%0A%09%09%09%09c= mapper.readValue(f, MixActionSettingContainer.class);%0A%09%09%09%7D%0A%09%09%09c.getMixActionSettings().put(item.getId(), item);%0A%09%09%09mapper.writeValue(f, c);%0A%09%09%09j.setSuccess(true);%0A%09%09%7Dcatch(Exception e)%7B%0A%09%09%09j.setSuccess(false);%0A%09%09%7D%0A%09%09return j;%0A%09%7D%0A%09%0A%09public DataGridJson getMixActionSettings(String path,String filename) throws Exception%7B%0A%09%09DataGridJson j = new DataGridJson();%0A%09%09List%3CMixActionSettingInfo%3E row=new ArrayList%3CMixActionSettingInfo%3E();%0A%09%09File f=new File(path+%22/%22+filename);%0A%09%09if(f.exists())%7B%0A%09%09%09ObjectMapper mapper = JsonObjectMapperFactory.getObjectMapper();%0A%09%09%09MixActionSettingContainer c = mapper.readValue(f, MixActionSettingContainer.class);%0A%09%09%09for(Entry%3CString,MixActionSettingInfo%3E entry:c.getMixActionSettings().entrySet())%7B%0A%09%09%09%09row.add(entry.getValue());%0A%09%09%09%7D%0A%09%09%7D%0A%09%09j.setRows(row);%0A%09%09j.setTotal(row.size());%0A%09%09return j;%0A%09%7D%0A%09%0A%09public Json deleteMixActionSetting(String path,String filename,String id)%7B%0A%09%09Json j = new Json();%0A%09%09File f=new File(path+%22/%22+filename);%0A%09%09MixActionSettingContainer c=new MixActionSettingContainer();%0A%09%09ObjectMapper mapper = JsonObjectMapperFactory.getObjectMapper();%0A%09%09try%7B%0A%09%09%09if(f.exists())%7B%0A%09%09%09%09c= mapper.readValue(f, MixActionSettingContainer.class);%0A%09%09%09%09c.getMixActionSettings().remove(id);%0A%09%09%09%09mapper.writeValue(f, c);%0A%09%09%09%7D%0A%09%09%09j.setSuccess(true);%0A%09%09%7Dcatch(Exception e)%7B%0A%09%09%09j.setSuccess(false);%0A%09%09%7D%0A%09%09return j;%0A%09%7D%0A%09%0A%7D%0A

Create MixActionService.java