Skip to content

Commit

Permalink
feat: scaffold group repo, svc
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Jun 26, 2024
1 parent ef6e70c commit 288bf83
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
18 changes: 18 additions & 0 deletions internal/group/group.repository.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package group

import (
"gorm.io/gorm"
)

type Repository interface {
}

type repositoryImpl struct {
Db *gorm.DB
}

func NewRepository(db *gorm.DB) Repository {
return &repositoryImpl{
Db: db,
}
}
30 changes: 30 additions & 0 deletions internal/group/group.service.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package group

import (
"context"

"github.com/isd-sgcu/rpkm67-backend/internal/cache"
proto "github.com/isd-sgcu/rpkm67-go-proto/rpkm67/backend/group/v1"
"go.uber.org/zap"
)

type Service interface {
proto.GroupServiceServer
}

type serviceImpl struct {
proto.UnimplementedGroupServiceServer
cache *cache.Repository
log *zap.Logger
}

func NewService(cache *cache.Repository, log *zap.Logger) Service {
return &serviceImpl{
cache: cache,
log: log,
}
}

func (s *serviceImpl) FindOne(_ context.Context, in *proto.FindOneGroupRequest) (res *proto.FindOneGroupResponse, err error) {
return nil, nil
}

0 comments on commit 288bf83

Please sign in to comment.