You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.5 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package BaseRolePersonService
import (
"context"
"dsBaseWeb/Business/BaseRolePerson/BaseRolePersonProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"errors"
"time"
)
/**
功能根据人员ID获取所管辖的地区信息
作者:吴缤
时间2020-06-12 11:50:28
*/
func GetManageArea(getManageAreaArg BaseRolePersonProto.GetManageAreaArg) (*BaseRolePersonProto.Reply, error) {
//1、准备动作连接服务器
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseRolePersonProto.NewBaseRolePersonManageClient(conn)
Reply, err := c.GetManageArea(ctx, &getManageAreaArg)
if err != nil {
LogUtil.Error("获取入学年份错误: ", err.Error())
}
return Reply, err
}
/**
功能:获取人员角色信息
作者:吴缤
时间2020-06-28 09:50:28
*/
func PageBaseRolePerson(queryArg BaseRolePersonProto.QueryArg) (*BaseRolePersonProto.Reply, error) {
//1、准备动作连接服务器
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseRolePersonProto.NewBaseRolePersonManageClient(conn)
Reply, err := c.PageBaseRolePerson(ctx, &queryArg)
if err != nil {
LogUtil.Error("获取人员角色信息错误: ", err.Error())
}
return Reply, err
}