refac: remove frontend & clearer DDD
This commit is contained in:
1 parent
6796ce63cb
commit
61a84201d8
212 files changed
+2097
-13007
No files matched your search
@@ -0,0 +1,23 @@
|
||||
package image
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Image struct {
|
||||
ID uint32 `json:"id"`
|
||||
Path string `json:"path"`
|
||||
ArticleID uint32 `json:"article_id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
func FromDB(id uint32, path string, articleId uint32, createdAt time.Time, updatedAt time.Time) Image {
|
||||
return Image{
|
||||
ID: id,
|
||||
Path: path,
|
||||
ArticleID: articleId,
|
||||
CreatedAt: createdAt,
|
||||
UpdatedAt: updatedAt,
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package image
|
||||
|
||||
import (
|
||||
"mime/multipart"
|
||||
)
|
||||
|
||||
type Repository interface {
|
||||
Create(file multipart.File, fileHeader multipart.FileHeader) (Image, error)
|
||||
Delete(id uint32) error
|
||||
}
|
||||
Reference in new issue
Block a user