深入解析 Sliver 仓库中的 mailgun/errors:Go 结构化错误处理库
2026/9/25 3:36:46
这不是“全宇宙注解列表”,
而是后端工程中 95% 会用到的注解清单。
把类交给 Spring 管理。
@Component通用组件@Service业务层@Repository数据层@Controller控制器@RestControllerREST 接口@Autowired自动注入@Qualifier指定 Bean@Value注入配置@Bean注册对象HTTP → 方法。
@RequestMapping@GetMapping@PostMapping@PathVariable@RequestParam@RequestBody@ResponseBody@ControllerAdvice@ExceptionHandler接口质量核心。
@Valid@NotNull@NotBlank@Size@Email@Pattern数据库一致性核心。
@Transactional并发体系核心。
@EnableAsync@Async@EnableScheduling@Scheduled工程化核心。
@SpringBootApplication@Configuration@ConfigurationProperties@Profile@ComponentScan日志 / 权限 / 监控。
@Aspect@Before@After@Around@EnableCaching@Cacheable@CachePut@CacheEvict@PreAuthorize@Secured@EnableMethodSecurity@Mapper@MapperScan@Select@Insert组件注入 → 接口映射 → 参数校验 事务控制 → 异步调度 → 启动配置 切面日志 → 缓存优化 → 权限安全注解不是记住多少个,
而是知道它属于哪一层、解决什么问题。
当你看到一个@,
你应该想到的是:
“它在告诉框架做什么。”