|
@@ -67,6 +67,13 @@ public class TranslateController {
|
|
|
TranslateResult<FileUploadVo> result = aiService.fileUpload(param);
|
|
|
FileUploadVo vo = result.getData();
|
|
|
aiRecord(vo.getFileKey(), userId, result,0,AIActionEnum.UPLOAD_TRANSLATION_FILE,vo.getFileId(),vo.getCharCount());
|
|
|
+ Integer cost;
|
|
|
+ if (vo.getCharCount() < 10000) {
|
|
|
+ cost = 2; // 不满1000字符的费用为1
|
|
|
+ } else {
|
|
|
+ cost = (int) Math.ceil(vo.getCharCount() / 1000.0 )*2;
|
|
|
+ }
|
|
|
+ vo.setCredit(cost);
|
|
|
return vo;
|
|
|
} catch (Exception e) {
|
|
|
TranslateResult<String> result = new TranslateResult<String>();
|
|
@@ -113,9 +120,9 @@ public class TranslateController {
|
|
|
param.setCharCount(charCount);
|
|
|
Integer cost;
|
|
|
if (charCount < 10000) {
|
|
|
- cost = 1; // 不满1000字符的费用为1
|
|
|
+ cost = 2; // 不满1000字符的费用为1
|
|
|
} else {
|
|
|
- cost = (int) Math.ceil(charCount / 5000.0 );
|
|
|
+ cost = (int) Math.ceil(charCount / 1000.0 )*2;
|
|
|
}
|
|
|
if(!checkPoint(vo, cost)){
|
|
|
TranslateResult<Map<String,Integer>> result = new TranslateResult<Map<String,Integer>>();
|