package com.ym.mec.web;

import com.ym.mec.common.config.FeignConfiguration;
import com.ym.mec.common.entity.HttpResponseResult;
import com.ym.mec.common.entity.MallCreateOrderModel;
import com.ym.mec.common.entity.OrderCancelModel;
import com.ym.mec.common.page.QueryInfo;
import com.ym.mec.thirdparty.adapay.entity.HfMerchantConfig;
import com.ym.mec.web.fallback.WebFeignServiceFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@FeignClient(name = "web-server", contextId = "WebFeignService", configuration = FeignConfiguration.class, fallback = WebFeignServiceFallback.class)
public interface WebFeignService {

	@RequestMapping(value = "api/createCashAccount")
	Boolean createCashAccount(@RequestParam("userId") Integer userId,@RequestParam("tenantId") Integer tenantId);

	@RequestMapping(value = "api/queryTeacherOrganId")
	Integer queryTeacherOrganId(@RequestParam("userId") Integer userId);

	@RequestMapping(value = "api/isPurchasedPracticeCourse")
	Boolean isPurchasedPracticeCourse(@RequestParam("userId") Integer userId);

	@RequestMapping(value = "api/updateNickName")
	int updateNickName(@RequestParam("userId") Integer userId, @RequestParam("nickName") String nickName);

	@RequestMapping(value = "api/queryOrganIdByUserId")
	String queryOrganIdByUserId(@RequestParam("userId") Integer userId, @RequestParam("clientId") String clientId);

	@RequestMapping(value = "api/getTenantConfigValue")
	String getTenantConfigValue(@RequestParam("tenantId") Integer tenantId, @RequestParam("paramName") String paramName);

	@PostMapping(value = "api/queryVipPracticeGroups")
    Boolean queryVipPracticeGroups();

	@GetMapping(value = "/queryByTenantId/{id}")
	HttpResponseResult<HfMerchantConfig> queryByTenantId(@PathVariable("id") Integer id);

	@PostMapping("/api/mallCreateOrder")
	HttpResponseResult<Map> mallCreateOrder(@RequestBody MallCreateOrderModel model);

	@PostMapping("/api/executePayment")
	HttpResponseResult executePayment(@RequestBody Map paymentParam);

	@PostMapping("/api/updateOrder")
	HttpResponseResult updateOrder(@RequestBody Map map);

	@PostMapping("/api/cancelOrder")
	HttpResponseResult<OrderCancelModel> cancelOrder(@RequestParam("orderNo") String orderNo);



	@PostMapping("/api/mallSaveOrderInfo")
	HttpResponseResult<Map> mallSaveOrderInfo(@RequestBody MallCreateOrderModel model);
}
