2525@ RequestMapping ("/admin/root" )
2626public class AdminRootController {
2727 @ Autowired
28- private ConfigService configService ;
28+ private ConfdataService confdataService ;
2929 @ Autowired
3030 private KeysService keysService ;
3131 @ Autowired
@@ -196,7 +196,7 @@ public Msg LoadInfo(@RequestParam(value = "data", defaultValue = "") String data
196196 } else if (key .getStorageType () == 7 ) {
197197 ret = FtpServiceImpl .Initialize (key );
198198 } else if (key .getStorageType () == 8 ) {
199- ret = UFileImageupload .Initialize (key );
199+ ret = S3Imageupload .Initialize (key );
200200 }
201201 Long l = imgService .getsourcememory (keyId );
202202 jsonObject .put ("isok" , ret );
@@ -219,23 +219,24 @@ public Msg LoadInfo(@RequestParam(value = "data", defaultValue = "") String data
219219 @ ResponseBody
220220 public Msg updateStorage (@ RequestParam (value = "data" , defaultValue = "" ) String data ) {
221221 JSONObject jsonObj = JSONObject .parseObject (data );
222- Integer id = jsonObj .getInteger ("id" );
223- String AccessKey = jsonObj .getString ("AccessKey" );
224- String AccessSecret = jsonObj .getString ("AccessSecret" );
225- String Endpoint = jsonObj .getString ("Endpoint" );
226- String Bucketname = jsonObj .getString ("Bucketname" );
227- String RequestAddress = jsonObj .getString ("RequestAddress" );
228- Integer storageType = jsonObj .getInteger ("storageType" );
229- String keyname = jsonObj .getString ("keyname" );
230- Keys keys = new Keys ();
231- keys .setId (id );
232- keys .setAccessKey (AccessKey );
233- keys .setAccessSecret (AccessSecret );
234- keys .setEndpoint (Endpoint );
235- keys .setBucketname (Bucketname );
236- keys .setRequestAddress (RequestAddress );
237- keys .setStorageType (storageType );
238- keys .setKeyname (keyname );
222+ // Integer id = jsonObj.getInteger("id");
223+ // String AccessKey = jsonObj.getString("AccessKey");
224+ // String AccessSecret = jsonObj.getString("AccessSecret");
225+ // String Endpoint = jsonObj.getString("Endpoint");
226+ // String Bucketname = jsonObj.getString("Bucketname");
227+ // String RequestAddress = jsonObj.getString("RequestAddress");
228+ // Integer storageType = jsonObj.getInteger("storageType");
229+ // String keyname = jsonObj.getString("keyname");
230+ // Keys keys = new Keys();
231+ // keys.setId(id);
232+ // keys.setAccessKey(AccessKey);
233+ // keys.setAccessSecret(AccessSecret);
234+ // keys.setEndpoint(Endpoint);
235+ // keys.setBucketname(Bucketname);
236+ // keys.setRequestAddress(RequestAddress);
237+ // keys.setStorageType(storageType);
238+ // keys.setKeyname(keyname);
239+ Keys keys = JSON .toJavaObject (jsonObj ,Keys .class );
239240 Msg msg = keysService .updateKey (keys );
240241 return msg ;
241242 }
@@ -260,15 +261,15 @@ public Msg getSettingConfig(@RequestParam(value = "data", defaultValue = "") Str
260261 User u = (User ) subject .getPrincipal ();
261262 try {
262263 UploadConfig uploadConfig = uploadConfigService .getUpdateConfig ();
263- Config config = configService . getSourceype ( );
264+ final Confdata confdata = confdataService . selectConfdata ( "config" );
264265 SysConfig sysConfig = sysConfigService .getstate ();
265266 AppClient appClientData = appClientService .getAppClientData ("app" );
266267 uploadConfig .setUsermemory (Long .toString (Long .valueOf (uploadConfig .getUsermemory ()) / 1024 / 1024 ));
267268 uploadConfig .setVisitormemory (Long .toString (Long .valueOf (uploadConfig .getVisitormemory ()) / 1024 / 1024 ));
268269 uploadConfig .setFilesizetourists (Long .toString (Long .valueOf (uploadConfig .getFilesizetourists ()) / 1024 / 1024 ));
269270 uploadConfig .setFilesizeuser (Long .toString (Long .valueOf (uploadConfig .getFilesizeuser ()) / 1024 / 1024 ));
270271 jsonObject .put ("uploadConfig" , uploadConfig );
271- jsonObject .put ("config" , config );
272+ jsonObject .put ("config" , JSONObject . parseObject ( confdata . getJsondata ()) );
272273 jsonObject .put ("sysConfig" , sysConfig );
273274 jsonObject .put ("appClient" , appClientData );
274275 msg .setData (jsonObject );
@@ -296,7 +297,7 @@ public Msg updateConfig(@RequestParam(value = "data", defaultValue = "") String
296297 msg .setCode ("500" );
297298 return msg ;
298299 }
299- Config config = JSON .toJavaObject ((JSON ) jsonObject .get ("config" ), Config .class );
300+ // Config config = JSON.toJavaObject((JSON) jsonObject.get("config"), Config.class);
300301 SysConfig sysConfig = JSON .toJavaObject ((JSON ) jsonObject .get ("sysConfig" ), SysConfig .class );
301302 AppClient appClient = JSON .toJavaObject ((JSON ) jsonObject .get ("appClient" ), AppClient .class );
302303 if (Integer .valueOf (vm ) == -1 ) {
@@ -308,7 +309,10 @@ public Msg updateConfig(@RequestParam(value = "data", defaultValue = "") String
308309 uploadConfig .setUsermemory (Long .toString (Long .valueOf (uploadConfig .getUsermemory ()) * 1024 * 1024 ));
309310 uploadConfig .setFilesizeuser (Long .toString (Long .valueOf (uploadConfig .getFilesizeuser ()) * 1024 * 1024 ));
310311 uploadConfigService .setUpdateConfig (uploadConfig );
311- configService .setSourceype (config );
312+ Confdata confdata = new Confdata ();
313+ confdata .setKey ("config" );
314+ confdata .setJsondata (jsonObject .getJSONObject ("config" ).toJSONString ());
315+ confdataService .updateConfdata (confdata );
312316 sysConfigService .setstate (sysConfig );
313317 if (!appClient .getIsuse ().equals ("on" )) {
314318 appClient .setIsuse ("off" );
0 commit comments