forked from sevastyan_b/SSPR_25
Создан первый сервис.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user