|
|
|
@ -171,3 +171,36 @@ func (s *Rpc) PageBaseGlobal(ctx context.Context, in *BaseGlobalProto.QueryArg)
|
|
|
|
|
return &reply, nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 通过全局变量的代码获取全局变量的信息
|
|
|
|
|
func (s *Rpc) GetBaseGlobalByCode(ctx context.Context, in *BaseGlobalProto.ModelArg) (*BaseGlobalProto.Reply, error) {
|
|
|
|
|
//异常处理
|
|
|
|
|
defer func() {
|
|
|
|
|
if err := recover(); err != nil {
|
|
|
|
|
fmt.Printf("%s\n", err)
|
|
|
|
|
}
|
|
|
|
|
}()
|
|
|
|
|
//rpc响应
|
|
|
|
|
var reply BaseGlobalProto.Reply
|
|
|
|
|
list, count, err := BaseGlobalDao.GetBaseGlobalByCodes([]string{in.GlobalCode})
|
|
|
|
|
//错误处理
|
|
|
|
|
if err != nil {
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = Const.DataBaseActionError
|
|
|
|
|
LogUtil.Error(ErrorConst.SqlQueryError, "执行GetBaseGlobalByCode时发生严重错误:"+err.Error())
|
|
|
|
|
return &reply, err
|
|
|
|
|
}
|
|
|
|
|
if list != nil {
|
|
|
|
|
reply.Count = count
|
|
|
|
|
reply.Success = true
|
|
|
|
|
reply.Message = Const.SuccessDataBaseAction
|
|
|
|
|
reply.List = CommonUtil.SerializeToString(list)
|
|
|
|
|
return &reply, nil
|
|
|
|
|
} else {
|
|
|
|
|
reply.Count = 0
|
|
|
|
|
reply.Success = false
|
|
|
|
|
reply.Message = Const.SuccessDataBaseAction
|
|
|
|
|
reply.List = Const.BlankArrayString
|
|
|
|
|
return &reply, nil
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|