我想做一个小网站搞页游该怎么做企业网站开发实训过程与内容
2026/2/19 19:06:59 网站建设 项目流程
我想做一个小网站搞页游该怎么做,企业网站开发实训过程与内容,用电脑做网站的历史在哪里找,高端设计网站平台毕设所有选题#xff1a; https://blog.csdn.net/2303_76227485/article/details/131104075 基于SpringbootVue3Ai对话的图书馆图书借阅系统(源代码数据库开题PPT) 项目编号#xff1a;262 一、系统介绍 本项目前后端分离#xff0c;分为用户、管理员2种角色。 1、用户…毕设所有选题https://blog.csdn.net/2303_76227485/article/details/131104075基于SpringbootVue3Ai对话的图书馆图书借阅系统(源代码数据库开题PPT)项目编号262一、系统介绍本项目前后端分离分为用户、管理员2种角色。1、用户图书协同过滤推荐、热门图书、热门分类、图书搜索、图书借阅、续借、还书、图书预约、评论、查看通知、AI助手、个人信息2、管理员图书管理图书信息录入图书信息查询图书信息修改图书信息删除图书分类管理用户管理启用禁用借阅管理借阅记录查询图书归还借阅审核逾期管理预约管理预约记录查询预约取消预约通知评论管理评论查看评论删除统计分析借阅统计热门图书排行用户借阅排行图书库存统计逾期统计3、亮点实现ai对话优化用户体验使用协同过滤算法为用户推荐图书后台首页大屏使用echarts图表统计更直观的看出系统的运行数据使用定时任务查询逾期的借阅并通知用户二、所用技术后端技术栈Springboot3mybatisPlusJwtMysqlMaven前端技术栈Vue3Vue-routeraxioselementPlusecharts三、环境介绍基础环境 :IDEA/eclipse, JDK1.8, Mysql5.7及以上, Maven3.6, node16, navicat, 通义千问apikey所有项目以及源代码本人均调试运行无问题 可支持远程调试运行四、页面截图1、用户2、管理员五、浏览地址前台地址http://localhost:3000用户账号密码zhangsan/123456管理员账户密码admin/123456六、部署教程使用Navicat或者其它工具在mysql中创建对应名称的数据库并执行项目的sql文件使用IDEA/Eclipse导入backend项目若为maven项目请选择maven等待依赖下载完成修改application.yml里面的数据库配置和通义千问的apikey配置src/main/java/com/library/LibraryManagementApplication.java启动后端项目vscode或idea打开frontend项目在编译器中打开terminal执行npm install 依赖下载完成后执行 npm run serve,执行成功后会显示访问地址七、协同过滤推荐部分代码OverridepublicIPageBookVOrecommendBooksByCF(LonguserId,Integerpage,Integersize){// 1获取目标用户的借阅记录已借阅的图书IDSetLonguserBorrowedBookIdsgetBorrowedBookIds(userId);if(CollectionUtils.isEmpty(userBorrowedBookIds)){// 无借阅历史返回热门图书兜底策略returngetHotBooks(page,size);}// 2构建用户-图书借阅矩阵用户ID - 图书ID - 借阅次数MapLong,MapLong,IntegeruserBookMatrixbuildUserBookMatrix();// 3计算目标用户与其他用户的相似度MapLong,DoubleuserSimilarityMapcalculateUserSimilarity(userId,userBookMatrix);// 4筛选相似度最高的N个用户ListLongsimilarUserIdsuserSimilarityMap.entrySet().stream().sorted((e1,e2)-Double.compare(e2.getValue(),e1.getValue())).limit(SIMILAR_USER_COUNT).map(Map.Entry::getKey).collect(Collectors.toList());// 5收集相似用户借阅过、目标用户未借阅的图书计算推荐分数MapLong,DoublebookRecommendScorecalculateBookRecommendScore(similarUserIds,userSimilarityMap,userBookMatrix,userBorrowedBookIds);// 6按推荐分数排序过滤无效图书分页返回returngetRecommendBookPage(bookRecommendScore,page,size);}/** * 获取用户已借阅的图书ID */privateSetLonggetBorrowedBookIds(LonguserId){returnborrowRecordMapper.selectList(newcom.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapperBorrowRecord().eq(BorrowRecord::getUserId,userId).in(BorrowRecord::getStatus,Constants.BORROW_STATUS_BORROWED,Constants.BORROW_STATUS_RETURNED)).stream().map(BorrowRecord::getBookId).collect(Collectors.toSet());}/** * 构建用户-图书借阅矩阵 */privateMapLong,MapLong,IntegerbuildUserBookMatrix(){// 查询所有有效借阅记录排除待审核/拒绝的ListBorrowRecordallBorrowRecordsborrowRecordMapper.selectList(newcom.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapperBorrowRecord().in(BorrowRecord::getStatus,Constants.BORROW_STATUS_BORROWED,Constants.BORROW_STATUS_RETURNED));// 统计每个用户对每本书的借阅次数MapLong,MapLong,IntegeruserBookMatrixnewHashMap();for(BorrowRecordrecord:allBorrowRecords){LonguserIdrecord.getUserId();LongbookIdrecord.getBookId();userBookMatrix.putIfAbsent(userId,newHashMap());MapLong,IntegerbookCountMapuserBookMatrix.get(userId);bookCountMap.put(bookId,bookCountMap.getOrDefault(bookId,0)1);}// 过滤借阅次数过少的记录减少噪声userBookMatrix.values().forEach(bookCountMap-bookCountMap.entrySet().removeIf(entry-entry.getValue()MIN_BORROW_COUNT));// 过滤无有效借阅的用户userBookMatrix.entrySet().removeIf(entry-entry.getValue().isEmpty());returnuserBookMatrix;}/** * 计算目标用户与其他用户的余弦相似度 */privateMapLong,DoublecalculateUserSimilarity(LongtargetUserId,MapLong,MapLong,IntegeruserBookMatrix){MapLong,IntegertargetUserRatingsuserBookMatrix.get(targetUserId);if(CollectionUtils.isEmpty(targetUserRatings)){returnnewHashMap();}MapLong,DoublesimilarityMapnewHashMap();for(Map.EntryLong,MapLong,Integerentry:userBookMatrix.entrySet()){LongotherUserIdentry.getKey();if(otherUserId.equals(targetUserId)){continue;// 跳过自己}MapLong,IntegerotherUserRatingsentry.getValue();// 计算余弦相似度doublesimilaritycalculateCosineSimilarity(targetUserRatings,otherUserRatings);if(similarity0){// 只保留正相似的用户similarityMap.put(otherUserId,similarity);}}returnsimilarityMap;}/** * 计算两个用户的余弦相似度 * 公式相似度 (A·B) / (|A| * |B|)其中A·B是点积|A|是A的模长 */privatedoublecalculateCosineSimilarity(MapLong,IntegeruserARatings,MapLong,IntegeruserBRatings){// 找出共同借阅的图书SetLongcommonBookIdsnewHashSet(userARatings.keySet());commonBookIds.retainAll(userBRatings.keySet());if(commonBookIds.isEmpty()){return0.0;// 无共同图书相似度为0}// 计算点积doubledotProduct0.0;for(LongbookId:commonBookIds){dotProductuserARatings.get(bookId)*userBRatings.get(bookId);}// 计算模长doublenormAMath.sqrt(userARatings.values().stream().mapToDouble(r-r*r).sum());doublenormBMath.sqrt(userBRatings.values().stream().mapToDouble(r-r*r).sum());if(normA0||normB0){return0.0;}returndotProduct/(normA*normB);}/** * 计算图书推荐分数相似用户相似度 * 借阅次数 */privateMapLong,DoublecalculateBookRecommendScore(ListLongsimilarUserIds,MapLong,DoubleuserSimilarityMap,MapLong,MapLong,IntegeruserBookMatrix,SetLonguserBorrowedBookIds){MapLong,DoublebookScoreMapnewHashMap();for(LongsimilarUserId:similarUserIds){doublesimilarityuserSimilarityMap.get(similarUserId);MapLong,IntegersimilarUserBooksuserBookMatrix.get(similarUserId);for(Map.EntryLong,Integerentry:similarUserBooks.entrySet()){LongbookIdentry.getKey();intborrowCountentry.getValue();// 跳过目标用户已借阅的图书if(userBorrowedBookIds.contains(bookId)){continue;}// 推荐分数 相似度 * 借阅次数加权doublescoresimilarity*borrowCount;bookScoreMap.put(bookId,bookScoreMap.getOrDefault(bookId,0.0)score);}}returnbookScoreMap;}/** * 过滤无效图书分页返回推荐列表 */privateIPageBookVOgetRecommendBookPage(MapLong,DoublebookScoreMap,Integerpage,Integersize){if(CollectionUtils.isEmpty(bookScoreMap)){// 无推荐结果返回热门图书returngetHotBooks(page,size);}// 按推荐分数降序排序ListLongrecommendBookIdsbookScoreMap.entrySet().stream().sorted((e1,e2)-Double.compare(e2.getValue(),e1.getValue())).map(Map.Entry::getKey).collect(Collectors.toList());// 过滤下架/库存不足的图书ListLongvalidBookIdsrecommendBookIds.stream().filter(bookId-{BookbookbookMapper.selectById(bookId);returnbook!nullbook.getStatus()Constants.BOOK_STATUS_ONLINEbook.getAvailableQuantity()0;}).collect(Collectors.toList());// 分页处理PageBookVOresultPagenewPage(page,size);intstart(page-1)*size;intendMath.min(startsize,validBookIds.size());if(startvalidBookIds.size()){resultPage.setRecords(newArrayList());resultPage.setTotal(0);returnresultPage;}// 查询分页后的图书VOListLongpageBookIdsvalidBookIds.subList(start,end);ListBookVObookVOspageBookIds.stream().map(this::getBookById).collect(Collectors.toList());resultPage.setRecords(bookVOs);resultPage.setTotal(validBookIds.size());returnresultPage;}/** * 兜底策略返回热门图书按借阅次数排序 */privateIPageBookVOgetHotBooks(Integerpage,Integersize){PageBookbookPagenewPage(page,size);// 查询上架且有库存的热门图书按借阅次数降序ListBookhotBooksbookMapper.selectList(newcom.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapperBook().eq(Book::getStatus,Constants.BOOK_STATUS_ONLINE).gt(Book::getAvailableQuantity,0).orderByDesc(Book::getBorrowCount));// 分页处理PageBookVOresultPagenewPage(page,size);intstart(page-1)*size;intendMath.min(startsize,hotBooks.size());if(starthotBooks.size()){resultPage.setRecords(newArrayList());resultPage.setTotal(0);returnresultPage;}ListBookVObookVOshotBooks.subList(start,end).stream().map(book-this.getBookById(book.getId())).collect(Collectors.toList());resultPage.setRecords(bookVOs);resultPage.setTotal(hotBooks.size());returnresultPage;}

需要专业的网站建设服务?

联系我们获取免费的网站建设咨询和方案报价,让我们帮助您实现业务目标

立即咨询