学习Go语言快2年了。一直都做为辅助工具在使用,很少有机会(时间)开发项目,最近对Gin框架做了一个大概的了解,做为GO语言web开发的主流框架,Gin的功能实在太少了,只能作为基本开发使用。
Gin里很多功能都需要依赖其它框架,比如数据库就需要使用Gorm,和PHP内置很多实用的系统函数相比,我们还需要做一个自己的函数功能库,才可以满足日常敏捷开发。
下面是我体验Gin的基本功能写了一个单页面做为测试功能:点击下载源代码
/**
* [Kwok GO] Ver:1.0
* Created Time: 2022-01-20 19:10:42
*/
package main
import (
"fmt"
"html/template"
"log"
"math/rand"
"net/http"
"regexp"
"strings"
"time"
"unicode/utf8"
"github.com/cao-guang/pinyin"
"github.com/gin-gonic/gin"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
)
//检查是否为蜘蛛(未实现)
func checkIsRobots() gin.HandlerFunc {
return func(c *gin.Context) {
start := time.Now()
c.Next()
cost := time.Since(start)
log.Println("本次执行耗时", cost)
}
}
//清除HTML代码
func trimHtml(src string) string {
re, _ := regexp.Compile("<[Ss]+?>")
src = re.ReplaceAllStringFunc(src, strings.ToLower)
re, _ = regexp.Compile("<style[Ss]+?</style>")
src = re.ReplaceAllString(src, "")
re, _ = regexp.Compile("<script[Ss]+?</script>")
src = re.ReplaceAllString(src, "")
re, _ = regexp.Compile("<[Ss]+?>")
src = re.ReplaceAllString(src, "n")
re, _ = regexp.Compile("s{2,}")
src = re.ReplaceAllString(src, "n")
return strings.TrimSpace(src)
}
//数据结构
type Enter struct {
ID uint `gorm:"primaryKey"`
Name string `gorm:"index;size:80"`
Shortname string `gorm:"size:8"`
Introduction string `gorm:"size:1024"`
Area string `gorm:"size:255"`
Business string `gorm:"size:2048"`
Boss string `gorm:"size:32"`
Cellphone string `gorm:"size:15"`
Email string `gorm:"size:128"`
Dateof string `gorm:"size:32"`
Address string `gorm:"size:64"`
}
//随机颜色
func randColor() string {
var colors = [...]string{"primary", "secondary", "success", "info", "warning", "danger", "light", "dark"}
color := rand.Perm(len(colors))
return colors[color[0]]
}
func main() {
//使用gorm初始化一个sqlite数据库
db, err := gorm.Open(sqlite.Open("enter.db"), &gorm.Config{})
if err != nil {
panic(err) //数据库有问题
}
var enterMap Enter //Enter空实例
db.AutoMigrate(&enterMap) //同使用Enter空实例映射数据库结构
result := db.First(&enterMap) //查询一条数据
if result.RowsAffected == 0 {
fmt.Println("数据库里没有数据,写入测试数据", result.RowsAffected)
var enters = []Enter{{1, "北京鼎盛机电设备维修有限公司", "鼎盛", "<p class="txt">北京鼎盛机电设备维修有限公司位于中国北京,主营业务包括机电设备(电机水泵)维修安装,欢迎新老客户联系我们,咨询交流! 我们有好的产品和专业的团队,公司发展迅速,我们为客户提供优质的产品、良好的技术支持、健全的售后服务,北京鼎盛机电设备维修有限公司是机电设备维修,电动机水泵维修,电机水泵销售,机械设备租赁知名企业,如果您对我公司的产品服务有兴趣,请在线留言或者来电咨询。</p>", "北京 房山", "机电设备维修,电动机水泵维修,电机水泵销售,机械设备租赁", "李德才", "13701319230", "", "2017-05-18", "北京市房山区长阳万兴路86号-A583"},
{2, "深圳市众视显科技有限公司", "众视显", "<p class="txt">深圳市众视显科技有限公司,是一家集生产及销售商用触摸一体机、多媒体广告机、液晶拼接墙等液晶显示终端设备的高新技术企业,公司秉承"以人为本,科学发展"的宗旨。以"客户体验,科技创新”做为核心竟争力。缔造更好的管理团队,技术团队和生产团队,创建和完善、快捷的售后服务体系”,不断满足客户的需求,引进商显市场!<br>rn公司拥有自已的生产厂房及新进设备,拥有的人才,基于强大的自主创新能力和对行业需求的深刻理解,深圳市众视显科技有限公司推出了多个应用解决方案,产品广泛应用于广告传媒,金融行业,街头信息查询,医疗事业,交通行业,例如地铁,车站,其他:例如学校,酒店、展会、博物馆等等,给各个行来从方案设计、方案整改、定制生产、安装调试等全过程提供了完整的解决方案支持与服务,赢得了分众传媒,粤海物业等国内企业和各界人士的信任和支持。本着诚实守信的经营原则,愿与商业各界伙伴共同携手,缔造共赢平台,同创美好未来</p>", "广东 深圳", "液晶拼接屏,广告机,液晶广告机,触摸一体机", "何炎", "13145824951", "", "2021-12-28", "深圳市光明区公明街道李松蓢社区第一工业区炮台路48号创新云谷厂房H栋1002"},
{3, "常州市纽旭机电设备有限公司", "纽旭机电", "位于江苏省常州市武进区,是集产品设计、研发、制造与销售于一体的技术企业。", "江苏 常州", "机电设备维修,电动机水泵维修,电机水泵销售,机械设备租赁", "张先生", "15113534634", "476161917@qq.com", "2016-05-18", "常州市武进区万科城柏悦湾花园21-218号"}}
db.Create(&enters) //写入数据
}
r := gin.Default() //使用Gin默认配置
r.SetFuncMap(template.FuncMap{
"randcolor": randColor, //模板里支持randColor函数
})
r.Use(checkIsRobots()) //使用中间件
r.LoadHTMLGlob("templates/*") //载入模板
r.GET("/", func(c *gin.Context) {
var enter Enter
result = db.Order("RANDOM()").Take(&enter) // 随机查询一条
scheme := "http://"
if c.Request.TLS != nil {
scheme = "https://"
}
host := c.Request.Host //当前域名
pinyin, err := pinyin.To_Py(enter.Shortname, "", "") //将公司简称转为拼音
if err != nil {
fmt.Println("拼音转换出错了:", err)
}
cutStr := 80 //不要使用len计算字符长度,会导致Rune越界
if utf8.RuneCountInString(trimHtml(enter.Introduction+enter.Name)) < cutStr {
cutStr = utf8.RuneCountInString(trimHtml(enter.Introduction+enter.Name)) - 1
}
c.HTML(http.StatusOK, "index.html", gin.H{
"title": enter.Business + enter.Name,
"keywords": enter.Business + "," + enter.Name,
"description": string([]rune(trimHtml(enter.Introduction + enter.Name))[:cutStr]),//这里可以写个func来处理更好
"scheme": scheme, //使用的协议
"host": host, //主机(域名)
"webURL": scheme + host, //完整地址
"business": strings.Split(enter.Business, ","),//分割字符串
"intro": template.HTML(enter.Introduction),//支持html
"enter": enter, //企业信息
"pinyin": pinyin,
"rangeColor": randColor(),//随机颜色
"copyright": rand.Intn(2022-2015) + 2015,//返回2015~2022的随机数
})
})
r.Run(":80")//在80端口上运行web服务,这里可以改为80809090之类
}
我们可以先使用go mod init对项目初始化后,再使用 go mod tidy 清除无用的依赖、go mod download 自动下载依赖库。
<!DOCTYPE html>
<html lang="cn">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no">
<title>{{- .title -}}</title>
{{if .keywords}}
<meta name="keywords" content="{{- .keywords -}}">
{{end}}
{{if .description}}
<meta name="description" content="{{- .description -}}">
{{end}}
<link href="{{- .webURL -}}" rel="canonical" />
<link rel="alternate" type="application/vnd.wap.xhtml+xml" media="handheld" href="{{- .webURL -}}" />
<meta name="mobile-agent" content="format=html5;url={{- .webURL -}}" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta http-equiv="Cache-Control" content="no-transform" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<style>
.bg-light p,
.bg-light h2 {
color: black !important;
}
.row .bg-light .btn {
background: brown;
}
</style>
</head>
<body>
<header id="{{.pinyin}}_header">
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
<div class="container-fluid">
<a class="navbar-brand" href="/" title="{{- .title -}}">{{ .enter.Name}}</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarScroll" aria-controls="navbarScroll" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarScroll">
<ul class="navbar-nav me-auto my-2 my-lg-0">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="{{- .webURL -}}">首页</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#introduction-{{.pinyin}}">公司简介</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#business-{{.pinyin}}" id="navbarScrollingDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
经营项目</a>
<ul class="dropdown-menu" aria-labelledby="navbarScrollingDropdown">
{{range .business}}
<li class="dropdown-item">{{.}}</li>
{{end}}
</ul>
</li>
<li class="nav-item">
<a class="nav-link" href="#contact-{{.pinyin}}">联系方式</a>
</li>
</ul>
<form action="https://www.sogou.com/web" class="d-flex" method="get" target="_blank">
<input type="search" aria-label="Search" class="form-control me-2" placeholder="{{ .enter.Name }}" value="" name="query">
<input name="submit" class="btn btn-{{- randcolor -}}" type="submit" value="搜索">
</form>
</div>
</div>
</nav>
</header>
<div class="p-5 mb-4 bg-light rounded-3" id="introduction-{{.pinyin}}">
<div class="container-fluid py-5">
<h1 class="display-5 fw-bold">{{ .enter.Name }}</h1>
<p class="col-md-8 fs-4">
{{ .intro }}
</p>
<button class="btn btn-primary btn-lg" type="button">请联系我们了解更多~</button>
</div>
</div>
<div class="row align-items-md-stretch m-3" id="business-{{.pinyin}}">
{{range $value := .business}}
<div class="col-md-6 mb-3" id="">
<div class="h-100 p-5 text-white bg-{{- randcolor }} rounded-3">
<h2>{{$value}}</h2>
<p>
{{ $.enter.Name }}竭诚为您提供{{$value}}服务,您可以拨打{{ $.enter.Shortname }}的联系电话: {{ $.enter.Cellphone }} 联系人: {{ $.enter.Boss }}。
</p>
<button class="btn btn-outline-light" type="button">服务项目</button>
</div>
</div>
{{end}}
</div>
<div class="list-group m-3" id="contact-{{.pinyin}}">
<div class="list-group-item list-group-item-action d-flex gap-3 py-3" aria-current="true">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-flower1" viewBox="0 0 16 16">
<path d="M6.174 1.184a2 2 0 0 1 3.652 0A2 2 0 0 1 12.99 3.01a2 2 0 0 1 1.826 3.164 2 2 0 0 1 0 3.652 2 2 0 0 1-1.826 3.164 2 2 0 0 1-3.164 1.826 2 2 0 0 1-3.652 0A2 2 0 0 1 3.01 12.99a2 2 0 0 1-1.826-3.164 2 2 0 0 1 0-3.652A2 2 0 0 1 3.01 3.01a2 2 0 0 1 3.164-1.826zM8 1a1 1 0 0 0-.998 1.03l.01.091c.012.077.029.176.054.296.049.241.122.542.213.887.182.688.428 1.513.676 2.314L8 5.762l.045-.144c.248-.8.494-1.626.676-2.314.091-.345.164-.646.213-.887a4.997 4.997 0 0 0 .064-.386L9 2a1 1 0 0 0-1-1zM2 9l.03-.002.091-.01a4.99 4.99 0 0 0 .296-.054c.241-.049.542-.122.887-.213a60.59 60.59 0 0 0 2.314-.676L5.762 8l-.144-.045a60.59 60.59 0 0 0-2.314-.676 16.705 16.705 0 0 0-.887-.213 4.99 4.99 0 0 0-.386-.064L2 7a1 1 0 1 0 0 2zm7 5-.002-.03a5.005 5.005 0 0 0-.064-.386 16.398 16.398 0 0 0-.213-.888 60.582 60.582 0 0 0-.676-2.314L8 10.238l-.045.144c-.248.8-.494 1.626-.676 2.314-.091.345-.164.646-.213.887a4.996 4.996 0 0 0-.064.386L7 14a1 1 0 1 0 2 0zm-5.696-2.134.025-.017a5.001 5.001 0 0 0 .303-.248c.184-.164.408-.377.661-.629A60.614 60.614 0 0 0 5.96 9.23l.103-.111-.147.033a60.88 60.88 0 0 0-2.343.572c-.344.093-.64.18-.874.258a5.063 5.063 0 0 0-.367.138l-.027.014a1 1 0 1 0 1 1.732zM4.5 14.062a1 1 0 0 0 1.366-.366l.014-.027c.01-.02.021-.048.036-.084a5.09 5.09 0 0 0 .102-.283c.078-.233.165-.53.258-.874a60.6 60.6 0 0 0 .572-2.343l.033-.147-.11.102a60.848 60.848 0 0 0-1.743 1.667 17.07 17.07 0 0 0-.629.66 5.06 5.06 0 0 0-.248.304l-.017.025a1 1 0 0 0 .366 1.366zm9.196-8.196a1 1 0 0 0-1-1.732l-.025.017a4.951 4.951 0 0 0-.303.248 16.69 16.69 0 0 0-.661.629A60.72 60.72 0 0 0 10.04 6.77l-.102.111.147-.033a60.6 60.6 0 0 0 2.342-.572c.345-.093.642-.18.875-.258a4.993 4.993 0 0 0 .367-.138.53.53 0 0 0 .027-.014zM11.5 1.938a1 1 0 0 0-1.366.366l-.014.027c-.01.02-.021.048-.036.084a5.09 5.09 0 0 0-.102.283c-.078.233-.165.53-.258.875a60.62 60.62 0 0 0-.572 2.342l-.033.147.11-.102a60.848 60.848 0 0 0 1.743-1.667c.252-.253.465-.477.629-.66a5.001 5.001 0 0 0 .248-.304l.017-.025a1 1 0 0 0-.366-1.366zM14 9a1 1 0 0 0 0-2l-.03.002a4.996 4.996 0 0 0-.386.064c-.242.049-.543.122-.888.213-.688.182-1.513.428-2.314.676L10.238 8l.144.045c.8.248 1.626.494 2.314.676.345.091.646.164.887.213a4.996 4.996 0 0 0 .386.064L14 9zM1.938 4.5a1 1 0 0 0 .393 1.38l.084.035c.072.03.166.064.283.103.233.078.53.165.874.258a60.88 60.88 0 0 0 2.343.572l.147.033-.103-.111a60.584 60.584 0 0 0-1.666-1.742 16.705 16.705 0 0 0-.66-.629 4.996 4.996 0 0 0-.304-.248l-.025-.017a1 1 0 0 0-1.366.366zm2.196-1.196.017.025a4.996 4.996 0 0 0 .248.303c.164.184.377.408.629.661A60.597 60.597 0 0 0 6.77 5.96l.111.102-.033-.147a60.602 60.602 0 0 0-.572-2.342c-.093-.345-.18-.642-.258-.875a5.006 5.006 0 0 0-.138-.367l-.014-.027a1 1 0 1 0-1.732 1zm9.928 8.196a1 1 0 0 0-.366-1.366l-.027-.014a5 5 0 0 0-.367-.138c-.233-.078-.53-.165-.875-.258a60.619 60.619 0 0 0-2.342-.572l-.147-.033.102.111a60.73 60.73 0 0 0 1.667 1.742c.253.252.477.465.66.629a4.946 4.946 0 0 0 .304.248l.025.017a1 1 0 0 0 1.366-.366zm-3.928 2.196a1 1 0 0 0 1.732-1l-.017-.025a5.065 5.065 0 0 0-.248-.303 16.705 16.705 0 0 0-.629-.661A60.462 60.462 0 0 0 9.23 10.04l-.111-.102.033.147a60.6 60.6 0 0 0 .572 2.342c.093.345.18.642.258.875a4.985 4.985 0 0 0 .138.367.575.575 0 0 0 .014.027zM8 9.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3z" />
</svg>
<div class="d-flex gap-2 w-100 justify-content-between">
<div>
<h6 class="mb-0">公司名称:</h6>
<p class="mb-0 opacity-75">{{ .enter.Name}}</p>
</div>
<small class="opacity-50 text-nowrap">{{ .enter.Shortname }}</small>
</div>
</div>
<div class="list-group-item list-group-item-action d-flex gap-3 py-3" aria-current="true">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-chat-dots" viewBox="0 0 16 16">
<path d="M5 8a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm4 0a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm3 1a1 1 0 1 0 0-2 1 1 0 0 0 0 2z" />
<path d="m2.165 15.803.02-.004c1.83-.363 2.948-.842 3.468-1.105A9.06 9.06 0 0 0 8 15c4.418 0 8-3.134 8-7s-3.582-7-8-7-8 3.134-8 7c0 1.76.743 3.37 1.97 4.6a10.437 10.437 0 0 1-.524 2.318l-.003.011a10.722 10.722 0 0 1-.244.637c-.079.186.074.394.273.362a21.673 21.673 0 0 0 .693-.125zm.8-3.108a1 1 0 0 0-.287-.801C1.618 10.83 1 9.468 1 8c0-3.192 3.004-6 7-6s7 2.808 7 6c0 3.193-3.004 6-7 6a8.06 8.06 0 0 1-2.088-.272 1 1 0 0 0-.711.074c-.387.196-1.24.57-2.634.893a10.97 10.97 0 0 0 .398-2z" />
</svg>
<div class="d-flex gap-2 w-100 justify-content-between">
<div>
<h6 class="mb-0">联系人:</h6>
<p class="mb-0 opacity-75">{{ .enter.Boss }}</p>
</div>
<small class="opacity-50 text-nowrap">{{ .enter.Cellphone }}</small>
</div>
</div>
<div class="list-group-item list-group-item-action d-flex gap-3 py-3" aria-current="true">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" class="bi bi-building" viewBox="0 0 16 16">
<path fill-rule="evenodd" d="M14.763.075A.5.5 0 0 1 15 .5v15a.5.5 0 0 1-.5.5h-3a.5.5 0 0 1-.5-.5V14h-1v1.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V10a.5.5 0 0 1 .342-.474L6 7.64V4.5a.5.5 0 0 1 .276-.447l8-4a.5.5 0 0 1 .487.022zM6 8.694 1 10.36V15h5V8.694zM7 15h2v-1.5a.5.5 0 0 1 .5-.5h2a.5.5 0 0 1 .5.5V15h2V1.309l-7 3.5V15z" />
<path d="M2 11h1v1H2v-1zm2 0h1v1H4v-1zm-2 2h1v1H2v-1zm2 0h1v1H4v-1zm4-4h1v1H8V9zm2 0h1v1h-1V9zm-2 2h1v1H8v-1zm2 0h1v1h-1v-1zm2-2h1v1h-1V9zm0 2h1v1h-1v-1zM8 7h1v1H8V7zm2 0h1v1h-1V7zm2 0h1v1h-1V7zM8 5h1v1H8V5zm2 0h1v1h-1V5zm2 0h1v1h-1V5zm0-2h1v1h-1V3z" />
</svg>
<div class="d-flex gap-2 w-100 justify-content-between">
<div>
<h6 class="mb-0">公司地址:</h6>
<p class="mb-0 opacity-75">{{ .enter.Address }}</p>
</div>
<small class="opacity-50 text-nowrap">{{ .enter.Area }}</small>
</div>
</div>
</div>
<div id="firendlinks" class="border p-2 clearfix mx-3">
<strong class="bg-dark text-white px-2 py-1 small">友情链接</strong>
<a href="https://www.google.com/search?q={{.host}}" class="m-1" target="_blank">Google</a>
<a href="https://www.baidu.com/s?wd={{.host}}" class="m-1" target="_blank">百度</a>
<a href="https://www.sogou.com/web?query={{.host}}" class="m-1" target="_blank">搜狗</a>
</div>
<footer class="container text-center py-3 my-4" id="foot_$company[domain]">
<p class="border-bottom pb-3 mb-3">Copyright © {{ .copyright }} - 2022 <a href="{{- .webURL -}}" class="company_{{.pinyin}}_name">{{ .enter.Name}}</a> <img src="data:image/gif;base64,R0lGODlhFAAUAPcAAAAAAP///8kAAtMECNkABs0ABdQDC9EMEb8AEbYAEGkCNkwAOWAeUDoSOTgWN1Q4U04OTk41T0IkRDYaTV5ZZlZObwwAXQsGZwAAgQAAfgAAeQAAbgAAagABZwAAYQQFbQAEdwAIkVxfeAAQegAbjho3kGtzhHN4gmt8jISPmXKFlKm0kb26fv/vbc3CcfnsjMW9h/Xjc+zbgtfGeKyic//iY+7Yde/Zf//YTf/bX+rKXPHTae7UcPLYeLSjZuPAUenIXurKYu7NZevMa8q2eP/TVui/Tv/SWvLJVubAVe7IWurGXc2sUu/KYfDNZOnFYefEZvncjezdspSMdZSPgfrEROW8UuvAV+S8Wf/SZunBYfvSb/LLbuTCbbSZWO6+UOi5T+q9WOm9Wui7WfzMZOa7XOnAX+3CYuO8aevJecWufOvSmI2Gd/7FUuOvS+y5T/jEWOm3UuGyUuOyVOa2Vua4Weu7XOa5WuK2X922afjOeunFe6eNWaOZhOiuSemxS/2/VOaxUeOwUOSzWua1Xee8bOnHi9e7h/SwQPCvSOOqStykTOOsU92pU9usYuGzaP+1SdSWPd2fQt+hR+CkTP++YOKpV9ynWeGwZ9+vZ5F6WfekOeigPdubRd6nXOmXNOCVOd6YQ96ZRrWAP9ucUdieWNmobdqwe+OTPdaOPNyRQdqWSrmLWL2QXqN9UoRpSuS2gdasftOHPdWQR/yOLN6DMtuGOPufRtKDPcN/PteKRteRU5R3XOCOR5NgNtV0KJ5fMIFYOvN8KOqCPeeCP854OrSUfvaCNtV1N8RrM+xxLdl1Ou1xNNVoMtttN62Lenx6efBeHuVgI9djL+RvNsVSJMlZKutfKbpNJNdfM9NlPbtMKJ9oVeJGHsY+HdpLKdlOKpppXNc/Ics9IdlHKNVIKtc9IdNAJnlkYP0rCtI5IP0tFMwnE8YnE88sGtYxH9Q4JMw+LcQYCtEVCtUhGM8XEdYfF9YfGdIhGs8AAM4CAcEMC7EODtYaF25iYv///yH5BAEAAP8ALAAAAAAUABQAAAj/AP8JHDjQ2DOCCBOe4gYs2CtX4WIlRNjKga9k0pTlodGA1USBeiJoEjZAHTh9t1Y8iDLx0QQKtPDRc0eu3r5KJiTsSTgFA59oBt71OwBPwDUWG9ggBEQFxKhuBOyZE3cvn7gZG6C9ILipTwYvxwpYi/Sj1zxmLjZQKSJF4KFPakL4q4LNW7NlznTVQKcBBiJDAk3Z4lLiw7Zh5cZlO0dN24USPUBlEuioGCQVGhKkm1YNGbF1CDigaCMLjUBYksgcIrGAn7x27L7FUzCCyJY5gP/BUmUpSwoQHTxAYGChg4YTOQgpSiNwT6ldqLjM4IXCBxMRFU6c4dTJzY2BVhbNafoFJweONomOtDhSa5YcHQiBJMGVSoidQGOc7BC1akiXhJgs8QQdVyyhRRNhTFIHD1BcglAUMdiAxyBiCGJGHKFQckcZQ8SwFUEyYAEGEl/88YYfVyhhRBAyfCRQLo2QwgghnhSyRkIBAQA7">
苏ICP备21025343号-2
</p>
<p class="text-muted">地址:{{ .enter.Address }} 电话:{{ .enter.Cellphone }}</p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<script>
var _hmt = _hmt || [];
(function () {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?2ceaab8b624b744236dc6fddc0ab8d2c";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>
除非注明,网络人的文章均为原创,转载请以链接形式标明本文地址:https://www.55mx.com/post/191
《【GIN初体验】尝试使用Gin写一个小页面》的网友评论(0)