上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 192 下一页
摘要: 一,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 刘宏缔的架构森林 阅读(59) 评论(0) 推荐(0)
摘要: 一,默认html模板不会打包到二进制文件中 如果二进制文件的当前目录下不包含html模板文件路径,会报错如下 $ ./mediabank [GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery mi 阅读全文
posted @ 2025-09-20 09:46 刘宏缔的架构森林 阅读(47) 评论(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 刘宏缔的架构森林 阅读(14) 评论(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 刘宏缔的架构森林 阅读(22) 评论(0) 推荐(0)
摘要: 一,go代码: 目录结构: routes package routes import ( "github.com/gin-gonic/gin" "mediabank/controller" ) func Routes() *gin.Engine { router := gin.Default() / 阅读全文
posted @ 2025-09-20 09:46 刘宏缔的架构森林 阅读(23) 评论(0) 推荐(0)
摘要: 一,目录结构 二,代码 controller package controller import ( "github.com/gin-gonic/gin" "net/http" ) type MediaController struct{} func NewMediaController() Med 阅读全文
posted @ 2025-09-20 09:46 刘宏缔的架构森林 阅读(19) 评论(0) 推荐(0)
摘要: 一,从官网下载 官方站: https://golang.google.cn/dl/ 从命令行下载: $ wget https://golang.google.cn/dl/go1.25.1.linux-amd64.tar.gz 二,安装 解压: $ tar -zxvf go1.25.1.linux-a 阅读全文
posted @ 2025-09-20 09:46 刘宏缔的架构森林 阅读(628) 评论(0) 推荐(0)
摘要: 一,创建项目 $ mkdir mediabank $ cd mediabank/ $ go mod init mediabank go: creating new go.mod: module mediabank $ go get github.com/gin-gonic/gin@latest 二, 阅读全文
posted @ 2025-09-20 09:46 刘宏缔的架构森林 阅读(41) 评论(0) 推荐(0)
摘要: 一,代码: 在activity中增加一行: getSupportActionBar()?.hide() 例子: class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) 阅读全文
posted @ 2025-09-06 22:07 刘宏缔的架构森林 阅读(25) 评论(0) 推荐(0)
摘要: 一,引入lifecycle 1,libs.versions.toml [versions] lifecycle = "2.9.1" [libraries] # lifecycle androidx-lifecycle-livedata-core-ktx = { group = "androidx.l 阅读全文
posted @ 2025-09-06 22:07 刘宏缔的架构森林 阅读(49) 评论(0) 推荐(0)
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 192 下一页