package com.ycwl.basic.integration.scenic.client;

import com.ycwl.basic.integration.common.response.CommonResponse;
import com.ycwl.basic.integration.scenic.dto.filter.ScenicFilterPageResponse;
import com.ycwl.basic.integration.scenic.dto.filter.ScenicFilterRequest;
import com.ycwl.basic.integration.scenic.dto.scenic.CreateScenicRequest;
import com.ycwl.basic.integration.scenic.dto.scenic.ScenicV2DTO;
import com.ycwl.basic.integration.scenic.dto.scenic.ScenicV2WithConfigDTO;
import com.ycwl.basic.integration.scenic.dto.scenic.ScenicV2ListResponse;
import com.ycwl.basic.integration.scenic.dto.scenic.ScenicV2WithConfigListResponse;
import com.ycwl.basic.integration.scenic.dto.scenic.UpdateScenicRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient(name = "zt-scenic", contextId = "scenic-v2", path = "/api/scenic/v2")
public interface ScenicV2Client {

    @GetMapping("/{scenicId}")
    CommonResponse<ScenicV2DTO> getScenic(@PathVariable("scenicId") Long scenicId);

    @GetMapping("/{scenicId}/with-config")
    CommonResponse<ScenicV2WithConfigDTO> getScenicWithConfig(@PathVariable("scenicId") Long scenicId);


    @PostMapping("/")
    CommonResponse<ScenicV2DTO> createScenic(@RequestBody CreateScenicRequest request);

    @PutMapping("/{scenicId}")
    CommonResponse<ScenicV2DTO> updateScenic(@PathVariable("scenicId") Long scenicId, 
                                           @RequestBody UpdateScenicRequest request);

    @DeleteMapping("/{scenicId}")
    CommonResponse<Void> deleteScenic(@PathVariable("scenicId") Long scenicId);

    @PostMapping("/filter")
    CommonResponse<ScenicFilterPageResponse> filterScenics(@RequestBody ScenicFilterRequest request);

    @GetMapping("/")
    CommonResponse<ScenicV2ListResponse> listScenics(@RequestParam(defaultValue = "1") Integer page,
                                                    @RequestParam(defaultValue = "10") Integer pageSize,
                                                    @RequestParam(required = false) Integer status,
                                                    @RequestParam(required = false) String name);

    @GetMapping("/with-config")
    CommonResponse<ScenicV2WithConfigListResponse> listScenicsWithConfig(@RequestParam(defaultValue = "1") Integer page,
                                                                        @RequestParam(defaultValue = "10") Integer pageSize,
                                                                        @RequestParam(required = false) Integer status,
                                                                        @RequestParam(required = false) String name);
}