上一页 1 ··· 87 88 89 90 91 92 93 94 95 ··· 203 下一页
摘要: 一,代码: func SetupRoutes(viewEngine *html.Engine) *fiber.App { // 创建 Fiber 应用 app := fiber.New(fiber.Config{ Views: viewEngine, }) app.Use(recover.New() 阅读全文
posted @ 2024-12-07 10:50 刘宏缔的架构森林 阅读(46) 评论(0) 推荐(0)
摘要: 一,官方文档地址: https://gorm.io/zh_CN/docs/logger.html 二,代码例子: 1,写日志到文件的函数: // 日志写入到文件 func LogToFile(filename,msg string) { // 输出到文件 //filename := "logs/" 阅读全文
posted @ 2024-12-07 10:49 刘宏缔的架构森林 阅读(236) 评论(0) 推荐(0)
摘要: 一,代码: <?php //调用函数一 function afunc($b, $c) { echo "afunc:参数b:".$b.":<br/>"; echo "afunc:参数c:".$c.":<br/>"; } //调用函数二 function bfunc($b, $c) { $sum = $ 阅读全文
posted @ 2024-12-01 17:00 刘宏缔的架构森林 阅读(138) 评论(0) 推荐(0)
摘要: 一,go-playground/validator官方代码地址 https://github.com/go-playground/validator 二,安装 $ go get -u github.com/go-playground/validator/v10 go: downloading git 阅读全文
posted @ 2024-11-30 11:10 刘宏缔的架构森林 阅读(435) 评论(0) 推荐(0)
摘要: 一,创建索引 CREATE FULLTEXT INDEX ft_content ON table_name (content) WITH PARSER ngram; 表名和字段可以用``表示引用 说明:创建全文索引时,如果不添加WITH PARSER ngram;有可能会检索不到结果 二,测试: 1 阅读全文
posted @ 2024-11-30 10:49 刘宏缔的架构森林 阅读(193) 评论(0) 推荐(0)
摘要: 一,代码 1,全局文件: // 日志消息结构体 type LogMessage struct { Level string Message string } //通道 var LogChan chan LogMessage //日志文件句柄 var GlobalLogFile *os.File // 阅读全文
posted @ 2024-11-30 10:48 刘宏缔的架构森林 阅读(119) 评论(0) 推荐(0)
摘要: 一,现象: 如果填写参数时使用的是params类型,而value中包含+,则此时的值在提交到线上时会被替换成空格,原因是:使用params类型参数和值会拼接在url中 二,解决: 在body标签下,使用form-data类型,此时的各项值不会被拼接到url中,+也就不会被替换成空格了 阅读全文
posted @ 2024-11-27 09:57 刘宏缔的架构森林 阅读(302) 评论(0) 推荐(0)
摘要: 一,代码: Unicode是为了解决传统的字符编码方案的局限而产生的,它为每种语言中的每个字符设定了统一并且唯一的二进制编码, 以满足跨语言、跨平台进行文本转换、处理的要求 package controller import ( "encoding/json" "fmt" "github.com/g 阅读全文
posted @ 2024-11-25 19:43 刘宏缔的架构森林 阅读(66) 评论(0) 推荐(0)
摘要: 一,代码: package main import ( "embed" "flag" "github.com/gofiber/template/html/v2" "net/http" "fmt" "runtime" "industry/config" "industry/routes" ) // 构 阅读全文
posted @ 2024-11-23 10:43 刘宏缔的架构森林 阅读(87) 评论(0) 推荐(0)
摘要: 一,官方网站: https://gorm.io/ 如图: 二,安装: 从命令行安装gorm $ go get -u gorm.io/gorm go: downloading gorm.io/gorm v1.25.12 go: downloading github.com/jinzhu/now v1. 阅读全文
posted @ 2024-11-23 09:18 刘宏缔的架构森林 阅读(345) 评论(0) 推荐(0)
上一页 1 ··· 87 88 89 90 91 92 93 94 95 ··· 203 下一页