package cn.com.qmth.examcloud.core.questions.api.controller;

import cn.com.qmth.examcloud.core.questions.service.initQuesHash.InitQuesHashService;
import cn.com.qmth.examcloud.web.support.ControllerSupport;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
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;

/**
 * @author weiwenhai
 * @date 2018.7.17
 * @company qmth
 * @describle 初始化所有题目题干的Hash
 */

@RestController
@RequestMapping("${api_cqb}/")
public class InitQuesHashController extends ControllerSupport {

    @Autowired
    private InitQuesHashService initQuesHashService;

    @ApiOperation(value = "根据机构初始化题干hash", notes = "根据机构初始化题干hash")
    @GetMapping(value = "/initQuesHash/{orgId}")
    public ResponseEntity<Object> initQuesHash(@PathVariable String orgId) {
        initQuesHashService.initHash(orgId);
        return new ResponseEntity<>(HttpStatus.OK);
    }
}
