package com.hig.onlineexam.controller;

import java.util.List;

import com.hig.exam.domain.ExamTaskManager;
import com.hig.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.hig.onlineexam.domain.dto.ExamTitleData;
import com.hig.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().getUserCode());
    	//ExamTitleData examTitleData = examTitleDataService.selectCurrentExam(user.getUser().getUserCode());
        //return AjaxResult.success(examTitleData);
        return  AjaxResult.success(list);
    }
}
