基于Java springboot+mybatis+mysql实现的校园新闻系统

一、系统介绍

系统主要功能:
1.主页
2.登录以及注册
3.普通用户对新闻咨询的编辑、发布和删除
4.普通用户对新闻资讯的浏览以及点赞
5.普通用户对新闻资讯的按分类浏览
6.普通用户对个人信息的更改
7.管理员对新闻的审核发布和撤销取消发布

应用技术:
前端:HTML、CSS、JS、BootStrap。
后端:Spring,SpringMVC,Mybatis,SpringBoot。
数据库:MySQL,Druid 连接池。
其他:Maven、Thymeleaf

二、功能展示

1.主页

在这里插入图片描述

2.登录以及注册

在这里插入图片描述

3.普通用户对新闻咨询的编辑、发布和删除

在这里插入图片描述
在这里插入图片描述

4.管理员对新闻的审核发布和撤销取消发布

在这里插入图片描述

三、代码展示

package com.ruoyi.bug.controller;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.bug.tools.ListToTree;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.bug.domain.Comment;
import com.ruoyi.bug.service.ICommentService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 评论Controller
 *
 * @author ruoyi
 * @date 2022-03-24
 */
@RestController
@RequestMapping("/comment/comment")
public class CommentController extends BaseController
{
    @Autowired
    private ICommentService commentService;

    /**
     * 查询评论列表
     */
    @GetMapping("/list")
    public TableDataInfo list(Comment comment)
    {
        startPage();
        List<Comment> list = commentService.selectCommentList(comment);
        return getDataTable(list);
    }

    /**
     * 导出评论列表
     */
    @Log(title = "评论", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, Comment comment)
    {
        List<Comment> list = commentService.selectCommentList(comment);
        ExcelUtil<Comment> util = new ExcelUtil<Comment>(Comment.class);
        util.exportExcel(response, list, "评论数据");
    }

    /**
     * 获取评论详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(commentService.selectCommentById(id));
    }

    /**
     * 新增评论
     */
    @Log(title = "评论", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody Comment comment)
    {
        Date currentTime = new Date();
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        String dateString = formatter.format(currentTime);
        comment.setSentTime(dateString);
        return toAjax(commentService.insertComment(comment));
    }

    /**
     * 修改评论
     */
    @Log(title = "评论", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody Comment comment)
    {
        return toAjax(commentService.updateComment(comment));
    }

    /**
     * 删除评论
     */
    @Log(title = "评论", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(commentService.deleteCommentByIds(ids));
    }

    /**
     * 根据表单ID获取评论详细信息
     */
    @GetMapping(value = "/getCommentInfo/{formId}")
    public AjaxResult getCommentInfo(@PathVariable("formId") Long formId)
    {
        Comment comment = new Comment();
        comment.setFormId(formId.toString());
        List<Comment> list = commentService.selectCommentList(comment);
        JSONArray jsonarray= JSONArray.parseArray(JSONObject.toJSONString(list));
        JSONArray result = ListToTree.listToTree(jsonarray,"id","parentId","reply");
        return AjaxResult.success(result);
    }
}

四、获取源码

点击下载
基于Java springboot+mybatis实现的校园新闻系统

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
课程介绍 仓库管理系统主要功能有采购入库,采购退货,销售出库,销售退货,仓库盘点,库存报表,Excel导入导出,按钮级权限控制及系统日志等功能,系统采用SpringBoot ,mybatis,easyui,ajax,mssql数据库等技术开发。提供所有源代码下载,系统功能完善,可直接运行。开发环境项目开发语言:SpringBoot ,mybatis,easyui,ajax,mssql数据库项目运行环境:jdk1.8及以上版本,tomcat8.0及以上版本,sql server2005及以上版本项目开发工具: 本项目开发工具是Intellij Idea课程目标掌握SpringBoot技术,熟悉仓库管理系统主要功能,采购入库,采购退货,销售出库,销售退货,仓库盘点,系统报表,权限控制及日志等50多门JAVA系列全套课程,包括大一新生到大四毕业的所有JAVA系列技术专业课程,项目实战,商业项目等;基础课程:JAVA初级工程师: 1、计算机基础 2、HTML语言基础 3、C语言从入门到精通+贪吃蛇游戏 4、贪吃蛇游戏 5、SQL SERVER数据库基础 6、JAVA从入门到精通+推箱子游戏+QQ即时通讯软件 7、推箱子游戏; 8、仿QQ即时通讯软件;JAVA中级工程师: 9、SQLSERVER数据库高级 10、SQLSERVER从入门到精通(基础+高级) 11、JavaScript从入门到精通, 12、JSP从入门到精通+点餐系统, 13、JSP从入门到精通+在线视频学习教育平台, 14、JSP从入门到精通+大型电商平台; 15、XML从入门到精通, 16、数据结构(JAVA版),JAVA高级工程师: 17、Oracle数据库从入门到精通, 18、ajax+jquery从入门到精通, 19、EasyUI从入门到精通,SSH框架: 20、Struts2从入门到精通课程, 21、Hibernate从入门到精通课程, 22、Spring从入门到精通课程; 23、Echarts从入门到精通, 24、Excel基于POI的导入导出工作流框架: 25、Activiti流程框架从入门到精通 26、JBPM流程框架从入门到精通SSM框架: 27、MyBatis从入门到精通 28、Spring MVC从入门到精通 29、Spring Boot入门到精通 30、Spring Cloud入门到精通面试题: 31、职业生涯规划及面试题集锦商业项目: 32、微信公众号在线支付系统 33、微信生活缴费在线支付系统 34、支付宝生活缴费在线支付系统 35、在线考试系统 36、人脸识别智能考试系统(人工智能AI) 37、仓库管理及质量追溯系统 38、房屋出租管理系统APP(身份证识别) 39、手机订餐管理系统, 40、CRM客户关系管理系统 41、大型房地产CRM销售管理系统 42、CMPP2,CMPP3移动网关系统 43、仓库管理系统SpringBoot) 44、影院在线售票系统(仿猫眼电影)人工智能: 45、人脸识别在线考试系统 46、人脸识别系统项目实战 47、车牌识别停车场管理系统 48、身份证识别系统项目实战 49、营业执照识别系统项目实战 50、名片识别管理系统
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小码叔

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值