// Code generated by goctl. DO NOT EDIT. // goctl 1.8.3 package handler import ( "net/http" agv "bj_power_mes/internal/handler/agv" api "bj_power_mes/internal/handler/api" dashboard "bj_power_mes/internal/handler/dashboard" dept "bj_power_mes/internal/handler/dept" dock "bj_power_mes/internal/handler/dock" equipment "bj_power_mes/internal/handler/equipment" inspection "bj_power_mes/internal/handler/inspection" job "bj_power_mes/internal/handler/job" login "bj_power_mes/internal/handler/login" machine "bj_power_mes/internal/handler/machine" manual_action "bj_power_mes/internal/handler/manual_action" measurement "bj_power_mes/internal/handler/measurement" pallet "bj_power_mes/internal/handler/pallet" permission "bj_power_mes/internal/handler/permission" product_type "bj_power_mes/internal/handler/product_type" reports "bj_power_mes/internal/handler/reports" role "bj_power_mes/internal/handler/role" scheduler "bj_power_mes/internal/handler/scheduler" system "bj_power_mes/internal/handler/system" task "bj_power_mes/internal/handler/task" temp_station "bj_power_mes/internal/handler/temp_station" user "bj_power_mes/internal/handler/user" workorder "bj_power_mes/internal/handler/workorder" "bj_power_mes/internal/svc" "github.com/zeromicro/go-zero/rest" ) func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { server.AddRoutes( []rest.Route{ { // 查询用户分页列表 Method: http.MethodGet, Path: "/users", Handler: user.QueryUsersHandler(serverCtx), }, { // 获取用户详情 Method: http.MethodGet, Path: "/users/:id", Handler: user.GetUserHandler(serverCtx), }, { // 获取当前登录用户信息 Method: http.MethodGet, Path: "/userinfo", Handler: user.UserinfoHandler(serverCtx), }, { // 创建用户 Method: http.MethodPost, Path: "/users", Handler: user.CreateUserHandler(serverCtx), }, { // 编辑用户 Method: http.MethodPut, Path: "/users/:id", Handler: user.UpdateUserHandler(serverCtx), }, { // 重置密码 Method: http.MethodPost, Path: "/users/resetPassword", Handler: user.ResetPasswordHandler(serverCtx), }, { // 修改密码 Method: http.MethodPost, Path: "/users/changePassword", Handler: user.ChangePasswordHandler(serverCtx), }, { // 启用用户 Method: http.MethodPost, Path: "/users/:id/enable", Handler: user.EnableUserHandler(serverCtx), }, { // 禁用用户 Method: http.MethodPost, Path: "/users/:id/disable", Handler: user.DisableUserHandler(serverCtx), }, { // 删除用户 Method: http.MethodDelete, Path: "/users/:id", Handler: user.DeleteUserHandler(serverCtx), }, { // 通过部门查询用户分页列表 Method: http.MethodGet, Path: "/depts/:id/users", Handler: user.QueryUsersOfDeptHandler(serverCtx), }, { // 通过角色查询用户分页列表 Method: http.MethodGet, Path: "/roles/:id/users", Handler: user.QueryUsersOfRoleHandler(serverCtx), }, { // 设置用户角色 Method: http.MethodPost, Path: "/users/:id/roles", Handler: user.SetUserRolesHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 登录 Method: http.MethodPost, Path: "/login", Handler: login.LoginHandler(serverCtx), }, { // 刷新token Method: http.MethodPost, Path: "/refreshToken", Handler: login.RefreshTokenHandler(serverCtx), }, }, rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 查询接口分页列表 Method: http.MethodGet, Path: "/apis", Handler: api.QueryApisHandler(serverCtx), }, { // 获取接口详情 Method: http.MethodGet, Path: "/apis/:id", Handler: api.GetApiHandler(serverCtx), }, { // 创建接口 Method: http.MethodPost, Path: "/apis", Handler: api.CreateApiHandler(serverCtx), }, { // 编辑接口 Method: http.MethodPut, Path: "/apis/:id", Handler: api.UpdateApiHandler(serverCtx), }, { // 删除接口 Method: http.MethodDelete, Path: "/apis/:id", Handler: api.DeleteApiHandler(serverCtx), }, { // 通过权限获取接口列表 Method: http.MethodGet, Path: "/permissions/:id/apis/list", Handler: api.ListApisOfPermissionHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 查询角色分页列表 Method: http.MethodGet, Path: "/roles", Handler: role.QueryRolesHandler(serverCtx), }, { // 创建角色 Method: http.MethodPost, Path: "/roles", Handler: role.CreateRoleHandler(serverCtx), }, { // 编辑角色 Method: http.MethodPut, Path: "/roles/:id", Handler: role.UpdateRoleHandler(serverCtx), }, { // 删除角色 Method: http.MethodDelete, Path: "/roles/:id", Handler: role.DeleteRoleHandler(serverCtx), }, { // 设置角色权限 Method: http.MethodPut, Path: "/roles/:id/permissions", Handler: role.SetRolePermissionsHandler(serverCtx), }, { // 添加角色用户 Method: http.MethodPost, Path: "/roles/:id/users", Handler: role.AddRoleUsersHandler(serverCtx), }, { // 删除角色用户 Method: http.MethodDelete, Path: "/roles/:id/users/:userId", Handler: role.DeleteRoleUserHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 获取权限列表 Method: http.MethodGet, Path: "/permissions/list", Handler: permission.ListPermissionsHandler(serverCtx), }, { // 获取子权限列表 Method: http.MethodGet, Path: "/permissions/:id/children-permissions/list", Handler: permission.ListChildrenPermissionsHandler(serverCtx), }, { // 获取权限树 Method: http.MethodGet, Path: "/permissions/tree", Handler: permission.PermissionsTreeHandler(serverCtx), }, { // 创建权限 Method: http.MethodPost, Path: "/permissions", Handler: permission.CreatePermissionHandler(serverCtx), }, { // 编辑权限 Method: http.MethodPut, Path: "/permissions/:id", Handler: permission.UpdatePermissionHandler(serverCtx), }, { // 删除权限 Method: http.MethodDelete, Path: "/permissions/:id", Handler: permission.DeletePermissionHandler(serverCtx), }, { // 通过角色获取权限ID列表 Method: http.MethodGet, Path: "/roles/:id/permissions/ids", Handler: permission.ListPermissionIdsOfRoleHandler(serverCtx), }, { // 设置权限接口 Method: http.MethodPut, Path: "/permissions/:id/apis", Handler: permission.SetPermissionApisHandler(serverCtx), }, { // 删除权限接口 Method: http.MethodDelete, Path: "/permissions/:id/apis/:apiId", Handler: permission.DeletePermissionApiHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 查询设备分页列表 Method: http.MethodGet, Path: "/equipments", Handler: equipment.QueryEquipmentsHandler(serverCtx), }, { // 获取设备详情 Method: http.MethodGet, Path: "/equipments/:id", Handler: equipment.GetEquipmentHandler(serverCtx), }, { // 查询设备类型列表 Method: http.MethodGet, Path: "/equipment-types", Handler: equipment.ListEquipmentTypesHandler(serverCtx), }, { // 创建设备 Method: http.MethodPost, Path: "/equipments", Handler: equipment.CreateEquipmentHandler(serverCtx), }, { // 编辑设备 Method: http.MethodPut, Path: "/equipments/:id", Handler: equipment.UpdateEquipmentHandler(serverCtx), }, { // 修改设备调度可用状态 Method: http.MethodPut, Path: "/equipments/:id/availability", Handler: equipment.UpdateEquipmentAvailabilityHandler(serverCtx), }, { // 删除设备 Method: http.MethodDelete, Path: "/equipments/:id", Handler: equipment.DeleteEquipmentHandler(serverCtx), }, { // 批量删除设备 Method: http.MethodPost, Path: "/equipments/batch-delete", Handler: equipment.BatchDeleteEquipmentsHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 工站监控 Method: http.MethodGet, Path: "/stations/monitor", Handler: workorder.StationMonitorHandler(serverCtx), }, { // 恢复扫描 Method: http.MethodGet, Path: "/work-orders/recovery/scan", Handler: workorder.ScanRecoveryHandler(serverCtx), }, { // 查询工单分页列表 Method: http.MethodGet, Path: "/work-orders", Handler: workorder.QueryWorkOrdersHandler(serverCtx), }, { // 查询任务日志分页列表 Method: http.MethodGet, Path: "/work-orders/:id/task-logs", Handler: workorder.QueryTaskLogsHandler(serverCtx), }, { // 获取最新任务日志 Method: http.MethodGet, Path: "/work-orders/logs/latest", Handler: workorder.GetLatestTaskLogsHandler(serverCtx), }, { // 获取工单详情 Method: http.MethodGet, Path: "/work-orders/:id", Handler: workorder.GetWorkOrderHandler(serverCtx), }, { // 获取带工艺流程信息的工单详情 Method: http.MethodGet, Path: "/work-orders/:id/detail", Handler: workorder.GetWorkOrderDetailHandler(serverCtx), }, { // 创建工单 Method: http.MethodPost, Path: "/work-orders", Handler: workorder.CreateWorkOrderHandler(serverCtx), }, { // 编辑工单 Method: http.MethodPut, Path: "/work-orders/:id", Handler: workorder.UpdateWorkOrderHandler(serverCtx), }, { // 开始工单 Method: http.MethodPost, Path: "/work-orders/:id/start", Handler: workorder.StartWorkOrderHandler(serverCtx), }, { // 暂停工单 Method: http.MethodPost, Path: "/work-orders/:id/pause", Handler: workorder.PauseWorkOrderHandler(serverCtx), }, { // 恢复工单 Method: http.MethodPost, Path: "/work-orders/:id/resume", Handler: workorder.ResumeWorkOrderHandler(serverCtx), }, { // 断电恢复工单 Method: http.MethodPost, Path: "/work-orders/:id/restore", Handler: workorder.RestoreWorkOrderHandler(serverCtx), }, { // 取消工单 Method: http.MethodPost, Path: "/work-orders/:id/cancel", Handler: workorder.CancelWorkOrderHandler(serverCtx), }, { // 停止工单 Method: http.MethodPost, Path: "/work-orders/:id/stop", Handler: workorder.StopWorkOrderHandler(serverCtx), }, { // 查询停止工单的待搬运工件 Method: http.MethodGet, Path: "/work-orders/stop/jobs/:id", Handler: workorder.QueryStopJobsHandler(serverCtx), }, { // 确认停止工单(搬运完成后) Method: http.MethodPost, Path: "/work-orders/:id/stop-confirm", Handler: workorder.StopWorkOrderConfirmHandler(serverCtx), }, { // 删除工单 Method: http.MethodDelete, Path: "/work-orders/:id", Handler: workorder.DeleteWorkOrderHandler(serverCtx), }, { // 批量删除工单 Method: http.MethodDelete, Path: "/work-orders", Handler: workorder.DeleteWorkOrdersHandler(serverCtx), }, { // 取消停止(取消 CANCELLING) Method: http.MethodPost, Path: "/work-orders/:id/cancel-stop", Handler: workorder.CancelStopWorkOrderHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 获取工件列表 Method: http.MethodGet, Path: "/jobs", Handler: job.QueryJobsHandler(serverCtx), }, { // 工单下工件分页 Method: http.MethodGet, Path: "/work-orders/:id/jobs", Handler: job.QueryJobsOfWorkOrderHandler(serverCtx), }, { // 获取工件详情 Method: http.MethodGet, Path: "/jobs/:id", Handler: job.GetJobHandler(serverCtx), }, { // 挂起工件 Method: http.MethodPost, Path: "/jobs/:id/suspend", Handler: job.SuspendJobHandler(serverCtx), }, { // 恢复工件 Method: http.MethodPost, Path: "/jobs/:id/resume", Handler: job.ResumeJobHandler(serverCtx), }, { // 返工工件 Method: http.MethodPost, Path: "/jobs/:id/rework", Handler: job.ReworkJobHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 查询部门分页列表 Method: http.MethodGet, Path: "/depts", Handler: dept.QueryDeptsHandler(serverCtx), }, { // 获取部门树 Method: http.MethodGet, Path: "/depts/tree", Handler: dept.DeptsTreeHandler(serverCtx), }, { // 获取部门详情 Method: http.MethodGet, Path: "/depts/:id", Handler: dept.GetDeptHandler(serverCtx), }, { // 创建部门 Method: http.MethodPost, Path: "/depts", Handler: dept.CreateDeptHandler(serverCtx), }, { // 编辑部门 Method: http.MethodPut, Path: "/depts/:id", Handler: dept.UpdateDeptHandler(serverCtx), }, { // 删除部门 Method: http.MethodDelete, Path: "/depts/:id", Handler: dept.DeleteDeptHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 查询报警信息 Method: http.MethodGet, Path: "/alarms", Handler: reports.QueryAlarmsHandler(serverCtx), }, { // 确认报警 Method: http.MethodPost, Path: "/alarms/:id/ack", Handler: reports.AckAlarmHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 生产线总览 Method: http.MethodGet, Path: "/dashboard/overview", Handler: dashboard.DashboardOverviewHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 获取产品类型列表 Method: http.MethodGet, Path: "/product-types/list", Handler: product_type.ListProductTypesHandler(serverCtx), }, { // 通过ID查询产品类型 Method: http.MethodGet, Path: "/product-types/:id", Handler: product_type.GetProductTypeHandler(serverCtx), }, { // 创建产品类型 Method: http.MethodPost, Path: "/product-types", Handler: product_type.CreateProductTypeHandler(serverCtx), }, { // 更新产品类型 Method: http.MethodPut, Path: "/product-types/:id", Handler: product_type.UpdateProductTypeHandler(serverCtx), }, { // 删除产品类型 Method: http.MethodDelete, Path: "/product-types/:id", Handler: product_type.DeleteProductTypeHandler(serverCtx), }, }, rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 接驳台槽位监控 Method: http.MethodGet, Path: "/docks/slots", Handler: dock.ListDockSlotsHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 暂存台槽位监控 Method: http.MethodGet, Path: "/buffer/slots", Handler: temp_station.ListBufferSlotsHandler(serverCtx), }, { // 重置暂存台:将在位工件回写到接驳台位置 Method: http.MethodPost, Path: "/buffer/reset", Handler: temp_station.ResetBufferHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 获取机床列表 Method: http.MethodGet, Path: "/machines/list", Handler: machine.ListMachinesHandler(serverCtx), }, { // 分页查询机床列表 Method: http.MethodGet, Path: "/machines", Handler: machine.QueryMachinesHandler(serverCtx), }, { // 获取机床详情 Method: http.MethodGet, Path: "/machines/:id", Handler: machine.GetMachineHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 当前调度队列 Method: http.MethodGet, Path: "/scheduler/ready-jobs", Handler: scheduler.ReadyJobsHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 任务分页列表 Method: http.MethodGet, Path: "/tasks", Handler: task.QueryTasksHandler(serverCtx), }, { // 任务详情 Method: http.MethodGet, Path: "/tasks/:id", Handler: task.GetTaskHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 查询人工交互列表 Method: http.MethodGet, Path: "/manual-actions", Handler: manual_action.QueryManualActionsHandler(serverCtx), }, { // 处理扫码失败 Method: http.MethodPost, Path: "/manual-actions/:id/resolve-scan-failed", Handler: manual_action.ResolveScanFailedHandler(serverCtx), }, { // 确认 L3 恢复 Method: http.MethodPost, Path: "/recovery/actions/:id/confirm", Handler: manual_action.ConfirmRecoveryHandler(serverCtx), }, { // 修复工件位置 Method: http.MethodPost, Path: "/recovery/fix-position", Handler: manual_action.FixPositionHandler(serverCtx), }, { // 查询恢复作业列表 Method: http.MethodGet, Path: "/recovery/jobs", Handler: manual_action.QueryRecoveryJobsHandler(serverCtx), }, { // 完成恢复 Method: http.MethodPost, Path: "/recovery/complete", Handler: manual_action.CompleteRecoveryHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 获取最新事件日志 Method: http.MethodGet, Path: "/event-logs/latest", Handler: reports.GetLatestEventLogsHandler(serverCtx), }, { // 分页查询事件日志 Method: http.MethodGet, Path: "/event-logs", Handler: reports.QueryEventLogsHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 产量报表(按月/日+大类统计) Method: http.MethodGet, Path: "/reports/production", Handler: reports.ProductionReportHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 查询托盘列表 Method: http.MethodGet, Path: "/pallets", Handler: pallet.QueryPalletsHandler(serverCtx), }, { // 获取托盘详情 Method: http.MethodGet, Path: "/pallets/:id", Handler: pallet.GetPalletHandler(serverCtx), }, { // 托盘报工 Method: http.MethodPost, Path: "/pallets/:id/report", Handler: pallet.ReportPalletHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { Method: http.MethodGet, Path: "/system/status", Handler: system.GetSystemStatusHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 获取当前检测信息 Method: http.MethodGet, Path: "/inspection/info", Handler: inspection.GetInspectionInfoHandler(serverCtx), }, { // 查询检测图片列表 Method: http.MethodGet, Path: "/inspection/images", Handler: inspection.QueryInspectionImagesHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // MOM业务: AGV对自动线进出请求接口 (AGV => 自动线) Method: http.MethodPost, Path: "/agv/request-entry", Handler: agv.AgvRequestEntryHandler(serverCtx), }, }, rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 上传抽检测量数据(外部测量软件调用,自动匹配抽检台当前工件,免鉴权) Method: http.MethodPost, Path: "/measurement/upload", Handler: measurement.UploadMeasurementHandler(serverCtx), }, { // 查询抽检测量数据列表(报表用,跨工单) Method: http.MethodGet, Path: "/measurement/list", Handler: measurement.QueryMeasurementsHandler(serverCtx), }, }, rest.WithPrefix("/api/v1"), ) server.AddRoutes( []rest.Route{ { // 查询工件测量数据 Method: http.MethodGet, Path: "/measurement/jobs/:jobId", Handler: measurement.GetMeasurementHandler(serverCtx), }, { // 查询工单测量数据列表 Method: http.MethodGet, Path: "/measurement/work-orders/:id", Handler: measurement.QueryMeasurementsOfWorkOrderHandler(serverCtx), }, }, rest.WithJwt(serverCtx.Config.Auth.AccessSecret), rest.WithPrefix("/api/v1"), ) }