获取门禁通行记录 API 接口

该 API 接口用于获取指定门禁的通行记录,接受门禁名称作为参数,返回包含所有通行记录的列表。

前端代码示例:

  getPassLogs(name) {
    getDoorPassLogs('1#MJ1F23').then(res => {
      console.log('门禁通行记录--->', res);
    })
  }

后端代码:

// 获取门禁通行记录
export function getDoorPassLogs(name) {
  return request({
    url: '/data/api/access/getDoorPassLogsByDoorName?name=' + name,
    method: 'get',
  })
}

@GetMapping("/getDoorPassLogsByDoorName")
public AjaxResult getDoorPassLogsByDoorName(String name) {
  String sql = "SELECT * FROM Face.FaceRecord where Name IS NOT NULL and Device = \'" + name + "\'";
  JdbcUtil jdbcUtil = new JdbcUtil(OneCardUrlConstant.SMART_CARD_ONE);
  List<Map<String, Object>> maps = jdbcUtil.executeQuerySql(sql);
  return AjaxResult.success(maps);
}

后端接收name参数为1内容:

The backend code is accepting the 'name' parameter as a string with a value of '1'.

获取门禁通行记录 API 接口 -  获取指定门禁的通行记录

原文地址: https://www.cveoy.top/t/topic/b183 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录