package com.zg.project.wisdom.controller;

import com.zg.framework.web.domain.AjaxResult;
import com.zg.project.wisdom.domain.dto.PkDatDTO;
import com.zg.project.wisdom.service.IPkDatService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/pk/dat")
public class PkDatController {

    @Resource
    private IPkDatService pkDatService;

    /**
     * 批量新增 pk.dat 数据
     */
    @PostMapping("/batchAdd")
    public AjaxResult batchAdd(@RequestBody List<PkDatDTO> list) {
        int rows = pkDatService.batchInsertPkDat(list);
        return rows > 0 ? AjaxResult.success("成功插入 " + rows + " 条记录")
                : AjaxResult.error("插入失败");
    }
}
