| | |
| | | package com.ruoyi.oil.controller; |
| | | |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.oil.domain.OilWall; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.uuid.UUID; |
| | | import com.ruoyi.oil.domain.ArdOilWall; |
| | | import com.ruoyi.oil.param.OilWallParam; |
| | | import com.ruoyi.oil.service.OilWallService; |
| | | import com.ruoyi.oil.service.ArdOilWallService; |
| | | import com.ruoyi.utils.result.Results; |
| | | 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.web.bind.annotation.*; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @author Administrator |
| | |
| | | public class OilWallController { |
| | | |
| | | @Autowired |
| | | private OilWallService oilWallService; |
| | | private ArdOilWallService ardOilWallService; |
| | | |
| | | @PostMapping("/add") |
| | | @ApiOperation("添加电子围栏") |
| | | public Results add(OilWall oilWall){ |
| | | return Results.succeed("成功添加"+oilWallService.addOilWall(oilWall)+"条数据"); |
| | | public Results add(@RequestBody ArdOilWall ardOilWall){ |
| | | ardOilWall.setId(String.valueOf(UUID.randomUUID())); |
| | | ardOilWall.setCreateBy(SecurityUtils.getUsername()); |
| | | ardOilWall.setCreateTime(new Date()); |
| | | return Results.succeed("成功添加"+ ardOilWallService.addOilWall(ardOilWall)+"条数据"); |
| | | } |
| | | |
| | | @DeleteMapping("/del") |
| | | @ApiOperation("删除电子围栏") |
| | | public Results del(String id){ |
| | | return Results.succeed("成功删除"+oilWallService.delOilWall(id)+"条数据"); |
| | | return Results.succeed("成功删除"+ ardOilWallService.delOilWall(id)+"条数据"); |
| | | } |
| | | |
| | | @PutMapping("/upd") |
| | | @ApiOperation("修改电子围栏") |
| | | public Results upd(OilWall oilWall){ |
| | | return Results.succeed("成功修改"+oilWallService.updOilWall(oilWall)+"条数据"); |
| | | public Results upd(@RequestBody ArdOilWall ardOilWall){ |
| | | ardOilWall.setUpdateBy(SecurityUtils.getUsername()); |
| | | ardOilWall.setUpdateTime(new Date()); |
| | | return Results.succeed("成功修改"+ ardOilWallService.updOilWall(ardOilWall)+"条数据"); |
| | | } |
| | | |
| | | @GetMapping("/one") |
| | | @ApiOperation("查询一条电子围栏") |
| | | public Results one(String id){ |
| | | return Results.succeed(oilWallService.delOilWall(id)); |
| | | return Results.succeed(ardOilWallService.one(id)); |
| | | } |
| | | |
| | | @GetMapping("/query") |
| | | @ApiOperation("查询所有电子围栏") |
| | | public Results query(OilWallParam oilWallParam){ |
| | | return Results.succeed(oilWallService.query(oilWallParam)); |
| | | return Results.succeed(ardOilWallService.query(oilWallParam)); |
| | | } |
| | | |
| | | } |