大家好!我是职场程序猿,感谢您阅读本文,欢迎一键三连哦。

当前专栏:Java毕业设计

精彩专栏推荐

 安卓app毕业设计 微信小程序毕业设计

开发环境

开发语言:Java 框架:springboot JDK版本:JDK1.8 服务器:tomcat7 数据库:mysql 5.7 数据库工具:Navicat12 开发软件:eclipse/myeclipse/idea Maven包:Maven3.3.9 浏览器:谷歌浏览器

演示视频

jspssm514Springboot的校园新闻网站

源码下载地址:

添加链接描述

论文目录

【如需全文请按文末获取联系】

目录

开发环境演示视频源码下载地址:论文目录**【如需全文请按文末获取联系】**

一、项目简介二、系统设计2.1软件功能模块设计2.2数据库设计

三、系统项目部分截图3.1用户前台功能模块3.2管理员功能模块

四、部分核心代码4.1 用户部分

获取源码或论文

一、项目简介

本论文主要论述了如何使用JAVA语言开发一个校园新闻网站 ,本系统将严格按照软件开发流程进行各个阶段的工作,采用B/S架构,面向对象编程思想进行项目开发。在引言中,作者将论述校园新闻网站的当前背景以及系统开发的目的,后续章节将严格按照软件开发流程,对系统进行各个阶段分析设计。 校园新闻网站的主要使用者分为管理员和用户,实现功能包括管理员:首页、个人中心、用户管理、新闻类型管理、校园新闻管理、留言板管理、论坛交流、系统管理,用户前台:首页、校园新闻、论坛交流、留言反馈、个人中心、后台管理等功能。由于本网站的功能模块设计比较全面,所以使得整个校园新闻网站信息管理的过程得以实现。

二、系统设计

2.1软件功能模块设计

整个系统是由多个功能模块组合而成的,要将所有的功能模块都一一列举出来,然后进行逐个的功能设计,使得每一个模块都有相对应的功能设计,然后进行系统整体的设计。 本校园新闻网站结构图如图4-2所示。

2.2数据库设计

1、用户信息实体图如图4-5所示: 2、校园新闻信息实体图如图4-6所示: 3、留言板信息实体图如图4-7所示:

三、系统项目部分截图

3.1用户前台功能模块

校园新闻网站 ,在系统首页可以查看首页、校园新闻、论坛交流、留言反馈、个人中心、后台管理等内容,如图5-1所示。 用户登录、用户注册,在注册页面可以填写用户名、密码、姓名、联系电话等信息进行注册、登录,如图5-2所示。

校园新闻,在校园新闻页面通过查看标题、类型、图片、发布日期等信息进行点我收藏,如图5-3所示。在个人中心页面通过填写用户名、密码、姓名、头像、性别、联系电话等信息进行更新信息、退出登录操作,如图5-4所示。

3.2管理员功能模块

管理员登录,通过填写用户名、密码、角色进行登录,如图5-7所示。 管理员登录进入校园新闻网站可以查看首页、个人中心、用户管理、新闻类型管理、校园新闻管理、留言板管理、论坛交流、系统管理等信息。 用户管理,在用户管理页面中可以通过查看用户名、姓名、头像、性别、联系电话等内容进行修改、删除,如图5-8所示。还可以根据需要对新闻类型管理进行详情,修改或删除等详细操作,如图5-9所示。 校园新闻管理,在校园新闻管理页面中可以查看标题、类型、图片、发布日期等信息,并可根据需要对已有校园新闻管理进行修改或删除等操作,如图5-10所示。 轮播图;该页面为轮播图管理界面。管理员可以在此页面进行首页轮播图的管理,通过新建操作可在轮播图中加入新的图片,还可以对以上传的图片进行修改操作,以及图片的删除操作,如图5-12所示。

四、部分核心代码

4.1 用户部分

package com.controller;

import java.io.File;

import java.io.FileNotFoundException;

import java.io.IOException;

import java.util.Arrays;

import java.util.Date;

import java.util.HashMap;

import java.util.List;

import java.util.Map;

import java.util.Random;

import java.util.UUID;

import org.apache.commons.io.FileUtils;

import org.apache.commons.lang3.StringUtils;

import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.http.HttpHeaders;

import org.springframework.http.HttpStatus;

import org.springframework.http.MediaType;

import org.springframework.http.ResponseEntity;

import org.springframework.util.ResourceUtils;

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.RequestParam;

import org.springframework.web.bind.annotation.RestController;

import org.springframework.web.multipart.MultipartFile;

import com.annotation.IgnoreAuth;

import com.baomidou.mybatisplus.mapper.EntityWrapper;

import com.entity.ConfigEntity;

import com.entity.EIException;

import com.service.ConfigService;

import com.utils.R;

/**

* 上传文件映射表

*/

@RestController

@RequestMapping("file")

@SuppressWarnings({"unchecked","rawtypes"})

public class FileController{

@Autowired

private ConfigService configService;

/**

* 上传文件

*/

@RequestMapping("/upload")

public R upload(@RequestParam("file") MultipartFile file,String type) throws Exception {

if (file.isEmpty()) {

throw new EIException("上传文件不能为空");

}

String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")+1);

File path = new File(ResourceUtils.getURL("classpath:static").getPath());

if(!path.exists()) {

path = new File("");

}

File upload = new File(path.getAbsolutePath(),"/upload/");

if(!upload.exists()) {

upload.mkdirs();

}

String fileName = new Date().getTime()+"."+fileExt;

File dest = new File(upload.getAbsolutePath()+"/"+fileName);

file.transferTo(dest);

if(StringUtils.isNotBlank(type) && type.equals("1")) {

ConfigEntity configEntity = configService.selectOne(new EntityWrapper().eq("name", "faceFile"));

if(configEntity==null) {

configEntity = new ConfigEntity();

configEntity.setName("faceFile");

configEntity.setValue(fileName);

} else {

configEntity.setValue(fileName);

}

configService.insertOrUpdate(configEntity);

}

return R.ok().put("file", fileName);

}

/**

* 下载文件

*/

@IgnoreAuth

@RequestMapping("/download")

public ResponseEntity download(@RequestParam String fileName) {

try {

File path = new File(ResourceUtils.getURL("classpath:static").getPath());

if(!path.exists()) {

path = new File("");

}

File upload = new File(path.getAbsolutePath(),"/upload/");

if(!upload.exists()) {

upload.mkdirs();

}

File file = new File(upload.getAbsolutePath()+"/"+fileName);

if(file.exists()){

/*if(!fileService.canRead(file, SessionManager.getSessionUser())){

getResponse().sendError(403);

}*/

HttpHeaders headers = new HttpHeaders();

headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);

headers.setContentDispositionFormData("attachment", fileName);

return new ResponseEntity(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);

}

} catch (IOException e) {

e.printStackTrace();

}

return new ResponseEntity(HttpStatus.INTERNAL_SERVER_ERROR);

}

}

获取源码或论文

如需对应的论文或源码,也可以下方微信联系我

推荐链接

评论可见,请评论后查看内容,谢谢!!!
 您阅读本篇文章共花了: