项目常用注解
你好呀,我的老朋友!我是老寇,欢迎来到老寇IoT云平台!
| 注解 | 说明 | 例子 |
|---|---|---|
| @EnableSecurity | 开启Spring Security资源拦截 | @EnableSecurity |
| @PreAuthorize | Spring Security根据XXX权限标识鉴权 |
@PreAuthorize("hasAuthority('sys:user:save')")
@PreAuthorize("(hasAuthority('sys:oss:upload') or hasAuthority('sys:oss:save')) and hasAuthority('sys:user:modify')") |
| @EnableWarmUp | 开启预热 | @EnableWarmUp |
| @Cipher | 属性加密/解密【支持AES/RSA】 |
@Cipher(type=CipherType.AES, isEncrypt=true)
@Cipher(type=CipherType.AES, isEncrypt=false) @Cipher(type=CipherType.RSA, isEncrypt=true) @Cipher(type=CipherType.RSA, isEncrypt=false) |
| @DistributedCache | 分布式缓存 |
@DistributedCache(name = "user_menu", key = "#userId", operateType = OperateType.GET)
@DistributedCache(name = "user_menu", key = "#userId", operateType = OperateType.DEL) |
| @CommandLog | 领域事件日志 | @CommandLog |
我是老寇,我们下次再见啦!
上次更新: 2/10/2026, 10:06:32 PM