package com.dcsoft.auth.service;

import com.dcsoft.common.core.constant.SecurityConstants;
import com.dcsoft.common.core.domain.R;
import com.dcsoft.common.core.web.page.TableDatasInfo;
import com.dcsoft.system.api.RemoteAuthService;
import com.dcsoft.system.api.RemoteStudentService;
import com.dcsoft.system.api.domain.FaceStudentBody;
import com.dcsoft.system.api.domain.SysAuth;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * 登录校验方法
 *
 * @author dcsoft
 */
@Component
public class SysAuthService
{
    @Autowired
    private RemoteAuthService remoteAuthService;


    @Autowired
    private RemoteStudentService remoteStudentService;


    public SysAuth getAuth(String appKey)
    {
        // 查询用户信息
        R<SysAuth> userResult = remoteAuthService.getAuth(appKey, SecurityConstants.INNER);
        return userResult.getData();
    }


    public TableDatasInfo studentList(FaceStudentBody faceStudent)
    {
        // 查询用户信息
        TableDatasInfo userResult = remoteStudentService.studentList(faceStudent, SecurityConstants.INNER);
        return userResult;
    }


}
