package com.chushang.system.feign;

import com.chushang.common.core.constant.SecurityConstants;
import com.chushang.common.core.web.Result;
import com.chushang.system.constants.SystemConstants;
import com.chushang.system.entity.po.SysLoginInfo;
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;

/**
 * by zhaowenyuan create 2022/5/20 10:28
 * 保存登录日志信息
 */
@FeignClient(contextId = "remoteLoginInfoService",
        value = SystemConstants.SYSTEM_SERVICE,
        path = SystemConstants.APPLICATION_NAME + "/log"
)
public interface RemoteLoginInfoService {

    /**
     * 保存访问记录
     *
     * @param source 请求来源
     * @return 结果
     */
    @PostMapping("/login/info")
    Result<Boolean> saveLoginInfo(@RequestBody SysLoginInfo sysLogininfo, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
