|
@ -0,0 +1,33 @@ |
|
|
|
|
|
package com.iflytop.gd.app.controller; |
|
|
|
|
|
|
|
|
|
|
|
import com.iflytop.gd.app.model.entity.Container; |
|
|
|
|
|
import com.iflytop.gd.app.service.ContainerService; |
|
|
|
|
|
import com.iflytop.gd.common.result.Result; |
|
|
|
|
|
import io.swagger.v3.oas.annotations.Operation; |
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag; |
|
|
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
@Tag(name = "容器") |
|
|
|
|
|
@RestController |
|
|
|
|
|
@RequestMapping("/api/container") |
|
|
|
|
|
@RequiredArgsConstructor |
|
|
|
|
|
@Slf4j |
|
|
|
|
|
public class ContainerController { |
|
|
|
|
|
private final ContainerService containerService; |
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "容器列表") |
|
|
|
|
|
@GetMapping("/list") |
|
|
|
|
|
public Result<List<Container>> getAllContainer() { |
|
|
|
|
|
return Result.success(containerService.getAllContainer()); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "更新容器配置") |
|
|
|
|
|
@PutMapping("") |
|
|
|
|
|
public Result<Boolean> updateContainer(@RequestBody Container container) { |
|
|
|
|
|
return Result.success(containerService.updateById(container)); |
|
|
|
|
|
} |
|
|
|
|
|
} |