34 lines
719 B
Go
34 lines
719 B
Go
package store
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
type Post struct {
|
|
ID int64 `json:"id"`
|
|
Content string `json:"content"`
|
|
Title string `json:"title"`
|
|
UserID int64 `json:"user_id"`
|
|
Tags []int64 `json:"tags"`
|
|
ReplyIDs []int64 `json:"reply_ids"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type User struct {
|
|
ID int64 `json:"id"`
|
|
Username string `json:"username"`
|
|
Email int64 `json:"email"`
|
|
Password string `json:"-"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
type Storage struct {
|
|
Posts interface {
|
|
Create(context.Context, *Post) error
|
|
}
|
|
Users interface {
|
|
Create(context.Context, *User) error
|
|
}
|
|
}
|