package com.bonus.sgzb.system.controller;
import com.bonus.sgzb.common.core.web.controller.BaseController;
import com.bonus.sgzb.common.core.web.domain.AjaxResult;
import com.bonus.sgzb.common.core.web.page.TableDataInfo;
import com.bonus.sgzb.common.security.annotation.InnerAuth;
import com.bonus.sgzb.system.api.domain.BmNumLogs;
import com.bonus.sgzb.system.service.impl.BmNumLogsService;
import org.springframework.web.bind.annotation.*;

import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
* (bm_num_logs)表控制层
*
* @author syruan
*/
@RestController
@RequestMapping("/bm_num_logs")
public class BmNumLogsController extends BaseController {

    /**
    * 服务对象
    */
    @Autowired
    private BmNumLogsService bmNumLogsService;

    @GetMapping("/list")
    public TableDataInfo list(BmNumLogs record) {
        startPage();
        List<BmNumLogs> list = bmNumLogsService.selectAll(record);
        return getDataTable(list);
    }

    /**
    * 通过主键查询单条数据
    *
    * @param id 主键
    * @return 单条数据
    */
    @GetMapping("selectByPrimaryKey")
    public BmNumLogs selectByPrimaryKey(Integer id) {
        return bmNumLogsService.selectByPrimaryKey(id);
    }

    @InnerAuth
    @PostMapping
    public AjaxResult add(@RequestBody BmNumLogs bmNumLogs) {
        return toAjax(bmNumLogsService.insert(bmNumLogs));
    }


}
