New file |
| | |
| | | package com.mes.loadposition.controller;
|
| | |
|
| | | import com.mes.loadposition.entity.LoadPosition;
|
| | | import com.mes.loadposition.service.LoadPositionService;
|
| | | import com.mes.utils.Result;
|
| | | import io.swagger.annotations.Api;
|
| | | import io.swagger.annotations.ApiOperation;
|
| | | import io.swagger.annotations.ApiResponse;
|
| | | import io.swagger.annotations.ApiResponses;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | | import org.springframework.http.ResponseEntity;
|
| | | import org.springframework.web.bind.annotation.*;
|
| | |
|
| | | import java.util.List;
|
| | |
|
| | | /**
|
| | | * |
| | | *
|
| | | * @author system
|
| | | * @since 2024-07-09 14:51:27
|
| | | */
|
| | | @RestController
|
| | | @RequestMapping("/api/loadPosition")
|
| | | @Api(tags = " 控制器")
|
| | | public class LoadPositionController {
|
| | |
|
| | | @Autowired
|
| | | private LoadPositionService loadPositionService;
|
| | |
|
| | | /**
|
| | | * 列表查询
|
| | | *
|
| | | * @param params
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "列表查询",notes = "列表查询",produces = "application/json")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @PostMapping("/findList")
|
| | | public Result findList(@RequestBody LoadPosition params) {
|
| | | List<LoadPosition> result = loadPositionService.findList(params);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 查询
|
| | | *
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "查询", notes = "查询详情")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "查询成功")})
|
| | | @GetMapping("/{id}")
|
| | | public Result findById(@PathVariable("id") Long id) {
|
| | | LoadPosition loadPosition = loadPositionService.getBaseMapper().selectById(id);
|
| | | return Result.success(loadPosition);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 新增
|
| | | *
|
| | | * @param loadPosition
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "新增", notes = "新增数据")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
|
| | | @PostMapping
|
| | | public Result insert( @RequestBody LoadPosition loadPosition) {
|
| | | boolean result = loadPositionService.save(loadPosition);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 修改
|
| | | *
|
| | | * @param loadPosition
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "修改", notes = "修改数据")
|
| | | @ApiResponses({@ApiResponse(code = 200, message = "操作成功")})
|
| | | @PutMapping
|
| | | public Result update( @RequestBody LoadPosition loadPosition) {
|
| | | boolean result = loadPositionService.updateById(loadPosition);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 删除
|
| | | *
|
| | | * @param id
|
| | | * @return
|
| | | */
|
| | | @ApiOperation(value = "删除", notes = "删除数据")
|
| | | @DeleteMapping("/{id}")
|
| | | public Result delete(@PathVariable("id") Long id) {
|
| | | int result = loadPositionService.getBaseMapper().deleteById(id);
|
| | | return Result.success(result);
|
| | | }
|
| | |
|
| | | } |