// Code generated by goctl. DO NOT EDIT.
// goctl 1.10.1
// Source: file.proto

package server

import (
	"context"

	"sundynix-micro-go/app/file/rpc/file"
	"sundynix-micro-go/app/file/rpc/internal/logic"
	"sundynix-micro-go/app/file/rpc/internal/svc"
)

type FileServiceServer struct {
	svcCtx *svc.ServiceContext
	file.UnimplementedFileServiceServer
}

func NewFileServiceServer(svcCtx *svc.ServiceContext) *FileServiceServer {
	return &FileServiceServer{
		svcCtx: svcCtx,
	}
}

// 根据ID获取文件信息
func (s *FileServiceServer) GetFileById(ctx context.Context, in *file.GetFileByIdReq) (*file.GetFileByIdResp, error) {
	l := logic.NewGetFileByIdLogic(ctx, s.svcCtx)
	return l.GetFileById(in)
}

// 根据ID列表批量获取文件信息
func (s *FileServiceServer) GetFilesByIds(ctx context.Context, in *file.GetFilesByIdsReq) (*file.GetFilesByIdsResp, error) {
	l := logic.NewGetFilesByIdsLogic(ctx, s.svcCtx)
	return l.GetFilesByIds(in)
}

// 创建文件记录
func (s *FileServiceServer) CreateFile(ctx context.Context, in *file.CreateFileReq) (*file.CreateFileResp, error) {
	l := logic.NewCreateFileLogic(ctx, s.svcCtx)
	return l.CreateFile(in)
}

// 通过MD5检查文件是否存在
func (s *FileServiceServer) CheckFileByMd5(ctx context.Context, in *file.CheckFileByMd5Req) (*file.CheckFileByMd5Resp, error) {
	l := logic.NewCheckFileByMd5Logic(ctx, s.svcCtx)
	return l.CheckFileByMd5(in)
}

// 删除文件记录
func (s *FileServiceServer) DeleteFiles(ctx context.Context, in *file.DeleteFilesReq) (*file.CommonResp, error) {
	l := logic.NewDeleteFilesLogic(ctx, s.svcCtx)
	return l.DeleteFiles(in)
}

// 获取文件列表
func (s *FileServiceServer) GetFileList(ctx context.Context, in *file.GetFileListReq) (*file.GetFileListResp, error) {
	l := logic.NewGetFileListLogic(ctx, s.svcCtx)
	return l.GetFileList(in)
}

// ---------- 存储配置 ----------
func (s *FileServiceServer) CreateStorageConfig(ctx context.Context, in *file.CreateStorageConfigReq) (*file.CommonResp, error) {
	l := logic.NewCreateStorageConfigLogic(ctx, s.svcCtx)
	return l.CreateStorageConfig(in)
}

func (s *FileServiceServer) UpdateStorageConfig(ctx context.Context, in *file.UpdateStorageConfigReq) (*file.CommonResp, error) {
	l := logic.NewUpdateStorageConfigLogic(ctx, s.svcCtx)
	return l.UpdateStorageConfig(in)
}

func (s *FileServiceServer) DeleteStorageConfig(ctx context.Context, in *file.DeleteFilesReq) (*file.CommonResp, error) {
	l := logic.NewDeleteStorageConfigLogic(ctx, s.svcCtx)
	return l.DeleteStorageConfig(in)
}

func (s *FileServiceServer) SetDefaultStorageConfig(ctx context.Context, in *file.SetDefaultStorageConfigReq) (*file.CommonResp, error) {
	l := logic.NewSetDefaultStorageConfigLogic(ctx, s.svcCtx)
	return l.SetDefaultStorageConfig(in)
}

func (s *FileServiceServer) GetStorageConfigList(ctx context.Context, in *file.StorageConfigListReq) (*file.StorageConfigListResp, error) {
	l := logic.NewGetStorageConfigListLogic(ctx, s.svcCtx)
	return l.GetStorageConfigList(in)
}

func (s *FileServiceServer) GetDefaultStorageConfig(ctx context.Context, in *file.GetDefaultStorageConfigReq) (*file.GetDefaultStorageConfigResp, error) {
	l := logic.NewGetDefaultStorageConfigLogic(ctx, s.svcCtx)
	return l.GetDefaultStorageConfig(in)
}
