张晓波
2023-09-19 164694c47c35d6654df69b533e8dbf8b5423efc5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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<RoomListVo> roomList = roomService.findList(room);
        PageInfo<RoomListVo> pageInfo = new PageInfo<>(roomList);
        return BasicResult.success(pageInfo);
    }
 
    @RequestMapping("pulldown")
    public BasicResult pulldown(@RequestBody(required = false) Room room,HttpServletRequest req){
        PagingUtils.setPageParam(req);
        List<BuildPull> roomList = roomService.pulldown();
        return BasicResult.success(roomList);
    }
 
 
 
    @RequestMapping("findRoomList")
    public BasicResult findRoomList(@RequestBody(required = false) Room room, HttpServletRequest req){
        PagingUtils.setPageParam(req);
        List<Room> roomList = roomService.findRoomList(room);
        PageInfo<Room> 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();
    }
 
 
 
}