From b4d3a41459c9e9799ee83c99c3b05de356beb944 Mon Sep 17 00:00:00 2001 From: xing Date: Wed, 24 May 2023 21:57:28 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"=E5=B0=8F=E4=BC=98"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4705d17e0eefda0f2f045ecb93e547513b24af8c. --- model/relation.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/model/relation.go b/model/relation.go index 31e0db7..cca14dd 100644 --- a/model/relation.go +++ b/model/relation.go @@ -23,7 +23,7 @@ const ( // Relationship join table // -// # RelationType HasOne| HasMany +// RelationType HasOne| HasMany // // eg: hasOne, post has a user. ForeignKey is user's id , Local is post's userId field // @@ -166,7 +166,7 @@ func SetHasMany[T, V any, K comparable](assignmentFn func(*T, *[]V), pIdFn func( // RelationHasOne // eg: post has a user. fId is post's userId, pId is user's id -func RelationHasOne[M, P any, I constraints.Integer | constraints.Unsigned](fId func(*M) I, pId func(*P) I, setVal func(*M, *P), r Relationship) RelationFn { +func RelationHasOne[M, P any, I constraints.Integer | uint64](fId func(*M) I, pId func(*P) I, setVal func(*M, *P), r Relationship) RelationFn { idFn := GetWithID(fId) setFn := SetHasOne(setVal, fId, pId) return func() (func(any) []any, func(any, any), any, any, Relationship) { @@ -177,8 +177,8 @@ func RelationHasOne[M, P any, I constraints.Integer | constraints.Unsigned](fId } // RelationHasMany -// eg: post has many comments,mId is post's id, pId is comment's postId -func RelationHasMany[M, P any, I constraints.Integer | constraints.Unsigned](mId func(*M) I, pId func(*P) I, setVal func(*M, *[]P), r Relationship) RelationFn { +// eg: post has many comments,mId is comment's postId, pId is post's id +func RelationHasMany[M, P any, I constraints.Integer | uint64](mId func(*M) I, pId func(*P) I, setVal func(*M, *[]P), r Relationship) RelationFn { idFn := GetWithID(mId) setFn := SetHasMany(setVal, mId, pId) return func() (func(any) []any, func(any, any), any, any, Relationship) {