package com.yanzhu.exam.onlineexam.controller;

import java.util.List;

import com.yanzhu.exam.exam.domain.ExamTaskManager;
import com.yanzhu.exam.exam.service.IExamTaskManagerService;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.yanzhu.exam.onlineexam.domain.dto.ExamTitleData;
import com.yanzhu.exam.onlineexam.service.IExamTitleDataService;
import com.ruoyi.common.core.domain.AjaxResult;

@RestController
@RequestMapping("/onlineexam/examtitle")
public class ExamTitleController {

	@Autowired
	IExamTitleDataService examTitleDataService;

    @Autowired
    IExamTaskManagerService  examTaskManagerService;

	@GetMapping(value = "/selectCurrentExam")
    public AjaxResult selectCurrentExam()
    {

        LoginUser user=SecurityUtils.getLoginUser();
        List<ExamTitleData> list= examTaskManagerService.selectCurrentExam(""+user.getUser().getUserId());
    	//ExamTitleData examTitleData = examTitleDataService.selectCurrentExam(user.getUser().getUserCode());
        //return AjaxResult.success(examTitleData);
        return  AjaxResult.success(list);
    }
}
