Commit 2105c8e0 by 徐高华

朋友圈

parent a3a57abb
package com.gic.haoban.manage.web.controller.moment; package com.gic.haoban.manage.web.controller.moment;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.api.base.commons.ServiceResponse; import com.gic.api.base.commons.ServiceResponse;
...@@ -112,8 +113,27 @@ public class QwMomentController { ...@@ -112,8 +113,27 @@ public class QwMomentController {
@RequestMapping("material-list") @RequestMapping("material-list")
public RestResponse<List<TaskMaterialVO>> getTaskMaterial(Long planId) { public RestResponse<List<TaskMaterialVO>> getTaskMaterial(Long planId) {
ServiceResponse<QwMomentPlanDTO> detailResp = this.qwMomentApiService.detail(planId) ; ServiceResponse<QwMomentPlanDTO> detailResp = this.qwMomentApiService.detail(planId) ;
List<TaskMaterialVO> list = new ArrayList<>() ;
return null ; if(detailResp.isSuccess() && null != detailResp.getResult()) {
String json = detailResp.getResult().getMediaInfo() ;
JSONArray arr = JSONArray.parseArray(json) ;
for(int i=0;i<arr.size();i++) {
JSONObject obj = arr.getJSONObject(i) ;
TaskMaterialVO vo = new TaskMaterialVO();
vo.setMaterialType(obj.getInteger("materialType"));
vo.setImgUrl(obj.getString("imgUrl"));
if(vo.getMaterialType()==4) {
vo.setLink(obj.getString("videoUrl"));
}
if(vo.getMaterialType()==3) {
vo.setLink(obj.getString("link"));
}
vo.setMaterialTitle(obj.getString("title"));
vo.setMaterialContent(obj.getString("contentText"));
list.add(vo);
}
}
return RestResponse.successResult(list) ;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment