基于SSM+Vue的鲸落文化线上体验馆设计与实现

news2024/10/5 23:27:06

末尾获取源码
开发语言:Java
Java开发工具:JDK1.8
后端框架:SSM
前端:采用Vue技术开发
数据库:MySQL5.7和Navicat管理工具结合
服务器:Tomcat8.5
开发软件:IDEA / Eclipse
是否Maven项目:是


目录

一、项目简介

二、系统设计

系统功能结构设计

三、系统项目截图

用户信息管理

制作视频管理

趣味视频管理

历史背景管理

四、核心代码

4.1登录相关

4.2文件上传

4.3封装


一、项目简介

现代经济快节奏发展以及不断完善升级的信息化技术,让传统数据信息的管理升级为软件存储,归纳,集中处理数据信息的管理方式。本鲸落文化线上体验馆就是在这样的大环境下诞生,其可以帮助管理者在短时间内处理完毕庞大的数据信息,使用这种软件工具可以帮助管理人员提高事务处理效率,达到事半功倍的效果。此鲸落文化线上体验馆利用当下成熟完善的SSM框架,使用跨平台的可开发大型商业网站的Java语言,以及最受欢迎的RDBMS应用软件之一的Mysql数据库进行程序开发.鲸落文化线上体验馆的开发根据操作人员需要设计的界面简洁美观,在功能模块布局上跟同类型网站保持一致,程序在实现基本要求功能时,也为数据信息面临的安全问题提供了一些实用的解决方案。可以说该程序在帮助管理者高效率地处理工作事务的同时,也实现了数据信息的整体化,规范化与自动化。


二、系统设计

鲸落文化线上体验馆的设计方案比如功能框架的设计,比如数据库的设计的好坏也就决定了该系统在开发层面是否高效,以及在系统维护层面是否容易维护和升级,因为在系统实现阶段是需要考虑用户的所有需求,要是在设计阶段没有经过全方位考虑,那么系统实现的部分也就无从下手,所以系统设计部分也是至关重要的一个环节,只有根据用户需求进行细致全面的考虑,才有希望开发出功能健全稳定的程序软件。

系统功能结构设计

在分析并得出使用者对程序的功能要求时,就可以进行程序设计了。如图4.2展示的就是管理员功能结构图,管理员主要负责填充图书和其类别信息,并对已填充的数据进行维护,包括修改与删除,管理员也需要审核老师注册信息,发布公告信息,管理自助租房信息等。



三、系统项目截图

用户信息管理

用户信息管理页面,此页面提供给管理员的功能有:用户信息的查询管理,可以删除用户信息、修改用户信息、新增用户信息,还进行了对用户名称的模糊查询的条件

制作视频管理

制作视频管理页面,此页面提供给管理员的功能有:查看已发布的制作视频数据,修改制作视频,制作视频作废,即可删除。

 

趣味视频管理

趣味视频管理页面,此页面提供给管理员的功能有:查看已发布的趣味视频数据,修改趣味视频,趣味视频作废,即可删除。

 

历史背景管理

历史背景管理页面,此页面提供给管理员的功能有:查看已发布的历史背景数据,修改历史背景,历史背景作废,即可删除。

 


四、核心代码

4.1登录相关


package com.controller;


import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
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.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.annotation.IgnoreAuth;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.entity.TokenEntity;
import com.entity.UserEntity;
import com.service.TokenService;
import com.service.UserService;
import com.utils.CommonUtil;
import com.utils.MD5Util;
import com.utils.MPUtil;
import com.utils.PageUtils;
import com.utils.R;
import com.utils.ValidatorUtils;

/**
 * 登录相关
 */
@RequestMapping("users")
@RestController
public class UserController{
	
	@Autowired
	private UserService userService;
	
	@Autowired
	private TokenService tokenService;

	/**
	 * 登录
	 */
	@IgnoreAuth
	@PostMapping(value = "/login")
	public R login(String username, String password, String captcha, HttpServletRequest request) {
		UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
		if(user==null || !user.getPassword().equals(password)) {
			return R.error("账号或密码不正确");
		}
		String token = tokenService.generateToken(user.getId(),username, "users", user.getRole());
		return R.ok().put("token", token);
	}
	
	/**
	 * 注册
	 */
	@IgnoreAuth
	@PostMapping(value = "/register")
	public R register(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
    		return R.error("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }

	/**
	 * 退出
	 */
	@GetMapping(value = "logout")
	public R logout(HttpServletRequest request) {
		request.getSession().invalidate();
		return R.ok("退出成功");
	}
	
	/**
     * 密码重置
     */
    @IgnoreAuth
	@RequestMapping(value = "/resetPass")
    public R resetPass(String username, HttpServletRequest request){
    	UserEntity user = userService.selectOne(new EntityWrapper<UserEntity>().eq("username", username));
    	if(user==null) {
    		return R.error("账号不存在");
    	}
    	user.setPassword("123456");
        userService.update(user,null);
        return R.ok("密码已重置为:123456");
    }
	
	/**
     * 列表
     */
    @RequestMapping("/page")
    public R page(@RequestParam Map<String, Object> params,UserEntity user){
        EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
    	PageUtils page = userService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.allLike(ew, user), params), params));
        return R.ok().put("data", page);
    }

	/**
     * 列表
     */
    @RequestMapping("/list")
    public R list( UserEntity user){
       	EntityWrapper<UserEntity> ew = new EntityWrapper<UserEntity>();
      	ew.allEq(MPUtil.allEQMapPre( user, "user")); 
        return R.ok().put("data", userService.selectListView(ew));
    }

    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
    public R info(@PathVariable("id") String id){
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }
    
    /**
     * 获取用户的session用户信息
     */
    @RequestMapping("/session")
    public R getCurrUser(HttpServletRequest request){
    	Long id = (Long)request.getSession().getAttribute("userId");
        UserEntity user = userService.selectById(id);
        return R.ok().put("data", user);
    }

    /**
     * 保存
     */
    @PostMapping("/save")
    public R save(@RequestBody UserEntity user){
//    	ValidatorUtils.validateEntity(user);
    	if(userService.selectOne(new EntityWrapper<UserEntity>().eq("username", user.getUsername())) !=null) {
    		return R.error("用户已存在");
    	}
        userService.insert(user);
        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
    public R update(@RequestBody UserEntity user){
//        ValidatorUtils.validateEntity(user);
        userService.updateById(user);//全部更新
        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
    public R delete(@RequestBody Long[] ids){
        userService.deleteBatchIds(Arrays.asList(ids));
        return R.ok();
    }
}

4.2文件上传

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);
		FileUtils.copyFile(dest, new File("C:\\Users\\Desktop\\jiadian\\springbootl7own\\src\\main\\resources\\static\\upload"+"/"+fileName));
		if(StringUtils.isNotBlank(type) && type.equals("1")) {
			ConfigEntity configEntity = configService.selectOne(new EntityWrapper<ConfigEntity>().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<byte[]> 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<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		return new ResponseEntity<byte[]>(HttpStatus.INTERNAL_SERVER_ERROR);
	}
	
}

4.3封装

package com.utils;

import java.util.HashMap;
import java.util.Map;

/**
 * 返回数据
 */
public class R extends HashMap<String, Object> {
	private static final long serialVersionUID = 1L;
	
	public R() {
		put("code", 0);
	}
	
	public static R error() {
		return error(500, "未知异常,请联系管理员");
	}
	
	public static R error(String msg) {
		return error(500, msg);
	}
	
	public static R error(int code, String msg) {
		R r = new R();
		r.put("code", code);
		r.put("msg", msg);
		return r;
	}

	public static R ok(String msg) {
		R r = new R();
		r.put("msg", msg);
		return r;
	}
	
	public static R ok(Map<String, Object> map) {
		R r = new R();
		r.putAll(map);
		return r;
	}
	
	public static R ok() {
		return new R();
	}

	public R put(String key, Object value) {
		super.put(key, value);
		return this;
	}
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1011945.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【NVM】nvm安装教程(nodejs多版本切换)

系列文章 C#底层库–记录日志帮助类 本文链接&#xff1a;https://blog.csdn.net/youcheng_ge/article/details/124187709 文章目录 系列文章前言一、安装准备1. 1 下载nvm-setup1. 2 卸载掉nodejs 二、安装步骤2.1 欢迎页面2.2 选择nvm安装目录2.3 选择nodejs安装目录2.4 安装…

进程间通信--信号

1&#xff1a;信号 什么是信号&#xff1f; 信号是给程序提供一种可以处理异步事件的方法&#xff0c;它利用软件中断来实现。不能自定义信号&#xff0c;所有信号都是系统预定义的。 信号由谁产生&#xff1f; 1)由shell终端根据当前发生的错误&#xff08;段错误、非法指令…

途虎养车IPO:飞轮效应下的汽车后市场巨头

汽车已经成为了家家户户必不可少的存在。作为消费品来说&#xff0c;汽车更新换代快&#xff0c;日常使用磨损大&#xff0c;随着智能汽车和新能源汽车市场的不断扩大&#xff0c;也给汽车售后服务产线带来了巨大的发展市场。保养以及维修市场的缺口越来越大&#xff0c;也为汽…

简明 SQL 子查询指南:掌握 EXISTS 实现数据筛选

子查询是一种在查询语句内部嵌套另一个完整查询的方式&#xff0c;用于获取更复杂的查询结果或数据过滤。在执行包含子查询的查询时&#xff0c;数据库引擎首先执行子查询&#xff0c;然后将其结果用作外层查询的条件或数据源。 以下两表作为后续SQL语句所用 table1 …

Jmeter系列-并发线程Concurrency Thread Group的介绍(7)

简介 Concurrency Thread Group提供了用于配置多个线程计划的简化方法&#xff0c;该线程组目的是为了保持并发水平&#xff0c;意味着如果并发线程不够&#xff0c;则在运行线程中启动额外的线程Concurrency Thread Group提供了更好的用户行为模拟&#xff0c;因为它使您可以…

AeDet:方位不变的多视图3D物体检测

代码&#xff1a;https://github.com/fcjian/AeDet 项目地址&#xff1a;https://fcjian.github.io/aedet/ 导读&动机 本篇论文探讨了自动驾驶领域中的多视图3D目标检测问题&#xff0c;特别关注了LSS&#xff08;Lift-Splat-Shoot&#xff09;方法的发展&#xff0c;该方法…

模拟实现C语言--strcat函数

模拟实现C语言–strcat函数 文章目录 模拟实现C语言--strcat函数一、strcat函数是什么&#xff1f;二、使用示例二、模拟实现 一、strcat函数是什么&#xff1f; 作用是把源数据追加到目标空间 char * strcat ( char * destination, const char * source );源字符串必须以 ‘…

Springboot整合规则引擎

Springboot整合Drools 规则引擎 1.添加maven 依赖坐标&#xff0c;并创建springboot项目 <!-- drools规则引擎 --> <dependency><groupId>org.drools</groupId><artifactId>drools-compiler</artifactId><version>7.6.0.Final<…

maven-resources-production:trunk-auth: java.lang.NegativeArraySizeException

ijdea启动auth项目报错&#xff1a; maven-resources-production:trunk-auth: java.lang.NegativeArraySizeException 一直在本地启动不起来&#xff0c;记录下操作步骤 第一步&#xff1a;将ijdea中的缓存都清理掉了&#xff0c;不行 第二步&#xff1a;将maven中的对应项目…

如何将内网ip映射到外网?快解析内网穿透

关于内网ip映射到外网的问题&#xff0c;就是网络地址转换&#xff0c;私网借公网。要实现这个&#xff0c;看起来说得不错&#xff0c;实际上是有前提条件的。要实现内网ip映射到外网&#xff0c;首先要有一个固定的公网IP&#xff0c;可以从运营商那里得到。当你得到公网IP后…

Mybatis动态数据源及其原理

一、引言 作者最近的平台项目需要一个功能&#xff0c;数据库是动态的&#xff0c;sql也是动态的&#xff0c;所以需要动态注入数据源&#xff0c;并且能够在运行过程中进行切换数据库。作者在这里分享一下做法&#xff0c;以及Mybatis这样做的原理。 二、分析 接下来分析一下…

【案例教学】华为云API图引擎服务 GES的便捷性—AI帮助快速处理图片小助手

云服务、API、SDK&#xff0c;调试&#xff0c;查看&#xff0c;我都行 阅读短文您可以学习到&#xff1a;人工智能AI快速处理图片 1 IntelliJ IDEA 之API插件介绍 API插件支持 VS Code IDE、IntelliJ IDEA等平台、以及华为云自研 CodeArts IDE&#xff0c;基于华为云服务提供…

LeetCode //C - 637. Average of Levels in Binary Tree

637. Average of Levels in Binary Tree Given the root of a binary tree, return the average value of the nodes on each level in the form of an array. Answers within 1 0 − 5 10^{-5} 10−5 of the actual answer will be accepted. Example 1: Input: root [3…

学Python的漫画漫步进阶 -- 第十三步

学Python的漫画漫步进阶 -- 第十三步 十三、图形用户界面13.1 Python中的图形用户界面开发库13.2 安装wxPython13.3 第一个wxPython程序13.4 自定义窗口类13.5 在窗口中添加控件13.6 事件处理13.7 布局管理13.7.1 盒子布局管理器13.7.2 动动手——重构事件处理示例13.7.3 动动手…

赴日开发工程师工作怎么找?

想要做赴日开发工作的途径有一下几种&#xff1a;一个是自己去联系日本的企业&#xff0c;当然这种的前提是你日语完全没有问题&#xff0c;但是现在很少有企业愿意直接与求职人员沟通。第二个就是你有IT技术&#xff0c;但是不会日语&#xff0c;年纪不大的可以来日本读个学校…

单目标追踪——【工具】汉明窗(Hamming window)

目录 汉明窗&#xff08;Hamming window&#xff09;原理作用代码实例可视化总结 汉明窗&#xff08;Hamming window&#xff09; 原理 汉明&#xff08;Hanning&#xff09;窗可以看成是升余弦窗的一个特例&#xff0c;汉宁窗可以看作是3个矩形时间窗的频谱之和&#xff0c;…

webpack实战:最新QQ音乐sign参数加密分析

文章目录 1. 写在前面2. 接口抓包分析3. 扣webpack代码4. 补浏览器环境5. 验证加密结果 1. 写在前面 现在&#xff01;很多的网站使用Webpack加载和处理JS文件。所以对于使用了Webpack加载的JS代码&#xff0c;一旦它们被打包并在浏览器中执行&#xff0c;通常是难以直接阅读和…

选择正确的开发框架:构建高效、可维护的应用程序

&#x1f482; 个人网站:【工具大全】【游戏大全】【神级源码资源网】&#x1f91f; 前端学习课程&#xff1a;&#x1f449;【28个案例趣学前端】【400个JS面试题】&#x1f485; 寻找学习交流、摸鱼划水的小伙伴&#xff0c;请点击【摸鱼学习交流群】 引言 在现代软件开发中…

python如何打包成应用

前几天有学生问&#xff0c;开发好的python代码如何打包给对方使用&#xff1f;对方没有python的安装执行环境。 python是一个强大的编程开发工具&#xff0c;它不仅仅是做一些命令行或脚本运行工具&#xff0c;还可以开发桌面、web等应用。 本文就介绍使用pyinstall如何把py…

GIS前端编程-地理事件动态模拟

GIS前端编程-地理事件动态模拟 动画特效功能图形闪烁要素轨迹移动 动画特效功能 目前&#xff0c;GIS应用除了涉及地理位置信息&#xff0c;还要结合时间维度&#xff0c;这样才能更加真实地模拟现实世界的事物。因此在实际项目应用中&#xff0c;静态的&#xff08;位置固定不…