package com.njcn.product.auth.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.njcn.common.pojo.enums.common.DataStateEnum;

import com.njcn.product.auth.mapper.AuthClientMapper;
import com.njcn.product.auth.pojo.po.AuthClient;
import com.njcn.product.auth.service.IAuthClientService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;


/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author hongawen
 * @since 2021-12-15
 */
@Service
@RequiredArgsConstructor
public class AuthClientServiceImpl extends ServiceImpl<AuthClientMapper, AuthClient> implements IAuthClientService {

    @Override
    public AuthClient getAuthClientByName(String clientName) {
      return lambdaQuery()
              .eq(AuthClient::getName,clientName)
              .eq(AuthClient::getState,DataStateEnum.ENABLE.getCode())
              .one();
    }
}
