package com.ym.mec.auth.api.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import com.ym.mec.auth.api.client.fallback.SysUserFeignServiceFallback;
import com.ym.mec.auth.api.dto.SysUserInfo;
import com.ym.mec.auth.api.entity.SysUser;
import com.ym.mec.common.config.FeignConfiguration;

@FeignClient(name = "auth-server", configuration = { FeignConfiguration.class }, fallback = SysUserFeignServiceFallback.class)
public interface SysUserFeignService {

	@GetMapping(value = "query/{username}")
	public SysUserInfo getUser(@PathVariable("username") String username);

	@GetMapping(value = "user/queryUserByPhone")
	public SysUser getUserByMobile(@RequestParam("mobile") String mobile);

	@RequestMapping(value = "user/add",method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE)
	public Object addUser(@RequestBody SysUser user);

	@GetMapping(value = "task/test")
	public Object test();

	@GetMapping(value = "queryUserInfo")
	public SysUser queryUserInfo();
}
