|
@@ -88,15 +88,14 @@ public class BizWxAppletClinicController extends BaseController{
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@PostMapping("/touchMemoryId")
|
|
@PostMapping("/touchMemoryId")
|
|
|
- @ApiOperation(value = "查询手术咨询的memoryId、AppId和ApiKey",notes = "根据AES算法进行解密,秘钥为clinicId", position = 9)
|
|
|
|
|
|
|
+ @ApiOperation(value = "查询手术咨询的memoryId、AppId和ApiKey",notes = "根据AES算法进行解密,秘钥为clinicId前16位,如果不够,后续补0到16位", position = 9)
|
|
|
public CommonResult<String> createSessionId(@RequestBody@Validated BizCreateAgentSessionDTO source) throws IOException {
|
|
public CommonResult<String> createSessionId(@RequestBody@Validated BizCreateAgentSessionDTO source) throws IOException {
|
|
|
BizAiAgentParamVO paramVO= clinicRoomService.touchMemoryId(source);
|
|
BizAiAgentParamVO paramVO= clinicRoomService.touchMemoryId(source);
|
|
|
// 使用AES对paramVO的JSON进行加密,秘钥为clinicId
|
|
// 使用AES对paramVO的JSON进行加密,秘钥为clinicId
|
|
|
String jsonParamVO = JsonUtils.toJsonString(paramVO);
|
|
String jsonParamVO = JsonUtils.toJsonString(paramVO);
|
|
|
String key = StrUtil.padAfter(source.getClinicId(), 16, '0');
|
|
String key = StrUtil.padAfter(source.getClinicId(), 16, '0');
|
|
|
|
|
|
|
|
- AES aes = SecureUtil.aes(key.getBytes());
|
|
|
|
|
- String encryptedData = aes.encryptHex(jsonParamVO);
|
|
|
|
|
- return CommonResult.success(encryptedData);
|
|
|
|
|
|
|
+ AES aes = new AES(key.getBytes());
|
|
|
|
|
+ return CommonResult.success(aes.encryptHex(jsonParamVO));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|