Package co.mastermindcms.modules.rest
Class EcommerceMediaController
- java.lang.Object
-
- co.mastermindcms.modules.rest.EcommerceMediaController
-
- All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean
@RestController public class EcommerceMediaController extends java.lang.Object implements org.springframework.beans.factory.InitializingBean
-
-
Field Summary
Fields Modifier and Type Field Description private CommerceProperties
commerceProperties
private CommonProperties
commonProperties
private co.mastermindcms.modules.filestorage.services.FileManagerService
fileManagerService
private com.fasterxml.jackson.databind.ObjectMapper
mapper
private SalesCatalogService
salesCatalogService
private SKUService
skuService
-
Constructor Summary
Constructors Constructor Description EcommerceMediaController()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
afterPropertiesSet()
org.springframework.http.ResponseEntity<?>
handleRemoveImage(java.lang.String payload, UploadType command)
org.springframework.http.ResponseEntity<?>
handleRemoveImage(java.util.Map<java.lang.String,java.lang.Object> payload)
org.springframework.http.ResponseEntity<java.util.List<java.lang.String>>
handleShowImages(java.lang.String pathStr, java.lang.String urlPrefix)
org.springframework.http.ResponseEntity<?>
handleUploadImage(org.springframework.web.multipart.MultipartFile file, java.lang.String payload, UploadType command)
org.springframework.http.ResponseEntity<?>
handleUploadImage(org.springframework.web.multipart.MultipartFile file, java.util.Map<java.lang.String,java.lang.Object> payload)
-
-
-
Field Detail
-
fileManagerService
@Autowired private co.mastermindcms.modules.filestorage.services.FileManagerService fileManagerService
-
salesCatalogService
@Autowired private SalesCatalogService salesCatalogService
-
skuService
@Autowired private SKUService skuService
-
commerceProperties
@Autowired private CommerceProperties commerceProperties
-
commonProperties
@Autowired private CommonProperties commonProperties
-
mapper
private final com.fasterxml.jackson.databind.ObjectMapper mapper
-
-
Method Detail
-
handleShowImages
@CrossOrigin(origins="*", allowCredentials="false") @PostMapping(value="/api/v1/images", params={"path","urlPrefix"}, produces="application/json") @ResponseBody public org.springframework.http.ResponseEntity<java.util.List<java.lang.String>> handleShowImages(@RequestParam(name="path") java.lang.String pathStr, @RequestParam(name="urlPrefix") java.lang.String urlPrefix)
-
handleUploadImage
@PostMapping("/api/v1/uploadImage") @ResponseBody public org.springframework.http.ResponseEntity<?> handleUploadImage(@RequestParam(value="file",required=false) org.springframework.web.multipart.MultipartFile file, @RequestParam("payload") java.lang.String payload, @RequestParam("command") UploadType command) throws java.lang.Exception
- Throws:
java.lang.Exception
-
handleRemoveImage
@PostMapping("/api/v1/removeImage") @ResponseBody public org.springframework.http.ResponseEntity<?> handleRemoveImage(@RequestParam("payload") java.lang.String payload, @RequestParam("command") UploadType command) throws java.lang.Exception
- Throws:
java.lang.Exception
-
handleUploadImage
public org.springframework.http.ResponseEntity<?> handleUploadImage(org.springframework.web.multipart.MultipartFile file, java.util.Map<java.lang.String,java.lang.Object> payload) throws java.lang.Exception
- Throws:
java.lang.Exception
-
handleRemoveImage
public org.springframework.http.ResponseEntity<?> handleRemoveImage(java.util.Map<java.lang.String,java.lang.Object> payload) throws java.lang.Exception
- Throws:
java.lang.Exception
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
-
-