admin_services

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlbumService

type AlbumService struct {
	// contains filtered or unexported fields
}

func NewAlbumService

func NewAlbumService(db *gorm.DB) *AlbumService

func (*AlbumService) DeleteAlbum

func (s *AlbumService) DeleteAlbum(id uint) error

func (*AlbumService) GetAlbum

func (s *AlbumService) GetAlbum(id uint) (*services.AlbumResponse, error)

func (*AlbumService) GetAllAlbums

func (s *AlbumService) GetAllAlbums(page, pageSize, offset int, searchkey, orderby, order string) (*services.GetAlbumsResponse, error)

type BackupService

type BackupService struct {
	// contains filtered or unexported fields
}

func NewBackupService

func NewBackupService(db *gorm.DB, storageService *storage.StorageService, dbConfig *config.DatabaseConfig, serverConfig *config.ServerConfig) *BackupService

func (*BackupService) CreateBackup

func (s *BackupService) CreateBackup() (*models.BackupTask, error)

func (*BackupService) CreateUploadBackupTask

func (s *BackupService) CreateUploadBackupTask(startTime time.Time, file *multipart.FileHeader) (*models.BackupTask, error)

CreateUploadBackupTask 创建上传备份任务

func (*BackupService) DeleteBackup

func (s *BackupService) DeleteBackup(backupID uint) error

func (*BackupService) DeleteRestoreTask

func (s *BackupService) DeleteRestoreTask(restoreID uint) error

func (*BackupService) GetBackupList

func (s *BackupService) GetBackupList() ([]models.BackupTask, error)

func (*BackupService) GetBackupTaskByID

func (s *BackupService) GetBackupTaskByID(id uint) (models.BackupTask, error)

GetBackupTaskByID 根据ID获取备份任务

func (*BackupService) GetRestoreRecords

func (s *BackupService) GetRestoreRecords() ([]models.RestoreTask, error)

func (*BackupService) RestoreBackup

func (s *BackupService) RestoreBackup(backupID uint) (*models.RestoreTask, error)

type GetUsersResponse

type GetUsersResponse struct {
	Users    []models.User `json:"users"`
	Page     int           `json:"page"`
	PageSize int           `json:"page_size"`
	Total    int64         `json:"total"`
}

type ImageService

type ImageService struct {
	// contains filtered or unexported fields
}

func NewImageService

func NewImageService(db *gorm.DB, cfg *config.Config) *ImageService

func (*ImageService) DeleteImage

func (s *ImageService) DeleteImage(id uint) error

func (*ImageService) GetAllImages

func (s *ImageService) GetAllImages(page, pageSize, offset int, searchkey, field, value, orderby, order string) (*services.GetImagesResponse, error)

func (*ImageService) GetImage

func (s *ImageService) GetImage(id uint) (*services.ImageResponse, error)

func (*ImageService) UpdateImageStorage

func (s *ImageService) UpdateImageStorage(id uint, storageName string) error

UpdateImageStorage 更新图片存储名称

type RoleRequest

type RoleRequest struct {
	Name              string   `json:"name"`
	Description       string   `json:"description"`
	AllowedExtensions []string `json:"allowed_extensions"`
	MaxFilesPerUpload int      `json:"max_files_per_upload"`
	MaxFileSizeMB     int      `json:"max_file_size_mb"`
	MaxAlbumsPerUser  int      `json:"max_albums_per_user"`
	MaxStorageSizeMB  int      `json:"max_storage_size_mb"`
	GalleryOpen       bool     `json:"gallery_open"`
	StorageName       string   `json:"storage_name"`
}

type RoleService

type RoleService struct {
	// contains filtered or unexported fields
}

func NewRoleService

func NewRoleService(db *gorm.DB) *RoleService

func (*RoleService) CreateRole

func (s *RoleService) CreateRole(role *models.Role) error

func (*RoleService) DeleteRole

func (s *RoleService) DeleteRole(id uint) error

func (*RoleService) GetRole

func (s *RoleService) GetRole(id int) (*models.Role, error)

func (*RoleService) GetRoles

func (s *RoleService) GetRoles(page, pageSize, offset int, searchkey, orderby, order string) (*[]models.Role, error)

func (*RoleService) GetUsersCountByRole

func (s *RoleService) GetUsersCountByRole() (map[string]int, error)

func (*RoleService) UpdateRole

func (s *RoleService) UpdateRole(id uint, role *RoleRequest) error

type StorageRequest

type StorageRequest struct {
	Name   string               `json:"name"`
	Type   string               `json:"type"`
	Config models.StorageConfig `json:"config"`
}

type StorageService

type StorageService struct {
	// contains filtered or unexported fields
}

func NewStorageService

func NewStorageService(db *gorm.DB) *StorageService

func (*StorageService) CreateStorage

func (s *StorageService) CreateStorage(storageReq *StorageRequest) error

func (*StorageService) DeleteStorage

func (s *StorageService) DeleteStorage(id uint) error

func (*StorageService) GetStorage

func (s *StorageService) GetStorage(id int) (*models.Storage, error)

func (*StorageService) GetStorageByName

func (s *StorageService) GetStorageByName(name string) (*models.Storage, error)

func (*StorageService) GetStorages

func (s *StorageService) GetStorages(page, pageSize, offset int, searchkey, orderby, order string) (*[]models.Storage, error)

func (*StorageService) TestStorageConnection

func (s *StorageService) TestStorageConnection(storageReq *StorageRequest) error

func (*StorageService) UpdateStorage

func (s *StorageService) UpdateStorage(id uint, storageReq *StorageRequest) error

type UserRequest

type UserRequest struct {
	Username string `json:"username" binding:"required,min=3,max=50"`
	Password string `json:"password"`
	Email    string `json:"email" binding:"required,email"`
	Role     string `json:"role" binding:"required"`
	Active   bool   `json:"active"`
}

UserRequest 用户管理请求结构体

type UserService

type UserService struct {
	// contains filtered or unexported fields
}

func NewUserService

func NewUserService(db *gorm.DB, cfg *config.Config) *UserService

func (*UserService) CreateUser

func (s *UserService) CreateUser(req UserRequest) error

func (*UserService) DeleteUser

func (s *UserService) DeleteUser(id int) error

func (*UserService) GetAllImagesTagsCloud

func (s *UserService) GetAllImagesTagsCloud() ([]services.TagCloudItem, error)

func (*UserService) GetUser

func (s *UserService) GetUser(id int) (*models.User, error)

func (*UserService) GetUsers

func (s *UserService) GetUsers(page, pageSize, offset int, searchkey, orderby, order string) (*GetUsersResponse, error)

func (*UserService) UpdateUser

func (s *UserService) UpdateUser(id int, currentUserID uint, req UserRequest) (*models.User, error)

Jump to

Keyboard shortcuts

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