mirror of
https://github.com/201206030/novel-cloud.git
synced 2025-06-24 05:56:38 +00:00
新闻微服务开发完成,首页微服务开发中
This commit is contained in:
@ -0,0 +1,26 @@
|
||||
package com.java2nb.novel.news.api;
|
||||
|
||||
import com.java2nb.novel.news.entity.News;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新闻微服务API接口定义(内部)
|
||||
* @author xiongxiaoyang
|
||||
* @version 1.0
|
||||
* @since 2020/5/28
|
||||
*/
|
||||
public interface NewsApi {
|
||||
|
||||
/**
|
||||
* 查询最新新闻集合
|
||||
* @param limit 查询条数
|
||||
* @return 新闻集合
|
||||
* */
|
||||
@GetMapping("api/news/listLastIndexNews")
|
||||
List<News> listLastIndexNews(@RequestParam("limit") int limit);
|
||||
|
||||
|
||||
}
|
@ -3,9 +3,10 @@ package com.java2nb.novel.news.entity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import javax.annotation.Generated;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
public class News {
|
||||
public class News implements Serializable {
|
||||
@ApiModelProperty(value = "主键")
|
||||
@Generated("org.mybatis.generator.api.MyBatisGenerator")
|
||||
private Long id;
|
||||
|
@ -0,0 +1,19 @@
|
||||
package com.java2nb.novel.news.vo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.java2nb.novel.news.entity.News;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
*/
|
||||
@Data
|
||||
public class NewsVO extends News {
|
||||
|
||||
@ApiModelProperty(value = "新闻发布时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
private Date createTime;
|
||||
}
|
Reference in New Issue
Block a user