riku
2022-06-09 9867f6d5c5bccfe52b878c344c536905dd6b309e
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
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 io.swagger.annotations.ApiOperation
import io.swagger.annotations.ApiParam
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) {
 
    /*****************************会议********************************************/
    @ApiOperation(value = "获取用户的会议信息")
    @GetMapping("/info/{userId}")
    fun getMeetingInfo(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam(value = "查询类型", allowableValues = "1,2,3,4,5") @RequestParam(value = "status") status: Int,
        @ApiParam("页码") @RequestParam(value = "page") page: Int,
        @ApiParam("单页数据量") @RequestParam(value = "per_page") perPage: Int,
        response: HttpServletResponse
    ) = meetingInfoService.getMeetingInfo(userId, status, page, perPage, response)
 
    @ApiOperation(value = "根据id查找会议信息")
    @GetMapping("/info/meetingId/{userId}")
    fun getMeetingInfoById(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam(value = "meetingId") meetingId: String
    ) = meetingInfoService.getMeetingInfoById(userId, meetingId)
 
    @ApiOperation(value = "上传会议信息")
    @PostMapping("/info/{userId}")
    fun addMeetingInfo(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议信息") @RequestBody meetingInfo: MeetingInfo
    ) = meetingInfoService.addMeetingInfo(userId, meetingInfo)
 
    @ApiOperation(value = "更新会议信息")
    @PutMapping("/info/{userId}")
    fun updateMeeting(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议信息") @RequestBody meetingInfo: MeetingInfo
    ) = meetingInfoService.updateMeetingInfo(userId, meetingInfo)
 
    @ApiOperation(value = "删除会议")
    @PostMapping("/delete/{userId}")
    fun deleteMeeting(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam(value = "meetingId") meetingId: String
    ) = meetingInfoService.deleteMeetingInfo(userId, meetingId)
 
    @ApiOperation(value = "获取用户会议签到状态")
    @GetMapping("/registerStatus/{userId}")
    fun getMeetingRegisterStatus(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String,
        @ApiParam(value = "会议室id", required = false) @RequestParam("roomId") roomId: String?
    ) = meetingInfoService.getMeetingRegisterStatus(userId, meetingId, roomId)
 
    @ApiOperation(value = "获取会议签到记录")
    @GetMapping("/registerRecord/{userId}")
    fun getMeetingRegisterRecord(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String,
        @ApiParam(value = "会议室id", required = false) @RequestParam("roomId") roomId: String?
    ) = meetingInfoService.getMeetingRegisterRecord(userId, meetingId, roomId)
 
    @ApiOperation(value = "会议签到")
    @PostMapping("/register/{userId}")
    fun meetingRegister(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String,
        @ApiParam(value = "会议室id", required = false) @RequestParam("roomId") roomId: String?
    ) = meetingInfoService.meetingRegister(userId, meetingId, roomId)
 
    @ApiOperation(value = "获取会议的会议室")
    @GetMapping("/room/{userId}")
    fun getMeetingRoom(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String
    ) = meetingInfoService.getMeetingRoom(userId, meetingId)
 
    /*****************************参会人员********************************************/
    @ApiOperation(value = "添加会议参会人员")
    @PostMapping("/participant/{userId}")
    fun addParticipant(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("参会人员列表") @RequestBody participantList: List<Participant>
    ) = meetingInfoService.addParticipant(userId, participantList)
 
    @ApiOperation(value = "删除会议参会人员")
    @PostMapping("/participant/{userId}/delete")
    fun deleteParticipant(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam(value = "meetingId") meetingId: String,
        @ApiParam("待删除参会人员列表") @RequestBody participantList: List<Participant>
    ) = meetingInfoService.deleteParticipant(userId, meetingId, participantList)
 
    @ApiOperation(value = "获取会议的参会人员")
    @GetMapping("/participant/{userId}")
    fun getParticipant(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String,
        @ApiParam("会议室id") @RequestParam("roomId") roomId: String?,
        @ApiParam(value = "参会人员类型", name = "0:主持人,1:会议嘉宾,2:企业代表,3:一般与会人,99:其他,-1:全部", allowableValues = "0,1,2,3,99,-1") @RequestParam("participantType") participantType: Int
    ) = meetingInfoService.getParticipant(userId, meetingId, roomId, participantType)
 
    @ApiOperation(value = "获取会议在线人员")
    @GetMapping("/participant/{userId}/onlineCount")
    fun getOnlineUsers(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String,
        @ApiParam("会议室id") @RequestParam("roomId") roomId: String
    ) = meetingInfoService.getOnlineUsers(userId, meetingId, roomId)
 
    @ApiOperation(value = "设置用户的禁言状态")
    @PostMapping("/participant/{userId}/setMute")
    fun setMuteStatus(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String,
        @ApiParam("会议室id") @RequestParam("roomId") roomId: String,
        @ApiParam("用户状态") @RequestBody userStatusList: List<UserStatusVo>
    ) = meetingInfoService.setMuteStatus(userId, meetingId, roomId, userStatusList)
 
    /*****************************会议文件********************************************/
    @ApiOperation(value = "上传会议文件")
    @PostMapping("/uploadFile/{userId}")
    fun uploadFiles(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String,
        @ApiParam("会议室id") @RequestParam("roomId") roomId: String,
        @ApiParam("文件类型") @RequestParam("documentType") documentType: Int,
        @ApiParam("文件信息") @RequestParam("params") msgVo: String,
        @ApiParam("文件") @RequestPart("files") files: Array<MultipartFile>
    ) = meetingInfoService.uploadFile(userId, meetingId, roomId, msgVo, files, documentType)
 
    @ApiOperation(value = "获取会议室文件")
    @GetMapping("/material/{userId}")
    fun getMeetingMaterials(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String,
        @ApiParam("会议室id") @RequestParam("mediaType") mediaType: Int,
        @ApiParam("页码") @RequestParam(value = "page") page: Int,
        @ApiParam("单页数据量") @RequestParam(value = "per_page") perPage: Int,
        response: HttpServletResponse
    ) = meetingInfoService.getMeetingMaterials(userId, meetingId, mediaType, page, perPage, response)
 
    @ApiOperation(value = "更新会议文件签收状态")
    @PostMapping("/material/sign/{userId}")
    fun updateSignState(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议文件签收状态") @RequestBody signStateList: List<MeetingMaterialVo>
    ) = meetingInfoService.updateSignState(userId, signStateList)
 
    @ApiOperation(value = "获取会议文件数量")
    @GetMapping("/count/material/{userId}")
    fun getMaterialCount(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String,
        @ApiParam("多媒体文件类型") @RequestParam("mediaType") mediaType: Int,
        @ApiParam("会议文件类型") @RequestParam("meetingFileType") meetingFileType: Int
    ) = meetingInfoService.getMaterialCount(userId, meetingId, mediaType, meetingFileType)
 
    @ApiOperation(value = "删除会议文件")
    @PostMapping("/material/delete/{userId}")
    fun deleteFiles(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String,
        @ApiParam("待删除会议文件") @RequestBody fileList: List<MeetingMaterialVo>
    ) = meetingInfoService.deleteFiles(userId, meetingId, fileList)
 
    @ApiOperation(value = "获取会议所有文件签收状态")
    @GetMapping("/count/all/material/{userId}")
    fun getAllMaterialSignStatus(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String
    ) = meetingInfoService.getAllMaterialSignStatus(userId, meetingId)
 
    /*****************************会议聊天记录********************************************/
    @ApiOperation(value = "获取会议聊天记录")
    @GetMapping("/comment/{userId}")
    fun getMeetingRecords(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String,
        @ApiParam("会议室id") @RequestParam("roomId") roomId: String,
        @ApiParam("页码") @RequestParam(value = "page") page: Int,
        @ApiParam("单页数据量") @RequestParam(value = "per_page") perPage: Int,
        response: HttpServletResponse
    ) = meetingInfoService.getMeetingRecords(userId, meetingId, roomId, page, perPage, response)
 
    /*****************************会议推送通知********************************************/
    @ApiOperation(value = "推送会议通知")
    @PostMapping("/push/{userId}")
    fun pushMeetingInfo(
        @ApiParam("用户id") @PathVariable userId: String,
        @ApiParam("会议id") @RequestParam("meetingId") meetingId: String,
        @ApiParam("会议室id") @RequestParam("roomId") roomId: String?,
        @ApiParam("通知标题") @RequestParam("title") title: String,
        @ApiParam("通知内容") @RequestParam("body") body: String
    ) = meetingInfoService.pushMeetingInfo(userId, meetingId, roomId, title, body)
}