package com.qmth.distributed.print.api;

import com.qmth.boot.api.constant.ApiConstant;
import com.qmth.distributed.print.business.service.TSyncStmmsExamService;
import com.qmth.teachcloud.common.annotation.OperationLogDetail;
import com.qmth.teachcloud.common.contant.SystemConstant;
import com.qmth.teachcloud.common.enums.log.CustomizedOperationTypeEnum;
import com.qmth.teachcloud.common.util.Result;
import com.qmth.teachcloud.common.util.ResultUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 云阅卷考试表 前端控制器
 * </p>
 */
@RestController
@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + SystemConstant.PREFIX_URL_BASIC + "/stmms_exam")
public class TSyncStmmsExamController {

    @Resource
    private TSyncStmmsExamService tSyncStmmsExamService;

    /**
     * 查询云阅卷考试
     */
    @ApiOperation(value = "查询云阅卷考试")
    @PostMapping("/list")
    public Result listExam(@RequestParam(value = "orgCode", required = false) String orgCode) {
        return ResultUtil.ok(tSyncStmmsExamService.listExam(orgCode));
    }

    /**
     * 同步云阅卷考试
     */
    @ApiOperation(value = "同步云阅卷考试")
    @PostMapping("/sync")
    public Result syncExam(@RequestParam(value = "orgCode", required = false) String orgCode) {
        return ResultUtil.ok(tSyncStmmsExamService.syncExam(orgCode));
    }
}
