package com.inspect.system.base;

import com.inspect.base.core.domain.Response;
import com.inspect.system.base.domain.SysUser;
import com.inspect.system.base.factory.RemoteUserFallbackFactory;
import com.inspect.system.base.model.LoginUser;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

@FeignClient(
   contextId = "remoteUserService",
   value = "inspect-management",
   fallbackFactory = RemoteUserFallbackFactory.class
)
public interface RemoteUserService {
   @GetMapping({"/user/info/{username}"})
   Response<LoginUser> getUserInfo(@PathVariable("username") String var1, @RequestHeader("from-source") String var2);

   @PostMapping({"/user/register"})
   Response<Boolean> registerUserInfo(@RequestBody SysUser var1, @RequestHeader("from-source") String var2);
}
