Newer
Older
DTRAMServer / src / main / java / com / example / test / rest_controllers / OpenModelController.java
package com.example.test.rest_controllers;

import java.io.IOException;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import com.example.test.services.ModelHandleService;

@RestController
@RequestMapping("/api")
public class OpenModelController {
	
	private final ModelHandleService modelService;
	
	OpenModelController(ModelHandleService oms){
		this.modelService = oms;
	}

	@PostMapping("/open_model")
	public void openModel(@RequestParam("file") MultipartFile file) {
		try {
			modelService.openModel(file.getInputStream());
		} catch (IOException e) {
			// TODO 自動生成された catch ブロック
			e.printStackTrace();
		}
	}
	
	
	
	
}