Documentation ¶
Index ¶
- Variables
- type Deps
- type INewsService
- type NewsCreateInput
- type NewsExport
- type NewsExportInput
- type NewsImportDataInput
- type NewsImportInput
- type NewsMassDeleteInput
- type NewsMassUpdateInput
- type NewsService
- func (s NewsService) Create(ctx context.Context, input NewsCreateInput) (*model.News, error)
- func (s NewsService) Delete(ctx context.Context, id int) error
- func (s NewsService) Export(ctx context.Context, data []byte) (*model3.Message, error)
- func (s NewsService) ExportList(ctx context.Context) ([]model.News, error)
- func (s NewsService) GetById(ctx context.Context, id int) (*model.News, error)
- func (s NewsService) Import(ctx context.Context, data []byte) (*model3.Message, error)
- func (s NewsService) List(ctx context.Context, m *model2.Meta[model.News]) error
- func (s NewsService) MassDelete(ctx context.Context, data []byte) (*model3.Message, error)
- func (s NewsService) MassUpdate(ctx context.Context, data []byte) (*model3.Message, error)
- func (s NewsService) Trx(db *gorm.DB) INewsService
- func (s NewsService) Update(ctx context.Context, id int, input NewsUpdateInput) error
- type NewsUpdateInput
- type Services
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNewsNotFound = apperr.New("news_not_found", apperr.WithTextTranslate(i18n.ErrNewsNotFound), apperr.WithCode(code.NotFound)) ErrNewsListIsEmpty = apperr.New("news_list_is_empty", apperr.WithTextTranslate(i18n.ErrNewsListIsEmpty), apperr.WithCode(code.NotFound)) ErrNewsExists = apperr.New("news_exists_error", apperr.WithTextTranslate(i18n.ErrNewsExists), apperr.WithCode(code.InvalidArgument)) )
Functions ¶
This section is empty.
Types ¶
type Deps ¶
type Deps struct {
Repositories repository.Repositories
}
type INewsService ¶
type INewsService interface { task.Consumer Trx(db *gorm.DB) INewsService List(ctx context.Context, m *model2.Meta[model.News]) error ExportList(ctx context.Context) ([]model.News, error) GetById(ctx context.Context, id int) (*model.News, error) Create(ctx context.Context, input NewsCreateInput) (*model.News, error) Update(ctx context.Context, id int, input NewsUpdateInput) error Delete(ctx context.Context, id int) error }
type NewsCreateInput ¶
type NewsExport ¶
type NewsExportInput ¶ added in v2.3.1
type NewsImportDataInput ¶
type NewsImportInput ¶
type NewsImportInput struct { UserID int `json:"user_id"` Data []NewsImportDataInput `json:"data"` }
type NewsMassDeleteInput ¶
type NewsMassDeleteInput struct {
IDs []int `json:"ids"`
}
type NewsMassUpdateInput ¶
type NewsService ¶
type NewsService struct {
// contains filtered or unexported fields
}
func NewNewsService ¶
func NewNewsService( newsRepository repository.INewsRepository, ) NewsService
func (NewsService) Create ¶
func (s NewsService) Create(ctx context.Context, input NewsCreateInput) (*model.News, error)
func (NewsService) ExportList ¶
func (NewsService) MassDelete ¶
func (NewsService) MassUpdate ¶
func (NewsService) Trx ¶
func (s NewsService) Trx(db *gorm.DB) INewsService
func (NewsService) Update ¶
func (s NewsService) Update(ctx context.Context, id int, input NewsUpdateInput) error
type NewsUpdateInput ¶
Click to show internal directories.
Click to hide internal directories.