摘要: 关于解决mapping映射失败的问题 具体报错:Failed to parse content to map [type=parse_exception] 我的代码类似于: func (demo DemoModel) Mapping() string { return ` { "settings": 阅读全文
posted @ 2025-04-09 10:42 小依昂阳 阅读(76) 评论(0) 推荐(0)
摘要: 关于解决es连接服务器失败的问题 由于我是在linux虚拟机中使用docker容器运行的es服务,但是我在windows的es客户端使用了默认的服务器连接,即"127.0.0.1:9200",导致服务器连接失败。 我们将服务器替换为linux虚拟机中的ip+port即可,我这里是"192.168.8 阅读全文
posted @ 2025-04-09 10:42 小依昂阳 阅读(69) 评论(0) 推荐(0)
摘要: 关于解决es创建索引出现(Method Not Allowed)的问题 具体报错:elastic: Error 405 (Method Not Allowed) 以下是我的代码 client, err = elastic.NewClient( elastic.SetURL("http://local 阅读全文
posted @ 2025-04-09 10:42 小依昂阳 阅读(39) 评论(0) 推荐(0)
摘要: 关于解决es创建doc数据时missing field [Type]的问题 ‎‎2024‎年‎4‎月‎17‎日,‏‎21:36:08 具体报错:missing required fields: [Type] 这是我没有使用gin框架时候的测试代码: func Create(data *DemoMod 阅读全文
posted @ 2025-04-09 10:42 小依昂阳 阅读(71) 评论(0) 推荐(0)
摘要: windows下解决cgo编译报错 测试代码如下: // test.go package main /* #cgo LDFLAGS: -L D:\desktop\app\code\go_study\cgo_ffmpeg\ffmpeg\lib -lavcodec #include <libavcode 阅读全文
posted @ 2025-04-09 10:36 小依昂阳 阅读(186) 评论(0) 推荐(0)
摘要: go-zero日志的优化 在你生成的 etc/xxx.yaml 文件下添加Log的配置 Name: auth Host: 0.0.0.0 Port: 8888 Log: ServiceName: auth Encoding: plain Stat: false TimeFormat: 2006-01 阅读全文
posted @ 2025-04-09 10:36 小依昂阳 阅读(17) 评论(0) 推荐(0)
摘要: goctl template模板的使用 # 在指定目录下生成模板 goctl template init --home ./template # 使用指定模板生成代码 goctl api go -api ./auth/auth_api/auth.api -dir ./auth/auth_api -- 阅读全文
posted @ 2025-04-09 10:36 小依昂阳 阅读(39) 评论(0) 推荐(0)