package com.bonus.sgzb.base.controller;



import com.bonus.sgzb.base.api.domain.MaMachineLabel;
import com.bonus.sgzb.base.service.IMaMachineLabelService;
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.log.annotation.Log;
import com.bonus.sgzb.common.log.enums.BusinessType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "标签")
@RestController
@RequestMapping("/base/maMachineLabel")
public class MaMachineLabelController extends BaseController {

    @Autowired
    private IMaMachineLabelService maMachineLabelService;

    /**
     * 查询标签编号
     * @param
     * @return
     */
    @ApiOperation(value = "查询标签编号")
    @GetMapping("/list")
    public TableDataInfo list()
    {
        List<MaMachineLabel> list = maMachineLabelService.selectMaMachineLabelList();
        return getDataTable(list);
    }
    /**
     * 标签生成ma_machine_label
     */

    @Log(title = "标签生成ma_machine_label", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody MaMachineLabel maMachineLabel) {
        return toAjax(maMachineLabelService.insertMaMachineLabel(maMachineLabel));
    }

}