<%_ if (position === 'import') { _%>
import <%= packageName %>.service.dto.ResourceCategoryDTO;
<%_ } _%>
<%_ if (position === 'method') { _%>

     /**
     * {@code POST  /} : Create a new uploadImage.
     *
     * @param uploadImageDTO the uploadImageDTO to create.
     * @param image the imageFile to upload.
     * @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new uploadImageDTO, or with status {@code 400 (Bad Request)} if the uploadImage has already an ID.
     * @throws URISyntaxException if the Location URI syntax is incorrect.
     */
    @PostMapping("")
    public ResponseEntity<UploadImageDTO> createUploadImage(
        @RequestPart(required = false) UploadImageDTO uploadImageDTO,
        @RequestPart("image") MultipartFile image
    ) throws URISyntaxException {
        log.debug("REST request to save UploadImage : {}", image.getOriginalFilename());
        if (image.isEmpty()) {
            throw new BadRequestAlertException("A new uploadImage cannot null", ENTITY_NAME, "imageisnull");
        }
        if (Objects.isNull(uploadImageDTO)) {
            uploadImageDTO = new UploadImageDTO();
        }
        uploadImageDTO.setImage(image);
        UploadImageDTO result = null;
        try {
            result = uploadImageService.save(uploadImageDTO);
        } catch (Exception e) {
            throw new BadRequestAlertException("UploadImageError", ENTITY_NAME, "fileError");
        }
        return ResponseEntity.created(new URI("/api/upload-images/" + result.getId()))
            .headers(HeaderUtil.createEntityCreationAlert(applicationName, true, ENTITY_NAME, result.getId().toString()))
            .body(result);
    }
<%_ } _%>
