package com.cyksj.service.station.impl;

import com.cyksj.common.constant.Constant;
import com.cyksj.mapper.GroupsRelationMapper;
import com.cyksj.mapper.station.CollegeStudentStationClickRecordMapper;
import com.cyksj.model.entity.CollegeStudentStationClickRecord;
import com.cyksj.service.station.CollegeStudentStationFService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 项目名: yhlxj2
 * 文件名: CollegeStudentStationFServiceImpl
 * 创建者: JavaZou
 * 创建时间:2024/5/28 11:59
 */
@Service
@RequiredArgsConstructor
public class CollegeStudentStationFServiceImpl implements CollegeStudentStationFService {
	private final CollegeStudentStationClickRecordMapper collegeStudentStationClickRecordMapper;

	private final GroupsRelationMapper groupsRelationMapper;

	@Override
	public void saveCollegeStudent(long userId, Integer type) {
		CollegeStudentStationClickRecord collegeStudentStationClickRecord = new CollegeStudentStationClickRecord();
		collegeStudentStationClickRecord.setUserId(userId);
		collegeStudentStationClickRecord.setType(type);
		collegeStudentStationClickRecordMapper.insert(collegeStudentStationClickRecord);
	}

	@Override
	public Long getExperienceTicket(Long userId) {
		Long relationId = groupsRelationMapper.getExperienceTicket(userId, Constant.GPT_MIRROR_SKU_ID);
		return relationId;
	}
}
