Merge remote-tracking branch 'origin/master' into master
This commit is contained in:
commit
545383ed28
@ -0,0 +1,100 @@
|
||||
package com.ruoyi.system.fantang.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Arrays;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.system.fantang.domain.FtFaceinfoDao;
|
||||
import com.ruoyi.system.fantang.service.IFtFaceinfoDaoService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 人脸信息Controller
|
||||
*
|
||||
* @author ryo
|
||||
* @date 2021-01-11
|
||||
*/
|
||||
@RequiredArgsConstructor(onConstructor_ = @Autowired)
|
||||
@RestController
|
||||
@RequestMapping("/fantang/faceInfo" )
|
||||
public class FtFaceinfoDaoController extends BaseController {
|
||||
|
||||
private final IFtFaceinfoDaoService iFtFaceinfoDaoService;
|
||||
|
||||
/**
|
||||
* 查询人脸信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:faceInfo:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(FtFaceinfoDao ftFaceinfoDao) {
|
||||
startPage();
|
||||
List<FtFaceinfoDao> list = iFtFaceinfoDaoService.queryList(ftFaceinfoDao);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出人脸信息列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:faceInfo:export')" )
|
||||
@Log(title = "人脸信息" , businessType = BusinessType.EXPORT)
|
||||
@GetMapping("/export" )
|
||||
public AjaxResult export(FtFaceinfoDao ftFaceinfoDao) {
|
||||
List<FtFaceinfoDao> list = iFtFaceinfoDaoService.queryList(ftFaceinfoDao);
|
||||
ExcelUtil<FtFaceinfoDao> util = new ExcelUtil<FtFaceinfoDao>(FtFaceinfoDao.class);
|
||||
return util.exportExcel(list, "faceInfo" );
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人脸信息详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:faceInfo:query')" )
|
||||
@GetMapping(value = "/{id}" )
|
||||
public AjaxResult getInfo(@PathVariable("id" ) Long id) {
|
||||
return AjaxResult.success(iFtFaceinfoDaoService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增人脸信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:faceInfo:add')" )
|
||||
@Log(title = "人脸信息" , businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody FtFaceinfoDao ftFaceinfoDao) {
|
||||
return toAjax(iFtFaceinfoDaoService.save(ftFaceinfoDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改人脸信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:faceInfo:edit')" )
|
||||
@Log(title = "人脸信息" , businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody FtFaceinfoDao ftFaceinfoDao) {
|
||||
return toAjax(iFtFaceinfoDaoService.updateById(ftFaceinfoDao) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除人脸信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('fantang:faceInfo:remove')" )
|
||||
@Log(title = "人脸信息" , businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}" )
|
||||
public AjaxResult remove(@PathVariable Long[] ids) {
|
||||
return toAjax(iFtFaceinfoDaoService.removeByIds(Arrays.asList(ids)) ? 1 : 0);
|
||||
}
|
||||
}
|
@ -0,0 +1,63 @@
|
||||
package com.ruoyi.system.fantang.domain;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
import lombok.experimental.Accessors;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 人脸信息对象 ft_faceInfo
|
||||
*
|
||||
* @author ryo
|
||||
* @date 2021-01-11
|
||||
*/
|
||||
@Data
|
||||
@ToString
|
||||
@EqualsAndHashCode
|
||||
@NoArgsConstructor
|
||||
@Accessors(chain = true)
|
||||
@TableName("ft_faceInfo")
|
||||
public class FtFaceinfoDao implements Serializable {
|
||||
|
||||
private static final long serialVersionUID=1L;
|
||||
|
||||
|
||||
/** id */
|
||||
@TableId(value = "id")
|
||||
private Long id;
|
||||
|
||||
/** 设备 id */
|
||||
@Excel(name = "设备 id")
|
||||
private String deviceId;
|
||||
|
||||
/** 员工 id */
|
||||
@Excel(name = "员工 id")
|
||||
private Long personId;
|
||||
|
||||
/** 手机 */
|
||||
@Excel(name = "手机")
|
||||
private String phone;
|
||||
|
||||
/** $column.columnComment */
|
||||
private Long memId;
|
||||
|
||||
/** 创建时间 */
|
||||
@Excel(name = "创建时间" , width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createtime;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Map<String, Object> params = new HashMap<>();
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
package com.ruoyi.system.fantang.mapper;
|
||||
|
||||
import com.ruoyi.system.fantang.domain.FtFaceinfoDao;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* 人脸信息Mapper接口
|
||||
*
|
||||
* @author ryo
|
||||
* @date 2021-01-11
|
||||
*/
|
||||
public interface FtFaceinfoDaoMapper extends BaseMapper<FtFaceinfoDao> {
|
||||
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.ruoyi.system.fantang.service;
|
||||
|
||||
import com.ruoyi.system.fantang.domain.FtFaceinfoDao;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 人脸信息Service接口
|
||||
*
|
||||
* @author ryo
|
||||
* @date 2021-01-11
|
||||
*/
|
||||
public interface IFtFaceinfoDaoService extends IService<FtFaceinfoDao> {
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
List<FtFaceinfoDao> queryList(FtFaceinfoDao ftFaceinfoDao);
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.ruoyi.system.fantang.service.impl;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.ruoyi.system.fantang.mapper.FtFaceinfoDaoMapper;
|
||||
import com.ruoyi.system.fantang.domain.FtFaceinfoDao;
|
||||
import com.ruoyi.system.fantang.service.IFtFaceinfoDaoService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 人脸信息Service业务层处理
|
||||
*
|
||||
* @author ryo
|
||||
* @date 2021-01-11
|
||||
*/
|
||||
@Service
|
||||
public class FtFaceinfoDaoServiceImpl extends ServiceImpl<FtFaceinfoDaoMapper, FtFaceinfoDao> implements IFtFaceinfoDaoService {
|
||||
|
||||
@Override
|
||||
public List<FtFaceinfoDao> queryList(FtFaceinfoDao ftFaceinfoDao) {
|
||||
LambdaQueryWrapper<FtFaceinfoDao> lqw = Wrappers.lambdaQuery();
|
||||
if (StringUtils.isNotBlank(ftFaceinfoDao.getDeviceId())){
|
||||
lqw.eq(FtFaceinfoDao::getDeviceId ,ftFaceinfoDao.getDeviceId());
|
||||
}
|
||||
if (ftFaceinfoDao.getPersonId() != null){
|
||||
lqw.eq(FtFaceinfoDao::getPersonId ,ftFaceinfoDao.getPersonId());
|
||||
}
|
||||
if (StringUtils.isNotBlank(ftFaceinfoDao.getPhone())){
|
||||
lqw.eq(FtFaceinfoDao::getPhone ,ftFaceinfoDao.getPhone());
|
||||
}
|
||||
return this.list(lqw);
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.system.fantang.mapper.FtFaceinfoDaoMapper">
|
||||
|
||||
<resultMap type="FtFaceinfoDao" id="FtFaceinfoDaoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="personId" column="person_id" />
|
||||
<result property="phone" column="phone" />
|
||||
<result property="memId" column="mem_id" />
|
||||
<result property="createtime" column="createTime" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
</mapper>
|
53
ruoyi-ui/src/api/fantang/faceInfo.js
Normal file
53
ruoyi-ui/src/api/fantang/faceInfo.js
Normal file
@ -0,0 +1,53 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询人脸信息列表
|
||||
export function listFaceInfo(query) {
|
||||
return request({
|
||||
url: '/fantang/faceInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询人脸信息详细
|
||||
export function getFaceInfo(id) {
|
||||
return request({
|
||||
url: '/fantang/faceInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增人脸信息
|
||||
export function addFaceInfo(data) {
|
||||
return request({
|
||||
url: '/fantang/faceInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改人脸信息
|
||||
export function updateFaceInfo(data) {
|
||||
return request({
|
||||
url: '/fantang/faceInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除人脸信息
|
||||
export function delFaceInfo(id) {
|
||||
return request({
|
||||
url: '/fantang/faceInfo/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出人脸信息
|
||||
export function exportFaceInfo(query) {
|
||||
return request({
|
||||
url: '/fantang/faceInfo/export',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
283
ruoyi-ui/src/views/fantang/faceInfo/index.vue
Normal file
283
ruoyi-ui/src/views/fantang/faceInfo/index.vue
Normal file
@ -0,0 +1,283 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="设备 id" prop="deviceId">
|
||||
<el-input
|
||||
v-model="queryParams.deviceId"
|
||||
placeholder="请输入设备 id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="员工 id" prop="personId">
|
||||
<el-input
|
||||
v-model="queryParams.personId"
|
||||
placeholder="请输入员工 id"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机" prop="phone">
|
||||
<el-input
|
||||
v-model="queryParams.phone"
|
||||
placeholder="请输入手机"
|
||||
clearable
|
||||
size="small"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['fantang:faceInfo:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['fantang:faceInfo:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['fantang:faceInfo:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['fantang:faceInfo:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="faceInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="id" align="center" prop="id" v-if="false"/>
|
||||
<el-table-column label="设备 id" align="center" prop="deviceId" />
|
||||
<el-table-column label="员工 id" align="center" prop="personId" />
|
||||
<el-table-column label="手机" align="center" prop="phone" />
|
||||
<el-table-column label="创建时间" align="center" prop="createtime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createtime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['fantang:faceInfo:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['fantang:faceInfo:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改人脸信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listFaceInfo, getFaceInfo, delFaceInfo, addFaceInfo, updateFaceInfo, exportFaceInfo } from "@/api/fantang/faceInfo";
|
||||
|
||||
export default {
|
||||
name: "FaceInfo",
|
||||
components: {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 人脸信息表格数据
|
||||
faceInfoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
deviceId: undefined,
|
||||
personId: undefined,
|
||||
phone: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询人脸信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listFaceInfo(this.queryParams).then(response => {
|
||||
this.faceInfoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: undefined,
|
||||
deviceId: undefined,
|
||||
personId: undefined,
|
||||
phone: undefined,
|
||||
memId: undefined,
|
||||
createtime: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加人脸信息";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getFaceInfo(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改人脸信息";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateFaceInfo(this.form).then(response => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addFaceInfo(this.form).then(response => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$confirm('是否确认删除人脸信息编号为"' + ids + '"的数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return delFaceInfo(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.msgSuccess("删除成功");
|
||||
})
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
const queryParams = this.queryParams;
|
||||
this.$confirm('是否确认导出所有人脸信息数据项?', "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
}).then(function() {
|
||||
return exportFaceInfo(queryParams);
|
||||
}).then(response => {
|
||||
this.download(response.msg);
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user