一、个人简介
💖💖作者:计算机编程果茶熊 💙💙个人简介:曾长期从事计算机专业培训教学,担任过编程老师,同时本人也热爱上课教学,擅长Java、微信小程序、Python、Golang、安卓Android等多个IT方向。会做一些项目定制化开发、代码讲解、答辩教学、文档编写、也懂一些降重方面的技巧。平常喜欢分享一些自己开发中遇到的问题的解决办法,也喜欢交流技术,大家有技术代码这一块的问题可以问我! 💛💛想说的话:感谢大家的关注与支持! 💜💜 网站实战项目 安卓/小程序实战项目 大数据实战项目 计算机毕业设计选题 💕💕文末获取源码联系计算机编程果茶熊
二、系统介绍
开发语言:Java+Python 数据库:MySQL 系统架构:B/S 后端框架:SpringBoot(Spring+SpringMVC+Mybatis)+Django 前端:Vue+HTML+CSS+JavaScript+jQuery
是一个集艺术品展示、拍卖交易、社区交流于一体的综合性数字化美术平台。该系统采用前后端分离的架构设计,前端运用Vue.js框架结合ElementUI组件库构建用户界面,后端基于SpringBoot框架整合Spring、SpringMVC和MyBatis技术栈,数据存储采用MySQL关系型数据库。平台涵盖用户注册登录、艺术家信息管理、作品分类展示、艺术作品浏览、线上拍卖竞价、论坛社区交流等核心功能模块。系统支持多角色权限管理,包括普通用户、艺术家、管理员等不同身份,每类用户都拥有相应的操作权限和功能界面。通过个人中心模块,用户可以管理个人信息、查看订单记录、参与拍卖历史等。论坛交流功能促进艺术爱好者之间的互动沟通,举报记录功能维护平台内容质量,订单管理系统确保交易流程的完整性和安全性,为用户提供便捷高效的线上美术体验服务。
三、基于Vue.js和SpringBoot的线上美术馆网站平台-视频解说
Vue.js毕业设计推荐:线上美术馆网站平台SpringBoot后端开发完整教程
四、基于Vue.js和SpringBoot的线上美术馆网站平台-功能展示
五、基于Vue.js和SpringBoot的线上美术馆网站平台-代码展示
import org.apache.spark.sql.SparkSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
@RestController
@RequestMapping("/api")
public class ArtGalleryController {
@Autowired
private ArtworkService artworkService;
@Autowired
private AuctionService auctionService;
@Autowired
private ForumService forumService;
private SparkSession spark = SparkSession.builder()
.appName("ArtGalleryAnalytics")
.master("local[*]")
.getOrCreate();
@PostMapping("/artwork/upload")
@Transactional
public Map<String, Object> uploadArtwork(@RequestBody Map<String, Object> artworkData) {
Map<String, Object> result = new HashMap<>();
try {
String title = (String) artworkData.get("title");
String description = (String) artworkData.get("description");
Integer categoryId = (Integer) artworkData.get("categoryId");
Integer artistId = (Integer) artworkData.get("artistId");
String imageUrl = (String) artworkData.get("imageUrl");
BigDecimal price = new BigDecimal(artworkData.get("price").toString());
if (title == null || title.trim().isEmpty()) {
result.put("success", false);
result.put("message", "作品标题不能为空");
return result;
}
if (categoryId == null || !artworkService.categoryExists(categoryId)) {
result.put("success", false);
result.put("message", "无效的作品分类");
return result;
}
if (artistId == null || !artworkService.artistExists(artistId)) {
result.put("success", false);
result.put("message", "无效的艺术家信息");
return result;
}
if (price.compareTo(BigDecimal.ZERO) <= 0) {
result.put("success", false);
result.put("message", "作品价格必须大于0");
return result;
}
Artwork artwork = new Artwork();
artwork.setTitle(title);
artwork.setDescription(description);
artwork.setCategoryId(categoryId);
artwork.setArtistId(artistId);
artwork.setImageUrl(imageUrl);
artwork.setPrice(price);
artwork.setCreateTime(LocalDateTime.now());
artwork.setStatus(1);
artwork.setViewCount(0);
artwork.setLikeCount(0);
int artworkId = artworkService.insertArtwork(artwork);
artworkService.updateArtistWorkCount(artistId);
artworkService.updateCategoryWorkCount(categoryId);
Map<String, Object> artworkInfo = new HashMap<>();
artworkInfo.put("id", artworkId);
artworkInfo.put("title", title);
artworkInfo.put("price", price);
artworkInfo.put("createTime", artwork.getCreateTime());
result.put("success", true);
result.put("message", "作品上传成功");
result.put("data", artworkInfo);
} catch (Exception e) {
result.put("success", false);
result.put("message", "作品上传失败:" + e.getMessage());
}
return result;
}
@PostMapping("/auction/bid")
@Transactional
public Map<String, Object> placeBid(@RequestBody Map<String, Object> bidData) {
Map<String, Object> result = new HashMap<>();
try {
Integer auctionId = (Integer) bidData.get("auctionId");
Integer userId = (Integer) bidData.get("userId");
BigDecimal bidAmount = new BigDecimal(bidData.get("bidAmount").toString());
Auction auction = auctionService.getAuctionById(auctionId);
if (auction == null) {
result.put("success", false);
result.put("message", "拍卖不存在");
return result;
}
if (auction.getStatus() != 1) {
result.put("success", false);
result.put("message", "拍卖已结束或未开始");
return result;
}
if (LocalDateTime.now().isAfter(auction.getEndTime())) {
result.put("success", false);
result.put("message", "拍卖时间已过");
return result;
}
if (bidAmount.compareTo(auction.getCurrentPrice()) <= 0) {
result.put("success", false);
result.put("message", "出价必须高于当前价格");
return result;
}
BigDecimal minIncrement = auction.getMinIncrement();
if (bidAmount.subtract(auction.getCurrentPrice()).compareTo(minIncrement) < 0) {
result.put("success", false);
result.put("message", "出价增幅不能小于最小加价幅度");
return result;
}
if (userId.equals(auction.getCurrentBidderId())) {
result.put("success", false);
result.put("message", "不能连续出价");
return result;
}
BidRecord bidRecord = new BidRecord();
bidRecord.setAuctionId(auctionId);
bidRecord.setUserId(userId);
bidRecord.setBidAmount(bidAmount);
bidRecord.setBidTime(LocalDateTime.now());
bidRecord.setStatus(1);
auctionService.insertBidRecord(bidRecord);
auction.setCurrentPrice(bidAmount);
auction.setCurrentBidderId(userId);
auction.setBidCount(auction.getBidCount() + 1);
auction.setUpdateTime(LocalDateTime.now());
if (auction.getEndTime().minusMinutes(5).isBefore(LocalDateTime.now())) {
auction.setEndTime(auction.getEndTime().plusMinutes(5));
}
auctionService.updateAuction(auction);
auctionService.notifyOtherBidders(auctionId, userId, bidAmount);
Map<String, Object> bidInfo = new HashMap<>();
bidInfo.put("auctionId", auctionId);
bidInfo.put("currentPrice", bidAmount);
bidInfo.put("bidCount", auction.getBidCount());
bidInfo.put("endTime", auction.getEndTime());
result.put("success", true);
result.put("message", "出价成功");
result.put("data", bidInfo);
} catch (Exception e) {
result.put("success", false);
result.put("message", "出价失败:" + e.getMessage());
}
return result;
}
@PostMapping("/forum/post")
@Transactional
public Map<String, Object> createForumPost(@RequestBody Map<String, Object> postData) {
Map<String, Object> result = new HashMap<>();
try {
Integer userId = (Integer) postData.get("userId");
Integer categoryId = (Integer) postData.get("categoryId");
String title = (String) postData.get("title");
String content = (String) postData.get("content");
List<String> images = (List<String>) postData.get("images");
if (title == null || title.trim().isEmpty()) {
result.put("success", false);
result.put("message", "帖子标题不能为空");
return result;
}
if (content == null || content.trim().length() < 10) {
result.put("success", false);
result.put("message", "帖子内容不能少于10个字符");
return result;
}
if (categoryId == null || !forumService.forumCategoryExists(categoryId)) {
result.put("success", false);
result.put("message", "无效的论坛分类");
return result;
}
if (forumService.getUserTodayPostCount(userId) >= 20) {
result.put("success", false);
result.put("message", "今日发帖数量已达上限");
return result;
}
String filteredContent = forumService.filterSensitiveWords(content);
String filteredTitle = forumService.filterSensitiveWords(title);
ForumPost post = new ForumPost();
post.setUserId(userId);
post.setCategoryId(categoryId);
post.setTitle(filteredTitle);
post.setContent(filteredContent);
post.setCreateTime(LocalDateTime.now());
post.setUpdateTime(LocalDateTime.now());
post.setViewCount(0);
post.setReplyCount(0);
post.setLikeCount(0);
post.setStatus(1);
post.setIsTop(0);
post.setIsEssence(0);
int postId = forumService.insertForumPost(post);
if (images != null && !images.isEmpty()) {
for (String imageUrl : images) {
if (imageUrl != null && !imageUrl.trim().isEmpty()) {
PostImage postImage = new PostImage();
postImage.setPostId(postId);
postImage.setImageUrl(imageUrl);
postImage.setCreateTime(LocalDateTime.now());
forumService.insertPostImage(postImage);
}
}
}
forumService.updateCategoryPostCount(categoryId, 1);
forumService.updateUserPostCount(userId, 1);
forumService.updateUserPoints(userId, 5);
Map<String, Object> postInfo = new HashMap<>();
postInfo.put("id", postId);
postInfo.put("title", filteredTitle);
postInfo.put("createTime", post.getCreateTime());
postInfo.put("viewCount", 0);
postInfo.put("replyCount", 0);
result.put("success", true);
result.put("message", "发帖成功");
result.put("data", postInfo);
} catch (Exception e) {
result.put("success", false);
result.put("message", "发帖失败:" + e.getMessage());
}
return result;
}
}
六、基于Vue.js和SpringBoot的线上美术馆网站平台-文档展示
七、END
💕💕文末获取源码联系计算机编程果茶熊