AHouseInfoDetailController.java 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package com.zksy.controller.property;
  2. import com.zksy.property.domain.AHouseInfoDetail;
  3. import com.zksy.property.service.AHouseInfoDetailService;
  4. import com.zksy.utils.AjaxResult;
  5. import io.swagger.annotations.Api;
  6. import io.swagger.annotations.ApiOperation;
  7. import org.springframework.beans.factory.annotation.Autowired;
  8. import org.springframework.web.bind.annotation.*;
  9. import java.time.LocalDateTime;
  10. import java.util.Arrays;
  11. /**
  12. * @author Administrator
  13. * @version 1.0
  14. * @project enterprise-assets-service
  15. * @description 房屋详细信息控制层
  16. * @date 2025/6/24 14:33:13
  17. */
  18. @RestController
  19. @RequestMapping("/ahouseInfoDetail")
  20. @Api(tags = "房屋详细信息",description = "房屋详细信息desc")
  21. public class AHouseInfoDetailController {
  22. @Autowired
  23. private AHouseInfoDetailService service;
  24. @GetMapping("/findByPage")
  25. @ApiOperation(value = "房屋详细信息查询分页")
  26. public AjaxResult findByPage(long pageNum, long pageSize, String area,String introduce,String houseType){
  27. return AjaxResult.success(service.findByPage(pageNum, pageSize, area,introduce,houseType));
  28. }
  29. @GetMapping("/getAHouseInfoDetailList")
  30. @ApiOperation(value = "房屋详细信息查询")
  31. public AjaxResult getAHouseInfoDetailList(String area,String introduce,String houseType){
  32. return AjaxResult.success(service.getAHouseInfoDetailList(area,introduce,houseType));
  33. }
  34. @GetMapping("/getById/{id}")
  35. @ApiOperation(value = "根据Id查询房屋详细信息")
  36. public AjaxResult getById(@PathVariable String id){
  37. return AjaxResult.success(service.getById(id));
  38. }
  39. @PostMapping("/save")
  40. @ApiOperation(value = "房屋详细信息保存")
  41. public AjaxResult save(@RequestBody AHouseInfoDetail entity) {
  42. return service.save(entity) ? AjaxResult.success(entity) : AjaxResult.error("保存失败");
  43. }
  44. @PostMapping("/update")
  45. @ApiOperation(value = "房屋详细信息修改")
  46. public AjaxResult update(@RequestBody AHouseInfoDetail entity) {
  47. entity.setUpdateTime(LocalDateTime.now());
  48. return service.updateById(entity) ? AjaxResult.success(entity) : AjaxResult.error("修改失败");
  49. }
  50. @PostMapping("/deleteBatch")
  51. @ApiOperation(value = "房屋详细信息删除")
  52. public AjaxResult delete(@RequestBody String[] ids) {
  53. return service.removeBatchByIds(Arrays.asList(ids)) ? AjaxResult.success("删除成功") : AjaxResult.error("删除失败");
  54. }
  55. @GetMapping("/getBySimplifiedHouseId")
  56. @ApiOperation(value = "根据房屋id查询房屋详细信息")
  57. public AjaxResult getBySimplifiedHouseId(String simplifiedHouseId){
  58. return AjaxResult.success(service.getBySimplifiedHouseId(simplifiedHouseId));
  59. }
  60. }