package com.neusoft.smart.pos.user.service;

import com.neusoft.smart.pos.dto.org.Shop;
import com.neusoft.smart.pos.dto.org.response.PostOrgResponse;
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.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "service-org")
public interface RemoteOrgService {
    @GetMapping("/shop/my")
    ResponseData<List<Shop>> getMyShops(@RequestHeader("X-AUTH-USERNAME") String username);

    @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);

    @GetMapping("/org/detail")
    ResponseData<PostOrgResponse> getOrgDetail(@RequestParam("orgId") int orgId,
                                               @RequestHeader("x-auth-username") String username);

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