Create share table and repository. (#930)
* Add share table and repository * Add datastore mock * Try fixing indent * Try fixing indent - 2 * Try fixing indent - 3 * Implement rest.Repository and rest.Persistance * Renew date * Better error handling * Improve field name * Fix json name conventionally
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"time"
|
||||
)
|
||||
|
||||
type Share struct {
|
||||
ID string `json:"id" orm:"column(id)"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
ExpiresAt time.Time `json:"expiresAt"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
LastVisitedAt time.Time `json:"lastVisitedAt"`
|
||||
ResourceIDs string `json:"resourceIds" orm:"column(resource_ids)"`
|
||||
ResourceType string `json:"resourceType"`
|
||||
VisitCount string `json:"visitCount"`
|
||||
}
|
||||
|
||||
type Shares []Share
|
||||
|
||||
type ShareRepository interface {
|
||||
Put(s *Share) error
|
||||
GetAll(options ...QueryOptions) (Shares, error)
|
||||
}
|
||||
Reference in New Issue
Block a user