提交 b06da08c authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 3e5afd5c
...@@ -45,6 +45,8 @@ public class BaseRequestPath { ...@@ -45,6 +45,8 @@ public class BaseRequestPath {
/** 分页 */ /** 分页 */
public static final String PAGE = "/page"; public static final String PAGE = "/page";
/** 分页 */ /** 分页 */
public static final String INDEX = "/index";
/** 分页 */
public static final String PAGE_BOOK = "/page-book"; public static final String PAGE_BOOK = "/page-book";
/** 列表 */ /** 列表 */
public static final String LIST = "/list"; public static final String LIST = "/list";
......
package com.zrqx.core.vo.resource.fg;
import java.util.List;
import com.zrqx.core.model.resource.year.YearLibrary;
import com.zrqx.core.vo.resource.fg.ebook.WapIndexEbookListVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value="WapIndexListVO",description="查询集合返回的实体")
public class WapIndexListVO {
@ApiModelProperty("最新上架杂志")
private List<WapIndexEbookListVO> bookList;
@ApiModelProperty("最近年")
private List<YearLibrary> yearList;
}
package com.zrqx.core.vo.resource.fg.ebook; package com.zrqx.core.vo.resource.fg.ebook;
import java.util.List;
import com.zrqx.core.model.resource.year.YearLibrary;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@Data @Data
@ApiModel(value="FgEbookListVO",description="查询电子书集合返回的实体") @ApiModel(value="WapIndexEbookListVO",description="查询电子书集合返回的实体")
public class WapIndexEbookListVO { public class WapIndexEbookListVO {
@ApiModelProperty("id") @ApiModelProperty("id")
private String id; private String id;
...@@ -24,6 +20,4 @@ public class WapIndexEbookListVO { ...@@ -24,6 +20,4 @@ public class WapIndexEbookListVO {
private String summary; private String summary;
@ApiModelProperty("pdf") @ApiModelProperty("pdf")
private String pdf; private String pdf;
@ApiModelProperty("最近年刊")
private List<YearLibrary> yearList;
} }
...@@ -11,10 +11,12 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -11,10 +11,12 @@ import org.springframework.web.bind.annotation.RestController;
import com.zrqx.core.constant.resource.ResourceRequestPath; import com.zrqx.core.constant.resource.ResourceRequestPath;
import com.zrqx.core.form.resource.bg.QueryResourceRelationForm; import com.zrqx.core.form.resource.bg.QueryResourceRelationForm;
import com.zrqx.core.form.resource.fg.articlelibrary.FgQueryArticleLibraryForm; import com.zrqx.core.form.resource.fg.articlelibrary.FgQueryArticleLibraryForm;
import com.zrqx.core.model.resource.year.YearLibrary;
import com.zrqx.core.util.page.PageInfo; import com.zrqx.core.util.page.PageInfo;
import com.zrqx.core.util.page.PageParam; import com.zrqx.core.util.page.PageParam;
import com.zrqx.core.util.response.CallBack; import com.zrqx.core.util.response.CallBack;
import com.zrqx.core.vo.resource.ResourceRelationVo; import com.zrqx.core.vo.resource.ResourceRelationVo;
import com.zrqx.core.vo.resource.fg.WapIndexListVO;
import com.zrqx.core.vo.resource.fg.articlelibrary.FgArticleLibraryListVO; import com.zrqx.core.vo.resource.fg.articlelibrary.FgArticleLibraryListVO;
import com.zrqx.core.vo.resource.fg.ebook.FgEbookListVO; import com.zrqx.core.vo.resource.fg.ebook.FgEbookListVO;
import com.zrqx.core.vo.resource.fg.ebook.FgEbookVO; import com.zrqx.core.vo.resource.fg.ebook.FgEbookVO;
...@@ -23,6 +25,7 @@ import com.zrqx.resource.bg.service.ResourceRelationService; ...@@ -23,6 +25,7 @@ import com.zrqx.resource.bg.service.ResourceRelationService;
import com.zrqx.resource.fg.service.articlelibrary.FgArticleLibraryService; import com.zrqx.resource.fg.service.articlelibrary.FgArticleLibraryService;
import com.zrqx.resource.fg.service.ebook.FgEbookService; import com.zrqx.resource.fg.service.ebook.FgEbookService;
import com.zrqx.resource.wap.service.WapBookService; import com.zrqx.resource.wap.service.WapBookService;
import com.zrqx.resource.wap.service.WapYearLibraryService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -48,13 +51,21 @@ public class WapEbookController { ...@@ -48,13 +51,21 @@ public class WapEbookController {
private ResourceRelationService resourceRelationService; private ResourceRelationService resourceRelationService;
@Autowired @Autowired
private FgEbookService ebookservice; private FgEbookService ebookservice;
@Autowired
private WapYearLibraryService yearLibraryService;
@ApiOperation("首页最新上架") @ApiOperation("首页最新上架")
@GetMapping(ResourceRequestPath.PAGE) @GetMapping(ResourceRequestPath.INDEX)
public CallBack<List<WapIndexEbookListVO>> getBookList(String oid) { public CallBack<WapIndexListVO> getBookList(String oid) {
List<WapIndexEbookListVO> list = bookservice.queryMainBody(oid); WapIndexListVO vo = new WapIndexListVO();
return CallBack.success(list); //查询最新杂志
List<WapIndexEbookListVO> bookList = bookservice.queryMainBody(oid);
//查询最近年
List<YearLibrary> yearList = yearLibraryService.queryYear();
vo.setBookList(bookList);
vo.setYearList(yearList);
return CallBack.success(vo);
} }
......
...@@ -67,7 +67,7 @@ public interface WapBookMapper extends BaseMapper<Book> { ...@@ -67,7 +67,7 @@ public interface WapBookMapper extends BaseMapper<Book> {
+ "<if test = 'mainBody != null' >" + "<if test = 'mainBody != null' >"
+ "and bb.mainBody = #{mainBody} " + "and bb.mainBody = #{mainBody} "
+ "</if>" + "</if>"
+ " order by bb.uploadTime desc" + " order by bb.uploadTime desc LIMIT 4"
+ "</script>") + "</script>")
List<WapIndexEbookListVO> queryMainBody(String oid); List<WapIndexEbookListVO> queryMainBody(String oid);
......
package com.zrqx.resource.wap.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Select;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.year.YearLibrary;
/**
* 年份库
* @author rjc
* @date 2019年9月10日上午11:41:37
*/
public interface WapYearLibraryMapper extends BaseMapper<YearLibrary> {
@Select("<script>"
+ "select bb.id,bb.name,DATE_FORMAT(bb.uploadTime,'%Y-%m-%d') uploadTime "
+ "FROM res_year_library bb WHERE bb.status = 1 "
+ " order by bb.uploadTime desc LIMIT 3"
+ "</script>")
List<YearLibrary> queryYear();
}
package com.zrqx.resource.wap.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zrqx.core.mapper.BaseMapper;
import com.zrqx.core.model.resource.year.YearLibrary;
import com.zrqx.core.service.BaseServiceImpl;
import com.zrqx.resource.wap.mapper.WapYearLibraryMapper;
/**
* 年份库
* @author rjc
* @date 2019年9月10日上午11:42:19
*/
@Service
public class WapYearLibrarySerivceImpl extends BaseServiceImpl<YearLibrary,String> implements WapYearLibraryService {
@Autowired
private WapYearLibraryMapper mapper;
@Override
public BaseMapper<YearLibrary> getMapper() {
return mapper;
}
@Override
public List<YearLibrary> queryYear() {
// TODO Auto-generated method stub
return mapper.queryYear();
}
}
package com.zrqx.resource.wap.service;
import java.util.List;
import com.zrqx.core.model.resource.year.YearLibrary;
import com.zrqx.core.service.BaseService;
/**
* 年份库
* @author rjc
* @date 2019年9月10日上午11:42:09
*/
public interface WapYearLibraryService extends BaseService<YearLibrary,String>{
List<YearLibrary> queryYear();
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论