标准收藏接口返回值更改

This commit is contained in:
caozhen
2023-09-14 17:00:10 +08:00
parent 97bbd92e52
commit 06e5c0bc9c
@@ -6,6 +6,8 @@ import javax.servlet.http.HttpServletRequest;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.system.vo.LoginUser; import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.MessageUtils;
import com.jero.modules.laws.common.constant.ResultCommon;
import com.jero.modules.personal.entity.LawsStandardCollection; import com.jero.modules.personal.entity.LawsStandardCollection;
import com.jero.modules.personal.service.ILawsStandardCollectionService; import com.jero.modules.personal.service.ILawsStandardCollectionService;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -63,11 +65,11 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId()); wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId());
int count = lawsStandardCollectionService.count(); int count = lawsStandardCollectionService.count();
if (count > 0){ if (count > 0){
return Result.OK("不能重复收藏!"); return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Cannot duplicate favorites" : "不能重复收藏!");
} }
lawsStandardCollection.setSource("1"); lawsStandardCollection.setSource("1");
lawsStandardCollectionService.add(lawsStandardCollection); lawsStandardCollectionService.add(lawsStandardCollection);
return Result.OK("操作成功!"); return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
} }
/** /**
@@ -78,10 +80,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@PostMapping(value = "/domestic/delete") @PostMapping(value = "/domestic/delete")
public Result<T> domesticDelete(@RequestBody Map<String, String> map) { public Result<T> domesticDelete(@RequestBody Map<String, String> map) {
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){ if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
return Result.error("请选择数据!"); return Result.error(MessageUtils.getLanguage().equals("EN") ? "Please select data!" : "请选择数据!");
} }
lawsStandardCollectionService.deleteById(map.get("id")); lawsStandardCollectionService.deleteById(map.get("id"));
return Result.OK("删除成功!"); return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
} }
/** /**
@@ -97,11 +99,11 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId()); wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId());
int count = lawsStandardCollectionService.count(); int count = lawsStandardCollectionService.count();
if (count > 0){ if (count > 0){
return Result.OK("不能重复收藏!"); return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Cannot duplicate favorites" : "不能重复收藏!");
} }
lawsStandardCollection.setSource("2"); lawsStandardCollection.setSource("2");
lawsStandardCollectionService.add(lawsStandardCollection); lawsStandardCollectionService.add(lawsStandardCollection);
return Result.OK("操作成功!"); return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
} }
/** /**
@@ -112,10 +114,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@PostMapping(value = "/overseas/delete") @PostMapping(value = "/overseas/delete")
public Result<T> overseasDelete(@RequestBody Map<String, String> map) { public Result<T> overseasDelete(@RequestBody Map<String, String> map) {
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){ if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
return Result.error("请选择数据!"); return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Cannot duplicate favorites" : "不能重复收藏!");
} }
lawsStandardCollectionService.deleteById(map.get("id")); lawsStandardCollectionService.deleteById(map.get("id"));
return Result.OK("删除成功!"); return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
} }
/** /**
@@ -131,11 +133,11 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId()); wrapper.eq(LawsStandardCollection::getCollectorId, sysUser.getId());
int count = lawsStandardCollectionService.count(); int count = lawsStandardCollectionService.count();
if (count > 0){ if (count > 0){
return Result.OK("不能重复收藏!"); return Result.OK(MessageUtils.getLanguage().equals("EN") ? "Cannot duplicate favorites" : "不能重复收藏!");
} }
lawsStandardCollection.setSource("3"); lawsStandardCollection.setSource("3");
lawsStandardCollectionService.add(lawsStandardCollection); lawsStandardCollectionService.add(lawsStandardCollection);
return Result.OK("操作成功!"); return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
} }
/** /**
@@ -146,10 +148,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@PostMapping(value = "/enterprise/delete") @PostMapping(value = "/enterprise/delete")
public Result<T> enterpriseDelete(@RequestBody Map<String, String> map) { public Result<T> enterpriseDelete(@RequestBody Map<String, String> map) {
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){ if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
return Result.error("请选择数据!"); return Result.error(MessageUtils.getLanguage().equals("EN") ? "Please select data!" : "请选择数据!");
} }
lawsStandardCollectionService.deleteById(map.get("id")); lawsStandardCollectionService.deleteById(map.get("id"));
return Result.OK("删除成功!"); return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
} }
/** /**
@@ -160,10 +162,10 @@ public class LawsStandardCollectionController extends JeroController<LawsStandar
@PostMapping(value = "/delete") @PostMapping(value = "/delete")
public Result<T> delete(@RequestBody Map<String, String> map) { public Result<T> delete(@RequestBody Map<String, String> map) {
if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){ if(!map.containsKey("id") || StringUtils.isEmpty(map.get("id"))){
return Result.error("请选择数据!"); return Result.error(MessageUtils.getLanguage().equals("EN") ? "Please select data!" : "请选择数据!");
} }
lawsStandardCollectionService.removeById(map.get("id")); lawsStandardCollectionService.removeById(map.get("id"));
return Result.OK("删除成功!"); return Result.OK(MessageUtils.getLanguage().equals("EN") ? ResultCommon.OK : "操作成功!");
} }
} }