| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.model.TFaultDescribeDic; |
| | | import com.ruoyi.system.query.TFaultDescribeDicQuery; |
| | | import com.ruoyi.system.service.TFaultDescribeDicService; |
| | | import com.ruoyi.system.vo.TFaultDescribeDicVO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author xiaochen |
| | | * @since 2025-01-17 |
| | | */ |
| | | @Api(tags = "故障描述") |
| | | @RestController |
| | | @RequestMapping("/t-fault-describe-dic") |
| | | public class TFaultDescribeDicController { |
| | | |
| | | |
| | | private final TFaultDescribeDicService faultDescribeDicService; |
| | | @Autowired |
| | | public TFaultDescribeDicController(TFaultDescribeDicService faultDescribeDicService) { |
| | | this.faultDescribeDicService = faultDescribeDicService; |
| | | } |
| | | |
| | | /** |
| | | * 获取故障描述管理列表 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:faultDescribe:list')") |
| | | @ApiOperation(value = "获取故障描述分页列表") |
| | | @PostMapping(value = "/pageList") |
| | | public R<PageInfo<TFaultDescribeDicVO>> pageList(@RequestBody TFaultDescribeDicQuery query) { |
| | | return R.ok(faultDescribeDicService.pageList(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加故障描述管理 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:faultDescribe:add')") |
| | | @Log(title = "故障描述信息-新增故障描述", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "添加故障描述") |
| | | @PostMapping(value = "/add") |
| | | public R<Boolean> add(@Validated @RequestBody TFaultDescribeDic dto) { |
| | | return R.ok(faultDescribeDicService.save(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 修改故障描述 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:faultDescribe:update')") |
| | | @Log(title = "故障描述信息-修改故障描述", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "修改故障描述") |
| | | @PostMapping(value = "/update") |
| | | public R<Boolean> update(@Validated @RequestBody TFaultDescribeDic dto) { |
| | | return R.ok(faultDescribeDicService.updateById(dto)); |
| | | } |
| | | |
| | | /** |
| | | * 查看故障描述详情 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:faultDescribe:detail')") |
| | | @ApiOperation(value = "查看故障描述详情") |
| | | @GetMapping(value = "/getDetailById") |
| | | public R<TFaultDescribeDic> getDetailById(@RequestParam String id) { |
| | | return R.ok(faultDescribeDicService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 删除故障描述 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:faultDescribe:delete')") |
| | | @Log(title = "故障描述信息-删除故障描述", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除故障描述") |
| | | @DeleteMapping(value = "/deleteById") |
| | | public R<Boolean> deleteById(@RequestParam String id) { |
| | | return R.ok(faultDescribeDicService.removeById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除故障描述 |
| | | */ |
| | | @PreAuthorize("@ss.hasPermi('system:faultDescribe:delete')") |
| | | @Log(title = "故障描述信息-删除故障描述", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "批量删除故障描述") |
| | | @DeleteMapping(value = "/deleteByIds") |
| | | public R<Boolean> deleteByIds(@RequestBody List<String> ids) { |
| | | return R.ok(faultDescribeDicService.removeByIds(ids)); |
| | | } |
| | | |
| | | } |
| | | |