加上小程序获取视频分类的接口

This commit is contained in:
xiezhijun 2021-06-05 18:18:00 +08:00
parent c43ca57dd4
commit ec68617f50
2 changed files with 44 additions and 2 deletions

View File

@ -70,6 +70,8 @@ public class WechatAppletController extends BaseController {
private IWechatAppletService iWechatAppletService;
@Autowired
private ISysServicesTopicService iSysServicesTopicService;
@Autowired
private ISysVideoClassifyService sysVideoClassifyService;
/**
* 查询微信小程序中展示的客户案例
@ -386,6 +388,9 @@ public class WechatAppletController extends BaseController {
sysNutritionalVideo.setUserType(1);
}
}
if(sysNutritionalVideo.getCateId() != null && sysNutritionalVideo.getCateId().longValue() == 0){
sysNutritionalVideo.setCateId(null);
}
startPage();
List<SysNutritionalVideo> list = sysNutritionalVideoService.selectSysNutritionalVideoList(sysNutritionalVideo, true);
return getDataTable(list);
@ -702,6 +707,41 @@ public class WechatAppletController extends BaseController {
// }
/**
* 获取视频分类
* @param openid
* @return
*/
@GetMapping("/getVideoClassify")
public AjaxResult getVideoClassify(@RequestParam("openid")String openid) {
List<SysVideoClassify> list = sysVideoClassifyService.selectSysVideoClassifyList(new SysVideoClassify());
List<List<Map<String,Object>>> result = new ArrayList<>();
int groupCount = 3;
SysVideoClassify all = new SysVideoClassify();
all.setId(0L);
all.setCateName("全部内容");
list.add(0, all);
if(list != null && list.size() > 0){
//分成三组
int groupNum = list.size()/groupCount + (list.size() % groupCount > 0 ? 1 : 0);
for (int i = 0; i < groupNum; i++) {
List<Map<String,Object>> groupList = new ArrayList<>();
for (int j = i * groupCount; j < (i+1)*groupCount; j++) {
if(j < list.size()){
Map<String,Object> videoClassifyMap = new HashMap<>();
SysVideoClassify sysVideoClassify = list.get(j);
videoClassifyMap.put("cateName", sysVideoClassify.getCateName());
videoClassifyMap.put("cateId", sysVideoClassify.getId());
groupList.add(videoClassifyMap);
}else{
break;
}
}
result.add(groupList);
}
}
return AjaxResult.success(result);
}
}

View File

@ -65,9 +65,11 @@
<el-table-column label="成交金额" prop="amount" align="center" />
<el-table-column label="成交时间" prop="orderTime" align="center"
><template slot-scope="scope">
<div v-if="scope.row.orderTime != undefined && scope.row.orderTime != null">
<div v-for="time in scope.row.orderTime.split(' ')" :key="time">
{{ time }}
</div>
</div>
</template>
</el-table-column>
<el-table-column label="开始日期" prop="startTime" align="center" />