From 4a72833f88c61ede1a4f3e2babad042e03e55770 Mon Sep 17 00:00:00 2001 From: alimy Date: Thu, 19 Feb 2026 20:46:25 +0800 Subject: [PATCH] add missing constraint for internal/dao/jinzhu --- internal/dao/jinzhu/authority.go | 2 -- internal/dao/jinzhu/comments.go | 5 ----- internal/dao/jinzhu/constraint.go | 31 ++++++++++++++++++++++++++++++- internal/dao/jinzhu/contacts.go | 2 -- internal/dao/jinzhu/following.go | 2 -- internal/dao/jinzhu/messages.go | 2 -- internal/dao/jinzhu/security.go | 2 -- internal/dao/jinzhu/timeline.go | 5 ----- internal/dao/jinzhu/topics.go | 5 ----- internal/dao/jinzhu/tweets.go | 10 ---------- internal/dao/jinzhu/user.go | 2 -- internal/dao/jinzhu/wallet.go | 2 -- 12 files changed, 30 insertions(+), 40 deletions(-) diff --git a/internal/dao/jinzhu/authority.go b/internal/dao/jinzhu/authority.go index caef4438..a86e5061 100644 --- a/internal/dao/jinzhu/authority.go +++ b/internal/dao/jinzhu/authority.go @@ -12,8 +12,6 @@ import ( "gorm.io/gorm" ) -var _ core.AuthorizationManageService = (*authorizationManageSrv)(nil) - type authorizationManageSrv struct { db *gorm.DB } diff --git a/internal/dao/jinzhu/comments.go b/internal/dao/jinzhu/comments.go index 7660dc16..d3520454 100644 --- a/internal/dao/jinzhu/comments.go +++ b/internal/dao/jinzhu/comments.go @@ -16,11 +16,6 @@ import ( "gorm.io/gorm" ) -var ( - _ core.CommentService = (*commentSrv)(nil) - _ core.CommentManageService = (*commentManageSrv)(nil) -) - type commentSrv struct { db *gorm.DB } diff --git a/internal/dao/jinzhu/constraint.go b/internal/dao/jinzhu/constraint.go index eb65e121..34f7bffa 100644 --- a/internal/dao/jinzhu/constraint.go +++ b/internal/dao/jinzhu/constraint.go @@ -2,9 +2,38 @@ package jinzhu -import "github.com/rocboss/paopao-ce/internal/core" +import ( + "github.com/rocboss/paopao-ce/internal/core" +) var ( + _ core.AuthorizationManageService = (*authorizationManageSrv)(nil) + _ core.CommentService = (*commentSrv)(nil) + _ core.CommentManageService = (*commentManageSrv)(nil) + + _ core.ContactManageService = (*contactManageSrv)(nil) + _ core.FollowingManageService = (*followingManageSrv)(nil) + + _ core.MessageService = (*messageSrv)(nil) + _ core.SecurityService = (*securitySrv)(nil) + + _ core.TopicService = (*topicSrv)(nil) + _ core.TopicServantA = (*topicSrvA)(nil) + + _ core.IndexPostsService = (*shipIndexSrv)(nil) + _ core.IndexPostsService = (*simpleIndexPostsSrv)(nil) + + _ core.TweetService = (*tweetSrv)(nil) + _ core.TweetManageService = (*tweetManageSrv)(nil) + _ core.TweetHelpService = (*tweetHelpSrv)(nil) + + _ core.TweetServantA = (*tweetSrvA)(nil) + _ core.TweetManageServantA = (*tweetManageSrvA)(nil) + _ core.TweetHelpServantA = (*tweetHelpSrvA)(nil) + + _ core.UserManageService = (*userManageSrv)(nil) + _ core.WalletService = (*walletSrv)(nil) + _ core.DataService = (*dataSrv)(nil) _ core.VersionInfo = (*dataSrv)(nil) diff --git a/internal/dao/jinzhu/contacts.go b/internal/dao/jinzhu/contacts.go index 349c605d..c8a319c8 100644 --- a/internal/dao/jinzhu/contacts.go +++ b/internal/dao/jinzhu/contacts.go @@ -14,8 +14,6 @@ import ( "gorm.io/gorm" ) -var _ core.ContactManageService = (*contactManageSrv)(nil) - type contactManageSrv struct { db *gorm.DB } diff --git a/internal/dao/jinzhu/following.go b/internal/dao/jinzhu/following.go index 19787008..0de96eec 100644 --- a/internal/dao/jinzhu/following.go +++ b/internal/dao/jinzhu/following.go @@ -12,8 +12,6 @@ import ( "gorm.io/gorm" ) -var _ core.FollowingManageService = (*followingManageSrv)(nil) - type followingManageSrv struct { db *gorm.DB f *dbr.Following diff --git a/internal/dao/jinzhu/messages.go b/internal/dao/jinzhu/messages.go index 0eb83cf3..7a53d6f7 100644 --- a/internal/dao/jinzhu/messages.go +++ b/internal/dao/jinzhu/messages.go @@ -12,8 +12,6 @@ import ( "gorm.io/gorm" ) -var _ core.MessageService = (*messageSrv)(nil) - type messageSrv struct { db *gorm.DB } diff --git a/internal/dao/jinzhu/security.go b/internal/dao/jinzhu/security.go index 4980763e..1f7cfdf3 100644 --- a/internal/dao/jinzhu/security.go +++ b/internal/dao/jinzhu/security.go @@ -15,8 +15,6 @@ import ( "gorm.io/gorm" ) -var _ core.SecurityService = (*securitySrv)(nil) - type securitySrv struct { db *gorm.DB rand *rand.Rand diff --git a/internal/dao/jinzhu/timeline.go b/internal/dao/jinzhu/timeline.go index 456d90ab..05c5f74f 100644 --- a/internal/dao/jinzhu/timeline.go +++ b/internal/dao/jinzhu/timeline.go @@ -14,11 +14,6 @@ import ( "gorm.io/gorm" ) -var ( - _ core.IndexPostsService = (*shipIndexSrv)(nil) - _ core.IndexPostsService = (*simpleIndexPostsSrv)(nil) -) - type shipIndexSrv struct { ams core.AuthorizationManageService ths core.TweetHelpService diff --git a/internal/dao/jinzhu/topics.go b/internal/dao/jinzhu/topics.go index 68b59f42..9c717d96 100644 --- a/internal/dao/jinzhu/topics.go +++ b/internal/dao/jinzhu/topics.go @@ -15,11 +15,6 @@ import ( "gorm.io/gorm" ) -var ( - _ core.TopicService = (*topicSrv)(nil) - _ core.TopicServantA = (*topicSrvA)(nil) -) - type topicSrv struct { db *gorm.DB tnTopicUser string diff --git a/internal/dao/jinzhu/tweets.go b/internal/dao/jinzhu/tweets.go index 8074d28e..b9edb666 100644 --- a/internal/dao/jinzhu/tweets.go +++ b/internal/dao/jinzhu/tweets.go @@ -17,16 +17,6 @@ import ( "gorm.io/gorm" ) -var ( - _ core.TweetService = (*tweetSrv)(nil) - _ core.TweetManageService = (*tweetManageSrv)(nil) - _ core.TweetHelpService = (*tweetHelpSrv)(nil) - - _ core.TweetServantA = (*tweetSrvA)(nil) - _ core.TweetManageServantA = (*tweetManageSrvA)(nil) - _ core.TweetHelpServantA = (*tweetHelpSrvA)(nil) -) - type tweetSrv struct { db *gorm.DB } diff --git a/internal/dao/jinzhu/user.go b/internal/dao/jinzhu/user.go index 66e6d158..265c7928 100644 --- a/internal/dao/jinzhu/user.go +++ b/internal/dao/jinzhu/user.go @@ -15,8 +15,6 @@ import ( "gorm.io/gorm" ) -var _ core.UserManageService = (*userManageSrv)(nil) - type userManageSrv struct { db *gorm.DB ums core.UserMetricServantA diff --git a/internal/dao/jinzhu/wallet.go b/internal/dao/jinzhu/wallet.go index e479bc92..ff4c98da 100644 --- a/internal/dao/jinzhu/wallet.go +++ b/internal/dao/jinzhu/wallet.go @@ -12,8 +12,6 @@ import ( "gorm.io/gorm" ) -var _ core.WalletService = (*walletSrv)(nil) - type walletSrv struct { db *gorm.DB }