Initial commit

This commit is contained in:
KamilM1205 2025-09-16 13:26:27 +04:00
commit c0cb826917
63 changed files with 2069 additions and 0 deletions

View file

@ -0,0 +1,33 @@
package entities
import (
"errors"
"github.com/google/uuid"
)
const ImagesTable = "images"
type Images struct {
Id uuid.UUID `db:"id"`
Path string `db:"path"`
}
func CreateImage(path string) (image Images, err error) {
image = Images{
Id: uuid.New(),
Path: path,
}
err = image.Validate()
return
}
func (i *Images) Validate() error {
if i.Path == "" {
return errors.New("Empty image.path")
}
return nil
}