api-目前只支持健身馆强校验
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.sv.service.api;
|
||||
|
||||
import com.enums.DeviceType;
|
||||
import com.enums.VenueTypeEnum;
|
||||
import com.sv.entity.Venue;
|
||||
import com.sv.mapper.DeviceMapper;
|
||||
import com.sv.mapper.VenueMapper;
|
||||
@@ -30,7 +31,14 @@ public class QRCodeService {
|
||||
if (integer != 1){
|
||||
throw new ServiceException(com.sv.exception.api.ExceptionCodeTemplate.DEVICE_ERROR);
|
||||
}
|
||||
return venueMapper.findById(venueId);
|
||||
Venue venue = venueMapper.findById(venueId);
|
||||
if (venue==null){
|
||||
throw new ServiceException(com.sv.exception.api.ExceptionCodeTemplate.VENUE_ERROR);
|
||||
}
|
||||
if (!VenueTypeEnum.FITNESS.value.equals(venue.getType())){
|
||||
throw new ServiceException(com.sv.exception.api.ExceptionCodeTemplate.VENUE_TYPE_ERROR);
|
||||
}
|
||||
return venue;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user