This commit is contained in:
2023-12-25 02:02:30 +08:00
parent 65f76703b8
commit c4762a33af
4 changed files with 59 additions and 13 deletions

View File

@@ -31,11 +31,11 @@ public class UrlCateListServiceImpl implements UrlCateListService {
{
//找用户ID
parent = parent.substring(1,parent.length()-1);
//找父标签有没有
UrlCateList cateParent = urlCateListDao.selectCateByNameAnduserId(parent,userId);
UrlCateList targetCate = new UrlCateList();
//设置属性
targetCate.setName(cateName.substring(1,cateName.length()-1));
targetCate.setUserId(userId);
@@ -100,6 +100,7 @@ public class UrlCateListServiceImpl implements UrlCateListService {
for(UrlList urlList : urlLists){
String parentString = urlCateListDao.selectUrListCateByUrlCateId(urlList.getCateId());
if (parentString == null) continue;
String [] strings = parentString.split(",");
for(String str :strings)

View File

@@ -27,12 +27,17 @@ public class UrlLiserServiceImpl implements UrlListService {
UserDao userDao;
public int selectCateAndInsertUrl(String parent,String name , String icon ,String url ,Integer userId)
{
parent = parent.substring(1,parent.length()-1);
UrlCateList urlCateList = urlCateListDao.selectCateByNameAnduserId(parent,userId);
UrlList urlList = new UrlList();
if (urlCateList == null)
{
urlList.setCateId(0);
}else{
urlList.setCateId(urlCateList.getId());
}
//设置属性
urlList.setCateId(urlCateList.getId());
urlList.setUrl(url);
urlList.setIcon(icon);
urlList.setName(name.substring(1,name.length()-1));
@@ -42,6 +47,7 @@ public class UrlLiserServiceImpl implements UrlListService {
urlList.setIsNeedAgent(Byte.valueOf(0+""));
urlList.setIsAd(Byte.valueOf(0+""));
urlList.setIsTop(Byte.valueOf(0+""));
urlList.setStatus(Byte.valueOf(0+""));
Byte b = 0;
urlList.setNeedLogin(b);
int flag = urlListDao.insert(urlList);