From 6ca271f30c46afa5962ce6c07b68c8c4e3b7af79 Mon Sep 17 00:00:00 2001 From: ychao_1983 Date: Mon, 30 Jan 2023 10:19:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- routers/routes/routes.go | 10 ++++++++++ routers/tech/tech.go | 27 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 routers/tech/tech.go diff --git a/routers/routes/routes.go b/routers/routes/routes.go index 2def76ff4..4fb24201b 100755 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -12,6 +12,8 @@ import ( "text/template" "time" + "code.gitea.io/gitea/routers/tech" + "code.gitea.io/gitea/routers/badge" "code.gitea.io/gitea/routers/reward/point" "code.gitea.io/gitea/routers/task" @@ -896,6 +898,14 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("/check_name", repo.CheckName) }, reqSignIn) + m.Group("/tech", func() { + m.Get("/new", tech.Create) + m.Get("/tech_view", tech.TechView) + m.Get("/repo_view", tech.RepoView) + m.Get("/admin_view", tech.AdminView) + + }, reqSignIn) + // ***** Release Attachment Download without Signin m.Get("/:username/:reponame/releases/download/:vTag/:fileName", ignSignIn, context.RepoAssignment(), repo.MustBeNotEmpty, repo.RedirectDownload) diff --git a/routers/tech/tech.go b/routers/tech/tech.go new file mode 100644 index 000000000..1003cd50c --- /dev/null +++ b/routers/tech/tech.go @@ -0,0 +1,27 @@ +package tech + +import ( + "code.gitea.io/gitea/modules/base" + "code.gitea.io/gitea/modules/context" +) + +const ( + tplCreate base.TplName = "tech/create" + tplTech base.TplName = "tech/tech_view" + tplRepo base.TplName = "tech/repo_view" + tplAdmin base.TplName = "tech/admin_view" +) + +func Create(ctx *context.Context) { + ctx.HTML(200, tplCreate) +} + +func TechView(ctx *context.Context) { + ctx.HTML(200, tplTech) +} +func RepoView(ctx *context.Context) { + ctx.HTML(200, tplRepo) +} +func AdminView(ctx *context.Context) { + ctx.HTML(200, tplAdmin) +}