c7e198d52743656936af89d189ee06d3da9dd187.svn-base 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package cn.com.goldenwater.dcproj.controller.duty;
  2. import cn.com.goldenwater.core.web.BaseController;
  3. import cn.com.goldenwater.core.web.BaseResponse;
  4. import cn.com.goldenwater.dcproj.model.AttInspTypeDuty;
  5. import cn.com.goldenwater.dcproj.service.AttInspTypeDutyService;
  6. import io.swagger.annotations.Api;
  7. import io.swagger.annotations.ApiOperation;
  8. import io.swagger.annotations.ApiParam;
  9. import org.slf4j.Logger;
  10. import org.slf4j.LoggerFactory;
  11. import org.springframework.beans.factory.annotation.Autowired;
  12. import org.springframework.web.bind.annotation.*;
  13. /**
  14. * @author lhc
  15. * @date 2021-7-14
  16. */
  17. @Api(value = "xxx管理", tags = "xxx管理")
  18. @RestController
  19. @RequestMapping("/att/insp/type/duty")
  20. public class AttInspTypeDutyController extends BaseController {
  21. private Logger logger = LoggerFactory.getLogger(getClass());
  22. @Autowired
  23. private AttInspTypeDutyService attInspTypeDutyService;
  24. @ApiOperation(value = "修改xxx")
  25. @RequestMapping(value = "", method = RequestMethod.POST)
  26. public BaseResponse<AttInspTypeDuty> insert(@ApiParam(name = "attInspTypeDuty", value = "AttInspTypeDuty", required = true) @RequestBody AttInspTypeDuty attInspTypeDuty) {
  27. attInspTypeDutyService.insert(attInspTypeDuty);
  28. return buildSuccessResponse(attInspTypeDuty);
  29. }
  30. @ApiOperation(value = "根据ID删除xxx")
  31. @RequestMapping(value = "delete/{id}", method = RequestMethod.POST)
  32. public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  33. int ret = attInspTypeDutyService.delete(id);
  34. return buildSuccessResponse();
  35. }
  36. @ApiOperation(value = "根据ID获取xxx(单表)")
  37. @RequestMapping(value = "/{id}", method = RequestMethod.GET)
  38. public BaseResponse<AttInspTypeDuty> get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) {
  39. AttInspTypeDuty attInspTypeDuty = attInspTypeDutyService.get(id);
  40. return buildSuccessResponse(attInspTypeDuty);
  41. }
  42. @ApiOperation(value = "根据ID获取xxx(单表)")
  43. @RequestMapping(value = "/arrayByOrgId", method = RequestMethod.GET)
  44. public BaseResponse<String[]> arrayByOrgId() {
  45. return buildSuccessResponse(attInspTypeDutyService.arrayByOrgId(getCurrentOrgId()));
  46. }
  47. }