sys包下中英文返回值

This commit is contained in:
caozhen
2023-09-15 18:41:54 +08:00
parent bb591d937f
commit e45518aefd
12 changed files with 128 additions and 62 deletions
@@ -63,7 +63,7 @@ public class LawsBrowsingHistoryController extends JeroController<LawsBrowsingHi
@PostMapping(value = "/add")
public Result<T> add(@Validated @RequestBody LawsBrowsingHistory lawsBrowsingHistory) {
lawsBrowsingHistoryService.add(lawsBrowsingHistory);
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
@@ -77,7 +77,7 @@ public class LawsBrowsingHistoryController extends JeroController<LawsBrowsingHi
LambdaQueryWrapper<LawsBrowsingHistory> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(LawsBrowsingHistory::getBrowsingUserId, sysUser.getId());
lawsBrowsingHistoryService.remove(wrapper);
return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Successfully cleared!" : "清除成功!");
return Result.error(MessageUtils.getMessage(ResultCommon.SUCCESSFULLY_CLEARED));
}
/**
@@ -91,6 +91,6 @@ public class LawsBrowsingHistoryController extends JeroController<LawsBrowsingHi
return Result.error(MessageUtils.getLanguage().equals("EN") ? "Please select data!" : "请选择数据!");
}
this.lawsBrowsingHistoryService.removeByIds(Arrays.asList(map.get("ids").split(",")));
return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Successfully deleted in bulk!" : "批量删除成功!");
return Result.error(MessageUtils.getMessage(ResultCommon.SUCCESSFULLY_DELETED_IN_BULK));
}
}
@@ -65,11 +65,11 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId());
int count = lawsStandardCollectionService.count();
if (count > 0){
return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Cannot duplicate favorites" : "不能重复收藏!");
return Result.error(MessageUtils.getMessage(ResultCommon.CANNOT_DUPLICATE_FAVORITES));
}
lawsStandardCollection.setSource("1");
lawsStandardCollectionService.add(lawsStandardCollection);
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
@@ -83,7 +83,7 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
return Result.error(MessageUtils.getLanguage().equals("EN") ? "Please select data!" : "请选择数据!");
}
lawsStandardCollectionService.deleteById(map.get("id"));
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
@@ -99,11 +99,11 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId());
int count = lawsStandardCollectionService.count();
if (count > 0){
return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Cannot duplicate favorites" : "不能重复收藏!");
return Result.error(MessageUtils.getMessage(ResultCommon.CANNOT_DUPLICATE_FAVORITES));
}
lawsStandardCollection.setSource("2");
lawsStandardCollectionService.add(lawsStandardCollection);
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
@@ -114,10 +114,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@PostMapping(value = "/overseas/delete")
public Result<T> overseasDelete(@RequestBody Map<String, String> map) {
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Cannot duplicate favorites" : "不能重复收藏!");
return Result.error(MessageUtils.getMessage(ResultCommon.CANNOT_DUPLICATE_FAVORITES));
}
lawsStandardCollectionService.deleteById(map.get("id"));
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
@@ -133,11 +133,11 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId());
int count = lawsStandardCollectionService.count();
if (count > 0){
return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Cannot duplicate favorites" : "不能重复收藏!");
return Result.error(MessageUtils.getMessage(ResultCommon.CANNOT_DUPLICATE_FAVORITES));
}
lawsStandardCollection.setSource("3");
lawsStandardCollectionService.add(lawsStandardCollection);
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
@@ -151,7 +151,7 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
return Result.error(MessageUtils.getLanguage().equals("EN") ? "Please select data!" : "请选择数据!");
}
lawsStandardCollectionService.deleteById(map.get("id"));
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
@@ -165,7 +165,7 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
return Result.error(MessageUtils.getLanguage().equals("EN") ? "Please select data!" : "请选择数据!");
}
lawsStandardCollectionService.removeById(map.get("id"));
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
}
@@ -120,7 +120,7 @@ public class LawsStandardSharingController extends JeroController<LawsStandardSh
sharings.add(sharing);
}
lawsStandardSharingService.saveBatch(sharings);
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
@@ -155,7 +155,7 @@ public class LawsStandardSharingController extends JeroController<LawsStandardSh
sharings.add(sharing);
}
lawsStandardSharingService.saveBatch(sharings);
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
@@ -190,7 +190,7 @@ public class LawsStandardSharingController extends JeroController<LawsStandardSh
sharings.add(sharing);
}
lawsStandardSharingService.saveBatch(sharings);
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
/**
@@ -204,7 +204,7 @@ public class LawsStandardSharingController extends JeroController<LawsStandardSh
return Result.error(MessageUtils.getLanguage().equals("EN") ? "Please select data!" : "请选择数据!");
}
this.lawsStandardSharingService.deleteByIds(Arrays.asList(map.get("ids").split(",")));
return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
return Result.OK(MessageUtils.getMessage(ResultCommon.OK));
}
}