package com.cyksj.service.chatgpt.impl;

import com.cyksj.mapper.GptUserRechargeNumRecordMapper;
import com.cyksj.model.entity.GptUserRechargeNumRecord;
import com.cyksj.service.chatgpt.GptUserRechargeRecordService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * 项目名: yhlxj11111111
 * 文件名: GptUserRechargeRecordServiceImpl
 * 创建者: JavaZou
 * 创建时间:2025/8/1 10:50
 */
@Service
@RequiredArgsConstructor
@Slf4j
public class GptUserRechargeRecordServiceImpl implements GptUserRechargeRecordService {
	private final GptUserRechargeNumRecordMapper gptUserRechargeNumRecordMapper;

	@Override
	public void recordGptUserRechargeNum(Long userId, Long relationId, String account, Integer num, String operator, String remark) {
		if (num == 0) {
			return;
		}
		//记录代充记录
		GptUserRechargeNumRecord gptUserRechargeNumRecord = new GptUserRechargeNumRecord();
		gptUserRechargeNumRecord.setUserId(userId);
		gptUserRechargeNumRecord.setRelationId(relationId);
		gptUserRechargeNumRecord.setAccount(account);
		gptUserRechargeNumRecord.setNum(num);
		gptUserRechargeNumRecord.setOperator(operator);
		gptUserRechargeNumRecord.setRemark(remark);
		gptUserRechargeNumRecordMapper.insert(gptUserRechargeNumRecord);
	}
}
