Commit fc68f960 authored by 王源's avatar 王源 🎧

添加基础信息rpc服务

parent 59ef3bd1
<?php
/**
* Created by PhpStorm.
* User: 王源
* Date: 2020/1/9
* Time: 15:07
*/
namespace Meibuyu\Micro\Service\Interfaces;
interface BaseInfoServiceInterface
{
/**
* 通过单个id获取岗位数组
* @param int $id
* @param array $columns
* @param array $relations
* @return array
*/
public function getPositionListById(int $id, array $columns = ['*'], array $relations = []): array;
/**
* 通过id数组获取国家数组
* @param array $idList
* @param array $columns
* @return array
*/
public function getCountryListByIdList(array $idList, array $columns = ['*']): array;
}
......@@ -22,6 +22,7 @@ interface UserServiceInterface
* 通过id列表获取用户数组
* @param array $idList
* @param array $columns
* @param array $relations 可传入['team', 'department', 'position'],分别是团队,部门和岗位
* @return mixed
*/
public function getByIdList(array $idList, array $columns = ['*'], array $relations = []);
......@@ -37,7 +38,7 @@ interface UserServiceInterface
/**
* 获取用户拥有某个应用的所有权限
* @param int $userId
* @param string $appName 为空获取全部权限
* @param string $appName 当前系统名称,为空获取全部权限
* @return array
*/
public function getPerms(int $userId, string $appName = null): array;
......
......@@ -387,3 +387,13 @@ if (!function_exists('num_2_file_size')) {
return number_format($num, 2) . ' ' . $format;
}
}
if (!function_exists('select_id_name')) {
function select_id_name($columns = [])
{
$columns = array_merge(['id', 'name'], $columns);
return function ($q) use ($columns) {
$q->select($columns);
};
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment