当前位置: 首页 > news >正文

基于SpringBoot的网上摄影工作室

目录

前言

 一、技术栈

二、系统功能介绍

用户信息管理

作品分类管理

轮播图管理

摄影作品管理

摄影作品收藏

摄影圈

摄影作品发布

三、核心代码

1、登录模块

 2、文件上传模块

3、代码封装


前言

随着信息技术在管理上越来越深入而广泛的应用,管理信息系统的实施在技术上已逐步成熟。本文介绍了网上摄影工作室的开发全过程。通过分析网上摄影工作室管理的不足,创建了一个计算机管理网上摄影工作室的方案。文章介绍了网上摄影工作室的系统分析部分,包括可行性分析等,系统设计部分主要介绍了系统功能设计和数据库设计。

本网上摄影工作室管理员功能有个人中心,用户信息管理,作品分类管理,摄影作品管理,摄影圈,系统管理等。用户可以注册登录,对摄影作品进行收藏和点赞以及评论,摄影圈发布信息,发布摄影作品,我的收藏等。因而具有一定的实用性。

本站是一个B/S模式系统,采用Spring Boot框架,MYSQL数据库设计开发,充分保证系统的稳定性。系统具有界面清晰、操作简单,功能齐全的特点,使得网上摄影工作室管理工作系统化、规范化。本系统的使用使管理人员从繁重的工作中解脱出来,实现无纸化办公,能够有效的提高网上摄影工作室管理效率。

 一、技术栈

末尾获取源码
SpringBoot+Vue+JS+ jQuery+Ajax...

二、系统功能介绍

用户信息管理

网上摄影工作室的系统管理员可以管理教师,可以对用户信息修改删除以及查询操作。

作品分类管理

系统管理员可以查看对作品分类进行添加,修改,删除以及查询操作。

 

轮播图管理

系统管理员可以对轮播图信息进行添加,修改,删除以及查询操作。

摄影作品管理

系统管理员可以对用户提交的摄影作品进行添加修改删除操作。

 

摄影作品收藏

用户登录后可以对摄影作品进行收藏操作。

摄影圈

用户登录后可以在摄影圈发布信息。

 

摄影作品发布

用户可以发布自己的摄影作品信息。

三、核心代码

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{@Autowiredprivate UserService userService;@Autowiredprivate 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();}
}

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

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

相关文章:

基于SpringBoot的网上摄影工作室

目录 前言 一、技术栈 二、系统功能介绍 用户信息管理 作品分类管理 轮播图管理 摄影作品管理 摄影作品收藏 摄影圈 摄影作品发布 三、核心代码 1、登录模块 2、文件上传模块 3、代码封装 前言 随着信息技术在管理上越来越深入而广泛的应用&#xff0c;管理信息系统…...

Spring源码解析——IOC之bean 的初始化

正文 一个 bean 经历了 createBeanInstance() 被创建出来&#xff0c;然后又经过一番属性注入&#xff0c;依赖处理&#xff0c;历经千辛万苦&#xff0c;千锤百炼&#xff0c;终于有点儿 bean 实例的样子&#xff0c;能堪大任了&#xff0c;只需要经历最后一步就破茧成蝶了。…...

互联网摸鱼日报(2023-10-07)

互联网摸鱼日报(2023-10-07) 36氪新闻 小米汽车将研发增程式电动车&#xff0c;产品已有规划&#xff1b;LG新能源和丰田汽车北美公司签署电动汽车电池供应协议&#xff5c;36氪新能源日报1005 详解企业数字化转型建设过程中所需的七种能力 电商平台&#xff0c;如何让丰收「…...

深入理解RBAC

RBAC是一种基于角色实现访问控制的权限管理机制&#xff0c;通过定义角色和权限、用户和角色、角色和角色之间的关系&#xff0c;实现多层次、细粒度、可复用的权限管理系统。原文: Role-based Access Control (RBAC) Model[1] Bernard HermantUnsplash Avery Pennarun写的&quo…...

uniapp微信小程序蓝牙连接与设备数据对接

蓝牙连接并通信方法封装大致步骤。 初始化蓝牙并搜索&#xff1b;获取并启用service服务&#xff1b;数据读取和监听设备返回数据 需要使用uniapp官方提供api&#xff1a; // 关闭蓝牙 uni.closeBluetoothAdapter({}) // 打开蓝牙 uni.openBluetoothAdapter({}) // 搜索附近…...

HBase 计划外启动 Major Compaction 的原因

HBase 的 Compaction 有两个线程池,一个是为 Minor Compaction 准备的, 一个是为 Major Compaction 准备的,hbase.regionserver.thread.compaction.throttle 是决定 Compaction 请求放入哪个线程池的阈值,当待合并文件的总大小小于这个阈值时,就是一个 Minor Compaction,…...

设计模式-桥接模式

概念 用于把抽象化与实现化解耦使得二者可以独立变化 演示 class ColorShape {yellowCircle() {console.log(yellow circle)}redCircle() {console.log(red circle)}yellowTriangle() {console.log(yellow triangle)}redTriangle() {console.log(red triangle)} }// 测试 le…...

arcgis地形分析全流程

主要内容&#xff1a;DEM的获取与处理、高程分析、坡度分析、坡向分析、地形起伏度分析、地表粗糙度分析、地表曲率分析&#xff1b; 主要工具&#xff1a;镶嵌至新栅格、按掩膜提取、投影栅格、坡度、坡向、焦点统计 一 DEM的获取与处理 1.1 DEM是什么&#xff1f; DEM(D…...

mapper.xml中的sql标签

在MyBatis中&#xff0c;mapper.xml文件是用于定义数据库操作的映射文件&#xff0c;其中的<sql>标签用于定义可重用的SQL片段。这些SQL片段可以在<select>, <update>, <insert>, <delete>等操作中被引用&#xff0c;以避免在多个地方重复编写相…...

重启redis的步骤

要重启 Redis&#xff0c;需要使用以下步骤&#xff1a; 登录到您的服务器&#xff1a;使用 SSH 或其他远程访问方式登录到托管 Redis 的服务器。 停止 Redis 服务器&#xff1a;您可以使用以下命令停止 Redis 服务器&#xff1a; redis-cli shutdown 这将向 Redis 服务器发送…...

第二证券:如何选股票的龙头股?

在股票商场中&#xff0c;每个出资者的方针都是可以出资到那些未来可以表现出色并带领整个工作开展的龙头股。选股关于出资者来说非常要害&#xff0c;由于选股不妥或许会导致出资失利。那么&#xff0c;怎么选股票的龙头股呢&#xff1f;本文从多个角度进行剖析&#xff0c;协…...

【华为OD机考B卷 | 100分】统计监控、需要打开多少监控器(JAVA题解——也许是全网最详)

前言 本人是算法小白&#xff0c;甚至也没有做过Leetcode。所以&#xff0c;我相信【同为菜鸡的我更能理解作为菜鸡的你们的痛点】。 题干 OD&#xff0c;B 卷 100 分题目【OD 统一考试&#xff08;B 卷&#xff09;】 1. 题目描述 某长方形停车场每个车位上方都有一个监控…...

Python Django 详解(基础)

文章目录 1 概述1.1 安装 django1.2 创建 django 项目1.3 创建 app 2 启动 Django2.1 settings.py&#xff1a;注册 app2.2 view.py&#xff1a;URL和视图对应2.3 启动 Django2.4 访问 3 快速上手3.1 templates&#xff1a;html 模板3.2 static&#xff1a;静态文件3.3 模板语法…...

C语言内存函数

目录 memcpy(Copy block of memory)使用和模拟实现memcpy的模拟实现 memmove(Move block of memory)使用和模拟实现memmove的模拟实现: memset(Fill block of memory)函数的使用扩展 memcmp(Compare two blocks of memory)函数的使用 感谢各位大佬对我的支持,如果我的文章对你有…...

【Docker】Docker-compose及Consul多容器编排工具

使用一个Dockerfile模版文件可以定义一个单独的应用容器&#xff0c;当需要定义多个容器时就需要编排 docker swarm&#xff08;管理跨节点&#xff09; 编排工具——docker compose Dockerfile可以让用户管理一个单独的应用容器&#xff1b;而Compose则允许用户在一个模板&…...

Unity网络同步方案帧同步和状态同步

网络同步方案 介绍开始我们使用的状态同步&#xff08;实时状态同步&#xff09;后来采用的帧同步 状态同步优点缺点 帧同步顺序执行追帧重连优点缺点 总结 这两年做的都是帧同步和状态同步的项目&#xff0c;正好最近有时间总结一下什么是帧同步和状态同步&#xff0c;之前在做…...

【Monorepo实战】pnpm+turbo+vitepress构建公共组件库文档系统

Monorepo架构可以把多个独立的系统放到一起联调&#xff0c;本文记录基于pnpm > workspace功能&#xff0c;如何构建将vitepress和组件库进行联调&#xff0c;并且使用turbo进行任务顺序编排。 技术栈清单&#xff1a; pnpm 、vitepress 、turbo 一、需求分析 1、最终目标…...

CentOS 编译安装Redis

一、编译配置hiredis.h C来操作redis数据库。通过hiredis接口来实现&#xff0c;目前只能在Linux环境使用。 下载hiredis.h hiredis的下载地址为&#xff1a;https://github.com/redis/hiredis 解压并编译hiredis [rootlocalhost source_code]# pwd /usr/local/source_…...

可拓展的低代码全栈框架

尽管现在越来越多的人开始对低代码开发感兴趣&#xff0c;但已有低代码方案的局限性仍然让大家有所保留。其中最常见的担忧莫过于低代码缺乏灵活性以及容易被厂商锁定。 显然这样的担忧是合理的&#xff0c;因为大家都不希望在实现特定功能的时候才发现低代码平台无法支持&…...

C++11 智能指针

目录 智能指针 异常导致执行流乱跳 智能指针解决问题 auto_ptr unique_ptr sharded_ptr weak_ptr 智能指针 由于C11引入异常之后&#xff0c;执行流乱跳&#xff0c;所以导致之前 malloc/new 的空间很容易没有被释放&#xff0c;导致内存泄露问题。 所以这时候&#x…...

二、WebGPU阶段间变量(inter-stage variables)

二、WebGPU阶段间变量&#xff08;inter-stage variables&#xff09; 在上一篇文章中&#xff0c;我们介绍了一些关于WebGPU的基础知识。在本文中&#xff0c;我们将介绍阶段变量&#xff08;inter-stage variables&#xff09;的基础知识。 阶段变量在顶点着色器和片段着色…...

【Linux】31个普通信号

文章目录 1.每种信号的含义2.两种不能被忽略的信号3.两种不能被捕捉的信号 1.每种信号的含义 信号编号信号名信号含义1SIGHUP如果终端接口检测到一个连接断开&#xff0c;则会将此信号发送给与该终端相关的控制进程&#xff0c;该信号的默认处理动作是终止进程。2SIGINT当用户…...

Mac电脑交互式原型设计 Axure RP 8汉化最新 for mac

Axure RP 8是一款专业且快速的原型设计工具&#xff0c;主要用于定义需求、规格、设计功能和界面。这款工具主要适用于用户体验设计师、交互设计师、业务分析师、信息架构师、可用性专家和产品经理等职业。 Axure RP 8的主要特性包括能够快速设计出应用软件或Web网站的线框图、…...

在线免费无时长限制录屏工具 - 录猎在线版

需要录屏的小伙伴注意啦&#xff0c;想要长时间录制又不想花钱的&#xff0c;可以看下这款在线版录屏软件 —— 录猎在线版&#xff0c;一个录屏软件所需要的基本功能它都有&#xff0c;设置录制范围、录制的声音来源、摄像头也能录制的。同时它是支持Windows和Mac系统的&#…...

c语言文件操作详解:fgetc,fputc,fgets,fputs,fscanf,,fprintf,fread,fwrite的使用和区别

前言&#xff1a;在对于c语言的学习中&#xff0c;我们为了持续使用一些数据&#xff0c;为了让我们的数据可以在程序退出后仍然保存并且可以使用&#xff0c;我们引入了文件的概念和操作&#xff0c;本文旨在为大家分享在文件操作中常用的输入输出函数的使用方式和技巧&#x…...

Harmony装饰器

1、装饰器 装饰器是用于装饰类、结构、方法以及变量&#xff0c;并赋予其特殊的含义。如&#xff1a; Component表示自定义组件Entry表示该自定义组件为入口组件State表示组件中的状态变量&#xff0c;状态变量变化会触发UI刷新。 2 、语法范式 Builder/BuilderParam&#…...

如何加快Chrome谷歌浏览器下载速度?

用Chrome打开chrome://flags/...

使用kubectl连接远程Kubernetes(k8s)集群

使用kubectl连接远程Kubernetes集群 环境准备下载kubectl下载地址 安装kubectl并处理配置文件Windows的安装配置安装kubectl拉取配置文件安装kubectl拉取配置文件kubectl命令自动补全 Linux的安装配置安装kubectl拉取配置文件kubectl命令自动补全 环境准备 你需要准备一个Kube…...

Kubernetes革命:云原生时代的应用编排和自动化

文章目录 什么是Kubernetes以及为何它备受欢迎&#xff1f;云原生应用和K8s的关系Kubernetes的核心概念&#xff1a;Pods、Services、ReplicaSets等部署、扩展和管理应用程序的自动化容器编排的演进&#xff1a;Docker到Kubernetes实际用例&#xff1a;企业如何受益于K8s的应用…...

mysql.mongoDb,neo4j数据库对比

#Mysql与MongoDb和Neo4j的一些对比 主要区别 MySQL&#xff1a; 1.MySQL是一种关系型数据库管理系统&#xff08;RDBMS&#xff09;&#xff0c;广泛用于处理结构化数据。 2.它支持SQL语言&#xff0c;具备成熟的事务处理和数据一致性能力。 3.MySQL适用于大多数传统的基于表…...