package com.usky.eg.controller.web;


import com.usky.common.core.bean.ApiResult;
import com.usky.common.core.bean.CommonPage;
import com.usky.eg.domain.EgRecord;
import com.usky.eg.service.EgRecordService;
import com.usky.eg.service.vo.EgRecordRequestVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 门禁_通行记录表 前端控制器
 * </p>
 *
 * @author zyj
 * @since 2024-11-27
 */
@RestController
@RequestMapping("/egRecord")
public class EgRecordController {
    @Autowired
    private EgRecordService egRecordService;

    @PostMapping
    public ApiResult<Void> add(@RequestBody EgRecord egRecord){
        egRecordService.add(egRecord);
        return ApiResult.success();
    }

    @PostMapping("page")
    public ApiResult<CommonPage<EgRecord>> page(@RequestBody EgRecordRequestVO requestVO){
        return ApiResult.success(egRecordService.page(requestVO));
    }
}

