github.com/k0marov/go-socnet@v0.0.0-20220715154813-90d07867c782/features/posts/domain/entities/entities.go (about) 1 package entities 2 3 import ( 4 "github.com/k0marov/go-socnet/core/abstract/ownable_likeable/contexters" 5 "github.com/k0marov/go-socnet/core/general/static_store" 6 "github.com/k0marov/go-socnet/features/posts/domain/models" 7 "github.com/k0marov/go-socnet/features/posts/domain/values" 8 profile_entities "github.com/k0marov/go-socnet/features/profiles/domain/entities" 9 ) 10 11 type Post struct { 12 models.PostModel 13 Images []values.PostImage 14 Likes int 15 } 16 17 type ContextedPost struct { 18 Post 19 contexters.OwnLikeContext 20 Author profile_entities.ContextedProfile 21 } 22 23 func ImagePathsToUrls(models []models.PostImageModel) (images []values.PostImage) { 24 for _, model := range models { 25 images = append(images, values.PostImage{ 26 URL: static_store.PathToURL(model.Path), 27 Index: model.Index, 28 }) 29 } 30 return 31 }