TB_ANTIVIRUS_LOGCongtoller.java 2.5 KB
package com.tianbo.analysis.controller;

import com.github.pagehelper.PageInfo;
import com.tianbo.analysis.model.ResultJson;
import com.tianbo.analysis.model.TB_ANTIVIRUS_LOG;
import com.tianbo.analysis.service.TB_ANTIVIRUS_LOGService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author shenhl
 * <p>
 * 2022/1/18/11:24
 */
@RestController
@RequestMapping(value = "/antivirus_log")
public class TB_ANTIVIRUS_LOGCongtoller {

    @Autowired
    TB_ANTIVIRUS_LOGService tbAntivirusLogService;

    /**
     * 消毒记录查询
     * @return
     */
    @RequestMapping(value = "/antivirus_log_list")
    @ResponseBody
    public ResultJson antivirus_log_list(@RequestParam(value = "pageSize", required = false, defaultValue = "1") int pageSize,
                                         @RequestParam(value = "limitSize", required = false, defaultValue = "10") int limitSize,
                                         @RequestParam(value = "antivirusName", required = false) String antivirusName){
        TB_ANTIVIRUS_LOG tbAntivirusLog = new TB_ANTIVIRUS_LOG();
        tbAntivirusLog.setAntivirusName(antivirusName);

        PageInfo<TB_ANTIVIRUS_LOG> list = tbAntivirusLogService.list(tbAntivirusLog, pageSize, limitSize);

        return new ResultJson("200","success",list);
    }

    /**
     * 消毒记录新增
     * @return
     */
    @RequestMapping(value = "/antivirus_log_add")
    @ResponseBody
    public ResultJson antivirus_log_add(TB_ANTIVIRUS_LOG tbAntivirusLog){

        return tbAntivirusLogService.insertSelective(tbAntivirusLog) > 0 ? new ResultJson("200", "新增成功")
                : new ResultJson("201", "新增失败");
    }

    /**
     * 消毒记录修改
     * @return
     */
    @RequestMapping(value = "/antivirus_log_edit")
    @ResponseBody
    public ResultJson antivirus_log_edit(TB_ANTIVIRUS_LOG tbAntivirusLog){

        return tbAntivirusLogService.updateByPrimaryKeySelective(tbAntivirusLog) > 0 ? new ResultJson("200", "修改成功")
                : new ResultJson("201", "修改失败");
    }

    /**
     * 消毒记录删除
     * @return
     */
    @RequestMapping(value = "/antivirus_log_remove")
    @ResponseBody
    public ResultJson antivirus_log_remove(@RequestParam(value = "autoid") String autoid){

        return tbAntivirusLogService.deleteByPrimaryKey(autoid) > 0 ? new ResultJson("200", "删除成功")
                : new ResultJson("201", "删除失败");
    }
}