1.在appView接口增加了获取页面风格
2.增加了APP首页展示接口 3.增加了APP搜索框查询
This commit is contained in:
parent
bc0ca85a2c
commit
afae505dae
@ -5,10 +5,11 @@ package com.platform.modules.foreign.controller;/**
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.platform.modules.foreign.dto.AppSearchDto;
|
||||
import com.platform.modules.live.dto.LiveSceneDTO;
|
||||
import com.platform.modules.sys.controller.AbstractController;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
@ -17,12 +18,7 @@ import com.platform.modules.sys.service.SysTenantService;
|
||||
import com.platform.modules.sys.vo.SysTenantVo;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.platform.common.annotation.SysLog;
|
||||
@ -151,8 +147,9 @@ public class LiveForeignController {
|
||||
redisUtils.hset(setKey, ip, appCommentIpCount, 60);
|
||||
} else {
|
||||
Integer appCommentIpCountAlready = Integer.valueOf(value.toString());
|
||||
if(appCommentIpCountAlready >= 5)
|
||||
if(appCommentIpCountAlready >= 5) {
|
||||
return R.error("当前用户评论过多,请稍后重试");
|
||||
}
|
||||
appCommentIpCount += appCommentIpCountAlready;
|
||||
redisUtils.hset(setKey, ip, appCommentIpCount);
|
||||
}
|
||||
@ -269,4 +266,23 @@ public class LiveForeignController {
|
||||
}
|
||||
return R.ok("success").put("data", object);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 按照直播中、预告、回顾的顺序(播放时间倒序排序)展示
|
||||
* @param page 当前页数
|
||||
* @param size 页面大小
|
||||
* @return 封装后的现场集合
|
||||
*/
|
||||
@GetMapping("/getAppAllScene")
|
||||
public R getAppAllScene(@RequestParam Integer page, @RequestParam Integer size) {
|
||||
page = (page - 1) * size;
|
||||
return R.ok().put("AppAllScene",liveSceneService.getAppAllScene(page,size));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/appSearch")
|
||||
public R appSearch(@RequestBody AppSearchDto appSearchDto) {
|
||||
return R.ok().put("appSearch",liveSceneService.appSearch(appSearchDto));
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,8 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
|
||||
import com.platform.modules.foreign.dto.AppSearchDto;
|
||||
import com.platform.modules.live.dto.LiveSceneDTO;
|
||||
import com.platform.modules.live.dto.SceneDTO;
|
||||
import com.platform.modules.live.vo.SceneCommentCountVo;
|
||||
import com.platform.modules.live.vo.SceneSortEntityVo;
|
||||
@ -52,4 +54,11 @@ public interface LiveSceneDao extends BaseMapper<LiveSceneEntity> {
|
||||
|
||||
@Update("update live_scene set hot_spot = 1 where id = #{id}")
|
||||
void updateHotSpot(Long id);
|
||||
|
||||
@Select("select * from live_scene where scene_state = 2 order by field(live_state,1,0,2) asc,live_start desc limit #{page},#{size};")
|
||||
List<SceneEntityVo> getAppAllScene(@Param("page") Integer page, @Param("size") Integer size);
|
||||
|
||||
|
||||
|
||||
List<LiveSceneDTO> appSearch(@Param("appSearchDto") AppSearchDto appSearchDto, Page<LiveSceneDTO> page);
|
||||
}
|
||||
|
||||
@ -8,7 +8,9 @@ import com.baomidou.mybatisplus.plugins.Page;
|
||||
import com.baomidou.mybatisplus.service.IService;
|
||||
import com.platform.common.utils.R;
|
||||
import com.platform.common.utils.PageUtils;
|
||||
import com.platform.modules.foreign.dto.AppSearchDto;
|
||||
import com.platform.modules.foreign.entity.SceneForeignEntity;
|
||||
import com.platform.modules.live.dto.LiveSceneDTO;
|
||||
import com.platform.modules.live.dto.SceneDTO;
|
||||
import com.platform.modules.live.entity.LiveSceneEntity;
|
||||
import com.platform.modules.live.entity.LiveSceneLiveInfoEntity;
|
||||
@ -174,4 +176,7 @@ public interface LiveSceneService extends IService<LiveSceneEntity> {
|
||||
List<SceneDTO> hotList(Integer count);
|
||||
|
||||
|
||||
List<SceneEntityVo> getAppAllScene(Integer page,Integer size);
|
||||
|
||||
List<LiveSceneDTO> appSearch(AppSearchDto appSearchDto);
|
||||
}
|
||||
|
||||
@ -11,9 +11,14 @@ import com.platform.modules.live.entity.LiveChannelComponentEntity;
|
||||
import com.platform.modules.live.entity.LiveSceneChannelEntity;
|
||||
import com.platform.modules.live.entity.LiveSceneEntity;
|
||||
import com.platform.modules.live.service.LiveSceneService;
|
||||
import com.platform.modules.sys.dao.SysConfigDao;
|
||||
import com.platform.modules.sys.entity.SysConfigEntity;
|
||||
import com.platform.modules.sys.service.impl.SysConfigServiceImpl;
|
||||
import io.swagger.models.auth.In;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanInfoFactory;
|
||||
import org.springframework.beans.factory.BeanFactoryUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@ -46,6 +51,9 @@ public class LiveChannelServiceImpl extends ServiceImpl<LiveChannelDao, LiveChan
|
||||
private LiveChannelService liveChannelService;
|
||||
@Autowired
|
||||
private LiveChannelComponentServiceImpl liveChannelComponentService;
|
||||
private SysConfigServiceImpl sysConfigService;
|
||||
@Autowired
|
||||
private SysConfigDao sysConfigDao;
|
||||
|
||||
@Override
|
||||
@Transactional(readOnly = true)
|
||||
@ -433,6 +441,17 @@ private LiveChannelDao liveChannelDao;
|
||||
}
|
||||
map.put("sceneGroupByChannel", collect);
|
||||
|
||||
//3.获取页面风格
|
||||
String pageStyle = "PAGE_STYLE";
|
||||
SysConfigEntity sysConfig = sysConfigDao.getPageStyle(pageStyle);
|
||||
if(sysConfig == null){
|
||||
sysConfig = new SysConfigEntity();
|
||||
sysConfig.setKey("PAGE_STYLE");
|
||||
sysConfig.setValue("1");
|
||||
sysConfig.setRemark("页面风格(页面风格:基础蓝色、喜庆红色、哀悼灰色)");
|
||||
sysConfigDao.insert(sysConfig);
|
||||
}
|
||||
map.put("pageStyle", sysConfig.getValue());
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
@ -11,10 +11,12 @@ import com.baomidou.mybatisplus.service.impl.ServiceImpl;
|
||||
import com.platform.autoconfigure.live.LiveProperties;
|
||||
import com.platform.common.exception.RRException;
|
||||
import com.platform.common.utils.*;
|
||||
import com.platform.modules.foreign.dto.AppSearchDto;
|
||||
import com.platform.modules.foreign.entity.SceneForeignEntity;
|
||||
import com.platform.modules.foreign.entity.SceneStreamForeignEntity;
|
||||
import com.platform.modules.live.constants.SceneConstants;
|
||||
import com.platform.modules.live.dao.LiveSceneDao;
|
||||
import com.platform.modules.live.dto.LiveSceneDTO;
|
||||
import com.platform.modules.live.dto.SceneDTO;
|
||||
import com.platform.modules.live.entity.*;
|
||||
import com.platform.modules.live.service.*;
|
||||
@ -2911,7 +2913,15 @@ public class LiveSceneServiceImpl extends ServiceImpl<LiveSceneDao, LiveSceneEnt
|
||||
return sceneDTOS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SceneEntityVo> getAppAllScene(Integer page,Integer size) {
|
||||
return liveSceneDao.getAppAllScene(page,size);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<LiveSceneDTO> appSearch(AppSearchDto appSearchDto) {
|
||||
Page<LiveSceneDTO> page = new Page<>(appSearchDto.getPage(), appSearchDto.getSize());
|
||||
return liveSceneDao.appSearch(appSearchDto, page);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.mapper.BaseMapper;
|
||||
import com.platform.modules.sys.entity.SysConfigEntity;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* 系统配置信息
|
||||
@ -21,5 +22,7 @@ public interface SysConfigDao extends BaseMapper<SysConfigEntity> {
|
||||
* 根据key,更新value
|
||||
*/
|
||||
int updateValueByKey(@Param("key") String key, @Param("value") String value);
|
||||
|
||||
|
||||
@Select("select * from sys_config where `key` = #{pageStyle};")
|
||||
SysConfigEntity getPageStyle(@Param("pageStyle") String pageStyle);
|
||||
}
|
||||
|
||||
@ -140,4 +140,27 @@
|
||||
</set>
|
||||
WHERE id = #{entity.id}
|
||||
</update>
|
||||
|
||||
<select id="appSearch" resultType="com.platform.modules.live.dto.LiveSceneDTO">
|
||||
SELECT
|
||||
id,
|
||||
title,
|
||||
title_image AS titleImage,
|
||||
live_state AS liveState
|
||||
FROM
|
||||
live_scene
|
||||
WHERE scene_state = 2
|
||||
<if test="appSearchDto.title != null and appSearchDto.title != ''">
|
||||
AND `title` LIKE CONCAT('%', #{appSearchDto.title}, '%')
|
||||
</if>
|
||||
<if test="appSearchDto.liveDesc != null and appSearchDto.liveDesc != ''">
|
||||
AND live_desc LIKE CONCAT('%', #{appSearchDto.liveDesc}, '%')
|
||||
</if>
|
||||
<if test="appSearchDto.startTime != null and appSearchDto.endTime != null">
|
||||
AND live_start BETWEEN #{appSearchDto.startTime} AND #{appSearchDto.endTime}
|
||||
</if>
|
||||
<if test="appSearchDto.channelName != null and appSearchDto.channelName != ''">
|
||||
AND channels_name = #{appSearchDto.channelName}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user