| | |
| | | package com.ruoyi.web.controller.api; |
| | | |
| | | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.basic.PageInfo; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.system.dto.THouseDTO; |
| | | import com.ruoyi.system.dto.TTenantDTO; |
| | | import com.ruoyi.system.model.THouse; |
| | | import com.ruoyi.system.model.TTenant; |
| | | import com.ruoyi.system.query.THouseQuery; |
| | | import com.ruoyi.system.query.TTenantQuery; |
| | | import com.ruoyi.system.query.TUserHistoryQuery; |
| | | import com.ruoyi.system.service.THouseService; |
| | | import com.ruoyi.system.vo.HouseVO; |
| | | 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> |
| | |
| | | @RestController |
| | | @RequestMapping("/t-house") |
| | | public class THouseController { |
| | | @Autowired |
| | | private THouseService tHouseService; |
| | | @Log(title = "房屋基础信息管理-新增房屋", businessType = BusinessType.INSERT) |
| | | @ApiOperation(value = "新增房屋") |
| | | @PostMapping(value = "/addHouse") |
| | | public AjaxResult<Boolean> addHouse(@Validated @RequestBody THouseDTO dto) { |
| | | return AjaxResult.success(tHouseService.save(dto)); |
| | | } |
| | | @Log(title = "房屋基础信息管理-编辑房屋", businessType = BusinessType.UPDATE) |
| | | @ApiOperation(value = "编辑房屋") |
| | | @PostMapping(value = "/updateHouse") |
| | | public AjaxResult<Boolean> updateHouse(@Validated @RequestBody THouseDTO dto) { |
| | | return AjaxResult.success(tHouseService.updateById(dto)); |
| | | } |
| | | @Log(title = "房屋基础信息管理-查询房屋信息", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "查询房屋信息") |
| | | @GetMapping(value = "/getHouseById") |
| | | public AjaxResult<THouse> getHouseById(@RequestParam Long id) { |
| | | return AjaxResult.success(tHouseService.getById(id)); |
| | | } |
| | | @Log(title = "房屋基础信息管理-删除房屋", businessType = BusinessType.DELETE) |
| | | @ApiOperation(value = "删除房屋") |
| | | @DeleteMapping(value = "/deleteHouseById") |
| | | public AjaxResult<Boolean> deleteHouseById(@RequestParam Long id) { |
| | | return AjaxResult.success(tHouseService.removeById(id)); |
| | | } |
| | | @ApiOperation(value = "获取房屋分页列表") |
| | | @PostMapping(value = "/houseList") |
| | | public AjaxResult<PageInfo<THouse>> houseList(@RequestBody THouseQuery query) { |
| | | return AjaxResult.success(tHouseService.houseList(query)); |
| | | } |
| | | @ApiOperation(value = "历史租户列表") |
| | | @PostMapping(value = "/userHistoryList") |
| | | public AjaxResult<PageInfo<HouseVO>> userHistoryList(@RequestBody TUserHistoryQuery query) { |
| | | return AjaxResult.success(tHouseService.userHistoryList(query)); |
| | | } |
| | | |
| | | } |
| | | |