diff --git a/internal/dao/slonik/following.go b/internal/dao/slonik/following.go new file mode 100644 index 00000000..bf34a0b5 --- /dev/null +++ b/internal/dao/slonik/following.go @@ -0,0 +1,56 @@ +// Copyright 2023 ROC. All rights reserved. +// Use of this source code is governed by a MIT style +// license that can be found in the LICENSE file. + +package slonik + +import ( + "github.com/jackc/pgx/v5" + "github.com/rocboss/paopao-ce/internal/core" + "github.com/rocboss/paopao-ce/internal/core/cs" + "github.com/rocboss/paopao-ce/internal/core/ms" +) + +var ( + _ core.FollowingManageService = (*followingManageSrv)(nil) +) + +type followingManageSrv struct { + *pgxSrv +} + +func (s *followingManageSrv) FollowUser(userId int64, followId int64) error { + // TODO + return cs.ErrNotImplemented +} + +func (s *followingManageSrv) UnfollowUser(userId int64, followId int64) error { + // TDOO + return cs.ErrNotImplemented +} + +func (s *followingManageSrv) ListFollows(userId int64, limit, offset int) (*ms.ContactList, error) { + // TODO + return nil, cs.ErrNotImplemented +} + +func (s *followingManageSrv) ListFollowings(userId int64, limit, offset int) (*ms.ContactList, error) { + // TODO + return nil, cs.ErrNotImplemented +} + +func (s *followingManageSrv) GetFollowCount(userId int64) (int64, int64, error) { + // TODO + return 0, 0, cs.ErrNotImplemented +} + +func (s *followingManageSrv) IsFollow(userId int64, followId int64) bool { + // TODO + return false +} + +func newFollowingManageService(db *pgx.Conn) core.FollowingManageService { + return &followingManageSrv{ + pgxSrv: newPgxSrv(db), + } +} diff --git a/internal/dao/slonik/slonik.go b/internal/dao/slonik/slonik.go index ae48ff88..280c2b46 100644 --- a/internal/dao/slonik/slonik.go +++ b/internal/dao/slonik/slonik.go @@ -33,6 +33,7 @@ type dataSrv struct { core.CommentManageService core.UserManageService core.ContactManageService + core.FollowingManageService core.SecurityService core.AttachmentCheckService } @@ -99,6 +100,7 @@ func NewDataService() (core.DataService, core.VersionInfo) { CommentManageService: newCommentManageService(db), UserManageService: newUserManageService(db), ContactManageService: newContactManageService(db), + FollowingManageService: newFollowingManageService(db), SecurityService: newSecurityService(db, pvs), AttachmentCheckService: security.NewAttachmentCheckService(), }