摘要:
一,代码 go //上传页面 func (ic *MediaController) Upload(c *gin.Context) { c.HTML(200, "upload.html", nil) } //接收上传,多张图片 func (ic *MediaController) Uploaded(c 阅读全文
posted @ 2025-09-20 09:51
刘宏缔的架构森林
阅读(10)
评论(0)
推荐(0)
摘要:
一,安装第三方库 $ go get -u github.com/disintegration/imaging go: downloading golang.org/x/image v0.0.0-20191009234506-e7c1f5e7dbb8 go: downloading golang.or 阅读全文
posted @ 2025-09-20 09:51
刘宏缔的架构森林
阅读(15)
评论(0)
推荐(0)
摘要:
一,报错信息: fatal: 协议错误:错误的行长度字符串:This 或 fatal: protocol error: bad line length character: This 二,出现的原因: 我修改了git项目的remote地址,是因为gitolite服务换了一台服务器,报错的原因是因为新 阅读全文
posted @ 2025-09-20 09:51
刘宏缔的架构森林
阅读(49)
评论(0)
推荐(0)
摘要:
一,官网 官网: https://miromannino.github.io/Justified-Gallery/ github: https://github.com/miromannino/Justified-Gallery 二,使用 引入: <link rel="stylesheet" hre 阅读全文
posted @ 2025-09-20 09:51
刘宏缔的架构森林
阅读(12)
评论(0)
推荐(0)
摘要:
一,代码 自定义异常: package global // 自定义错误类型 type CustomError struct { Code int Error error } 抛出异常: func (ic *MediaController) List(c *gin.Context) { err:=er 阅读全文
posted @ 2025-09-20 09:46
刘宏缔的架构森林
阅读(4)
评论(0)
推荐(0)
摘要:
一,代码 初始化一个全局变量用来写日志 package global import ( "fmt" "go.uber.org/zap" "go.uber.org/zap/zapcore" "os" "sync" "time" ) //全局变量 var ( LogFileAccess *os.File 阅读全文
posted @ 2025-09-20 09:46
刘宏缔的架构森林
阅读(20)
评论(0)
推荐(0)
摘要:
一,zap库安装 $ go get -u go.uber.org/zap go: added go.uber.org/multierr v1.11.0 go: added go.uber.org/zap v1.27.0 二,代码 accesslog package middleware import 阅读全文
posted @ 2025-09-20 09:46
刘宏缔的架构森林
阅读(14)
评论(0)
推荐(0)
摘要:
一,默认html模板不会打包到二进制文件中 如果二进制文件的当前目录下不包含html模板文件路径,会报错如下 $ ./mediabank [GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery mi 阅读全文
posted @ 2025-09-20 09:46
刘宏缔的架构森林
阅读(19)
评论(0)
推荐(0)
摘要:
一,代码 controller: //得到用户信息 func (ic *MediaController) User(c *gin.Context) { if c.Request.Header.Get("X-Requested-With") == "XMLHttpRequest" { c.JSON(h 阅读全文
posted @ 2025-09-20 09:46
刘宏缔的架构森林
阅读(6)
评论(0)
推荐(0)
摘要:
一,下载jquery 官网: https://jquery.com/ 从命令行下载: $ wget https://code.jquery.com/jquery-3.7.1.min.js 二,代码: 目录结构 routes package routes import ( "github.com/gi 阅读全文
posted @ 2025-09-20 09:46
刘宏缔的架构森林
阅读(13)
评论(0)
推荐(0)
浙公网安备 33010602011771号