diff --git a/代码库/mall-admin/src/main/java/com/sock/mall/controller/OssCtontroller.java b/代码库/mall-admin/src/main/java/com/sock/mall/controller/OssCtontroller.java new file mode 100644 index 0000000..5b7722e --- /dev/null +++ b/代码库/mall-admin/src/main/java/com/sock/mall/controller/OssCtontroller.java @@ -0,0 +1,42 @@ +package com.macro.mall.controller; + + +import com.macro.mall.dto.CommonResult; +import com.macro.mall.dto.OssCallbackResult; +import com.macro.mall.dto.OssPolicyResult; +import com.macro.mall.service.impl.OssServiceImpl; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; + +/** + * Oss��ز����ӿ� + */ +@Controller +@Api(tags = "OssController",description = "Oss����") +@RequestMapping("/aliyun/oss") +public class OssController { + @Autowired + private OssServiceImpl ossService;//�����Ʒ��� + + @ApiOperation(value = "oss�ϴ�ǩ������") + @RequestMapping(value = "/policy",method = RequestMethod.GET) + @ResponseBody + public Object policy() { + OssPolicyResult result = ossService.policy(); + return new CommonResult().success(result); + } + + @ApiOperation(value = "oss�ϴ��ɹ��ص�")//�����ƴ洢 + @RequestMapping(value = "callback",method = RequestMethod.POST) + @ResponseBody + public Object callback(HttpServletRequest request) { + OssCallbackResult ossCallbackResult = ossService.callback(request); + return new CommonResult().success(ossCallbackResult); + } + +} \ No newline at end of file