feat(auth): 添加完整的用户认证API项目

- 实现用户注册、登录、JWT令牌认证功能
- 集成Gin、GORM、Viper、Zap等框架
- 添加密码加密、数据库操作、中间件等完整功能
- 配置多环境支持、日志轮转、CORS处理
- 创建完整的项目结构和配置文件体系
This commit is contained in:
liumangmang
2025-12-30 18:00:42 +08:00
parent 7f4527d501
commit b010f82221
139 changed files with 2772 additions and 103 deletions

View File

@@ -0,0 +1,24 @@
package main
import (
"fmt"
"time"
)
func main() {
ch := make(chan string) // 无缓冲 channel
go func() {
fmt.Println("[Sender] 准备发送数据...")
ch <- "hello from goroutine" // 这里会阻塞,直到有人接收
fmt.Println("[Sender] 数据发送完毕")
}()
time.Sleep(1 * time.Second)
fmt.Println("[Main] 1 秒后开始接收数据...")
msg := <-ch // 接收数据,同时解除发送方阻塞
fmt.Println("[Main] 收到:", msg)
fmt.Println("[Main] 程序结束")
}