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

ruoyi-vue 官网介绍和要点CSMD说明

创建数据库及数据表

添加CSMD 相关文件代码:Controller

package com.ruoyi.web.controller.system; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.system.domain.User; import com.ruoyi.system.service.impl.UserService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.util.List; @RestController @RequestMapping("/system") public class HelloController extends BaseController { @Autowired private UserService userService; @GetMapping("/hello") public List<User> hello() { return userService.findAll(); } }

添加CSMD 相关文件代码:Service

package com.ruoyi.system.service.impl; import com.ruoyi.system.domain.User; import com.ruoyi.system.mapper.UserMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; @Service public class UserService { @Autowired private UserMapper userMapper; public List<User> findAll() { return userMapper.findAll(); } }

添加CSMD 相关文件代码:Mapper

package com.ruoyi.system.mapper; import com.ruoyi.system.domain.User; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Select; import java.util.List; @Mapper public interface UserMapper { @Select("SELECT * FROM user") List<User> findAll(); }

添加CSMD 相关文件代码:Domain

package com.ruoyi.system.domain; public class User { private Integer id; private String name; private Integer age; private Integer sex; private String createTime; public User() { } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Integer getAge() { return age; } public void setAge(Integer age) { this.age = age; } public Integer getSex() { return sex; } public void setSex(Integer sex) { this.sex = sex; } public String getCreateTime() { return createTime; } public void setCreateTime(String createTime) { this.createTime = createTime; } }

屏蔽新加接口安全防护策略

.antMatchers("/login", "/register", "/captchaImage", "/system/hello").anonymous() .antMatchers("/system/user/*").anonymous() .antMatchers("/hello").anonymous()

Postman 测试新接口

http://www.jsqmd.com/news/651917/

相关文章:

  • 构建企业级智能问答系统的完整解决方案:MaxKB实战指南
  • 别再死记硬背AXI了!手把手教你用Vivado2020.2自定义IP核,让PL轻松读写PS的DDR内存
  • golang如何使用DTM分布式事务框架_golang DTM分布式事务框架使用方法
  • 项目上传github仓库(flutter)
  • 深度解析UUV Simulator:从水下动力学到多传感器融合的完整机器人仿真架构
  • 如何3分钟从视频中智能提取PPT:终极自动化工具指南
  • 40x40 矩阵控制系统
  • 告别龟速重构:用PyTorch实战LISTA,让你的压缩感知快人一步
  • ESP32与TB6612FNG实战:串口指令解析与直流电机闭环调速系统
  • SQL如何实现动态排名统计 掌握DENSE_RANK排序逻辑
  • 内容创作者利器:用HY-MT1.5-7B批量翻译多语言文章
  • 钉钉小程序开发避坑指南:从IDE配置到安全域名设置的完整流程
  • 告别单调图表!用C# DevExpress ChartControl打造酷炫数据看板(附甘特图、环形图实战代码)
  • 从“科研苦力”到“高效学者”:好写作AI的期刊论文功能,一次学术写作的“降维打击”
  • AI-Shoujo HF Patch高级配置指南:3步深度优化游戏体验
  • 【Android】今天学点啥1.3.6-啥都能学
  • 猫抓浏览器插件:三步搞定网页视频音频下载的终极指南
  • 2026年蒸汽式香薰机值得买吗?有哪些推荐?
  • Github热榜项目推荐 | 主动拥抱、持续学习
  • 避坑指南:STM32F103 CAN过滤器配置的那些‘坑’(从原理到代码调试)
  • Obsidian Excel插件终极指南:如何在笔记中无缝管理表格数据?
  • Flowable7.x实战指南:构建流程历史轨迹可视化系统
  • OpenProject:开源项目管理利器,让团队协作效率翻倍的完整解决方案
  • 用FPGA给循迹小车写BGM?手把手教你用Xilinx Ego1驱动无源蜂鸣器播放音乐
  • 从扫地机器人到自动驾驶:图解激光SLAM中的图优化技术演进
  • 如何处理SQL存储过程大数据导入_利用数据泵或外部表
  • 从零部署到资源调度:H3C XG310 GPU服务器在K8s云原生环境中的实战集成
  • 腾讯AI产品策划(Agent方向)面试题精选:10道高频考题+答案解析(附PDF)
  • 别再瞎调参数了!OpenCV高斯滤波的sigma和ksize到底怎么设?一个公式搞定
  • 数据孤岛吞噬制造企业利润,iPaaS平台选型指南全面发布