Class EcommerceMediaController

  • All Implemented Interfaces:
    org.springframework.beans.factory.InitializingBean

    @RestController
    public class EcommerceMediaController
    extends java.lang.Object
    implements org.springframework.beans.factory.InitializingBean
    • Field Detail

      • fileManagerService

        @Autowired
        private co.mastermindcms.modules.filestorage.services.FileManagerService fileManagerService
      • skuService

        @Autowired
        private SKUService skuService
      • mapper

        private final com.fasterxml.jackson.databind.ObjectMapper mapper
    • Constructor Detail

      • EcommerceMediaController

        public EcommerceMediaController()
    • 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 interface org.springframework.beans.factory.InitializingBean
        Throws:
        java.lang.Exception