From 6268a5c374b361cb8907c125f8997bf250df9f0a Mon Sep 17 00:00:00 2001 From: User_cyk <1020691186@qq.com> Date: Sun, 24 Dec 2023 16:08:48 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=88=86=E7=B1=BB=E6=A0=87?= =?UTF-8?q?=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/UrlAndCateController.java | 25 +++++++++++++++++++ .../lovenav/service/UrlCateListService.java | 2 ++ .../serviceImpl/UrlCateListServiceImpl.java | 5 ++++ 3 files changed, 32 insertions(+) diff --git a/src/main/java/com/lovenav/controller/UrlAndCateController.java b/src/main/java/com/lovenav/controller/UrlAndCateController.java index e6c7549..1bc50c2 100644 --- a/src/main/java/com/lovenav/controller/UrlAndCateController.java +++ b/src/main/java/com/lovenav/controller/UrlAndCateController.java @@ -583,4 +583,29 @@ public class UrlAndCateController { return JSONObject.toJSONString(result); } + @RequestMapping("/insertCateByUser") + public String disposeBookmarkToJsonByUserId(UrlCateList urlCateList) + { + int flag = 0; + Date date = new Date(); + urlCateList.setCreatetime(date.getTime()); + urlCateList.setUrlNumber(Long.valueOf(0)); + urlCateList.setRootCateId(0); + HashMap result = new HashMap<>(); + flag = urlCateListService.insertSelective(urlCateList); + if(flag == 1) + { + result.put("code", 200); + result.put("msg", "处理成功"); + result.put("data", result); + }else{ + result.put("code", 500); + result.put("msg", "处理失败"); + result.put("data", result); + } + return JSONObject.toJSONString(result); + } + + + } diff --git a/src/main/java/com/lovenav/service/UrlCateListService.java b/src/main/java/com/lovenav/service/UrlCateListService.java index 8d33cc4..1060c4a 100644 --- a/src/main/java/com/lovenav/service/UrlCateListService.java +++ b/src/main/java/com/lovenav/service/UrlCateListService.java @@ -17,4 +17,6 @@ public interface UrlCateListService { public String selectUrListCateByUrlCateId(Integer cateId); public UrlCateList selectByPrimaryKey(Integer id); + public int insertSelective(UrlCateList urlCateList); + } diff --git a/src/main/java/com/lovenav/service/serviceImpl/UrlCateListServiceImpl.java b/src/main/java/com/lovenav/service/serviceImpl/UrlCateListServiceImpl.java index e887607..79742d2 100644 --- a/src/main/java/com/lovenav/service/serviceImpl/UrlCateListServiceImpl.java +++ b/src/main/java/com/lovenav/service/serviceImpl/UrlCateListServiceImpl.java @@ -62,6 +62,11 @@ public class UrlCateListServiceImpl implements UrlCateListService { return urlCateListDao.selectUrListCateByUrlCateId(cateId); } + + public int insertSelective(UrlCateList urlCateList) + { + return urlCateListDao.insertSelective(urlCateList); + } public UrlCateList selectByPrimaryKey(Integer id) { return urlCateListDao.selectByPrimaryKey(id);