47 lines
1.1 KiB
Plaintext
47 lines
1.1 KiB
Plaintext
|
|
// ************************************
|
||
|
|
// @package: handleMgr
|
||
|
|
// @description: 反射类-请求对象
|
||
|
|
// @author:
|
||
|
|
// @revision history:
|
||
|
|
// @create date: 2022-02-23 16:33:53
|
||
|
|
// ************************************
|
||
|
|
|
||
|
|
package handleMgr
|
||
|
|
|
||
|
|
// RequestObject 请求对象
|
||
|
|
type RequestObject struct {
|
||
|
|
// 请求的模块名称
|
||
|
|
ModuleName string
|
||
|
|
|
||
|
|
// 请求的方法名称
|
||
|
|
MethodName string
|
||
|
|
|
||
|
|
// 请求的参数数组
|
||
|
|
Parameters []interface{}
|
||
|
|
|
||
|
|
// 是否处理返回值
|
||
|
|
IsHaveResult bool
|
||
|
|
|
||
|
|
// 执行完成,返回chan监控
|
||
|
|
ResultChan chan *ResponseObject
|
||
|
|
}
|
||
|
|
|
||
|
|
// NewRequestObject
|
||
|
|
// @description:
|
||
|
|
// parameter:
|
||
|
|
// @moduleName:模块名名称
|
||
|
|
// @methodName:执行方法名称
|
||
|
|
// @parameters:方法参数
|
||
|
|
// @isHaveResult:是否处理返回值
|
||
|
|
// return:
|
||
|
|
// @*RequestObject:
|
||
|
|
func NewRequestObject(moduleName string, methodName string, parameters []interface{}, isHaveResult bool) *RequestObject {
|
||
|
|
return &RequestObject{
|
||
|
|
ModuleName: moduleName,
|
||
|
|
MethodName: methodName,
|
||
|
|
Parameters: parameters,
|
||
|
|
IsHaveResult: isHaveResult,
|
||
|
|
ResultChan: make(chan *ResponseObject, 1),
|
||
|
|
}
|
||
|
|
}
|