云收藏系统|基于Springboot实现云收藏系统(二)

简介: 云收藏系统|基于Springboot实现云收藏系统

云收藏系统|基于Springboot实现云收藏系统(一)https://developer.aliyun.com/article/1423337


四,核心代码展示

package com.favorites.web;
import com.favorites.cache.CacheService;
import com.favorites.comm.Const;
import com.favorites.comm.aop.LoggerManage;
import com.favorites.domain.Collect;
import com.favorites.domain.Favorites;
import com.favorites.domain.Praise;
import com.favorites.domain.enums.CollectType;
import com.favorites.domain.enums.IsDelete;
import com.favorites.domain.result.ExceptionMsg;
import com.favorites.domain.result.Response;
import com.favorites.domain.view.CollectSummary;
import com.favorites.repository.CollectRepository;
import com.favorites.repository.FavoritesRepository;
import com.favorites.repository.PraiseRepository;
import com.favorites.service.CollectService;
import com.favorites.service.FavoritesService;
import com.favorites.service.LookAroundService;
import com.favorites.service.LookRecordService;
import com.favorites.utils.DateUtils;
import com.favorites.utils.HtmlUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@RestController
@RequestMapping("/collect")
public class CollectController extends BaseController{
  @Autowired
  private CollectRepository collectRepository;
  @Resource
  private FavoritesService favoritesService;
  @Resource
  private CollectService collectService;
  @Resource
  private FavoritesRepository favoritesRepository;
  @Resource
  private PraiseRepository praiseRepository;
  @Autowired
  private CacheService cacheService;
  /**
   * 随便看看
   */
  @Autowired
  private LookAroundService lookAroundService;
  /**
   * 浏览记录
   */
  @Autowired
  private LookRecordService lookRecordService;
  /**
   * 文章收集
   * @param collect
   * @return
   */
  @RequestMapping(value = "/collect", method = RequestMethod.POST)
  @LoggerManage(description="文章收集")
  public Response collect(Collect collect) {    
    try {
      if(StringUtils.isBlank(collect.getLogoUrl()) || collect.getLogoUrl().length()>300){
        collect.setLogoUrl(Const.BASE_PATH + Const.default_logo);
      }
      collect.setUserId(getUserId());
      if(collectService.checkCollect(collect)){
        Collect exist=collectRepository.findByIdAndUserId(collect.getId(), collect.getUserId());
        if(collect.getId()==null){
          collectService.saveCollect(collect);
        }else if(exist==null){//收藏别人的文章
          collectService.otherCollect(collect);
        }else{
          collectService.updateCollect(collect);
        }
      }else{
        return result(ExceptionMsg.CollectExist);
      }
    } catch (Exception e) {
      // TODO: handle exception
      logger.error("collect failed, ", e);
      return result(ExceptionMsg.FAILED);
    }
    return result();
  }
  @RequestMapping(value="/getCollectLogoUrl",method=RequestMethod.POST)
  @LoggerManage(description="获取收藏页面的LogoUrl")
  public String getCollectLogoUrl(String url){
    if(StringUtils.isNotBlank(url)){
      String logoUrl = cacheService.getMap(url);
      if(StringUtils.isNotBlank(logoUrl)){
        return logoUrl;
      }else{
        return Const.default_logo;
      }
    }else{
      return Const.default_logo;
    }
  }
  /**
   * 根据收藏的文章标题和描述推荐收藏夹
   */
  @RequestMapping(value="/getFavoriteResult",method=RequestMethod.POST)
  @LoggerManage(description="获取推荐收藏夹")
  public Map<String,Object> getFavoriteResult(String title,String description){
    Long result = null;
    int faultPosition = 0;
    Map<String,Object> maps = new HashMap<String,Object>();
    List<Favorites> favoritesList = this.favoritesRepository.findByUserIdOrderByLastModifyTimeDesc(getUserId());
    for (int i = 0; i < favoritesList.size(); i++){
      Favorites favorites = favoritesList.get(i);
      if(favorites.getName().indexOf(title) > 0 || favorites.getName().indexOf(description) > 0){
        result = favorites.getId();
      }
      if("未读列表".equals(favorites.getName())){
        faultPosition = i;
      }
    }
    result = result == null ? favoritesList.get(faultPosition).getId() : result;
    maps.put("favoritesResult",result == null ? 0 : result);
    maps.put("favoritesList",favoritesList);
    return maps;
  }
  /**
   * @param page
   * @param size
   * @param type
   * @return
   */
  @RequestMapping(value="/standard/{type}/{favoritesId}/{userId}/{category}")
  @LoggerManage(description="文章列表standard")
  public List<CollectSummary> standard(@RequestParam(value = "page", defaultValue = "0") Integer page,
          @RequestParam(value = "size", defaultValue = "15") Integer size,@PathVariable("type") String type,
          @PathVariable("favoritesId") Long favoritesId,@PathVariable("userId") Long userId,
      @PathVariable("category") String category) {
      Sort sort = new Sort(Direction.DESC, "id");
      Pageable pageable = PageRequest.of(page, size,sort);
      List<CollectSummary> collects = null;
      if("otherpublic".equalsIgnoreCase(type)){
        if(null != favoritesId && 0 != favoritesId){
          collects = collectService.getCollects(type, userId, pageable, favoritesId,getUserId());
        }else{
          collects = collectService.getCollects("others", userId, pageable, null,getUserId());
        }
      }else if(category != null && !"".equals(category) && !"NO".equals(category)){//用于随便看看功能中收藏列表显示
      collects = lookAroundService.queryCollectExplore(pageable,getUserId(),category);
    }else if(type != null && !"".equals(type) && "lookRecord".equals(type)){//用于浏览记录功能中收藏列表显示
      collects =lookRecordService.getLookRecords(this.getUserId(),pageable);
    }else{
        if(null != favoritesId && 0 != favoritesId){
          collects = collectService.getCollects(String.valueOf(favoritesId),getUserId(), pageable,null,null);
        }else{
          collects=collectService.getCollects(type,getUserId(), pageable,null,null);
        }
      }
    return collects;
  }
  @RequestMapping(value="/lookAround")
  @LoggerManage(description="查看更多lookAround")
  public List<CollectSummary> lookAround(@RequestParam(value = "page", defaultValue = "0") Integer page,
                     @RequestParam(value = "size", defaultValue = "15") Integer size) {
    Sort sort = new Sort(Direction.DESC, "id");
    Pageable pageable = PageRequest.of(page, size, sort);
    List<CollectSummary> collects =lookAroundService.queryCollectExplore(pageable, getUserId(),null);
    return collects;
  }
  /**
   * @param page
   * @param size
   * @param type
   * @return
   */
  @RequestMapping(value="/simple/{type}/{favoritesId}/{userId}/{category}")
  @LoggerManage(description="文章列表simple")
  public List<CollectSummary> simple(@RequestParam(value = "page", defaultValue = "0") Integer page,
          @RequestParam(value = "size", defaultValue = "15") Integer size,@PathVariable("type") String type,
          @PathVariable("favoritesId") Long favoritesId,@PathVariable("userId") Long userId
      ,@PathVariable("category") String category) {
    Sort sort = new Sort(Direction.DESC, "id");
      Pageable pageable = PageRequest.of(page, size,sort);
      List<CollectSummary> collects = null;
      if("otherpublic".equalsIgnoreCase(type)){
        if(null != favoritesId && 0 != favoritesId){
          collects = collectService.getCollects(type, userId, pageable, favoritesId,getUserId());
        }else{
          collects = collectService.getCollects("others", userId, pageable, null,getUserId());
        }
      }else if(category != null && !"".equals(category) && !"NO".equals(category)){//用于随便看看功能中收藏列表显示
      collects = lookAroundService.queryCollectExplore(pageable,getUserId(),category);
    }else{
        if(null != favoritesId && 0 != favoritesId){
          collects = collectService.getCollects(String.valueOf(favoritesId),getUserId(), pageable,null,null);
        }else{
          collects = collectService.getCollects(type,getUserId(), pageable,null,null);
        }
      }
    return collects;
  }
  /**
   * @param id
   * @param type
   */
  @RequestMapping(value="/changePrivacy/{id}/{type}")
  public Response changePrivacy(@PathVariable("id") long id,@PathVariable("type") CollectType type) {
    collectRepository.modifyByIdAndUserId(type, id, getUserId());
    return result();
  }
  /**
   * like and unlike
   * @param id
   * @return
   */
  @RequestMapping(value="/like/{id}")
  @LoggerManage(description="文章点赞或者取消点赞")
  public Response like(@PathVariable("id") long id) {
    try {
      collectService.like(getUserId(), id);
    } catch (Exception e) {
      // TODO: handle exception
      logger.error("文章点赞或者取消点赞异常:",e);
    }
    return result();
  }
  /**
   * @param id
   * @return
   */
  @RequestMapping(value="/delete/{id}")
  public Response delete(@PathVariable("id") long id) {
    Collect collect = collectRepository.findById(id);
    if(null != collect && getUserId()==collect.getUserId()){
      collectRepository.deleteById(id);
      if(null != collect.getFavoritesId() && !IsDelete.YES.equals(collect.getIsDelete())){
        favoritesRepository.reduceCountById(collect.getFavoritesId(), DateUtils.getCurrentTime());
      }
    }
    return result();
  }
  /**
   * @param id
   * @return
   */
  @RequestMapping(value="/detail/{id}")
  public Collect detail(@PathVariable("id") long id) {
    Collect collect=collectRepository.findById(id);
    return collect;
  }
  /**
   * 导入收藏夹
   *
   */
  @RequestMapping("/import")
  @LoggerManage(description="导入收藏夹操作")
  public void importCollect(@RequestParam("htmlFile") MultipartFile htmlFile,String structure,String type){
    try {
      if(StringUtils.isNotBlank(structure)&& IsDelete.YES.toString().equals(structure)){
        // 按照目录结构导入
        Map<String, Map<String, String>> map = HtmlUtil.parseHtmlTwo(htmlFile.getInputStream());
        if(null == map || map.isEmpty()){
          logger.info("未获取到url连接");
          return ;
        }
        for (Entry<String, Map<String, String>> entry : map.entrySet()) {  
            String favoritesName = entry.getKey();
            Favorites favorites = favoritesRepository.findByUserIdAndName(getUserId(), favoritesName);
            if(null == favorites){
              favorites = favoritesService.saveFavorites(getUserId(), favoritesName);
            }
            collectService.importHtml(entry.getValue(), favorites.getId(), getUserId(),type);
        } 
      }else{
        Map<String, String> map = HtmlUtil.parseHtmlOne(htmlFile.getInputStream());
        if(null == map || map.isEmpty()){
          logger.info("未获取到url连接");
          return ;
        }
        // 全部导入到<导入自浏览器>收藏夹
        Favorites favorites = favoritesRepository.findByUserIdAndName(getUserId(), "导入自浏览器");
        if(null == favorites){
          favorites = favoritesService.saveFavorites(getUserId(),"导入自浏览器");
        }
        collectService.importHtml(map, favorites.getId(), getUserId(),type);
      }
    } catch (Exception e) {
      logger.error("导入html异常:",e);
    }
  }
  /**
   * 导出收藏夹
   * @param favoritesId
   * @return
   */
  @RequestMapping("/export")
  @LoggerManage(description="导出收藏夹操作")
  public void export(String favoritesId,HttpServletResponse response){
    if(StringUtils.isNotBlank(favoritesId)){
      try {
        String[] ids = favoritesId.split(",");
        String date = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date());
        String fileName= "favorites_" + date + ".html";
        StringBuilder sb = new StringBuilder();
        for(String id : ids){
          try {
            sb = sb.append(collectService.exportToHtml(Long.parseLong(id)));
          } catch (Exception e) {
            logger.error("异常:",e);
          }
        }
        sb = HtmlUtil.exportHtml("云收藏夹", sb);
        response.setCharacterEncoding("UTF-8");  
        response.setHeader("Content-disposition","attachment; filename=" + fileName);
        response.getWriter().print(sb);
      } catch (Exception e) {
        logger.error("异常:",e);
      }
    }
  }
  @RequestMapping(value="/searchMy/{key}")
  public List<CollectSummary> searchMy(Model model,@RequestParam(value = "page", defaultValue = "0") Integer page,
          @RequestParam(value = "size", defaultValue = "20") Integer size, @PathVariable("key") String key) {
    Sort sort = new Sort(Direction.DESC, "id");
      Pageable pageable = PageRequest.of(page, size,sort);
      List<CollectSummary> myCollects=collectService.searchMy(getUserId(),key ,pageable);
    model.addAttribute("myCollects", myCollects);
    logger.info("searchMy end :");
    return myCollects;
  }
  @RequestMapping(value="/searchOther/{key}")
  public List<CollectSummary> searchOther(Model model,@RequestParam(value = "page", defaultValue = "0") Integer page,
          @RequestParam(value = "size", defaultValue = "20") Integer size, @PathVariable("key") String key) {
    Sort sort = new Sort(Direction.DESC, "id");
      Pageable pageable = PageRequest.of(page, size,sort);
      List<CollectSummary> otherCollects=collectService.searchOther(getUserId(), key, pageable);
    logger.info("searchOther end :");
    return otherCollects;
  }
  /**
   * 查询点赞状态及该文章的点赞数量
   */
  @RequestMapping(value="/getPaiseStatus/{collectId}")
  public Map<String,Object> getPraiseStatus(Model model,@PathVariable("collectId") Long collectId){
    Map<String,Object> maps = new HashMap<String,Object>();
    Praise praise = praiseRepository.findByUserIdAndCollectId(getUserId(), collectId);
    Long praiseCount = praiseRepository.countByCollectId(collectId);
    maps.put("status",praise != null ? "praise" : "unpraise");
    maps.put("praiseCount",praiseCount);
    return maps;
  }
}
package com.favorites.web;
import java.util.List;
import javax.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.favorites.domain.Collect;
import com.favorites.domain.Comment;
import com.favorites.domain.User;
import com.favorites.domain.result.Response;
import com.favorites.repository.CollectRepository;
import com.favorites.repository.CommentRepository;
import com.favorites.repository.UserRepository;
import com.favorites.service.NoticeService;
import com.favorites.utils.DateUtils;
import com.favorites.utils.StringUtil;
@RestController
@RequestMapping("/comment")
public class CommentController extends BaseController{
  @Autowired
  private  CommentRepository CommentRepository;
  @Autowired
  private UserRepository userRepository;
  @Resource
  private NoticeService noticeService;
  @Autowired
  private CollectRepository colloectRepository;
  /**
   * @param comment评论
   * @return
   */
  @RequestMapping(value="/add")
  public Response add(Comment comment) {
    User user = null;
    if (comment.getContent().indexOf("@") > -1) {
      List<String> atUsers = StringUtil.getAtUser(comment.getContent());
      if(atUsers!=null && atUsers.size()>0){
        user = userRepository.findByUserName(atUsers.get(0));
        if (null != user) {
          comment.setReplyUserId(user.getId());
        } else {
          logger.info("为找到匹配:" + atUsers.get(0) + "的用户.");
        }
        String content=comment.getContent().substring(0,comment.getContent().indexOf("@"));
        if(StringUtils.isBlank(content)){
          content=comment.getContent().substring(comment.getContent().indexOf("@")+user.getUserName().length()+1,comment.getContent().length());
        }
        comment.setContent(content);
      }
    }
    comment.setUserId(getUserId());
    comment.setCreateTime(DateUtils.getCurrentTime());
    CommentRepository.save(comment);
    if(null != user){
      // 保存消息通知(回复)
      noticeService.saveNotice(String.valueOf(comment.getCollectId()), "comment", user.getId(), String.valueOf(comment.getId()));
    }else{
      // 保存消息通知(直接评论)
      Collect collect = colloectRepository.findById((long)comment.getCollectId());
      if(null != collect){
        noticeService.saveNotice(String.valueOf(comment.getCollectId()), "comment", collect.getUserId(), String.valueOf(comment.getId()));
      }
    }
    return result();
  }
  /**
   * @param collectId
   * @return
   */
  @RequestMapping(value="/list/{collectId}")
  public List<Comment> list(@PathVariable("collectId") long collectId) {
    List<Comment> comments= CommentRepository.findByCollectIdOrderByIdDesc(collectId);
    return convertComment(comments);
  }
  /**
   * @param id
   * @return
   */
  @RequestMapping(value="/delete/{id}")
  public Response delete(@PathVariable("id") long id) {
    CommentRepository.deleteById(id);
    return result();
  }
  /**
   * 转化时间和用户名
   * @param comments
   * @return
   */
  private List<Comment> convertComment(List<Comment> comments) {
    for (Comment comment : comments) {
      User user = userRepository.findById((long)comment.getUserId());
      comment.setCommentTime(DateUtils.getTimeFormatText(comment.getCreateTime()));
      comment.setUserName(user.getUserName());
      comment.setProfilePicture(user.getProfilePicture());
      if(comment.getReplyUserId()!=null && comment.getReplyUserId()!=0){
         User replyUser = userRepository.findById((long)comment.getReplyUserId());
         comment.setReplyUserName(replyUser.getUserName());
      }
    }
    return comments;
  }
}

五,项目总结

整个系统的开发和实现还是比较有创意的,它很好的解决本地浏览器信息收藏的不方便性,可以通过本次开发的云收藏系统和浏览收藏信息进行共享,并在平台中进行有效的管理和共享,功能还是比较实用且齐全的,是一个优秀的毕业设计项目。系统使用Springboot框架开发,整个界面设计十很简洁大方。

相关文章
|
3月前
|
JavaScript 前端开发 Java
垃圾分类管理系统基于 Spring Boot Vue 3 微服务架构实操指南
本文介绍了基于Java技术的垃圾分类管理系统开发方案与实施案例。系统采用前后端分离架构,后端使用Spring Boot框架搭配MySQL数据库,前端可选择Vue.js或Java Swing实现。核心功能模块包括垃圾分类查询、科普教育、回收预约等。文中提供了两个典型应用案例:彭湖花园小区使用的Swing桌面系统和基于Spring Boot+Vue的城市管理系统,分别满足不同场景需求。最新技术方案升级为微服务架构,整合Spring Cloud、Redis、Elasticsearch等技术,并采用Docker容器
189 0
|
4月前
|
JavaScript 前端开发 Java
制造业ERP源码,工厂ERP管理系统,前端框架:Vue,后端框架:SpringBoot
这是一套基于SpringBoot+Vue技术栈开发的ERP企业管理系统,采用Java语言与vscode工具。系统涵盖采购/销售、出入库、生产、品质管理等功能,整合客户与供应商数据,支持在线协同和业务全流程管控。同时提供主数据管理、权限控制、工作流审批、报表自定义及打印、在线报表开发和自定义表单功能,助力企业实现高效自动化管理,并通过UniAPP实现移动端支持,满足多场景应用需求。
408 1
|
5月前
|
前端开发 Java 关系型数据库
基于Java+Springboot+Vue开发的鲜花商城管理系统源码+运行
基于Java+Springboot+Vue开发的鲜花商城管理系统(前后端分离),这是一项为大学生课程设计作业而开发的项目。该系统旨在帮助大学生学习并掌握Java编程技能,同时锻炼他们的项目设计与开发能力。通过学习基于Java的鲜花商城管理系统项目,大学生可以在实践中学习和提升自己的能力,为以后的职业发展打下坚实基础。技术学习共同进步
404 7
|
5月前
|
存储 Java 数据库
Spring Boot 注册登录系统:问题总结与优化实践
在Spring Boot开发中,注册登录模块常面临数据库设计、密码加密、权限配置及用户体验等问题。本文以便利店销售系统为例,详细解析四大类问题:数据库字段约束(如默认值缺失)、密码加密(明文存储风险)、Spring Security配置(路径权限不当)以及表单交互(数据丢失与提示不足)。通过优化数据库结构、引入BCrypt加密、完善安全配置和改进用户交互,提供了一套全面的解决方案,助力开发者构建更 robust 的系统。
161 0
|
2月前
|
前端开发 Java API
酒店管理系统基于 JavaFX Spring Boot 和 React 经典项目重构实操
本文介绍了基于现代技术栈的酒店管理系统开发方案,整合了JavaFX、Spring Boot和React三大技术框架。系统采用前后端分离架构,JavaFX构建桌面客户端,React开发Web管理界面,Spring Boot提供RESTful API后端服务。核心功能模块包括客房管理和客户预订流程,文中提供了JavaFX实现的客房管理界面代码示例和React开发的预订组件代码,展示了如何实现客房信息展示、添加修改操作以及在线预订功能。
157 1
|
消息中间件 存储 Java
📨 Spring Boot 3 整合 MQ 构建聊天消息存储系统
本文详细介绍了如何使用Spring Boot 3结合RabbitMQ构建高效可靠的聊天消息存储系统。通过引入消息队列,实现了聊天功能与消息存储的解耦,解决了高并发场景下直接写入数据库带来的性能瓶颈问题。文章首先分析了不同MQ产品的特点及适用场景,最终选择RabbitMQ作为解决方案,因其成熟稳定、灵活路由和易于集成等优势。接着,通过Docker快速部署RabbitMQ,并完成Spring Boot项目的配置与代码实现,包括生产者发送消息、消费者接收并处理消息等功能。最后,通过异步存储机制,既保证了消息的即时性,又实现了可靠持久化。
356 0
📨 Spring Boot 3 整合 MQ 构建聊天消息存储系统
|
4月前
|
供应链 JavaScript BI
ERP系统源码,基于SpringBoot+Vue+ElementUI+UniAPP开发
这是一款专为小微企业打造的 SaaS ERP 管理系统,基于 SpringBoot+Vue+ElementUI+UniAPP 技术栈开发,帮助企业轻松上云。系统覆盖进销存、采购、销售、生产、财务、品质、OA 办公及 CRM 等核心功能,业务流程清晰且操作简便。支持二次开发与商用,提供自定义界面、审批流配置及灵活报表设计,助力企业高效管理与数字化转型。
424 2
ERP系统源码,基于SpringBoot+Vue+ElementUI+UniAPP开发
|
3月前
|
Java 调度 流计算
基于Java 17 + Spring Boot 3.2 + Flink 1.18的智慧实验室管理系统核心代码
这是一套基于Java 17、Spring Boot 3.2和Flink 1.18开发的智慧实验室管理系统核心代码。系统涵盖多协议设备接入(支持OPC UA、MQTT等12种工业协议)、实时异常检测(Flink流处理引擎实现设备状态监控)、强化学习调度(Q-Learning算法优化资源分配)、三维可视化(JavaFX与WebGL渲染实验室空间)、微服务架构(Spring Cloud构建分布式体系)及数据湖建设(Spark构建实验室数据仓库)。实际应用中,该系统显著提升了设备调度效率(响应时间从46分钟降至9秒)、设备利用率(从41%提升至89%),并大幅减少实验准备时间和维护成本。
240 0
|
3月前
|
机器学习/深度学习 数据采集 人机交互
springboot+redis互联网医院智能导诊系统源码,基于医疗大模型、知识图谱、人机交互方式实现
智能导诊系统基于医疗大模型、知识图谱与人机交互技术,解决患者“知症不知病”“挂错号”等问题。通过多模态交互(语音、文字、图片等)收集病情信息,结合医学知识图谱和深度推理,实现精准的科室推荐和分级诊疗引导。系统支持基于规则模板和数据模型两种开发原理:前者依赖人工设定症状-科室规则,后者通过机器学习或深度学习分析问诊数据。其特点包括快速病情收集、智能病症关联推理、最佳就医推荐、分级导流以及与院内平台联动,提升患者就诊效率和服务体验。技术架构采用 SpringBoot+Redis+MyBatis Plus+MySQL+RocketMQ,确保高效稳定运行。
229 0
|
6月前
|
人工智能 自然语言处理 前端开发
20分钟上手DeepSeek开发:SpringBoot + Vue2快速构建AI对话系统
本文介绍如何使用Spring Boot3与Vue2快速构建基于DeepSeek的AI对话系统。系统具备实时流式交互、Markdown内容渲染、前端安全防护等功能,采用响应式架构提升性能。后端以Spring Boot为核心,结合WebFlux和Lombok开发;前端使用Vue2配合WebSocket实现双向通信,并通过DOMPurify保障安全性。项目支持中文语义优化,API延迟低,成本可控,适合个人及企业应用。跟随教程,轻松开启AI应用开发之旅!

热门文章

最新文章