package com.ruoyi.project.controller;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.project.domain.TrsResults;
import com.ruoyi.project.utils.JiaoduiUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 配置管理Controller
 * 
 * @author ruoyi
 * @date 2025-03-19
 */
@Controller
@RequestMapping("/project/jiaodui")
public class TrsJiaoduiController extends BaseController
{
    private String prefix = "project/jiaodui";

    @Autowired
    private JiaoduiUtils jiaoduiUtils;
    /**
     * 在线校对
     */
    @RequiresPermissions("jiaodui:local")
    @GetMapping("/edit")
    public String edit(ModelMap mmap)
    {
        return prefix + "/edit";
    }

    @RequiresPermissions("jiaodui:local")
    @RequestMapping ("/jiaodui")
    @ResponseBody
    public AjaxResult jiaodui(String content,String title,String type)
    {
        List<TrsResults> jiaodui = jiaoduiUtils.getJiaodui(content,title, type);
        return AjaxResult.success("校对完成", jiaodui);
    }


}
