usecase

package
v0.0.0-...-ac9090e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

* @Author: CuiYao * @Date: 2021-09-07 09:37:10 * @Last Modified by: CuiYao * @Last Modified time: 2022-01-28 10:16:11

* @Author: CuiYao * @Date: 2021-12-10 16:53:33 * @Last Modified by: CuiYao * @Last Modified time: 2021-12-10 17:04:32

Index

Constants

This section is empty.

Variables

View Source
var (
	Host = os.Getenv("APIHOST")
)

Functions

func MakeUsecase

func MakeUsecase(repo repository.Repository, minioClient *minio.Client) *usecase

Types

type Minio

type Minio interface {

	//*******Bucket操作
	//创建Bucket
	MakeBucket(ctx context.Context) error
	//列出Bucket
	ListBucket(ctx context.Context) error
	//Bucket是否存在
	ExistsBucket(ctx context.Context) error
	//删除Bucket
	Delete(ctx context.Context) error
	//列出Bucket中的对象
	ListObject(ctx context.Context) error

	//******Object 对象操作
	//文件下载
	FGetObject(ctx context.Context) error
	//文件上传
	FPutObject(ctx context.Context) error
	//流上传
	PutObject(ctx context.Context) error
	//流下载
	GetObject(ctx context.Context) error
	//获取URL
	GetObjectUrl(ctx context.Context, bucketName, objectName string) (string, error)
	//删除对象
	DeleteObject(ctx context.Context) error
}

type Resources

type Resources interface {
	UploadResourcesIcon(ctx context.Context, bucketName string, file *multipart.FileHeader) (string, error)
	CreateResources(ctx context.Context, resources entity.Resources) error
	UpdateResources(ctx context.Context, resources entity.Resources) error
	ListResources(ctx context.Context) ([]entity.Resources, error)
	GetResources(ctx context.Context, id string) (entity.Resources, error)
	DeleteResources(ctx context.Context, id string) error
}

type Usecase

type Usecase interface {
	Resources
	Minio
	Wallpaper
}

type User

type User interface {
	CreateUser(ctx context.Context, user entity.User) (entity.User, error)
	UpdateUser(ctx context.Context, id string, user entity.User) (int, error)
	ListUser(ctx context.Context) ([]entity.User, error)
	DeleteUser(ctx context.Context, id string) error
}

type Wallpaper

type Wallpaper interface {
	UploadWallpaper(ctx context.Context, bucketName string, file *multipart.FileHeader) (string, string, error)
	ListWallpaper(ctx context.Context) (entity.Wallpaper, error)
	GetWallpaper(ctx context.Context, bucketName, fileName string) (string, error)
	DeleteWallpaper(ctx context.Context, bucketName, fileName string) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL