package com.jeesharp.business.modules.ai.service.impl;

import com.jeesharp.business.modules.ai.entity.AiChatFeedback;
import com.jeesharp.business.modules.ai.mapper.AiChatFeedbackMapper;
import com.jeesharp.business.modules.ai.service.AiChatFeedbackService;
import com.jeesharp.business.modules.common.constants.PlatformTenantConstants;
import com.jeesharp.business.modules.ai.vo.AiChatFeedbackQueryVO;
import com.jeesharp.framework.mybatis.core.service.CrudService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(readOnly = true)
public class AiChatFeedbackServiceImpl extends CrudService<AiChatFeedbackMapper, AiChatFeedback, AiChatFeedbackQueryVO>
        implements AiChatFeedbackService {

    @Override
    @Transactional(readOnly = false)
    public void createFeedback(AiChatFeedback entity) {
        entity.closeTenantCodeAutoSet();
        entity.setTenantCode(PlatformTenantConstants.PLATFORM_TENANT_CODE);
        entity.setTenantId(PlatformTenantConstants.PLATFORM_TENANT_ID);
        save(entity);
    }

    @Override
    @Transactional(readOnly = false)
    public void updateFeedback(AiChatFeedback entity) {
        update(entity);
    }

}
