|
|
|
@ -2,6 +2,7 @@ |
|
|
|
|
|
|
|
package com.gaotao.modules.oss.controller; |
|
|
|
|
|
|
|
import com.gaotao.common.constant.SysMsgConstant; |
|
|
|
import com.gaotao.common.exception.XJException; |
|
|
|
import com.gaotao.common.utils.ConfigConstant; |
|
|
|
import com.gaotao.common.utils.Constant; |
|
|
|
@ -16,6 +17,7 @@ import com.gaotao.modules.oss.cloud.OSSFactory; |
|
|
|
import com.gaotao.modules.oss.entity.SysOssEntity; |
|
|
|
import com.gaotao.modules.oss.service.SysOssService; |
|
|
|
import com.gaotao.modules.oss.vo.SysOssEntityData; |
|
|
|
import com.gaotao.modules.sys.controller.AbstractController; |
|
|
|
import com.gaotao.modules.sys.service.SysConfigService; |
|
|
|
import com.google.gson.Gson; |
|
|
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
|
|
|
@ -35,7 +37,7 @@ import java.util.Map; |
|
|
|
*/ |
|
|
|
@RestController |
|
|
|
@RequestMapping("sys/oss") |
|
|
|
public class SysOssController { |
|
|
|
public class SysOssController extends AbstractController { |
|
|
|
@Autowired |
|
|
|
private SysOssService sysOssService; |
|
|
|
@Autowired |
|
|
|
@ -89,7 +91,7 @@ public class SysOssController { |
|
|
|
|
|
|
|
sysConfigService.updateValueByKey(KEY, new Gson().toJson(config)); |
|
|
|
|
|
|
|
return R.ok(); |
|
|
|
return R.ok(getLanguageMsg(SysMsgConstant.OBJECT_ID_200000)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -100,7 +102,7 @@ public class SysOssController { |
|
|
|
@RequiresPermissions("sys:oss:all") |
|
|
|
public R upload(@RequestParam("file") MultipartFile file) throws Exception { |
|
|
|
if (file.isEmpty()) { |
|
|
|
throw new XJException("上传文件不能为空"); |
|
|
|
throw new XJException(getLanguageMsg(SysMsgConstant.OBJECT_ID_200126)); |
|
|
|
} |
|
|
|
|
|
|
|
//上传文件 |
|
|
|
@ -125,7 +127,7 @@ public class SysOssController { |
|
|
|
public R delete(@RequestBody Long[] ids){ |
|
|
|
sysOssService.removeByIds(Arrays.asList(ids)); |
|
|
|
|
|
|
|
return R.ok(); |
|
|
|
return R.ok(getLanguageMsg(SysMsgConstant.OBJECT_ID_200000)); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -156,7 +158,7 @@ public class SysOssController { |
|
|
|
@PostMapping("/updateOssRef") |
|
|
|
public R updateOssRef(@RequestBody SysOssEntity sysOssEntity){ |
|
|
|
sysOssService.updateOssRef(sysOssEntity); |
|
|
|
return R.ok(); |
|
|
|
return R.ok(getLanguageMsg(SysMsgConstant.OBJECT_ID_200000)); |
|
|
|
} |
|
|
|
|
|
|
|
} |