Создан первый сервис.

This commit is contained in:
2025-03-27 23:18:35 +04:00
parent 7dee24b6ff
commit c5caa4d5ee
3 changed files with 78 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
package ru.sguardian;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
public class ContainerFirst {
public static void main(String[] args){
SpringApplication.run(ContainerFirst.class, args);
System.out.println("Server-1 started");
}
@PostMapping("/service-one")
public int[][] processMatrixPart(@RequestBody int[][] matrix){
long startTime = System.nanoTime();
MatrixProcessor process = new MatrixProcessor();
System.out.println("Service started work");
int[][] result = process.operationMatrix(matrix);
long endTime = System.nanoTime();
System.out.println("Service-1 end work " + (endTime - startTime) / 1000000 + " ms");
return result;
}
}