woj-server/internal/service/status/service.go

37 lines
818 B
Go
Raw Normal View History

package status
import (
2023-07-14 21:47:11 +08:00
"git.0x7f.app/WOJ/woj-server/internal/e"
2023-07-15 16:19:49 +08:00
"git.0x7f.app/WOJ/woj-server/internal/misc/log"
2023-07-14 21:47:11 +08:00
"git.0x7f.app/WOJ/woj-server/internal/model"
2023-07-15 16:19:49 +08:00
"git.0x7f.app/WOJ/woj-server/internal/repo/db"
"github.com/samber/do"
"go.uber.org/zap"
)
var _ Service = (*service)(nil)
type Service interface {
Create(data *CreateData) (*model.Status, e.Status)
Query(sid uint, associations bool) (*model.Status, e.Status)
QueryByVersion(pvid uint, offset int, limit int) ([]*model.Status, e.Status)
2023-07-15 16:19:49 +08:00
HealthCheck() error
}
func NewService(i *do.Injector) (Service, error) {
return &service{
log: do.MustInvoke[log.Service](i).GetLogger("status"),
db: do.MustInvoke[db.Service](i),
}, nil
}
type service struct {
log *zap.Logger
2023-07-15 16:19:49 +08:00
db db.Service
}
2023-07-15 16:19:49 +08:00
func (s *service) HealthCheck() error {
return nil
}