New file |
| | |
| | | package com.ycl.platform.controller; |
| | | |
| | | import com.ycl.system.domain.group.Update; |
| | | import com.ycl.system.domain.group.Add; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import lombok.RequiredArgsConstructor; |
| | | import java.util.List; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import jakarta.validation.constraints.NotEmpty; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import com.ycl.platform.service.YwPointService; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.platform.domain.form.YwPointForm; |
| | | import com.ycl.platform.domain.query.YwPointQuery; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * 运维点位 前端控制器 |
| | | * |
| | | * @author xp |
| | | * @since 2024-03-05 |
| | | */ |
| | | @Validated |
| | | @RequiredArgsConstructor |
| | | @Api(value = "运维点位", tags = "运维点位管理") |
| | | @RestController |
| | | @RequestMapping("/yw-point") |
| | | public class YwPointController { |
| | | |
| | | private final YwPointService ywPointService; |
| | | |
| | | @PostMapping |
| | | @ApiOperation(value = "添加", notes = "添加") |
| | | public Result add(@RequestBody @Validated(Add.class) YwPointForm form) { |
| | | return ywPointService.add(form); |
| | | } |
| | | |
| | | @PostMapping("/batch") |
| | | @ApiOperation(value = "批量添加", notes = "批量添加") |
| | | public Result batchAdd(@RequestBody @NotEmpty(message = "数据不能为空") List<YwPointForm> form) { |
| | | return ywPointService.batchAdd(form); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation(value = "修改", notes = "修改") |
| | | public Result update(@RequestBody @Validated(Update.class) YwPointForm form) { |
| | | return ywPointService.update(form); |
| | | } |
| | | |
| | | @DeleteMapping("/{id}") |
| | | @ApiOperation(value = "ID删除", notes = "ID删除") |
| | | public Result removeById(@PathVariable("id") String id) { |
| | | return ywPointService.removeById(id); |
| | | } |
| | | |
| | | @DeleteMapping("/batch") |
| | | @ApiOperation(value = "批量删除", notes = "批量删除") |
| | | public Result remove(@RequestBody @NotEmpty(message = "请选择数据") List<String> ids) { |
| | | return ywPointService.remove(ids); |
| | | } |
| | | |
| | | @PreAuthorize("@ss.hasPermi('point:page')") |
| | | @GetMapping("/page") |
| | | @ApiOperation(value = "分页", notes = "分页") |
| | | public Result page(YwPointQuery query) { |
| | | return ywPointService.page(query); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @ApiOperation(value = "详情", notes = "详情") |
| | | public Result detail(@PathVariable("id") String id) { |
| | | return ywPointService.detail(id); |
| | | } |
| | | |
| | | @GetMapping("/list") |
| | | @ApiOperation(value = "列表", notes = "列表") |
| | | public Result list() { |
| | | return ywPointService.all(); |
| | | } |
| | | } |