Web应用开发 分类归档 - 永夜 https://www.shuijingwanwq.com/category/web-devel/ 没有不值得去解决的问题,也没有不值得去学习的技术! Wed, 29 Jul 2026 10:32:23 +0000 zh-Hans hourly 1 https://wordpress.org/?v=7.0.2 https://media.shuijingwanwq.com/2026/05/logo-150x150.png Web应用开发 分类归档 - 永夜 https://www.shuijingwanwq.com/category/web-devel/ 32 32 从零到一:在 Trae CN + Docker 中搭建 Go + Gin 开发环境 https://www.shuijingwanwq.com/2026/06/08/16544/ https://www.shuijingwanwq.com/2026/06/08/16544/#respond Mon, 08 Jun 2026 12:02:40 +0000 https://www.shuijingwanwq.com/?p=16544 本文记录了在 Ubuntu 26.04 上使用 Trae CN 编辑器和 Docker 容器搭建 Go + Gin 开发环境的完整流程。文章介绍了宿主机配置 Git 认证、安装 Go 及扩展的方法,重点阐述了通过挂载目录复用 Git 配置、持久化 Go 模块缓存以及在容器内成功运行 Gin 服务的步骤,最终实现了宿主机负责编辑、容器负责运行的高效工作流。

从零到一:在 Trae CN + Docker 中搭建 Go + Gin 开发环境最先出现在永夜

]]>
https://www.shuijingwanwq.com/2026/06/08/16544/feed/ 0
Ubuntu 26.04 + Docker 搭建 Go Gin 开发环境(全记录) https://www.shuijingwanwq.com/2026/06/03/15587/ https://www.shuijingwanwq.com/2026/06/03/15587/#respond Wed, 03 Jun 2026 11:44:06 +0000 https://www.shuijingwanwq.com/?p=15587 本文记录了在 Ubuntu 26.04 上利用 Docker 搭建 Go Gin 开发环境的全过程。通过编写 Dockerfile 预装 Git,构建 Go 1.26 Alpine 镜像,并编写 docker-compose.yml 接入现有的 MySQL 和 Redis 自定义网络。最终实现了在容器内运行 Gin 应用,成功验证了数据库连通性及 API 请求,实现了代码与数据库容器的分离部署。

Ubuntu 26.04 + Docker 搭建 Go Gin 开发环境(全记录)最先出现在永夜

]]>
https://www.shuijingwanwq.com/2026/06/03/15587/feed/ 0
Google网页无法编入索引?我这样解决了 https://www.shuijingwanwq.com/2026/05/21/12363/ https://www.shuijingwanwq.com/2026/05/21/12363/#respond Thu, 21 May 2026 04:42:47 +0000 https://www.shuijingwanwq.com/?p=12363 Post Views: 53 1、收到 Google Search Console 的邮件:新原因导致网站 h […]

Google网页无法编入索引?我这样解决了最先出现在永夜

]]>
https://www.shuijingwanwq.com/2026/05/21/12363/feed/ 0
当 where 中的字段包含 shipping_at_gmt 与 shipping_status|shipping_type|operated_source 时,则强制使用组合索引,否则不强制使用组合索引 https://www.shuijingwanwq.com/2026/05/14/10479/ https://www.shuijingwanwq.com/2026/05/14/10479/#respond Thu, 14 May 2026 03:09:40 +0000 https://www.shuijingwanwq.com/?p=10479 本文针对列表接口响应超时的优化过程,探讨了在 Spatie\QueryBuilder 中强制使用组合索引的适用场景。通过 SQL 执行耗时分析发现,当查询条件包含 shipping_at_gmt 与 shipping_status、shipping_type 或 operated_source 时,强制使用组合索引有效;但在包含 operator_user_id 且数据量极大时会导致负优化。基于此总结出针对性规则,最终实现后的打印调试结果符合预期。

当 where 中的字段包含 shipping_at_gmt 与 shipping_status|shipping_type|operated_source 时,则强制使用组合索引,否则不强制使用组合索引最先出现在永夜

]]>
https://www.shuijingwanwq.com/2026/05/14/10479/feed/ 0
在 Spatie\QueryBuilder 中,查询 SQL 强制使用索引 https://www.shuijingwanwq.com/2026/04/25/9583/ https://www.shuijingwanwq.com/2026/04/25/9583/#comments Sat, 25 Apr 2026 03:56:41 +0000 https://www.shuijingwanwq.com/?p=9583 针对 Spatie\QueryBuilder 中查询 SQL 强制使用索引的需求,文章参考了列表接口响应超时的优化方法,介绍了具体的实现步骤。通过配置生成的 SQL 语句已符合预期,成功强制查询使用指定索引。

在 Spatie\QueryBuilder 中,查询 SQL 强制使用索引最先出现在永夜

]]>
https://www.shuijingwanwq.com/2026/04/25/9583/feed/ 1
WSL-Ubuntu 下 Docker 搭建 Hyperf:从启动失败到最佳开发结构 https://www.shuijingwanwq.com/2026/04/08/9440/ https://www.shuijingwanwq.com/2026/04/08/9440/#respond Wed, 08 Apr 2026 08:41:34 +0000 https://www.shuijingwanwq.com/?p=9440 本文记录了在 WSL-Ubuntu 环境下使用 Docker 搭建 Hyperf 框架时解决 Redis 连接失败问题的过程。文章排查了连接拒绝的原因,确立了基于 WSL 的最佳开发架构,通过创建 Docker 公共网络实现了 Redis、MySQL 容器与 Hyperf 项目的互通。最终通过修改 .env 配置文件,成功启动服务并实现了通过 localhost 访问。

WSL-Ubuntu 下 Docker 搭建 Hyperf:从启动失败到最佳开发结构最先出现在永夜

]]>
https://www.shuijingwanwq.com/2026/04/08/9440/feed/ 0
在 WSL-Ubuntu 中 Docker 下安装 Hyperf https://www.shuijingwanwq.com/2026/04/07/9435/ https://www.shuijingwanwq.com/2026/04/07/9435/#comments Tue, 07 Apr 2026 09:50:54 +0000 https://www.shuijingwanwq.com/?p=9435 本文记录了在 WSL-Ubuntu 环境下的 Docker 中安装 Hyperf 项目的全过程。操作中主要遇到了因容器 PHP 版本与 Pest 测试框架依赖不匹配而导致的 Composer 报错问题。作者分析了版本冲突原因,并通过在安装时跳过 Pest 组件及清理容器目录的方案,最终成功创建了 Hyperf 项目。

在 WSL-Ubuntu 中 Docker 下安装 Hyperf最先出现在永夜

]]>
https://www.shuijingwanwq.com/2026/04/07/9435/feed/ 1
Go + Gin 实战 RESTful API:从环境搭建(WSL/Docker/VS Code)到 Git 提交与 GitHub 托管 https://www.shuijingwanwq.com/2026/04/03/9416/ https://www.shuijingwanwq.com/2026/04/03/9416/#respond Fri, 03 Apr 2026 04:11:30 +0000 https://www.shuijingwanwq.com/?p=9416 本文记录了使用 Go 和 Gin 构建 RESTful API 的全过程,涵盖了 WSL 与 Docker 的环境配置。文章首先尝试了 GoLand 配合 Docker,但因路径映射和 GOROOT 配置的复杂性,最终转向 VS Code 结合 Dev Containers。通过配置 devcontainer.json 和 docker-compose.yml,实现了在容器内挂载代码、安装依赖及运行服务。文章还解决了 Go 版本不兼容导致的依赖获取问题,并完成了代码向 GitHub 仓库的提交与托管配置。

Go + Gin 实战 RESTful API:从环境搭建(WSL/Docker/VS Code)到 Git 提交与 GitHub 托管最先出现在永夜

]]>
https://www.shuijingwanwq.com/2026/04/03/9416/feed/ 0
在 WSL-Ubuntu 中 Docker 下安装 Hyperf https://www.shuijingwanwq.com/2026/03/20/9355/ https://www.shuijingwanwq.com/2026/03/20/9355/#respond Fri, 20 Mar 2026 03:32:36 +0000 https://www.shuijingwanwq.com/?p=9355 本文记录了在 WSL-Ubuntu 环境下利用 Docker 安装 Hyperf 框架的过程。在完成目录创建与挂载配置后,项目创建初期因容器内 PHP 版本为 8.1,无法满足 Pest 测试框架及其依赖对 PHP 8.2 的要求,导致依赖解析失败。最终通过清理容器内残留文件并在安装过程中跳过 Pest 组件,成功完成了 Hyperf 项目的创建。

在 WSL-Ubuntu 中 Docker 下安装 Hyperf最先出现在永夜

]]>
https://www.shuijingwanwq.com/2026/03/20/9355/feed/ 0
在 phpstorm 中提示:@property-read https://www.shuijingwanwq.com/2025/08/27/9286/ https://www.shuijingwanwq.com/2025/08/27/9286/#respond Wed, 27 Aug 2025 02:51:49 +0000 mailer]]> https://www.shuijingwanwq.com/?p=9286 文章针对 PHPStorm 中提示 @property-read 错误的问题进行了分析,指出在 Yii2 框架的 yii\swiftmailer\Mailer 组件中,transport 并非通过公开属性设置,而是通过 setTransport() 方法进行配置。由于直接设置属性的方式属于间接调用 magic setter,导致 PHPStorm 无法通过静态分析识别该属性。文章最终通过调整配置方式解决了该报错,使代码不再出现提示。

在 phpstorm 中提示:@property-read最先出现在永夜

]]>
https://www.shuijingwanwq.com/2025/08/27/9286/feed/ 0