You've already forked FrameTour-BE
bindFace
This commit is contained in:
@@ -37,5 +37,5 @@ public interface FaceService {
|
||||
|
||||
ApiResponse<List<ContentPageVO>> contentListUseDefaultFace();
|
||||
|
||||
void bindFace(Long faceId, Long userId);
|
||||
void bindFace(Long faceId, Long memberId);
|
||||
}
|
||||
|
@@ -14,6 +14,7 @@ import com.ycwl.basic.mapper.StatisticsMapper;
|
||||
import com.ycwl.basic.mapper.FaceMapper;
|
||||
import com.ycwl.basic.mapper.TemplateMapper;
|
||||
import com.ycwl.basic.mapper.VideoMapper;
|
||||
import com.ycwl.basic.mapper.OrderMapper;
|
||||
import com.ycwl.basic.model.mobile.face.FaceRecognizeResp;
|
||||
import com.ycwl.basic.model.mobile.order.IsBuyRespVO;
|
||||
import com.ycwl.basic.model.mobile.scenic.content.ContentPageVO;
|
||||
@@ -28,6 +29,7 @@ import com.ycwl.basic.model.pc.source.entity.MemberSourceEntity;
|
||||
import com.ycwl.basic.model.pc.source.entity.SourceEntity;
|
||||
import com.ycwl.basic.model.pc.source.req.SourceReqQuery;
|
||||
import com.ycwl.basic.model.pc.source.resp.SourceRespVO;
|
||||
import com.ycwl.basic.model.pc.order.entity.OrderEntity;
|
||||
import com.ycwl.basic.model.pc.task.entity.TaskEntity;
|
||||
import com.ycwl.basic.model.pc.video.entity.MemberVideoEntity;
|
||||
import com.ycwl.basic.model.pc.video.entity.VideoEntity;
|
||||
@@ -102,6 +104,8 @@ public class FaceServiceImpl implements FaceService {
|
||||
private TemplateBiz templateBiz;
|
||||
@Autowired
|
||||
private DeviceRepository deviceRepository;
|
||||
@Autowired
|
||||
private OrderMapper orderMapper;
|
||||
|
||||
@Override
|
||||
public ApiResponse<PageInfo<FaceRespVO>> pageQuery(FaceReqQuery faceReqQuery) {
|
||||
@@ -493,8 +497,32 @@ public class FaceServiceImpl implements FaceService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bindFace(Long faceId, Long userId) {
|
||||
|
||||
public void bindFace(Long faceId, Long memberId) {
|
||||
FaceEntity face = faceRepository.getFace(faceId);
|
||||
if (face == null) {
|
||||
throw new BaseException("人脸数据不存在");
|
||||
}
|
||||
|
||||
Long currentMemberId = face.getMemberId();
|
||||
if (currentMemberId.equals(memberId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
FaceEntity updateFace = new FaceEntity();
|
||||
updateFace.setId(faceId);
|
||||
updateFace.setMemberId(memberId);
|
||||
faceMapper.update(updateFace);
|
||||
|
||||
sourceMapper.updateMemberIdByFaceId(faceId, memberId);
|
||||
|
||||
videoMapper.updateMemberIdByFaceId(faceId, memberId);
|
||||
|
||||
OrderEntity orderUpdate = new OrderEntity();
|
||||
orderUpdate.setFaceId(faceId);
|
||||
orderUpdate.setMemberId(memberId);
|
||||
orderMapper.updateMemberIdByFaceId(orderUpdate);
|
||||
|
||||
faceRepository.clearFaceCache(faceId);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user