You've already forked FrameTour-BE
景区账号添加问题
This commit is contained in:
@@ -85,4 +85,11 @@ public interface SourceMapper {
|
||||
int deleteUselessSource();
|
||||
|
||||
int updateMemberIdByFaceId(Long faceId, Long memberId);
|
||||
|
||||
/**
|
||||
* 根据faceId查询type=2的source列表
|
||||
* @param faceId 人脸ID
|
||||
* @return type=2的source列表
|
||||
*/
|
||||
List<SourceEntity> listImageSourcesByFaceId(Long faceId);
|
||||
}
|
||||
|
@@ -103,6 +103,12 @@ public class AppScenicServiceImpl implements AppScenicService {
|
||||
|
||||
ScenicLoginRespVO scenicLoginRespVO = new ScenicLoginRespVO();
|
||||
BeanUtil.copyProperties(scenicAccount,scenicLoginRespVO);
|
||||
List<Long> scenicIds = scenicAccountMapper.getAccountRelations(scenicAccount.getId());
|
||||
if (!scenicIds.isEmpty()) {
|
||||
scenicLoginRespVO.setScenicId(scenicIds);
|
||||
} else {
|
||||
scenicLoginRespVO.setScenicId(List.of(scenicAccount.getId()));
|
||||
}
|
||||
scenicLoginRespVO.setToken(token);
|
||||
return ApiResponse.success(scenicLoginRespVO);
|
||||
}
|
||||
|
@@ -21,7 +21,13 @@ public class ScenicAccountServiceImpl implements ScenicAccountService {
|
||||
if (entity.getId() == null) {
|
||||
entity.setId(SnowFlakeUtil.getLongId());
|
||||
}
|
||||
return mapper.add(entity);
|
||||
int result = mapper.add(entity);
|
||||
if (entity.getScenicId() != null && !entity.getScenicId().isEmpty()) {
|
||||
entity.getScenicId().forEach(scenicId -> {
|
||||
mapper.addAccountScenicRelation(entity.getId(), scenicId, entity.getIsSuper());
|
||||
});
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user