package com.flossom.system.api;

import com.flossom.common.core.constant.ServiceNameConstants;
import com.flossom.common.core.domain.LoginBody;
import com.flossom.common.core.domain.R;
import com.flossom.common.core.domain.RegisterBody;
import com.flossom.common.core.domain.entity.WxUserMember;
import com.flossom.system.api.factory.RemoteUserFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 授权服务
 *
 * @author flossom
 */
@FeignClient(contextId = "remoteAuthService", value = ServiceNameConstants.AUTH_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
public interface RemoteAuthService
{

    @PostMapping("login")
    public R<Map<String, String>> login(@RequestBody LoginBody form);

    @PostMapping("wxLogin")
    public R<Map<String, String>> wxLogin(@RequestBody WxUserMember form);

    @PostMapping("register")
    public R<?> register(@RequestBody RegisterBody registerBody);

}
