goProject/.svn/pristine/57/576810f1d094644512c078a85a8cf10b20959f04.svn-base
2025-01-06 16:21:36 +08:00

82 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ************************************
// @package: handleMgr
// @description: 全局操作接口管理API类
// @author:
// @revision history:
// @create date: 2022-02-23 16:24:59
// ************************************
package handleMgr
/*
用于提供全局操作接口管理API类
*/
/*
接口说明
接口1
// RegisterNewModule
// @description: 注册方法
// parameter:
// @moduleName:模块名
// @structObject:模块对象
// @monitorTime:监控日志超时时间,传入0是用默认值100
// return:
示例RegisterNewModule("test", new(testBll), 0)
接口2
// Done
// @description: 执行访问
// parameter:
// @logicalId:逻辑实例Id-同一串行错误类的唯一标识
// @moduleName:模块名
// @funcName:执行方法名称
// @parameter:方法参数
// @isHaveResult:是否处理返回值
// return:
// @data:返还对象
// @code:错误码-0未无错误
// @message:错误说明-空字符串为无错误
示例data,code,mes := Done("test", "testBll", "Add", parameter, false)
注意:
注册的类实现的方法返回值必须是*ResponseObject为返回对象
示例:
type testBll struct {
}
// TestAdd
// @description:测试添加
// parameter:
// @receiver t:
// @x:
// @y:
// return:
// @*ResponseObject:
func (t testBll) TestAdd(x, y int) *ResponseObject {
responseObj := GetInitResponseObj()
data[x] = y
z := x + y
responseObj.SetData(z)
responseObj.SetResultStatus("错误码")
return responseObj
}
func TestNew(t *testing.T) {
// 注册类
RegisterNewModule("test", new(testBll), 10)
// 调用方法
data, code, mes := Done("test", "testBll", "TestAdd", parameter, false)
// 可以重复注册多个类,逻辑实例Id保持一致即可
RegisterNewModule("test", new(test2Bll), 10)
data, code, mes := Done("test", "test2Bll", "TestAdd", parameter, false)
}
*/