|
@@ -1,5 +1,6 @@
|
|
package com.platform.api;
|
|
package com.platform.api;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.platform.annotation.IgnoreAuth;
|
|
import com.platform.annotation.IgnoreAuth;
|
|
import com.platform.entity.*;
|
|
import com.platform.entity.*;
|
|
@@ -10,9 +11,11 @@ import com.platform.service.ApiUserService;
|
|
import com.platform.service.custom.MyApiTmBrandTypeService;
|
|
import com.platform.service.custom.MyApiTmBrandTypeService;
|
|
import com.platform.service.custom.MySysUserBrandService;
|
|
import com.platform.service.custom.MySysUserBrandService;
|
|
import com.platform.service.impl.SysUserServiceImpl;
|
|
import com.platform.service.impl.SysUserServiceImpl;
|
|
|
|
+import com.platform.service.impl.ZhiHouseService;
|
|
import com.platform.util.ApiBaseAction;
|
|
import com.platform.util.ApiBaseAction;
|
|
import com.platform.util.ApiPageUtils;
|
|
import com.platform.util.ApiPageUtils;
|
|
import com.platform.utils.Query;
|
|
import com.platform.utils.Query;
|
|
|
|
+import com.platform.vos.RequestScene;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
@@ -62,6 +65,9 @@ public class ApiBrandController extends ApiBaseAction {
|
|
@Autowired
|
|
@Autowired
|
|
private ApiRecommendService recommendService;
|
|
private ApiRecommendService recommendService;
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private ZhiHouseService zhiHouseService;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 分页获取品牌
|
|
* 分页获取品牌
|
|
*
|
|
*
|
|
@@ -171,12 +177,22 @@ public class ApiBrandController extends ApiBaseAction {
|
|
int total = brandService.queryTotal(query);
|
|
int total = brandService.queryTotal(query);
|
|
result = new ApiPageUtils(brandEntityList, total, query.getLimit(), query.getPage());
|
|
result = new ApiPageUtils(brandEntityList, total, query.getLimit(), query.getPage());
|
|
}else{
|
|
}else{
|
|
- params.put("fields", "id,name,app_list_pic_url,pv_total_num");
|
|
|
|
- Query query = new Query(params);
|
|
|
|
- List<BrandVo> brandVos = sceneService.queryList(query);
|
|
|
|
- int total = sceneService.queryTotal(query);
|
|
|
|
|
|
+ RequestScene requestScene = new RequestScene();
|
|
|
|
+ if(params.containsKey("isShow")){
|
|
|
|
+ requestScene.setIsShow(true);
|
|
|
|
+ }
|
|
|
|
+ if(params.containsKey("userId"))
|
|
|
|
+ requestScene.setUserId(userId);{
|
|
|
|
+ }
|
|
|
|
+ if(params.containsKey("name"))
|
|
|
|
+ requestScene.setSceneName(name);{
|
|
|
|
+ }
|
|
|
|
+ requestScene.setPage(Long.valueOf(page));
|
|
|
|
+ requestScene.setLimit(Long.valueOf(size));
|
|
|
|
+ JSONObject mySceneJsonData = zhiHouseService.getSceneFromZhiHouse(requestScene);
|
|
|
|
+ List<Object> mySceneList = mySceneJsonData.getJSONArray("list");
|
|
// 处理场景数据
|
|
// 处理场景数据
|
|
- result = new ApiPageUtils(brandVos, total, query.getLimit(), query.getPage());
|
|
|
|
|
|
+ result = new ApiPageUtils(mySceneList, mySceneJsonData.getInteger("totalCount"), size, page);
|
|
}
|
|
}
|
|
return toResponsSuccess(result);
|
|
return toResponsSuccess(result);
|
|
|
|
|