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.

106 lines
2.8 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 BaseGlobalService
import (
"context"
"dsBaseWeb/Business/BaseGlobal/BaseGlobalProto"
"dsBaseWeb/Utils/GRpcUtil"
"dsBaseWeb/Utils/LogUtil"
"time"
)
/**
功能:增加全局变量
作者:吴缤
时间2020-04-22
*/
func AddBaseGlobal(modelArg BaseGlobalProto.ModelArg) (*BaseGlobalProto.Reply, error) {
//1、准备动作连接服务器
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
c := BaseGlobalProto.NewBaseGlobalManageClient(conn)
Reply, err := c.AddBaseGlobal(ctx, &modelArg)
if err != nil {
LogUtil.Error("增加全局变量错误: ", err.Error())
}
return Reply, err
}
/**
功能:删除全局变量
作者:吴缤
时间2020-04-22
*/
func DeleteBaseGlobal(deleteIdsArg BaseGlobalProto.DeleteIdsArg) (*BaseGlobalProto.Reply, error) {
//1、准备动作连接服务器
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
c := BaseGlobalProto.NewBaseGlobalManageClient(conn)
Reply, err := c.DeleteBaseGlobal(ctx, &deleteIdsArg)
if err != nil {
LogUtil.Error("删除全局变量错误: ", err.Error())
}
return Reply, err
}
/**
功能:修改全局变量
作者:吴缤
时间2020-04-22
*/
func UpdateBaseGlobal(modelArg BaseGlobalProto.ModelArg) (*BaseGlobalProto.Reply, error) {
//1、准备动作连接服务器
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
c := BaseGlobalProto.NewBaseGlobalManageClient(conn)
Reply, err := c.UpdateBaseGlobal(ctx, &modelArg)
if err != nil {
LogUtil.Error("修改全局变量错误: ", err.Error())
}
return Reply, err
}
/**
功能:根据全局变量列表
作者:吴缤
时间2020-04-22
*/
func PageBaseGlobal(queryArg BaseGlobalProto.QueryArg) (*BaseGlobalProto.Reply, error) {
//1、准备动作连接服务器
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、
c := BaseGlobalProto.NewBaseGlobalManageClient(conn)
Reply, err := c.PageBaseGlobal(ctx, &queryArg)
if err != nil {
LogUtil.Error("根据全局变量列表错误: ", err.Error())
}
return Reply, err
}
/**
功能:获取全局变量信息
作者:吴缤
时间2020-06-09 16:26:22
*/
func GetBaseGlobal(modelArg BaseGlobalProto.ModelArg) (*BaseGlobalProto.Reply, error) {
//1、准备动作连接服务器
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
//2、业务传参
c := BaseGlobalProto.NewBaseGlobalManageClient(conn)
Reply, err := c.GetBaseGlobal(ctx, &modelArg)
if err != nil {
LogUtil.Error("获取全局变量信息错误: ", err.Error())
}
return Reply, err
}