25 lines
458 B
Go
25 lines
458 B
Go
package bd
|
|
|
|
import (
|
|
"git.ukamnya.ru/stulyaganov/RestApi/internal/bd/model"
|
|
)
|
|
|
|
type Filmsrepo struct {
|
|
db Bd
|
|
}
|
|
|
|
func (f *Filmsrepo) Create(m *model.Films) (*model.Films, error) {
|
|
if err := f.db.db.QueryRow(
|
|
"INSERT INTO films (id, ru_title, orig_title) VALUES($1, $2, $3) RETURNING id",
|
|
m.Id, m.Ru_title, m.Orig_title).Scan(&m.Id); err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return m, nil
|
|
|
|
}
|
|
|
|
func FindDyId(id int) (*model.Films, error) {
|
|
return nil, nil
|
|
}
|