package com.web.standard.controller; import com.app.base.data.ApiResponseResult; import com.web.standard.entity.Standard; import com.web.standard.service.StandardService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Sort; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RestController; /** * 看板标准化 * @author l */ @Api(description = "看板标准化") @RestController @RequestMapping(value= "/standard") public class StandardController { @Autowired private StandardService standardService; @ApiOperation(value="看板标准化列表", notes="看板标准化列表") @RequestMapping(value = "/getStandardList", method = RequestMethod.GET) public ApiResponseResult getStandardlist() { try { Sort sort = new Sort(Sort.Direction.DESC,"id"); return standardService.getStandardList(); } catch (Exception e) { return ApiResponseResult.failure(e.getMessage()); } } @ApiOperation(value="根据id查看看板标准化模板", notes="根据id查看板标准化模板") @RequestMapping(value = "/getStandardById", method = RequestMethod.GET) public ApiResponseResult getStandardById(Long id) { try { return standardService.getStandardById(id); } catch (Exception e) { return ApiResponseResult.failure(e.getMessage()); } } @ApiOperation(value="添加板标准化模板", notes="添加板标准化模板") @RequestMapping(value = "/addStandard", method = RequestMethod.POST) public ApiResponseResult addStandard(Standard standard) { try { return standardService.addStandard(standard); } catch (Exception e) { return ApiResponseResult.failure(e.getMessage()); } } @ApiOperation(value="修改看板标准化模板", notes="修改板标准化模板") @RequestMapping(value = "/updateStandard", method = RequestMethod.POST) public ApiResponseResult updateStandard(Standard standard) { try { return standardService.updateStandard(standard); } catch (Exception e) { return ApiResponseResult.failure(e.getMessage()); } } @ApiOperation(value="删除", notes="删除") @RequestMapping(value = "/deleteStandard", method = RequestMethod.POST) public ApiResponseResult deleteStandard(Long id) { try { return standardService.deleteStandard(id); } catch (Exception e) { return ApiResponseResult.failure(e.getMessage()); } } }