package com.unis.crk.common.controller;

import com.unis.crk.common.entity.Billnonewgjj;
import com.unis.crk.common.service.IBillnonewgjjService;
import com.unis.crk.utils.ResultUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;


/**
 * <p>
 * 专用于生成国家局业务单据号 前端控制器
 * </p>
 *
 * @author TangSong
 * @since 2023-08-03
 */
@CrossOrigin
@Api(value = "专用于生成国家局业务单据号",tags = {"专用于生成国家局业务单据号"})
@RestController
@RequestMapping("billnonewgjj")
public class BillnonewgjjController {

    private final static Logger LOGGER = LoggerFactory.getLogger(BillnonewgjjController.class);


    @Autowired
    private IBillnonewgjjService billnonewgjjService;


    /**
     * 根据ID查询数据
     * @param id
     * @return
     */
    @ApiOperation(value="查询", notes="根据ID查询数据")
    @GetMapping("getOne/{id}")
    public ResultUtil getOne(@PathVariable("id") String id){
        LOGGER.info("入参为:{}",id);
        ResultUtil<Billnonewgjj> data = new ResultUtil<>();
        if (StringUtils.isEmpty(id)){
            data.failed("传入的主键为空");
            return data;
        }
        data.success(this.billnonewgjjService.getById(id));
        return data;
    }



}

