¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.limslaboratory.controller; |
| | | |
| | | import com.yuanchu.limslaboratory.pojo.dto.AddStandardDto; |
| | | import com.yuanchu.limslaboratory.service.StandardService; |
| | | import com.yuanchu.limslaboratory.vo.Result; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | /** |
| | | * <p> |
| | | * å端æ§å¶å¨ |
| | | * </p> |
| | | * |
| | | * @author æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | | * @since 2023-07-11 |
| | | */ |
| | | @Api(tags = "æ ååº-->2ãæ å") |
| | | @RestController |
| | | @RequestMapping("/standards") |
| | | public class StandardController { |
| | | |
| | | @Autowired |
| | | private StandardService standardService; |
| | | |
| | | @ApiOperation("æ·»å ç©æ") |
| | | @PostMapping("/add") |
| | | public Result<?> addStandardInformation(@Validated @RequestBody AddStandardDto addStandardDto) { |
| | | Integer isMaterialSuccess = standardService.addStandardInformation(addStandardDto); |
| | | if (isMaterialSuccess == 1) { |
| | | return Result.success("æ·»å ç©æã"+ addStandardDto.getStandardName() +"ãæåï¼"); |
| | | } |
| | | return Result.fail("æ·»å ç©æã"+ addStandardDto.getStandardName() +"ã失败ï¼"); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå 餿°æ®") |
| | | @DeleteMapping("/delete") |
| | | public Result<?> deleteStandardsInformation(Integer standardsId) { |
| | | Integer isDeleteMaterialSuccess = standardService.deleteStandardInformation(standardsId); |
| | | if (isDeleteMaterialSuccess == 1) { |
| | | return Result.success("å 餿åï¼"); |
| | | } |
| | | return Result.fail("å é¤å¤±è´¥ï¼"); |
| | | } |
| | | } |