package com.css.simulation.resource.server.infra.feign.fallback;

import api.common.pojo.common.ResponseBodyVO;
import api.common.pojo.param.MinioParameter;
import com.css.simulation.resource.server.infra.feign.service.FileDownService;
import feign.Response;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@Slf4j
@Service
public class FileDownServiceFallback implements FileDownService {


    @Override
    public ResponseBodyVO<String> upload(@RequestPart("file") MultipartFile file, @RequestParam("objectName") String objectName) {
        return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE);
    }

    @Override
    public ResponseBodyVO<String> getPublicUrl(@RequestParam("objectName")String objectName) {
        return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE);
    }

    @Override
    public ResponseBodyVO<String> uploadLocalFile(@RequestParam("localFilePath") String localFilePath, @RequestParam("objectName") String objectName) {
        return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE);
    }

    @GetMapping(value = "/minio/copy")
    public ResponseBodyVO<String> copy(@RequestParam("source") String source, @RequestParam("target") String target//  "/xx/xxx/x/xx"
    ) {
        return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE);
    }

    @GetMapping(value = "/minio/move")
    public ResponseBodyVO<String> move(@RequestParam("source") String source, @RequestParam("target") String target//  "/xx/xxx/x/xx"
    ) {
        return new ResponseBodyVO<>(ResponseBodyVO.Response.SERVER_FAILURE);
    }

    @Override
    public ResponseBodyVO<String> uploadProcessBar(@RequestPart("file") MultipartFile file, @RequestParam("objectName") String objectName, @RequestParam("objectPath") String objectPath) {
        return null;
    }


    @Override
    public Response download(@RequestBody @Validated MinioParameter minioParameter) {
        log.error("------- 下载错误：" + minioParameter.getObjectName());
        return null;
    }

    @Override
    public ResponseBodyVO<List<String>> list(@RequestBody @Validated MinioParameter minioParameter) {
        return null;
    }

    @Override
    public ResponseBodyVO<List<String>> listDeepOne(@RequestBody @Validated MinioParameter minioParameter) {
        return null;
    }

    @Override
    public ResponseBodyVO<String> getPreviewUrl(@RequestBody @Validated MinioParameter minioParameter) {
        return null;
    }

    @Override
    public Response remove(@RequestBody @Validated MinioParameter minioParameter) {
        log.error("------- 删除错误：" + minioParameter.getObjectName());
        return null;
    }
}
