You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
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 jakarta.validation.Valid;
|
|
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>> getList() {
|
|
return Result.success(containerService.getList());
|
|
}
|
|
|
|
@Operation(summary = "更新容器配置")
|
|
@PutMapping("")
|
|
public Result<Boolean> update(@Valid @RequestBody Container container) {
|
|
return Result.success(containerService.updateById(container));
|
|
}
|
|
}
|