api-目前只支持健身馆强校验

This commit is contained in:
limqhz
2020-07-23 16:06:24 +08:00
parent 4fcd4b4d40
commit ade7baaa6b
3 changed files with 15 additions and 5 deletions

View File

@@ -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;
}