|
|
@@ -5,17 +5,28 @@ import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
+import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
import com.goafanti.app.service.AppHomePageService;
|
|
|
+import com.goafanti.business.service.JtBusinessService;
|
|
|
+import com.goafanti.comment.bo.CommentResult;
|
|
|
+import com.goafanti.comment.service.CommentService;
|
|
|
import com.goafanti.common.bo.Result;
|
|
|
+import com.goafanti.common.constant.AFTConstants;
|
|
|
+import com.goafanti.common.constant.ErrorConstants;
|
|
|
import com.goafanti.common.controller.BaseApiController;
|
|
|
+import com.goafanti.common.utils.StringUtils;
|
|
|
|
|
|
@RestController
|
|
|
@RequestMapping(path = "/open/app/home")
|
|
|
public class OpenAppHomeController extends BaseApiController{
|
|
|
@Resource
|
|
|
private AppHomePageService appHomePageService;
|
|
|
+ @Resource
|
|
|
+ private JtBusinessService jtBusinessService;
|
|
|
+ @Resource
|
|
|
+ private CommentService commentService;
|
|
|
|
|
|
|
|
|
/**App首页轮播图、导航、知产*/
|
|
|
@@ -37,6 +48,63 @@ public class OpenAppHomeController extends BaseApiController{
|
|
|
res.setData(appHomePageService.getHomeRecommended(type));
|
|
|
return res;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 项目列表
|
|
|
+ * @param topId
|
|
|
+ * @param secondId
|
|
|
+ * @param name
|
|
|
+ * @param pageSize
|
|
|
+ * @param pageNo
|
|
|
+ * @param privateProject
|
|
|
+ * @param auditStatus
|
|
|
+ * @param module
|
|
|
+ * @param isHot
|
|
|
+ * @param orderType
|
|
|
+ * @param orderSort
|
|
|
+ * @param ownerId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value="/projectList", method=RequestMethod.GET)
|
|
|
+ public Result getProjectList(String topId,String secondId,String name,Integer pageSize,Integer pageNo,Integer privateProject,Integer auditStatus,Integer module,Integer isHot,Integer orderType,Integer orderSort,String ownerId) {
|
|
|
+ Result result=new Result();
|
|
|
+ result.setData(jtBusinessService.getProjects(topId,secondId,name,pageSize,pageNo,privateProject,auditStatus,module,isHot,orderType,orderSort,ownerId));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 项目详情
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value="/projectdDtail",method=RequestMethod.GET)
|
|
|
+ public Result projectdDtail(String id){
|
|
|
+ Result result =new Result();
|
|
|
+ if (StringUtils.isBlank(id)) {
|
|
|
+ result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"商品ID","商品ID"));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ result.setData(jtBusinessService.getBusinessProjectDetail(id));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 项目评价
|
|
|
+ * @param id
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/projectdComment", method = RequestMethod.GET)
|
|
|
+ public Result listComment(String id,Integer pageNo,Integer pageSize) {
|
|
|
+ Result result=new Result();
|
|
|
+ if(StringUtils.isBlank(id)) {
|
|
|
+ result.getError().add(buildError(ErrorConstants.PARAM_EMPTY_ERROR,"商品ID","商品ID"));
|
|
|
+ }
|
|
|
+ CommentResult commentResult=new CommentResult();
|
|
|
+ commentResult.setPositiveCommentCount(commentService.getCommentCount(0, id));
|
|
|
+ commentResult.setOrdinaryCommentCount(commentService.getCommentCount(1, id));
|
|
|
+ commentResult.setNegativeCommentCount(commentService.getCommentCount(2, id));
|
|
|
+ commentResult.setComments(commentService.searchComment(id, pageNo, pageSize));
|
|
|
+ result.setData(commentResult);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|