update code

dev_xds
haha 2023-10-16 19:44:43 +08:00
parent 3564e8926d
commit 7a4f736b2d
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,34 @@
package com.yanzhu.jh.bigscreen.web.controller;
import com.ruoyi.common.constant.Constants;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.redis.RedisCache;
import com.yanzhu.jh.video.domain.SurProjectPhotography;
import com.yanzhu.jh.video.service.ISurProjectPhotographyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.concurrent.TimeUnit;
@RestController
@RequestMapping("/bgscreen/photography")
public class ProjectPhotographyController extends BaseController {
@Autowired
ISurProjectPhotographyService photographyService;
@Autowired
private RedisCache redisCache;
public AjaxResult listPhotography(SurProjectPhotography where){
String key="bgscreen_photography_listPhotography_"+where.getProjectId();
Object obj=redisCache.getCacheObject(key);
if(obj!=null){
return AjaxResult.success(obj);
}
List<SurProjectPhotography> list=photographyService.selectSurProjectPhotographyList(where);
redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES);
return AjaxResult.success(list);
}
}

View File

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="createDate != null "> and create_date = #{createDate}</if>
<if test="updateDate != null "> and update_date = #{updateDate}</if>
</where>
order by video_date
</select>
<select id="selectSurProjectPhotographyById" parameterType="Long" resultMap="SurProjectPhotographyResult">