package cn.meowrain.aioj.backend.question.service.impl;

import cn.meowrain.aioj.backend.question.dao.entity.QuestionSubmit;
import cn.meowrain.aioj.backend.question.dao.mapper.QuestionSubmitMapper;
import cn.meowrain.aioj.backend.question.service.QuestionSubmitService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * 题目提交服务实现
 */
@Service
@RequiredArgsConstructor
public class QuestionSubmitServiceImpl extends ServiceImpl<QuestionSubmitMapper, QuestionSubmit> implements QuestionSubmitService {

	@Override
	public Long createSubmit(QuestionSubmit questionSubmit) {
		this.save(questionSubmit);
		return questionSubmit.getId();
	}

	@Override
	public Boolean updateSubmitStatus(QuestionSubmit questionSubmit) {
		return this.updateById(questionSubmit);
	}

	@Override
	public QuestionSubmit getSubmitById(Long submitId) {
		return this.getById(submitId);
	}
}
