Documentation ¶
Index ¶
- type Controller
- type Dao
- type DbDao
- func (db DbDao) DeletePhoto(imageUuid uuid.UUID) error
- func (db DbDao) GetPhotoById(imageUuid uuid.UUID) (*EntityPhotoInfo, error)
- func (db DbDao) GetPhotoByIdAs(photoId uuid.UUID, userId uuid.UUID) (*EntityPhotoAuthorInfo, error)
- func (db DbDao) ListUsersPhotoAfter(authorUuid uuid.UUID, searchAsUuid uuid.UUID, afterPhotoId uuid.UUID, ...) ([]EntityPhotoAuthorInfo, error)
- func (db DbDao) NewPhotoPerUser(photoId uuid.UUID, userId uuid.UUID, imageUrl string) error
- type EntityPhotoAuthorInfo
- type EntityPhotoInfo
- type IdParam
- type Photo
- type Service
- type ServiceImpl
- func (service ServiceImpl) CreatePost(userId string, imageData []byte, logger logrus.FieldLogger) (Photo, error)
- func (service ServiceImpl) DeletePostAs(imageId string, userId string) error
- func (service ServiceImpl) GetPhotoByIdAs(photoId string, searchAs string) (*Photo, error)
- func (service ServiceImpl) GetPostAuthorById(imageId string) (string, error)
- func (service ServiceImpl) GetUsersPhotosPage(id string, searchAs string, pageCursor string) ([]Photo, *string, error)
- type UserPhotosCursor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
Service Service
}
func (Controller) ListRoutes ¶
func (controller Controller) ListRoutes() []route.Route
type Dao ¶
type Dao interface { GetPhotoByIdAs(photoId uuid.UUID, userId uuid.UUID) (*EntityPhotoAuthorInfo, error) NewPhotoPerUser(photoId uuid.UUID, userId uuid.UUID, imageUrl string) error DeletePhoto(imageUuid uuid.UUID) error GetPhotoById(imageUuid uuid.UUID) (*EntityPhotoInfo, error) ListUsersPhotoAfter(authorUuid uuid.UUID, searchAsUuid uuid.UUID, afterPhotoId uuid.UUID, beforeDate string) ([]EntityPhotoAuthorInfo, error) }
type DbDao ¶
type DbDao struct { Time timeprovider.TimeProvider Db database.AppDatabase }
func (DbDao) GetPhotoById ¶
func (db DbDao) GetPhotoById(imageUuid uuid.UUID) (*EntityPhotoInfo, error)
func (DbDao) GetPhotoByIdAs ¶
func (DbDao) ListUsersPhotoAfter ¶
type EntityPhotoAuthorInfo ¶
type EntityPhotoAuthorInfo struct { user.ModelUserWithCustom // contains filtered or unexported fields }
func ParsePhotoEntity ¶
func ParsePhotoEntity(rows database.StructRows) ([]EntityPhotoAuthorInfo, error)
type EntityPhotoInfo ¶
type Photo ¶
type Photo struct { Id string `json:"id"` Author user.User `json:"author"` PublishDate time.Time `json:"publishDate"` LikesCount uint `json:"likesCount"` CommentsCount uint `json:"commentsCount"` Liked bool `json:"liked"` ImageUrl string `json:"imageUrl"` }
func DbPhotosListToPage ¶
func DbPhotosListToPage(dbPhotos []EntityPhotoAuthorInfo) (photos []Photo, pageCursor *string)
func (*Photo) AddImageHost ¶
func (photo *Photo) AddImageHost(r *http.Request, logger logrus.FieldLogger)
type Service ¶
type Service interface { CreatePost(userId string, imageData []byte, logger logrus.FieldLogger) (Photo, error) DeletePostAs(imageId string, userId string) error GetPostAuthorById(imageId string) (string, error) GetUsersPhotosPage(id string, searchAs string, cursor string) ([]Photo, *string, error) GetPhotoByIdAs(photoId string, searchAs string) (*Photo, error) }
type ServiceImpl ¶
type ServiceImpl struct { Db Dao Storage storage.Storage ImageProcessor imageProcessor UserService user.Service BanService user.BanService }
func (ServiceImpl) CreatePost ¶
func (service ServiceImpl) CreatePost(userId string, imageData []byte, logger logrus.FieldLogger) (Photo, error)
func (ServiceImpl) DeletePostAs ¶
func (service ServiceImpl) DeletePostAs(imageId string, userId string) error
func (ServiceImpl) GetPhotoByIdAs ¶
func (service ServiceImpl) GetPhotoByIdAs(photoId string, searchAs string) (*Photo, error)
func (ServiceImpl) GetPostAuthorById ¶
func (service ServiceImpl) GetPostAuthorById(imageId string) (string, error)
func (ServiceImpl) GetUsersPhotosPage ¶
type UserPhotosCursor ¶
type UserPhotosCursor struct { api.PaginationInfo user.IdParams }
Click to show internal directories.
Click to hide internal directories.