mirror of
https://github.com/usual2970/certimate.git
synced 2025-07-28 21:24:28 +00:00
Implement complete workflow execution process
This commit is contained in:
@@ -2,8 +2,11 @@ package repository
|
||||
|
||||
import (
|
||||
"context"
|
||||
"database/sql"
|
||||
"errors"
|
||||
|
||||
"github.com/usual2970/certimate/internal/domain"
|
||||
"github.com/usual2970/certimate/internal/utils/app"
|
||||
)
|
||||
|
||||
type AccessRepository struct{}
|
||||
@@ -13,5 +16,24 @@ func NewAccessRepository() *AccessRepository {
|
||||
}
|
||||
|
||||
func (a *AccessRepository) GetById(ctx context.Context, id string) (*domain.Access, error) {
|
||||
return nil, nil
|
||||
record, err := app.GetApp().Dao().FindRecordById("access", id)
|
||||
if err != nil {
|
||||
if errors.Is(err, sql.ErrNoRows) {
|
||||
return nil, domain.ErrRecordNotFound
|
||||
}
|
||||
return nil, err
|
||||
}
|
||||
|
||||
rs := &domain.Access{
|
||||
Meta: domain.Meta{
|
||||
Id: record.GetId(),
|
||||
Created: record.GetTime("created"),
|
||||
Updated: record.GetTime("updated"),
|
||||
},
|
||||
Name: record.GetString("name"),
|
||||
Config: record.GetString("config"),
|
||||
ConfigType: record.GetString("configType"),
|
||||
Usage: record.GetString("usage"),
|
||||
}
|
||||
return rs, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user