11 2023 档案

摘要:一. 初始化连接 1 package model 2 3 import ( 4 "fmt" 5 6 "gorm.io/driver/mysql" 7 "gorm.io/gorm" 8 ) 9 10 /*** 11 Navicat 数据库可视化工具: https://www.navicat.com/e 阅读全文
posted @ 2023-11-27 12:47 看一百次夜空里的深蓝 阅读(276) 评论(0) 推荐(0) 编辑
摘要:一. Cookie 1 func (con UserControl) Index(c *gin.Context) { 2 /*** 设置Cookie 3 func (c *Context) SetCookie(name, value string, maxAge int, path, domain 阅读全文
posted @ 2023-11-24 19:30 看一百次夜空里的深蓝 阅读(101) 评论(0) 推荐(0) 编辑
摘要:一.中间件 1 package main 2 3 import ( 4 "fmt" 5 "gin01/middlewares" 6 "text/template" 7 "time" 8 9 "github.com/gin-gonic/gin" 10 ) 11 12 /*** 13 中间件的注意事项: 阅读全文
posted @ 2023-11-24 11:28 看一百次夜空里的深蓝 阅读(90) 评论(0) 推荐(0) 编辑
摘要:一. 请求参数的获取值 动态路由 1 type User struct { 2 Username string `form:"username" json:"username"` 3 Password string `form:"password" json:"password"` 4 Age in 阅读全文
posted @ 2023-11-23 12:37 看一百次夜空里的深蓝 阅读(163) 评论(0) 推荐(0) 编辑
摘要:一, 模板定义,模板变量,条件判断,模板函数,模板命名 1 {{define "default/index.html"}} 2 <!DOCTYPE html> 3 <html lang="en"> 4 5 <head> 6 <meta charset="UTF-8"> 7 <meta name="v 阅读全文
posted @ 2023-11-22 18:45 看一百次夜空里的深蓝 阅读(331) 评论(0) 推荐(0) 编辑
摘要:1.Gin框架搭建,初识 1 // main.go 2 package main 3 4 /*** 5 Gin入门: 6 文档: https://gin-gonic.com/zh-cn/docs/quickstart/ 7 热加载: 8 文档: https://github.com/cosmtrek 阅读全文
posted @ 2023-11-21 23:14 看一百次夜空里的深蓝 阅读(41) 评论(0) 推荐(0) 编辑
摘要:一丶Redis 1 package redis_test 2 3 import ( 4 "fmt" 5 6 "github.com/gomodule/redigo/redis" 7 ) 8 9 // 安装 10 // go get github.com/gomodule/redigo/redis 1 阅读全文
posted @ 2023-11-19 03:21 看一百次夜空里的深蓝 阅读(26) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示