package com.xm.controller;
import java.util.List;
import com.xm.api.BaseResponse;
import com.xm.api.StatusCode;
import com.xm.entity.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import com.xm.service.ArticleService;
@CrossOrigin
@RestController
public class ArticleController {
@Autowired
private ArticleService articleService;
//根据id查询文章详情
@GetMapping("/article/{id}")
public BaseResponse selectArticleById(@PathVariable("id") Integer id) {
Article article = articleService.selectArticleById(id);
BaseResponse retMsg = new BaseResponse(StatusCode.Success);
retMsg.setData(article);
return retMsg;
}
//根据id查询文章,药品详情
@GetMapping("/articleGoods/{id}")
public BaseResponse selectArticleGoodsById(@PathVariable("id") Integer id) {
Article article = articleService.selectArticleGoodsById(id);
BaseResponse retMsg = new BaseResponse(StatusCode.Success);
retMsg.setData(article);
return retMsg;
}
//按发表日期查询文章列表
@GetMapping("/articles")
public BaseResponse selectArticlesOrderByDate() {
List<Article> articles = articleService.selectArticlesOrderByDate();
BaseResponse retMsg = new BaseResponse(StatusCode.Success);
retMsg.setData(articles);
return retMsg;
}
//按热度查询文章列表
@GetMapping("/top")
public BaseResponse selectArticlesOrderByHits() {
List<Article> articles = articleService.selectArticlesOrderByHits();
BaseResponse retMsg = new BaseResponse(StatusCode.Success);
retMsg.setData(articles);
return retMsg;
}
//查询全部文章列表和所有评论
@GetMapping("/comments")
public BaseResponse selectTitlesWithComment() {
List<Article> articles = articleService.selectTitlesWithComment();
BaseResponse retMsg = new BaseResponse(StatusCode.Success);
retMsg.setData(articles);
return retMsg;
}
//发布文章
@PostMapping("/article")
public BaseResponse insertArticle(@RequestBody Article article) {
articleService.insertArticle(article);
BaseResponse retMsg = new BaseResponse(StatusCode.Success);
return retMsg;
}
//修改文章
@PutMapping("/article")
public BaseResponse updateArticle(@RequestBody Article article) {
articleService.updateArticle(article);
BaseResponse retMsg = new BaseResponse(StatusCode.Success);
return retMsg;
}
//删除文章
@DeleteMapping("/article/{id}")
public BaseResponse deleteArticleById(@PathVariable("id") Integer id) {
articleService.deleteArticleById(id);
BaseResponse retMsg = new BaseResponse(StatusCode.Success);
return retMsg;
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip

共73个文件
java:42个
jpg:12个
xml:7个

1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 103 浏览量
2022-11-27
08:52:58
上传
评论 3
收藏 992KB ZIP 举报
温馨提示
java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip java毕业设计基于SpringBoot+vue的养生系统源码+数据库.zip
资源推荐
资源详情
资源评论






























收起资源包目录


































































































共 73 条
- 1
资源评论


程序员张小妍
- 粉丝: 2w+
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助


最新资源
- 基于 Python tkinter 与 MySQL的图书管理系统.zip
- 基于 Python 的 Linux 应用防火墙(UESTC 课程设计).zip
- 基于 Python 编写的点名器.zip
- 基于 Python 的 Hyper-V 虚拟机管理工具.zip
- 基于 Python 的结构化日志库..zip
- 基于 Python 的 QQ 空间爬虫程序.zip
- 基于 python 的 selenium UI 自动化测试框架,采用 Page Object 设计模式进行二次开发
- 基于 python 开发的 DDNS 域名自动解析工具, 适用于百度云_ 百度智能云域名。.zip
- 基于 Python 的跳动爱心.zip
- 基于 Python 的量化投资基金的仓库.zip
- 基于 Redis 官方分布式锁文章的 Python 实现.zip
- 基于 Python 实现微信公众号爬虫.zip
- 基于 Python-Flask 的微服务框架.zip
- 基于 skywind3000_KCP 的 python 版本.zip
- 基于 Skulpt.js 的在线 Python 编程学习网站.zip
- 基于 skulpt 开发的 Python online.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈



安全验证
文档复制为VIP权益,开通VIP直接复制
