|
@@ -6,12 +6,15 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.flyer.foster.dto.PosterLibQueryDTO;
|
|
import com.flyer.foster.dto.PosterLibQueryDTO;
|
|
import com.flyer.foster.dto.PosterLibRespDTO;
|
|
import com.flyer.foster.dto.PosterLibRespDTO;
|
|
|
|
+import com.flyer.foster.dto.app.AppPosterLibQueryDTO;
|
|
|
|
+import com.flyer.foster.dto.app.AppPosterLibRespDTO;
|
|
import com.flyer.foster.entity.PosterLib;
|
|
import com.flyer.foster.entity.PosterLib;
|
|
import com.flyer.foster.mapper.IPosterLibMapper;
|
|
import com.flyer.foster.mapper.IPosterLibMapper;
|
|
import com.flyer.foster.service.IPosterLibService;
|
|
import com.flyer.foster.service.IPosterLibService;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.time.LocalDateTime;
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
@@ -49,4 +52,18 @@ public class PosterLibServiceImpl extends ServiceImpl<IPosterLibMapper, PosterLi
|
|
pageResult.setTotal(pageInfo.getTotal());
|
|
pageResult.setTotal(pageInfo.getTotal());
|
|
return pageResult;
|
|
return pageResult;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public AppPosterLibRespDTO getLatestPoster(AppPosterLibQueryDTO queryDTO) {
|
|
|
|
+ LocalDateTime now = LocalDateTime.now();
|
|
|
|
+ PosterLib posterLib = this.lambdaQuery()
|
|
|
|
+ .le(PosterLib::getStartTime, now)
|
|
|
|
+ .ge(PosterLib::getEndTime, now)
|
|
|
|
+ .orderByDesc(PosterLib::getId)
|
|
|
|
+ .last("limit 1")
|
|
|
|
+ .one();
|
|
|
|
+ AppPosterLibRespDTO respDTO = new AppPosterLibRespDTO();
|
|
|
|
+ BeanUtil.copyProperties(posterLib, respDTO);
|
|
|
|
+ return respDTO;
|
|
|
|
+ }
|
|
}
|
|
}
|