package com.thhy.engineering.modules.biz.room.controller; import com.github.pagehelper.PageInfo; import com.thhy.engineering.modules.biz.room.entity.BuildPull; import com.thhy.engineering.modules.biz.room.entity.Room; import com.thhy.engineering.modules.biz.room.entity.RoomDto; import com.thhy.engineering.modules.biz.room.entity.RoomListVo; import com.thhy.engineering.modules.biz.room.service.RoomService; import com.thhy.general.common.BasicResult; import com.thhy.general.utils.PagingUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import java.util.List; /** * @author zhang_xiao_bo * @since 2023-04-11 17:19:21 */ @RestController @RequestMapping("room") public class RoomController { @Autowired private RoomService roomService; @RequestMapping("findList") public BasicResult findList(@RequestBody(required = false) Room room,HttpServletRequest req){ PagingUtils.setPageParam(req); List roomList = roomService.findList(room); PageInfo pageInfo = new PageInfo<>(roomList); return BasicResult.success(pageInfo); } @RequestMapping("pulldown") public BasicResult pulldown(@RequestBody(required = false) Room room,HttpServletRequest req){ PagingUtils.setPageParam(req); List roomList = roomService.pulldown(); return BasicResult.success(roomList); } @RequestMapping("findRoomList") public BasicResult findRoomList(@RequestBody(required = false) Room room, HttpServletRequest req){ PagingUtils.setPageParam(req); List roomList = roomService.findRoomList(room); PageInfo pageInfo = new PageInfo<>(roomList); return BasicResult.success(pageInfo); } @RequestMapping("addRoom") public BasicResult addRoom(@RequestBody RoomDto roomDto){ roomService.addRoom(roomDto); return BasicResult.success(); } /** @RequestMapping("update") public BasicResult update(@RequestBody Room room){ roomService.update(room); return BasicResult.success(); }**/ @RequestMapping("delete") public BasicResult delete(@RequestBody Room room){ roomService.delete(room.getRoomId()); return BasicResult.success(); } @RequestMapping("deleteFloor") public BasicResult deleteFloor(@RequestBody RoomDto roomDto){ roomService.deleteFloor(roomDto); return BasicResult.success(); } }