Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
meibuyu-rpc
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
without authentication
meibuyu-rpc
Commits
fc68f960
Commit
fc68f960
authored
May 12, 2020
by
王源
🎧
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加基础信息rpc服务
parent
59ef3bd1
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
1 deletion
+43
-1
BaseInfoServiceInterface.php
src/Service/Interfaces/BaseInfoServiceInterface.php
+31
-0
UserServiceInterface.php
src/Service/Interfaces/UserServiceInterface.php
+2
-1
functions.php
src/functions.php
+10
-0
No files found.
src/Service/Interfaces/BaseInfoServiceInterface.php
0 → 100644
View file @
fc68f960
<?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
;
}
src/Service/Interfaces/UserServiceInterface.php
View file @
fc68f960
...
@@ -22,6 +22,7 @@ interface UserServiceInterface
...
@@ -22,6 +22,7 @@ interface UserServiceInterface
* 通过id列表获取用户数组
* 通过id列表获取用户数组
* @param array $idList
* @param array $idList
* @param array $columns
* @param array $columns
* @param array $relations 可传入['team', 'department', 'position'],分别是团队,部门和岗位
* @return mixed
* @return mixed
*/
*/
public
function
getByIdList
(
array
$idList
,
array
$columns
=
[
'*'
],
array
$relations
=
[]);
public
function
getByIdList
(
array
$idList
,
array
$columns
=
[
'*'
],
array
$relations
=
[]);
...
@@ -37,7 +38,7 @@ interface UserServiceInterface
...
@@ -37,7 +38,7 @@ interface UserServiceInterface
/**
/**
* 获取用户拥有某个应用的所有权限
* 获取用户拥有某个应用的所有权限
* @param int $userId
* @param int $userId
* @param string $appName 为空获取全部权限
* @param string $appName
当前系统名称,
为空获取全部权限
* @return array
* @return array
*/
*/
public
function
getPerms
(
int
$userId
,
string
$appName
=
null
)
:
array
;
public
function
getPerms
(
int
$userId
,
string
$appName
=
null
)
:
array
;
...
...
src/functions.php
View file @
fc68f960
...
@@ -387,3 +387,13 @@ if (!function_exists('num_2_file_size')) {
...
@@ -387,3 +387,13 @@ if (!function_exists('num_2_file_size')) {
return
number_format
(
$num
,
2
)
.
' '
.
$format
;
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
);
};
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment