feat: Implement Oauth2 login log service and repository
- Added Oauth2LogLoginService for managing user authorization logs. - Implemented methods for inserting logs, cleaning logs, and exporting log data. - Created a new file for Oauth2 login log service. refactor: Remove unused open_api module - Deleted the open_api.go file as it was not utilized in the project. fix: Update error codes in SysProfileController - Changed error codes for binding errors and user authentication errors to more descriptive values. fix: Update cache handling in SysConfig and SysDictType services - Modified Redis set operations to include expiration time for cached values. refactor: Update middleware authorization checks - Replaced PreAuthorize middleware with AuthorizeUser across multiple routes in system and tool modules for consistency. chore: Clean up trace and ws modules - Updated middleware authorization in trace and ws modules to use AuthorizeUser.
This commit is contained in:
@@ -17,16 +17,16 @@ func Setup(router *gin.Engine) {
|
||||
iperfGroup := router.Group("/tool/iperf")
|
||||
{
|
||||
iperfGroup.GET("/v",
|
||||
middleware.PreAuthorize(nil),
|
||||
middleware.AuthorizeUser(nil),
|
||||
controller.NewIPerf.Version,
|
||||
)
|
||||
iperfGroup.POST("/i",
|
||||
middleware.PreAuthorize(nil),
|
||||
middleware.AuthorizeUser(nil),
|
||||
collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.iperf", collectlogs.BUSINESS_TYPE_OTHER)),
|
||||
controller.NewIPerf.Install,
|
||||
)
|
||||
iperfGroup.GET("/run",
|
||||
middleware.PreAuthorize(nil),
|
||||
middleware.AuthorizeUser(nil),
|
||||
collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.iperf", collectlogs.BUSINESS_TYPE_OTHER)),
|
||||
controller.NewIPerf.Run,
|
||||
)
|
||||
@@ -36,20 +36,20 @@ func Setup(router *gin.Engine) {
|
||||
pingGroup := router.Group("/tool/ping")
|
||||
{
|
||||
pingGroup.POST("",
|
||||
middleware.PreAuthorize(nil),
|
||||
middleware.AuthorizeUser(nil),
|
||||
controller.NewPing.Statistics,
|
||||
)
|
||||
pingGroup.GET("",
|
||||
middleware.PreAuthorize(nil),
|
||||
middleware.AuthorizeUser(nil),
|
||||
collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.ping", collectlogs.BUSINESS_TYPE_OTHER)),
|
||||
controller.NewPing.StatisticsOn,
|
||||
)
|
||||
pingGroup.GET("/v",
|
||||
middleware.PreAuthorize(nil),
|
||||
middleware.AuthorizeUser(nil),
|
||||
controller.NewPing.Version,
|
||||
)
|
||||
pingGroup.GET("/run",
|
||||
middleware.PreAuthorize(nil),
|
||||
middleware.AuthorizeUser(nil),
|
||||
collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.ping", collectlogs.BUSINESS_TYPE_OTHER)),
|
||||
controller.NewPing.Run,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user