Hanserwei 0a126eb520 feat(security): implement JWT-based authentication and authorization
- Configured JWT token validation filter in security chain
- Added user role mapping with new t_user_role table and UserRole entity
- Implemented custom authentication entry point and access denied handler
- Updated UserDetailService to load user roles from database
- Added @PreAuthorize annotation support for method-level security
- Refactored build scripts to use java-library plugin and proper dependency scope
- Enhanced SQL schema with user role table and improved table comments
- Added global exception handler for AccessDeniedException
- Introduced ResponseCodeEnum constants for unauthorized and forbidden access
- Integrated TokenAuthenticationFilter into Spring Security filter chain
2025-11-29 15:19:35 +08:00
Description
每个技术人都应该有属于自己的博客!相比较直接使用第三方博客平台,自行搭建博客更有成就感;另外就是没有平台限制,比如你想发个二维码引流啥的,平台基本都是不允许的,还有,你可以自由 div 定制自己想要的博客 css 样式,哪天 UI 看不爽了,咱就自己换;最后我希望通过这个项目锻炼一下我自己的后端gradle相关知识,以及JPA+PostgreSQL。前端我希望我可以系统学一学CSS相关知识,虽然前端在AI冲击之下已经有点难了。但是我坚信,AI的前端和手写的前端是不一样的。
183 KiB
Languages
Java 91.8%
PLpgSQL 8.2%