package com.hxhq.business.controller;

import java.util.Arrays;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.hxhq.business.domain.SnGen;
import com.hxhq.business.service.ISnGenService;
import com.hxhq.common.core.web.controller.BaseController;
import com.hxhq.common.core.web.domain.AjaxResult;
import com.hxhq.common.core.web.page.TableDataInfo;


/**
 * 每日编号生成记录Controller
 *
 * @author hxhq
 * @date 2026-01-12
 */
@RestController
@RequestMapping("/business/snGen")
public class SnGenController extends BaseController
{
    @Autowired
    private ISnGenService snGenService;

    /**
     * 获取每日编号生成记录详细信息
     */
    @GetMapping(value = "/info")
    public AjaxResult getInfo(Long id)
    {
        return AjaxResult.success(snGenService.getById(id));
    }

    /**
     * 新增每日编号生成记录信息
     */
    @PostMapping("/save")
    public AjaxResult save(@RequestBody SnGen snGen)
    {
        return toAjax(snGenService.saveOrUpdate(snGen));
    }

    /**
     * 删除每日编号生成记录信息
     */
    @PostMapping("/delete")
    public AjaxResult delete(@RequestBody Long[] ids)
    {
        return toAjax(snGenService.removeByIds(Arrays.asList(ids)));
    }
}
