backend expert
1
总安装量
0
周安装量
#49474
全站排名
安装命令
npx skills add https://github.com/chrysaliscat/designgraduation --skill Backend Expert
Skill 文档
Backend Expert Skill (Spring Boot + MyBatis)
This skill provides specialized knowledge for developing and debugging backend services in the RuoYi-Vue ecosystem.
ðï¸ Core Principles
- Layered Architecture: Controller -> Service -> Mapper -> XML -> DB.
- RuoYi Conventions:
- Use
@PreAuthorizefor permission control. - Use
SecurityUtils.getUserId()to get current user securely. - Use
AjaxResultfor all Controller returns. - Use
TableDataInfofor pagination returns.
- Use
- MyBatis Strictness: XML SQL columns usually use
snake_case, Java entities usecamelCase. ResultMaps are mandatory for complex queries.
ð ï¸ Common Workflows
1. Debugging Data Loss (The “Silent Fail”)
Context: Frontend sends data, but backend receives null.
Checklist:
- JSON Body: Is the Controller method using
@RequestBody? - Getter/Setters: Does the Domain class have getters/setters for new fields?
- Compilation: CRITICAL. Did the code actually compile? Check for “symbol not found” errors that might be hidden in log files.
- Mapper XML: explicitly map
column="user_name"toproperty="userName".
2. Controller Pattern
@PreAuthorize("@ss.hasPermi('module:business:add')")
@PostMapping
public AjaxResult add(@RequestBody MyObject obj) {
obj.setCreateBy(SecurityUtils.getUsername());
return toAjax(myService.insert(obj));
}
3. Service Pattern
- Business logic goes here, NOT in Controller.
- Handle transactional logic with
@Transactional. - Verify data uniqueness or integrity before calling Mapper.
How to use
Invoke this skill when adding new API endpoints or Entity fields. It forces you to:
- Verify
resultMapin XML. - Check
SecurityUtilsusage. - Confirm strict Data Binding.