package com.cirs.biz.controller;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.servlet.http.HttpServletResponse;

import com.cirs.biz.domain.TVerificationScoretaskDetail;
import com.cirs.biz.domain.TVerificationTaskDetail;
import com.cirs.biz.domain.VerificationData;
import com.cirs.common.utils.DictUtils;
import org.springframework.http.MediaType;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.cirs.common.annotation.Log;
import com.cirs.common.core.controller.BaseController;
import com.cirs.common.core.domain.AjaxResult;
import com.cirs.common.enums.BusinessType;
import com.cirs.biz.domain.TVerificationScoretask;
import com.cirs.biz.service.ITVerificationScoretaskService;
import com.cirs.common.utils.poi.ExcelUtil;
import com.cirs.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
import reactor.core.publisher.Mono;

/**
 * 打分算法验证任务Controller
 * 
 * @author allen
 * @date 2023-12-10
 */
@RestController
@RequestMapping("/biz/scoretask")
public class TVerificationScoretaskController extends BaseController
{
    @Autowired
    private ITVerificationScoretaskService tVerificationScoretaskService;

    /**
     * 查询打分算法验证任务列表
     */
    @PreAuthorize("@ss.hasPermi('biz:scoretask:list')")
    @GetMapping("/list")
    public TableDataInfo list(TVerificationScoretask tVerificationScoretask)
    {
        startPage();
        List<TVerificationScoretask> list = tVerificationScoretaskService.selectTVerificationScoretaskList(tVerificationScoretask);
        return getDataTable(list);
    }

    /**
     * 导出打分算法验证任务列表
     */
    @PreAuthorize("@ss.hasPermi('biz:scoretask:export')")
    @Log(title = "打分算法验证任务", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, TVerificationScoretask tVerificationScoretask)
    {
        List<TVerificationScoretask> list = tVerificationScoretaskService.selectTVerificationScoretaskList(tVerificationScoretask);
        ExcelUtil<TVerificationScoretask> util = new ExcelUtil<TVerificationScoretask>(TVerificationScoretask.class);
        util.exportExcel(response, list, "打分算法验证任务数据");
    }

    /**
     * 获取打分算法验证任务详细信息
     */
    @PreAuthorize("@ss.hasPermi('biz:scoretask:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return success(tVerificationScoretaskService.selectTVerificationScoretaskById(id));
    }

    /**
     * 新增打分算法验证任务
     */
    @PreAuthorize("@ss.hasPermi('biz:scoretask:add')")
    @Log(title = "打分算法验证任务", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody TVerificationScoretask tVerificationScoretask)
    {
        return toAjax(tVerificationScoretaskService.insertTVerificationScoretask(tVerificationScoretask));
    }

    /**
     * 修改打分算法验证任务
     */
    @PreAuthorize("@ss.hasPermi('biz:scoretask:edit')")
    @Log(title = "打分算法验证任务", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody TVerificationScoretask tVerificationScoretask)
    {
        return toAjax(tVerificationScoretaskService.updateTVerificationScoretask(tVerificationScoretask));
    }

    /**
     * 删除打分算法验证任务
     */
    @PreAuthorize("@ss.hasPermi('biz:scoretask:remove')")
    @Log(title = "打分算法验证任务", businessType = BusinessType.DELETE)
	@DeleteMapping("/{ids}")
    public AjaxResult remove(@PathVariable Long[] ids)
    {
        return toAjax(tVerificationScoretaskService.deleteTVerificationScoretaskByIds(ids));
    }


}
