Bladeren bron

服务项目更新接口

liliang4869 7 jaren geleden
bovenliggende
commit
ef7c5e7359

+ 11 - 0
src/main/java/com/goafanti/business/controller/AdminJtBusinessController.java

@@ -85,6 +85,7 @@ public class AdminJtBusinessController extends CertifyApiController{
 		Result result=new Result();
 		//只允许修改3种字段
 		JtBusinessCategory jtBusinessCategory2=new JtBusinessCategory();
+		jtBusinessCategory2.setId(jtBusinessCategory.getId());
 		jtBusinessCategory2.setImgUrl(jtBusinessCategory.getImgUrl());
 		jtBusinessCategory2.setName(jtBusinessCategory.getName());
 		jtBusinessCategory2.setSummary(jtBusinessCategory.getSummary());
@@ -201,4 +202,14 @@ public class AdminJtBusinessController extends CertifyApiController{
 		return result;
 	}
 	
+	@RequestMapping(value="/project/update",method=RequestMethod.POST)
+	private Result updateProject(JtBusinessProject jtBusinessProject) {
+		Result result=new Result();
+		jtBusinessProject.setCreateTime(null);
+//		jtBusinessProject.setId(null);
+		jtBusinessProject.setNumber(null);
+		jtBusinessService.updateProject(jtBusinessProject);
+		return result;
+	}
+	
 }

+ 1 - 0
src/main/java/com/goafanti/business/service/JtBusinessService.java

@@ -22,4 +22,5 @@ JtBusinessCategory getCategoryById(String id);
 int updateCategory(JtBusinessCategory jtBusinessCategory);
 int insertProject(JtBusinessProject jtBusinessProject);
 int deleteProjectById(String id);
+int updateProject(JtBusinessProject jtBusinessProject);
 }

+ 6 - 0
src/main/java/com/goafanti/business/service/impl/JtBusinessServiceImpl.java

@@ -228,5 +228,11 @@ public class JtBusinessServiceImpl  extends BaseMybatisDao<JtBusinessProjectMapp
 		return jtBusinessProjectMapper.deleteByPrimaryKey(id);
 	}
 
+	@Override
+	public int updateProject(JtBusinessProject jtBusinessProject) {
+		// TODO Auto-generated method stub
+		return jtBusinessProjectMapper.updateByPrimaryKeySelective(jtBusinessProject);
+	}
+
 	
 }