package com.neusoft.smart.pos.gateway.service.feignService;

import com.neusoft.smart.pos.dto.org.Shop;
import com.neusoft.smart.pos.dto.org.request.PostShopRequest;
import com.neusoft.smart.pos.dto.org.request.PutShopRequest;
import com.neusoft.smart.pos.dto.org.response.PostShopResponse;
import com.neusoft.smart.pos.framework.dto.ResponseData;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(value = "service-org/shop")
public interface RemoteShopService {

    @PostMapping("/insert")
    ResponseData<PostShopResponse> saveShop(@RequestBody PostShopRequest shopRequest);

    @PutMapping("/update")
    ResponseData<Integer> shopUpdate(@RequestBody PutShopRequest shopRequest);

    @GetMapping("/shopsByIds")
    ResponseData<List<Shop>> queryShopListByIds(@RequestParam(value="ids") List<Integer> ids);

    @GetMapping("/shopsByOrgId")
    ResponseData<List<Shop>> queryShopListByOrgId(@RequestParam(value="orgId") Integer orgId,@RequestParam(value="shopId",defaultValue = "0") Integer shopId);

    @GetMapping("/detail")
    ResponseData<PostShopResponse> getShopDetail(@RequestParam(value="shopId") int shopId);

    @GetMapping("/shopsByUser")
    ResponseData<List<PostShopResponse>> queryShopListByCurrentUser();
}