26 lines
828 B
Go
Executable File
26 lines
828 B
Go
Executable File
package usecase
|
|
|
|
import (
|
|
"code.30cm.net/digimon/app-cloudep-product-service/pkg/domain/entity"
|
|
"context"
|
|
)
|
|
|
|
type CategoryUseCase interface {
|
|
// Insert 創建新的類別
|
|
Insert(ctx context.Context, data *entity.Category) error
|
|
// FindOneByID 根據 ID 查詢單個類別
|
|
FindOneByID(ctx context.Context, id string) (*entity.Category, error)
|
|
// Update 更新類別信息
|
|
Update(ctx context.Context, id string, data *entity.Category) error
|
|
// Delete 刪除指定 ID 的類別
|
|
Delete(ctx context.Context, id string) error
|
|
// ListCategory 根據查詢參數獲取類別列表
|
|
ListCategory(ctx context.Context, params CategoryQueryParams) ([]*entity.Category, int64, error)
|
|
}
|
|
|
|
type CategoryQueryParams struct {
|
|
PageSize int64 // 每頁顯示的專案數量
|
|
PageIndex int64 // 要查詢的頁數
|
|
ID []string
|
|
}
|