Documentation
¶
Index ¶
- Variables
- type Deps
- type INews
- type News
- func (s News) Create(ctx context.Context, input NewsCreateInput) (*model.News, error)
- func (s News) Delete(ctx context.Context, id int) error
- func (s News) Export(ctx context.Context, taskID int, data []byte, msgChan chan<- *model3.Message) (*model3.Message, error)
- func (s News) GetById(ctx context.Context, id int) (*model.News, error)
- func (s News) Import(ctx context.Context, taskID int, data []byte, msgChan chan<- *model3.Message) (*model3.Message, error)
- func (s News) List(ctx context.Context, m *model2.Meta[model.News]) error
- func (s News) MassDelete(ctx context.Context, taskID int, data []byte, msgChan chan<- *model3.Message) (*model3.Message, error)
- func (s News) MassUpdate(ctx context.Context, taskID int, data []byte, msgChan chan<- *model3.Message) (*model3.Message, error)
- func (s News) Trx(db *gorm.DB) INews
- func (s News) Update(ctx context.Context, id int, input NewsUpdateInput) error
- type NewsCreateInput
- type NewsExport
- type NewsExportInput
- type NewsImportDataInput
- type NewsImportInput
- type NewsMassDeleteInput
- type NewsMassUpdateInput
- 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 INews ¶ added in v2.3.117
type INews interface {
Trx(db *gorm.DB) INews
List(ctx context.Context, m *model2.Meta[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 News ¶ added in v2.3.117
type News struct {
// contains filtered or unexported fields
}
func NewNews ¶ added in v2.3.117
func NewNews( newsRepository repository.INewsRepository, ) News
func (News) MassDelete ¶ added in v2.3.117
func (News) MassUpdate ¶ added in v2.3.117
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 NewsUpdateInput ¶
Click to show internal directories.
Click to hide internal directories.