新闻微服务开发完成,首页微服务开发中

This commit is contained in:
xiongxiaoyang
2020-05-28 18:53:35 +08:00
parent 387d5e862c
commit 7edd79a5f2
23 changed files with 629 additions and 15 deletions

View File

@ -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);
}

View File

@ -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;

View File

@ -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;
}