github.com/k0marov/go-socnet@v0.0.0-20220715154813-90d07867c782/features/posts/domain/models/models.go (about)

     1  package models
     2  
     3  import (
     4  	"github.com/k0marov/go-socnet/core/general/core_values"
     5  	"time"
     6  
     7  	"github.com/k0marov/go-socnet/features/posts/domain/values"
     8  )
     9  
    10  type PostToCreate struct {
    11  	Author    core_values.UserId
    12  	Text      string
    13  	CreatedAt time.Time
    14  }
    15  
    16  type PostImageModel struct {
    17  	Index int                    `db:"ind"`
    18  	Path  core_values.StaticPath `db:"path"`
    19  }
    20  
    21  type PostModel struct {
    22  	Id        values.PostId      `db:"id"`
    23  	AuthorId  core_values.UserId `db:"owner_id"`
    24  	Text      string             `db:"textContent"`
    25  	CreatedAt int64              `db:"createdAt"`
    26  	Images    []PostImageModel
    27  }