From 1a333302145d683d26905a7c6d26881fec1244d7 Mon Sep 17 00:00:00 2001 From: black1552 Date: Thu, 5 Mar 2026 09:47:46 +0800 Subject: [PATCH] =?UTF-8?q?refactor(curd):=20=E4=BF=AE=E6=94=B9=E5=85=B3?= =?UTF-8?q?=E8=81=94=E6=9F=A5=E8=AF=A2=E5=8F=82=E6=95=B0=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=A2=84=E5=8A=A0=E8=BD=BD=E5=87=BD=E6=95=B0?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 ClearFieldPage 方法的 with 参数从 string 类型改为 map[string]func(db gorm.PreloadBuilder) error 类型 - 将 ClearFieldList 方法的 with 参数从 string 类型改为 map[string]func(db gorm.PreloadBuilder) error 类型 - 将 ClearFieldOne 方法的 with 参数从 string 类型改为 map[string]func(db gorm.PreloadBuilder) error 类型 - 将 FindPri 方法的 with 参数从 string 类型改为 map[string]func(db gorm.PreloadBuilder) error 类型 - 将 First 方法的 with 参数从 string 类型改为 map[string]func(db gorm.PreloadBuilder) error 类型 - 将 All 方法的 with 参数从 string 类型改为 map[string]func(db gorm.PreloadBuilder) error 类型 - 将 Paginate 方法的 with 参数从 string 类型改为 map[string]func(db gorm.PreloadBuilder) error 类型 - 修改所有方法中的关联查询逻辑,从单一字符串预加载改为循环遍历预加载函数映射 - 更新参数验证条件,从判断字符串非空改为判断映射不为nil --- .idea/GOHCache.xml | 4 ++-- crud/curd.go | 57 +++++++++++++++++++++++++++++----------------- 2 files changed, 38 insertions(+), 23 deletions(-) diff --git a/.idea/GOHCache.xml b/.idea/GOHCache.xml index 4c81551..f72a8fe 100644 --- a/.idea/GOHCache.xml +++ b/.idea/GOHCache.xml @@ -242,7 +242,7 @@ -