摘要: 先看一下表结构 type Products struct { // 商品ID ProductId int64 `json:"productId" form:"productId" gorm:"primaryKey;column:product_id" ` // 分类ID CategoryId int 阅读全文
posted @ 2023-10-31 22:59 Amani_Bey 阅读(63) 评论(0) 推荐(0) 编辑
摘要: 用的是gin,gin拦截器相对于java 的实现非常简单 package handle import ( "github.com/gin-gonic/gin" "log" "net/http" ) // AuthUser 返回类型:HandlerFunc func AuthUser() gin.Ha 阅读全文
posted @ 2023-10-31 13:56 Amani_Bey 阅读(52) 评论(0) 推荐(0) 编辑
摘要: newLogger := logger.New(log.New(os.Stdout, "\r\n", log.LstdFlags), logger.Config{ SlowThreshold: time.Second, // 满阈值 Colorful: true, // 日志颜色开启 Paramet 阅读全文
posted @ 2023-10-31 12:42 Amani_Bey 阅读(104) 评论(0) 推荐(0) 编辑