37 lines
832 B
Go
37 lines
832 B
Go
package status
|
|
|
|
import (
|
|
"git.0x7f.app/WOJ/woj-server/internal/e"
|
|
"git.0x7f.app/WOJ/woj-server/internal/misc/log"
|
|
"git.0x7f.app/WOJ/woj-server/internal/model"
|
|
"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, count *int64) ([]*model.Status, e.Status)
|
|
|
|
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
|
|
db db.Service
|
|
}
|
|
|
|
func (s *service) HealthCheck() error {
|
|
return nil
|
|
}
|