增加房间检测接口
This commit is contained in:
parent
85a475b19b
commit
0cf4b4761e
|
|
@ -42,6 +42,12 @@ abstract class RetrofitClient {
|
|||
@Path("roomNum") String roomNum,
|
||||
);
|
||||
|
||||
/// 检验房间是否存在
|
||||
@GET("/room/checkout")
|
||||
Future<BaseStructureResult<bool>> checkout(
|
||||
@Query("roomNum") String roomNum,
|
||||
);
|
||||
|
||||
/// 获取会议室所有用户
|
||||
@GET("/room/user")
|
||||
Future<BaseStructureResult<List<MeetingRoomUser>>> getMeetingRoomAllUser(
|
||||
|
|
|
|||
|
|
@ -87,4 +87,26 @@ class LoginLogic extends GetxController with RequestToolMixin {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// 检验房间
|
||||
Future<void> doHttpCheckMeetingRoom() async {
|
||||
if(state.meetingCodeController.text.isEmpty){
|
||||
ToastUtils.showError("请输入会议号");
|
||||
}else if(state.meetingCodeController.text.length != 8){
|
||||
ToastUtils.showError("请输入正确的会议号");
|
||||
}else if(state.nickNameCodeController.text.isEmpty){
|
||||
ToastUtils.showError("请输入昵称");
|
||||
}else if(state.checkAgreementBool != true){
|
||||
ToastUtils.showError("请阅读并勾选相关协议");
|
||||
}else{
|
||||
BaseStructureResult<bool> res = await getClient().checkout(state.meetingCodeController.text);
|
||||
if (null != res.data) {
|
||||
if(res.data == true){
|
||||
doHttpAnonymousLogin();
|
||||
}else{
|
||||
ToastUtils.showError("房间不存在");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ class _LoginPageState extends State<LoginPage> {
|
|||
if (state.pageState.value == 0) {
|
||||
logic.doHttpLogin();
|
||||
} else {
|
||||
logic.doHttpAnonymousLogin();
|
||||
logic.doHttpCheckMeetingRoom();
|
||||
}
|
||||
},
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue