This commit is contained in:
2025-01-27 03:38:17 +08:00
parent 25d563cb2b
commit 348a3801df
6 changed files with 136 additions and 14 deletions

View File

@ -380,15 +380,12 @@ public class WxPayServiceImpl implements WxPayService {
*/
public String decryptToString(byte[] associatedData, byte[] nonce, String ciphertext) throws GeneralSecurityException, IOException {
try {
Cipher cipher = Cipher.getInstance(HttpConstant.AES_GCM_NoPadding);
SecretKeySpec key = new SecretKeySpec(wechatConfig.getKeyPath().getBytes(), HttpConstant.AES);
GCMParameterSpec spec = new GCMParameterSpec(NumberConstant.ONE_HUNDRED_TWENTY_EIGHT, nonce);// 规定为128
Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
SecretKeySpec key = new SecretKeySpec(wechatConfig.getApiV3().getBytes(), "AES");
GCMParameterSpec spec = new GCMParameterSpec(128, nonce);
cipher.init(Cipher.DECRYPT_MODE, key, spec);
cipher.updateAAD(associatedData);
return new String(cipher.doFinal(Base64.getDecoder().decode(ciphertext)), String.valueOf(StandardCharsets.UTF_8));
return new String(cipher.doFinal(Base64.getDecoder().decode(ciphertext)), StandardCharsets.UTF_8);
} catch (NoSuchAlgorithmException | NoSuchPaddingException e) {
throw new IllegalStateException(e);
} catch (InvalidKeyException | InvalidAlgorithmParameterException e) {

View File

@ -170,6 +170,13 @@ public class FaceServiceImpl implements FaceService {
faceEntity.setFaceUrl(faceUrl);
faceEntity.setId(newFaceId);
faceMapper.add(faceEntity);
} else {
//更新人脸
FaceEntity faceEntity = new FaceEntity();
faceEntity.setId(oldFaceId);
faceEntity.setFaceUrl(faceUrl);
faceMapper.update(faceEntity);
faceRepository.clearFaceCache(oldFaceId);
}
StatisticsRecordAddReq statisticsRecordAddReq = new StatisticsRecordAddReq();
statisticsRecordAddReq.setMemberId(userId);

View File

@ -371,10 +371,6 @@ public class TaskTaskServiceImpl implements TaskService {
memberVideoEntity.setIsBuy(1);
}
memberVideoEntity.setVideoId(video.getId());
// 已经生成了
new Thread(() -> {
sendVideoGeneratedServiceNotification(list.get(0).getId(), face.getMemberId());
}).start();
}
}
videoMapper.addRelation(memberVideoEntity);