refactor: simplify route handlers by removing redundant ID parsing logic

This commit is contained in:
mlogclub
2026-05-23 22:28:21 +08:00
parent 1852f9df8b
commit f9ddf39c83
25 changed files with 155 additions and 195 deletions
@@ -40,7 +40,11 @@ func AssetAnyList(ctx *gin.Context) {
httpx.WriteJSON(ctx, &web.PageResult{Results: results, Page: paging})
}
func AssetGetBy(ctx *gin.Context, id int64) {
func AssetGetBy(ctx *gin.Context) {
id, ok := httpx.GetPathInt64(ctx, "id")
if !ok {
return
}
if _, err := services.AuthService.RequirePermission(ctx, constants.PermissionAssetView); err != nil {
httpx.WriteJSON(ctx, err)
return