feiyu02
2022-01-12 1564af04dacafcc08a9682a4ef1e651120c8cc46
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
package cn.flightfeather.supervision.lightshare.web
 
 
import cn.flightfeather.supervision.domain.entity.MeetingInfo
import cn.flightfeather.supervision.domain.entity.Participant
import cn.flightfeather.supervision.lightshare.service.MeetingInfoService
import cn.flightfeather.supervision.lightshare.vo.MeetingMaterialVo
import cn.flightfeather.supervision.lightshare.vo.UserStatusVo
import cn.flightfeather.supervision.websocket.Processor
import io.swagger.annotations.Api
import org.springframework.web.bind.annotation.*
import org.springframework.web.multipart.MultipartFile
import javax.servlet.http.HttpServletResponse
 
@Api(tags = ["在线会议API接口"])
@RestController
@RequestMapping("/meeting")
class MeetingInfoController(val meetingInfoService: MeetingInfoService) {
 
    /*****************************会议********************************************/
    @GetMapping("/info/{userId}")
    fun getMeetingInfo(
            @PathVariable userId: String,
            @RequestParam(value = "status") status: Int,
            @RequestParam(value = "page") page: Int,
            @RequestParam(value = "per_page") perPage: Int,
            response: HttpServletResponse
    ) = meetingInfoService.getMeetingInfo(userId, status, page, perPage, response)
 
    @GetMapping("/info/meetingId/{userId}")
    fun getMeetingInfoById(
            @PathVariable userId: String,
            @RequestParam(value = "meetingId") meetingId: String
    ) = meetingInfoService.getMeetingInfoById(userId, meetingId)
 
    @PostMapping("/info/{userId}")
    fun addMeetingInfo(
            @PathVariable userId: String,
            @RequestBody meetingInfo: MeetingInfo
    ) = meetingInfoService.addMeetingInfo(userId, meetingInfo)
 
    @PutMapping("/info/{userId}")
    fun updateMeeting(
            @PathVariable userId: String,
            @RequestBody meetingInfo: MeetingInfo
    ) = meetingInfoService.updateMeetingInfo(userId, meetingInfo)
 
    @PostMapping("/delete/{userId}")
    fun deleteMeeting(
            @PathVariable userId: String,
            @RequestParam(value = "meetingId") meetingId: String
    ) = meetingInfoService.deleteMeetingInfo(userId, meetingId)
 
    @GetMapping("/registerStatus/{userId}")
    fun getMeetingRegisterStatus(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String,
            @RequestParam("roomId") roomId: String?
    ) = meetingInfoService.getMeetingRegisterStatus(userId, meetingId, roomId)
 
    @GetMapping("/registerRecord/{userId}")
    fun getMeetingRegisterRecord(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String,
            @RequestParam("roomId") roomId: String?
    ) = meetingInfoService.getMeetingRegisterRecord(userId, meetingId, roomId)
 
    @PostMapping("/register/{userId}")
    fun meetingRegister(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String,
            @RequestParam("roomId") roomId: String?
    ) = meetingInfoService.meetingRegister(userId, meetingId, roomId)
 
    @GetMapping("/room/{userId}")
    fun getMeetingRoom(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String
    ) = meetingInfoService.getMeetingRoom(userId, meetingId)
 
    /*****************************参会人员********************************************/
    @PostMapping("/participant/{userId}")
    fun addParticipant(
            @PathVariable userId: String,
            @RequestBody participantList: List<Participant>
    ) = meetingInfoService.addParticipant(userId, participantList)
 
    @PostMapping("/participant/{userId}/delete")
    fun deleteParticipant(
            @PathVariable userId: String,
            @RequestParam(value = "meetingId") meetingId: String,
            @RequestBody participantList: List<Participant>
    ) = meetingInfoService.deleteParticipant(userId, meetingId, participantList)
 
    @GetMapping("/participant/{userId}")
    fun getParticipant(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String,
            @RequestParam("roomId") roomId: String?,
            @RequestParam("participantType") participantType: Int
    ) = meetingInfoService.getParticipant(userId, meetingId, roomId, participantType)
 
    @GetMapping("/participant/{userId}/onlineCount")
    fun getOnlineUsers(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String,
            @RequestParam("roomId") roomId: String
    ) = meetingInfoService.getOnlineUsers(userId, meetingId, roomId)
 
    @PostMapping("/participant/{userId}/setMute")
    fun setMuteStatus(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String,
            @RequestParam("roomId") roomId: String,
            @RequestBody userStatusList: List<UserStatusVo>
    ) = meetingInfoService.setMuteStatus(userId, meetingId, roomId, userStatusList)
 
    /*****************************会议文件********************************************/
    @PostMapping("/uploadFile/{userId}")
    fun uploadFiles(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String,
            @RequestParam("roomId") roomId: String,
            @RequestParam("documentType") documentType: Int,
            @RequestParam("params") msgVo: String,
            @RequestPart("files") files: Array<MultipartFile>
    ) = meetingInfoService.uploadFile(userId, meetingId, roomId, msgVo, files, documentType)
 
    @GetMapping("/material/{userId}")
    fun getMeetingMaterials(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String,
            @RequestParam("mediaType") mediaType: Int,
            @RequestParam(value = "page") page: Int,
            @RequestParam(value = "per_page") perPage: Int,
            response: HttpServletResponse
    ) = meetingInfoService.getMeetingMaterials(userId, meetingId, mediaType, page, perPage, response)
 
    @PostMapping("/material/sign/{userId}")
    fun updateSignState(
            @PathVariable userId: String,
            @RequestBody signStateList: List<MeetingMaterialVo>
    ) = meetingInfoService.updateSignState(userId, signStateList)
 
    @GetMapping("/count/material/{userId}")
    fun getMaterialCount(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String,
            @RequestParam("mediaType") mediaType: Int,
            @RequestParam("meetingFileType") meetingFileType: Int
    ) = meetingInfoService.getMaterialCount(userId, meetingId, mediaType, meetingFileType)
 
    @PostMapping("/material/delete/{userId}")
    fun deleteFiles(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String,
            @RequestBody fileList: List<MeetingMaterialVo>
    ) = meetingInfoService.deleteFiles(userId, meetingId, fileList)
 
    @GetMapping("/count/all/material/{userId}")
    fun getAllMaterialSignStatus(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String
    ) = meetingInfoService.getAllMaterialSignStatus(userId, meetingId)
 
    /*****************************会议聊天记录********************************************/
    @GetMapping("/comment/{userId}")
    fun getMeetingRecords(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String,
            @RequestParam("roomId") roomId: String,
            @RequestParam(value = "page") page: Int,
            @RequestParam(value = "per_page") perPage: Int,
            response: HttpServletResponse
    ) = meetingInfoService.getMeetingRecords(userId, meetingId, roomId, page, perPage, response)
 
    /*****************************会议推送通知********************************************/
    @PostMapping("/push/{userId}")
    fun pushMeetingInfo(
            @PathVariable userId: String,
            @RequestParam("meetingId") meetingId: String,
            @RequestParam("roomId") roomId: String?,
            @RequestParam("title") title: String,
            @RequestParam("body") body: String
    ) = meetingInfoService.pushMeetingInfo(userId, meetingId, roomId, title, body)
}