diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2024-06-19 06:32:45 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-19 06:32:45 +0800 |
commit | 43c7a2e7b1c7fb8aa2347d82ad0a6886d6fad9c2 (patch) | |
tree | c98c2e1159ee02eb52282811f28a4c31ad222c67 /routers/web/repo/activity.go | |
parent | 17baf1af10de025a47ade1f16f1e5c51646d7fcf (diff) | |
download | gitea-43c7a2e7b1c7fb8aa2347d82ad0a6886d6fad9c2.tar.gz gitea-43c7a2e7b1c7fb8aa2347d82ad0a6886d6fad9c2.zip |
Refactor names (#31405)
This PR only does "renaming":
* `Route` should be `Router` (and chi router is also called "router")
* `Params` should be `PathParam` (to distingush it from URL query param, and to match `FormString`)
* Use lower case for private functions to avoid exposing or abusing
Diffstat (limited to 'routers/web/repo/activity.go')
-rw-r--r-- | routers/web/repo/activity.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/repo/activity.go b/routers/web/repo/activity.go index 6f6641cc65..c8fa60f77a 100644 --- a/routers/web/repo/activity.go +++ b/routers/web/repo/activity.go @@ -24,7 +24,7 @@ func Activity(ctx *context.Context) { ctx.Data["PageIsPulse"] = true - ctx.Data["Period"] = ctx.Params("period") + ctx.Data["Period"] = ctx.PathParam("period") timeUntil := time.Now() var timeFrom time.Time @@ -75,7 +75,7 @@ func ActivityAuthors(ctx *context.Context) { timeUntil := time.Now() var timeFrom time.Time - switch ctx.Params("period") { + switch ctx.PathParam("period") { case "daily": timeFrom = timeUntil.Add(-time.Hour * 24) case "halfweekly": |