25
25
@ RequestMapping ("/admin/root" )
26
26
public class AdminRootController {
27
27
@ Autowired
28
- private ConfigService configService ;
28
+ private ConfdataService confdataService ;
29
29
@ Autowired
30
30
private KeysService keysService ;
31
31
@ Autowired
@@ -196,7 +196,7 @@ public Msg LoadInfo(@RequestParam(value = "data", defaultValue = "") String data
196
196
} else if (key .getStorageType () == 7 ) {
197
197
ret = FtpServiceImpl .Initialize (key );
198
198
} else if (key .getStorageType () == 8 ) {
199
- ret = UFileImageupload .Initialize (key );
199
+ ret = S3Imageupload .Initialize (key );
200
200
}
201
201
Long l = imgService .getsourcememory (keyId );
202
202
jsonObject .put ("isok" , ret );
@@ -219,23 +219,24 @@ public Msg LoadInfo(@RequestParam(value = "data", defaultValue = "") String data
219
219
@ ResponseBody
220
220
public Msg updateStorage (@ RequestParam (value = "data" , defaultValue = "" ) String data ) {
221
221
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 );
239
240
Msg msg = keysService .updateKey (keys );
240
241
return msg ;
241
242
}
@@ -260,15 +261,15 @@ public Msg getSettingConfig(@RequestParam(value = "data", defaultValue = "") Str
260
261
User u = (User ) subject .getPrincipal ();
261
262
try {
262
263
UploadConfig uploadConfig = uploadConfigService .getUpdateConfig ();
263
- Config config = configService . getSourceype ( );
264
+ final Confdata confdata = confdataService . selectConfdata ( "config" );
264
265
SysConfig sysConfig = sysConfigService .getstate ();
265
266
AppClient appClientData = appClientService .getAppClientData ("app" );
266
267
uploadConfig .setUsermemory (Long .toString (Long .valueOf (uploadConfig .getUsermemory ()) / 1024 / 1024 ));
267
268
uploadConfig .setVisitormemory (Long .toString (Long .valueOf (uploadConfig .getVisitormemory ()) / 1024 / 1024 ));
268
269
uploadConfig .setFilesizetourists (Long .toString (Long .valueOf (uploadConfig .getFilesizetourists ()) / 1024 / 1024 ));
269
270
uploadConfig .setFilesizeuser (Long .toString (Long .valueOf (uploadConfig .getFilesizeuser ()) / 1024 / 1024 ));
270
271
jsonObject .put ("uploadConfig" , uploadConfig );
271
- jsonObject .put ("config" , config );
272
+ jsonObject .put ("config" , JSONObject . parseObject ( confdata . getJsondata ()) );
272
273
jsonObject .put ("sysConfig" , sysConfig );
273
274
jsonObject .put ("appClient" , appClientData );
274
275
msg .setData (jsonObject );
@@ -296,7 +297,7 @@ public Msg updateConfig(@RequestParam(value = "data", defaultValue = "") String
296
297
msg .setCode ("500" );
297
298
return msg ;
298
299
}
299
- Config config = JSON .toJavaObject ((JSON ) jsonObject .get ("config" ), Config .class );
300
+ // Config config = JSON.toJavaObject((JSON) jsonObject.get("config"), Config.class);
300
301
SysConfig sysConfig = JSON .toJavaObject ((JSON ) jsonObject .get ("sysConfig" ), SysConfig .class );
301
302
AppClient appClient = JSON .toJavaObject ((JSON ) jsonObject .get ("appClient" ), AppClient .class );
302
303
if (Integer .valueOf (vm ) == -1 ) {
@@ -308,7 +309,10 @@ public Msg updateConfig(@RequestParam(value = "data", defaultValue = "") String
308
309
uploadConfig .setUsermemory (Long .toString (Long .valueOf (uploadConfig .getUsermemory ()) * 1024 * 1024 ));
309
310
uploadConfig .setFilesizeuser (Long .toString (Long .valueOf (uploadConfig .getFilesizeuser ()) * 1024 * 1024 ));
310
311
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 );
312
316
sysConfigService .setstate (sysConfig );
313
317
if (!appClient .getIsuse ().equals ("on" )) {
314
318
appClient .setIsuse ("off" );
0 commit comments