From 7a4f736b2dc74d1535bd2eb8c5a7fbad17fc72f7 Mon Sep 17 00:00:00 2001 From: haha Date: Mon, 16 Oct 2023 19:44:43 +0800 Subject: [PATCH] update code --- .../ProjectPhotographyController.java | 34 +++++++++++++++++++ .../video/SurProjectPhotographyMapper.xml | 1 + 2 files changed, 35 insertions(+) create mode 100644 yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProjectPhotographyController.java diff --git a/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProjectPhotographyController.java b/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProjectPhotographyController.java new file mode 100644 index 00000000..a05dd7af --- /dev/null +++ b/yanzhu-bigscreen/src/main/java/com/yanzhu/jh/bigscreen/web/controller/ProjectPhotographyController.java @@ -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 list=photographyService.selectSurProjectPhotographyList(where); + redisCache.setCacheObject(key, list, Constants.BIGSCREEN_QUERY_CACHE, TimeUnit.MINUTES); + return AjaxResult.success(list); + } +} diff --git a/yanzhu-jh/src/main/resources/mapper/video/SurProjectPhotographyMapper.xml b/yanzhu-jh/src/main/resources/mapper/video/SurProjectPhotographyMapper.xml index f804f57f..25f78c1a 100644 --- a/yanzhu-jh/src/main/resources/mapper/video/SurProjectPhotographyMapper.xml +++ b/yanzhu-jh/src/main/resources/mapper/video/SurProjectPhotographyMapper.xml @@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and create_date = #{createDate} and update_date = #{updateDate} + order by video_date