3 changed files with 86 additions and 0 deletions
-
27src/main/java/com/iflytop/sgs/app/cmd/control/LiquidAddCommand.java
-
34src/main/java/com/iflytop/sgs/app/controller/ContainerController.java
-
25src/main/java/com/iflytop/sgs/app/service/api/ContainerService.java
@ -0,0 +1,34 @@ |
|||||
|
package com.iflytop.sgs.app.controller; |
||||
|
|
||||
|
import com.iflytop.sgs.app.model.entity.Container; |
||||
|
import com.iflytop.sgs.app.service.api.ContainerService; |
||||
|
import com.iflytop.sgs.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)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.iflytop.sgs.app.service.api; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
|
import com.iflytop.sgs.app.mapper.ContainerMapper; |
||||
|
import com.iflytop.sgs.app.model.entity.Container; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* 容器接口服务 |
||||
|
*/ |
||||
|
@Service |
||||
|
@RequiredArgsConstructor |
||||
|
public class ContainerService extends ServiceImpl<ContainerMapper, Container> { |
||||
|
private final ContainerMapper containerMapper; |
||||
|
|
||||
|
public List<Container> getList() { |
||||
|
return this.list(); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue