| @@ -148,7 +148,7 @@ public class PersonPhotoServiceImpl implements PersonPhotoService { | |||||
| if (result.isSuccess()) { | if (result.isSuccess()) { | ||||
| return new ResultData(); | return new ResultData(); | ||||
| } | } | ||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(), result.getMsg()); | |||||
| return new ResultData(result.getCode(), result.getMsgInfo(result.getCode(),result.getMsg())); | |||||
| } catch (IOException e) { | } catch (IOException e) { | ||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(), "接口请求异常"); | return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(), "接口请求异常"); | ||||
| @@ -235,7 +235,7 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { | |||||
| photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); | photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); | ||||
| photoSpeakVideo.setVideoMsg(video.getMsg()); | photoSpeakVideo.setVideoMsg(video.getMsg()); | ||||
| this.updateById(photoSpeakVideo); | this.updateById(photoSpeakVideo); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(),"生成视频失败"); | |||||
| return new ResultData(video.getCode(), video.getMsgInfo(video.getCode(),video.getMsg())); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); | photoSpeakVideo.setVideoStatus(EnumVideoStatus.fail.getCode()); | ||||
| @@ -348,7 +348,7 @@ public class PhotoSpeakVideoServiceImpl implements PhotoSpeakVideoService { | |||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); | speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); | ||||
| speakVideo.setVideoMsg("视频超分失败"); | speakVideo.setVideoMsg("视频超分失败"); | ||||
| this.updateById(speakVideo); | this.updateById(speakVideo); | ||||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR.getCode(), "接口请求异常"); | |||||
| return new ResultData(result.getCode(), result.getMsgInfo(result.getCode(),result.getMsg())); | |||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| e.printStackTrace(); | e.printStackTrace(); | ||||
| speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); | speakVideo.setVideoHyStatus(EnumVideoStatus.draft.getCode()); | ||||
| @@ -83,6 +83,6 @@ public class VoiceInfoServiceImpl implements VoiceInfoService { | |||||
| if (result.isSuccess()){ | if (result.isSuccess()){ | ||||
| return new ResultData(result.getTime()); | return new ResultData(result.getTime()); | ||||
| } | } | ||||
| return new ResultData(ErrorCode.SYS_SERVER_ERROR.getCode(), result.getMsg()); | |||||
| return new ResultData(result.getCode(), result.getMsgInfo(result.getCode(),result.getMsg())); | |||||
| } | } | ||||
| } | } | ||||
| @@ -6,27 +6,25 @@ import lombok.Data; | |||||
| @Data | @Data | ||||
| public class AiCheckPhotoResult { | public class AiCheckPhotoResult { | ||||
| private boolean success; | |||||
| private String msg; | |||||
| private Integer code; | |||||
| private boolean success; | |||||
| private String msg; | |||||
| private Integer code; | |||||
| public String getMsgInfo(Integer code,String msg){ | |||||
| if (code == 10 && msg.equals("unknown error")) { | |||||
| return "服务被Avatar攻击... 点击“编辑”重试"; | |||||
| }else if (code == 2000){ | |||||
| return "成功"; | |||||
| }else if (code == 2001 && msg.equals("no face")){ | |||||
| return "图片中没有人脸"; | |||||
| }else if (code == 2002 && msg.equals("more face")){ | |||||
| return "图片中人脸大于1个"; | |||||
| }else if (code == 2003 && msg.equals("big angle")){ | |||||
| return "图片中人脸转动角度太大"; | |||||
| }else if (code == 2004 && msg.equals("big mouth angle")){ | |||||
| return "图片中嘴张开太大"; | |||||
| }else if (code == 2005 && msg.equals("Sensitive people")){ | |||||
| return "图片中人物可能是敏感人物,比如是政要或者明星"; | |||||
| }else { | |||||
| return "系统繁忙,请稍后重试"; | |||||
| } | |||||
| } | |||||
| public String getMsgInfo(Integer code, String msg) { | |||||
| if (code == 2000) { | |||||
| return "成功"; | |||||
| } else if (code == 2001 && msg.equals("no face")) { | |||||
| return "(MetaService)图片中没有人脸"; | |||||
| } else if (code == 2002 && msg.equals("more face")) { | |||||
| return "(MetaService)图片中人脸大于1个"; | |||||
| } else if (code == 2003 && msg.equals("big angle")) { | |||||
| return "(MetaService)图片中人脸转动角度太大"; | |||||
| } else if (code == 2004 && msg.equals("big mouth angle")) { | |||||
| return "图片中嘴张开太大(SM)"; | |||||
| } else if (code == 2005 && msg.equals("Sensitive people")) { | |||||
| return "(MetaService)图片中人物可能是敏感人物,比如是政要或者明星"; | |||||
| } else { | |||||
| return "(MetaService)服务被Avatar攻击... 点击“编辑”重试"; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -8,6 +8,7 @@ public class AiPhotoSpeakResult { | |||||
| private boolean success; | private boolean success; | ||||
| private String msg; | private String msg; | ||||
| private String url; | private String url; | ||||
| private Integer code; | |||||
| private String saveDir; | private String saveDir; | ||||
| private String audioPath; | private String audioPath; | ||||
| @@ -15,15 +16,13 @@ public class AiPhotoSpeakResult { | |||||
| if (code == 4000) { | if (code == 4000) { | ||||
| return "成功"; | return "成功"; | ||||
| } else if (code == 3006 && msg.equals("miss parameter")) { | } else if (code == 3006 && msg.equals("miss parameter")) { | ||||
| return "却少参数"; | |||||
| return "(MetaService)却少参数"; | |||||
| } else if (code == 3007 && msg.equals("miss gen_txt")) { | } else if (code == 3007 && msg.equals("miss gen_txt")) { | ||||
| return "没有检测到文本"; | |||||
| return "(MetaService)没有检测到文本"; | |||||
| } else if (code == 3008 && msg.equals("check languages")) { | } else if (code == 3008 && msg.equals("check languages")) { | ||||
| return "文字和语种不对应"; | |||||
| } else if (msg.equals("unknown error")) { | |||||
| return "服务被Avatar攻击... 点击“编辑”重试"; | |||||
| return "(MetaService)文字和语种不对应"; | |||||
| } else { | } else { | ||||
| return "系统繁忙,请稍后重试"; | |||||
| return "(MetaService)服务被Avatar攻击... 点击“编辑”重试"; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -6,25 +6,23 @@ import lombok.Data; | |||||
| @Data | @Data | ||||
| public class AiPreviewResult { | public class AiPreviewResult { | ||||
| private boolean success; | |||||
| private Integer code; | |||||
| private String msg; | |||||
| private String url; | |||||
| private Double time; | |||||
| private boolean success; | |||||
| private Integer code; | |||||
| private String msg; | |||||
| private String url; | |||||
| private Double time; | |||||
| public String getMsgInfo(Integer code, String msg) { | |||||
| if (code == 3000) { | |||||
| return "成功"; | |||||
| } else if (code == 3006 && msg.equals("miss parameter")) { | |||||
| return "缺少参数"; | |||||
| } else if (code == 3007 && msg.equals("miss gen_txt")) { | |||||
| return "没有检测到文本"; | |||||
| } else if (code == 3008 && msg.equals("check languages")) { | |||||
| return "文字和语种不对应"; | |||||
| } else if (msg.equals("unknown error")) { | |||||
| return "服务被Avatar攻击... 点击“编辑”重试"; | |||||
| } else { | |||||
| return "系统繁忙,请稍后重试"; | |||||
| } | |||||
| } | |||||
| public String getMsgInfo(Integer code, String msg) { | |||||
| if (code == 3000) { | |||||
| return "成功"; | |||||
| } else if (code == 3006 && msg.equals("miss parameter")) { | |||||
| return "(MetaService)缺少参数"; | |||||
| } else if (code == 3007 && msg.equals("miss gen_txt")) { | |||||
| return "(MetaService)没有检测到文本"; | |||||
| } else if (code == 3008 && msg.equals("check languages")) { | |||||
| return "(MetaService)文字和语种不对应"; | |||||
| } else { | |||||
| return "(MetaService)服务被Avatar攻击... 点击“编辑”重试"; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @@ -12,11 +12,8 @@ public class AiVideoHqResult { | |||||
| public String getMsgInfo(Integer code, String msg) { | public String getMsgInfo(Integer code, String msg) { | ||||
| if (code == 5000) { | if (code == 5000) { | ||||
| return "成功"; | return "成功"; | ||||
| } else if (msg.equals("unknown error")) { | |||||
| } else { | |||||
| return "服务被Avatar攻击... 点击“编辑”重试"; | return "服务被Avatar攻击... 点击“编辑”重试"; | ||||
| }else { | |||||
| return "系统繁忙,请稍后重试"; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||