AiAgentInfoServiceImpl.java 1.29 KB
package com.bs.reception.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bs.reception.entity.script.AiAgentInfo;
import com.bs.reception.mapper.AiAgentInfoMapper;
import com.bs.reception.service.IAiAgentInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * AI助理智能体信息 服务实现类
 * 
 * @author bs
 */
@Slf4j
@Service
public class AiAgentInfoServiceImpl extends ServiceImpl<AiAgentInfoMapper, AiAgentInfo> implements IAiAgentInfoService {

    /**
     * 根据智能体编码查询智能体信息
     * 
     * @param agentCode 智能体编码
     * @return AI智能体信息
     */
    @Override
    public AiAgentInfo getAiAgentInfoByCode(String agentCode) {
        log.info("根据智能体编码查询智能体信息,agentCode: {}", agentCode);
        
        LambdaQueryWrapper<AiAgentInfo> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(AiAgentInfo::getAgentCode, agentCode)
                    .eq(AiAgentInfo::getDeletedFlag, "N");
        
        AiAgentInfo aiAgentInfo = this.getOne(queryWrapper);
        log.info("查询结果: {}", aiAgentInfo);
        
        return aiAgentInfo;
    }

}