更新项目详情

This commit is contained in:
cyk
2023-07-03 11:18:08 +08:00
parent e0ca7c5e70
commit 9eff5079b9

View File

@@ -1,11 +1,14 @@
package com.hellogithub.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hellogithub.dao.categoryDao;
import com.hellogithub.dao.projectDao;
import com.hellogithub.entity.categoryEntity;
import com.hellogithub.entity.projectEntity;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -130,13 +133,16 @@ public class projectService {
return projectDao.addProjectLookcount(id);
}
public String retProjectLabel(String id ){
Map<String,String > dataMap = new HashMap<>();
Map<String,List<String>> dataMap = new HashMap<>();
List<String> strs=new ArrayList<>();
List<categoryEntity> categoryEntityList = projectDao.retProjectLabel(id);
for(int i=0;i<categoryEntityList.size();i++)
{
categoryEntity categoryEntity=categoryEntityList.get(i);
dataMap.put("CategoryName",categoryEntity.getCategoryName());
strs.add(categoryEntity.getCategoryName());
}
return dataMap.toString();
dataMap.put("CategoryName",strs);
return JSONArray.toJSONString(dataMap);
}
}