mirror of https://github.com/go-sonic/sonic.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
1012 B
Go
25 lines
1012 B
Go
2 years ago
|
package service
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
|
||
|
"github.com/go-sonic/sonic/model/dto"
|
||
|
"github.com/go-sonic/sonic/model/entity"
|
||
|
"github.com/go-sonic/sonic/model/param"
|
||
|
)
|
||
|
|
||
|
type PhotoService interface {
|
||
|
List(ctx context.Context, sort *param.Sort) ([]*entity.Photo, error)
|
||
|
Page(ctx context.Context, page param.Page, sort *param.Sort) ([]*entity.Photo, int64, error)
|
||
|
GetByID(ctx context.Context, id int32) (*entity.Photo, error)
|
||
|
Create(ctx context.Context, photoParam *param.Photo) (*entity.Photo, error)
|
||
|
Update(ctx context.Context, id int32, photoParam *param.Photo) (*entity.Photo, error)
|
||
|
Delete(ctx context.Context, id int32) error
|
||
|
ConvertToDTO(ctx context.Context, photo *entity.Photo) *dto.Photo
|
||
|
ConvertToDTOs(ctx context.Context, photos []*entity.Photo) []*dto.Photo
|
||
|
ListTeams(ctx context.Context) ([]string, error)
|
||
|
ListByTeam(ctx context.Context, team string, sort *param.Sort) ([]*entity.Photo, error)
|
||
|
IncreaseLike(ctx context.Context, id int32) error
|
||
|
GetPhotoCount(ctx context.Context) (int64, error)
|
||
|
}
|