FileUploadController.java 1.03 KB
Newer Older
neo's avatar
neo committed
1 2 3 4 5 6 7 8 9 10 11 12
package pwc.taxtech.atms.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import pwc.taxtech.atms.constant.enums.EnumModule;
import pwc.taxtech.atms.vat.service.impl.FileUploadAdapter;

13
import static pwc.taxtech.atms.constant.Constant.USER_Id_FOR_UPLOAD;
neo's avatar
neo committed
14 15 16 17 18 19 20 21 22

@RestController
@RequestMapping("/api/v1/FileUpload")
public class FileUploadController {
    @Autowired
    private FileUploadAdapter fileUploadAdapter;

    @RequestMapping(value = "NewFile", method = RequestMethod.POST, produces = MediaType.MULTIPART_FORM_DATA_VALUE)
    public ResponseEntity getInputInvoiceTreeViewData(MultipartHttpServletRequest request) {
23
        return fileUploadAdapter.upload(request);
neo's avatar
neo committed
24 25
    }
}