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

import com.neusoft.smart.pos.dto.org.Shop;
import com.neusoft.smart.pos.dto.org.request.PostOrgRequest;
import com.neusoft.smart.pos.dto.org.request.PostShopRequest;
import com.neusoft.smart.pos.dto.org.request.PutOrgRequest;
import com.neusoft.smart.pos.dto.org.response.PostOrgResponse;
import com.neusoft.smart.pos.dto.org.response.PostShopResponse;
import com.neusoft.smart.pos.dto.org.request.TablesRequest;
import com.neusoft.smart.pos.dto.org.response.TablesResponse;
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")
public interface RemoteOrgService {
    @GetMapping("/shop/my")
    ResponseData<List<Shop>> getMyShops();

    @GetMapping("/shop/shopsByUser/{userId}")
    ResponseData<List<Integer>> getShops(@PathVariable("userId") Integer userId);

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

    @PostMapping("/org/insert")
    ResponseData<PostOrgResponse> orgInsert(@RequestBody PostOrgRequest orgRequest);

    @PutMapping("/org/update")
    ResponseData<Integer> orgUpdate(@RequestBody PutOrgRequest putOrgRequest);


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

    @GetMapping("/org/detail")
    ResponseData<PostOrgResponse> getOrgDetail(@RequestParam(value = "orgId") Integer orgId);

    @GetMapping("/tables/{id}")
    ResponseData<TablesResponse> selectTableById(@PathVariable("id") Integer id);

    @PutMapping("/tables")
    ResponseData updateTable(TablesRequest record);
}