| 12345678910111213141516171819202122 |
- package console
- import (
- "html/template"
- "github.com/gin-gonic/gin"
- )
- func Console(c *gin.Context) {
- const templateText = `
- <h1>Go接入服务信息</h1>
- <a href="{{.host}}/debug/update" title="点击后从自动构建服务拉取版本升级并重启GO服务, 请谨慎点击" target="_blank">点击升级到最新版本</a>
- <br><br>
- <a href="{{.host}}/swagger/index.html" target="_blank">点击打开swagger</a>
- <br>
- `
- if tmpl, err := template.New("index").Parse(templateText); err == nil {
- _ = tmpl.Execute(c.Writer, nil)
- } else {
- c.String(400, "index err.")
- }
- }
|