Files
be.ems/src/modules/chart/chart.go
TsMask 56991a0b49 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.
2025-04-27 11:07:34 +08:00

39 lines
1.0 KiB
Go

package chart
import (
"be.ems/src/framework/logger"
"be.ems/src/framework/middleware"
"be.ems/src/framework/middleware/collectlogs"
"be.ems/src/modules/chart/controller"
"github.com/gin-gonic/gin"
)
// 模块路由注册
func Setup(router *gin.Engine) {
logger.Infof("开始加载 ====> chart 模块路由")
// G6关系图
chartGraphGroup := router.Group("/chart/graph")
{
chartGraphGroup.GET("",
middleware.AuthorizeUser(nil),
controller.NewChartGraph.Load,
)
chartGraphGroup.GET("/groups",
middleware.AuthorizeUser(nil),
controller.NewChartGraph.GroupNames,
)
chartGraphGroup.POST("",
middleware.AuthorizeUser(nil),
collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.chartGraph", collectlogs.BUSINESS_TYPE_UPDATE)),
controller.NewChartGraph.Save,
)
chartGraphGroup.DELETE("/:group",
middleware.AuthorizeUser(nil),
collectlogs.OperateLog(collectlogs.OptionNew("log.operate.title.chartGraph", collectlogs.BUSINESS_TYPE_DELETE)),
controller.NewChartGraph.Delete,
)
}
}