张洋洋
2025-02-24 9804628abf554c3658345fc8fc9472cfb179fd5f
src/main/java/com/se/simu/controller/SemFilesSimuController.java
@@ -2,13 +2,11 @@
import com.se.simu.service.SemFilesSimuService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
@@ -71,4 +69,24 @@
    }
    /**
     * sem文件创建模拟
     */
    @ApiOperation("1-sem文件创建模拟")
    @PostMapping("/create")
    public ResponseEntity<Object> createSimuBySemFile() throws Exception {
        return ResponseEntity.ok(semFilesSimuService.createSimuBySemFile());
    }
    /**
     * sem文件读取模拟
     */
    @ApiOperation("2-sem文件读取模拟")
    @ApiImplicitParam(name = "filePath", value = "文件地址", required = true, dataType = "String", paramType = "query", example = "D:\\app\\simulation\\other\\1211SEM样例\\管点.sem", dataTypeClass = String.class)
    @PostMapping("/read")
    public ResponseEntity<Object> readSemFile(@RequestParam("filePath") String filePath) throws Exception {
        return ResponseEntity.ok(semFilesSimuService.readSemFile(filePath));
    }
}