package com.tofly.base.api.feign;

import com.tofly.base.api.entity.User;
import com.tofly.base.api.feign.factory.BaseLogServiceFallbackFactory;
import com.tofly.common.core.constant.SecurityConstants;
import com.tofly.common.core.entity.ResultRespone;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

/**
 * @author Administrator
 * @date 2019/9/6  15:50
 */
@FeignClient(contextId = "baseUserLoginService",value = "tofly-base",fallbackFactory = BaseLogServiceFallbackFactory.class)
public interface BaseUserLoginService {

    /**
     * 修改用户登录状态信息，记录密码错误次数，以及修改IP
     *
     * @param user 用户信息
     * @param from     调用标志
     */
    @PostMapping("/user/info/update")
    ResultRespone<Boolean> updateUserInfo(@RequestBody User user, @RequestHeader(SecurityConstants.FROM) String from);
}
