feat(face):人脸上传接口增加scene参数

- 在AioDeviceController中调用faceUpload时添加空字符串scene参数
- 在LyCompatibleController中调用faceUpload时添加空字符串scene参数- 在AppFaceController中增加scene请求参数并传递给faceService
- 修改FaceService接口和实现类faceUpload方法签名,添加scene参数- 移除多个控制器和服务中未使用的导入依赖
- 调整代码格式以符合规范
This commit is contained in:
2025-11-03 17:45:30 +08:00
parent 6886f87fe9
commit fa8a8ed711
5 changed files with 17 additions and 16 deletions

View File

@@ -28,7 +28,7 @@ public interface FaceService {
ApiResponse<Integer> deleteById(Long id);
ApiResponse<Integer> deleteByIds(List<Long> ids);
FaceRecognizeResp faceUpload(MultipartFile file, Long scenicId, Long userId);
FaceRecognizeResp faceUpload(MultipartFile file, Long scenicId, Long userId, String scene);
List<FaceRespVO> listByUser(Long userId, String scenicId);
SearchFaceRespVo matchFaceId(Long faceId);

View File

@@ -15,7 +15,6 @@ import com.ycwl.basic.mapper.ProjectMapper;
import com.ycwl.basic.mapper.SourceMapper;
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;
@@ -224,7 +223,7 @@ public class FaceServiceImpl implements FaceService {
}
@Override
public FaceRecognizeResp faceUpload(MultipartFile file, Long scenicId, Long userId) {
public FaceRecognizeResp faceUpload(MultipartFile file, Long scenicId, Long userId, String scene) {
//1、上传人脸照片
IStorageAdapter adapter = StorageFactory.use("faces");
String filePath = StorageUtil.joinPath(USER_FACE, DateUtil.format(new Date(),"yyyy-MM-dd"));
@@ -292,7 +291,15 @@ public class FaceServiceImpl implements FaceService {
// 异步执行自动添加打印
Long finalFaceId = newFaceId;
new Thread(() -> autoAddPhotosToPreferPrint(finalFaceId), "auto-add-print-" + newFaceId).start();
Thread thread = new Thread(() -> autoAddPhotosToPreferPrint(finalFaceId), "auto-add-print-" + newFaceId);
thread.start();
if (org.apache.commons.lang3.Strings.CI.equals("print", scene)) {
try {
thread.join();
} catch (InterruptedException ignore) {
}
}
return resp;
}