|
@@ -1,5 +1,6 @@
|
|
|
package com.sooka.module.web.cms;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.sooka.common.constant.CmsConst;
|
|
@@ -152,7 +153,7 @@ public class IndexController {
|
|
|
map.put("categoryId",lmid);
|
|
|
}
|
|
|
map.put("keyword",keyword);
|
|
|
- PageInfo<TCmsContent> tCmsContentPageInfo = contentService.SearchTitleFor(pageNumber,map);
|
|
|
+ List<TCmsContent> tCmsContentPageInfo = contentService.SearchTitleFor(pageNumber,map);
|
|
|
TCmsSite site = new TCmsSite();
|
|
|
site.setSiteId(Integer.parseInt(siteId));
|
|
|
modelAndView.addObject("model",tCmsContentPageInfo);
|
|
@@ -164,6 +165,25 @@ public class IndexController {
|
|
|
return modelAndView;
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping("/appSearchFor")
|
|
|
+ @ResponseBody
|
|
|
+ public String SearchTitleFor(String type, String keyword, String siteId, @RequestParam(value = "number",defaultValue = "1") Integer pageNumber){
|
|
|
+ JSONObject obj = new JSONObject();
|
|
|
+ Map<String,Object>map=new HashMap<>(3);
|
|
|
+ map.put("type",type);
|
|
|
+ map.put("keyword",keyword);
|
|
|
+ List<TCmsContent> tCmsContentPageInfo = contentService.SearchTitleFor(pageNumber,map);
|
|
|
+ TCmsSite site = new TCmsSite();
|
|
|
+ site.setSiteId(Integer.parseInt(siteId));
|
|
|
+ obj.put("model",tCmsContentPageInfo);
|
|
|
+ obj.put("frontPath",httpProtocol+"://"+ host+":"+port+"/"+siteName+"/"+sitePrefix);
|
|
|
+ obj.put("resPath",httpProtocol+"://"+ host+":"+port+"/"+siteName+"/"+"static"+"/"+"www");
|
|
|
+ obj.put("keyword",keyword);
|
|
|
+ obj.put("siteId",siteId);
|
|
|
+ obj.put("site",site);
|
|
|
+ return JsonUtil.toSuccessResultJSON("查询成功!",obj);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 站点首页
|
|
|
* @param siteId
|