package com.friday.executor.common;

import com.friday.base.common.response.DubboResult;
import com.friday.mystery.apiauthentication.bean.UserDto;
import com.friday.mystery.apiauthentication.service.IAccountService;
import com.friday.operation.api.executor.service.IEmployeeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;

/**
 * @Author YaoYao
 * @Date Created In 13:57 2023/4/4
 * @Description 资讯接口服务
 * @Modified By
 */
@Service
@Slf4j
public class EmployeeInfoHelper implements IEmployeeService {
    @Autowired(required = false)
    private IAccountService accountService;

    @Override
    public DubboResult<UserDto> getUserDetail(String userId) {
        DubboResult<UserDto> result = accountService.getUserDetail(userId);
        if(result.success()){
            return DubboResult.newSuccess(result.getObject());
        }
        return DubboResult.newFailure(DubboResult.SERVER_EXCEPTION, result.getMessage());
    }

//    @Override
//    public DubboResult<ArrayList<UserDto>> fuzzyQueryEmployeeInfo(String queryKey) {
//        DubboResult<ArrayList<UserDto>> result = accountService.getUserBaseInfos(queryKey);
//        if(result.success()){
//            return DubboResult.newSuccess(result.getObject());
//        }
//        return DubboResult.newFailure(DubboResult.SERVER_EXCEPTION, result.getMessage());
//    }
}
