| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- package com.example.lambda.service.web;
- import com.example.lambda.service.web.entity.*;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.beans.factory.annotation.Value;
- import org.springframework.web.bind.annotation.GetMapping;
- import org.springframework.web.bind.annotation.PostMapping;
- import org.springframework.web.bind.annotation.RequestBody;
- import org.springframework.web.bind.annotation.RestController;
- @RestController
- public class LambdaController {
- @Value("${server.port}")
- private Integer port;
- @Autowired
- private LambdaService lambdaService;
- @GetMapping("/")
- public String check() {
- String status = lambdaService.interpreterStatus();
- return "Lambda Service listen at " + port + ", with " + status;
- }
- @GetMapping("/info")
- public ServiceInfo info() {
- return lambdaService.info();
- }
- @PostMapping("/pattern")
- public ServiceResponse pattern(@RequestBody PatternParam param) {
- System.out.println("pattern: " + param.getData().toString());
- ServiceResponse response = lambdaService.pattern(param);
- return response;
- }
- @PostMapping("/render")
- public ServiceResponse render(@RequestBody RenderParam param) {
- System.out.println("render: " + param.getData().toString());
- ServiceResponse response = lambdaService.render(param);
- return response;
- }
- }
|