Browse Source

!2 add reservedCall

chenliangyu 3 months ago
parent
commit
7f15224f1a

+ 49 - 0
Module/mod_guiconsole/GUIConsole_client_g.h

@@ -744,6 +744,55 @@ public:
 		return Error;
 	}
 
+	ErrorCodeEnum ReservedCall(GUIConsoleService_ReservedCall_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		if (m_context.checkEmpty())
+		{
+			m_context.AutoGenerate();
+			DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
+			m_context = m_context.upgradeLink();
+		}
+		auto ret = pFunc->AsyncRequest(GUIConsoleService_Method_ReservedCall, GUIConsoleService_MethodSignature_ReservedCall, Buf, spAsyncWait, m_context, dwTimeout);
+		m_context.clear();
+		return ret;
+	}
+	ErrorCodeEnum ReservedCall(GUIConsoleService_ReservedCall_Req &Req, GUIConsoleService_ReservedCall_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = ReservedCall(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum ReservedCall(GUIConsoleService_ReservedCall_Req &Req, GUIConsoleService_ReservedCall_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = ReservedCall(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum ReservedCall(GUIConsoleService_ReservedCall_Req &Req, GUIConsoleService_ReservedCall_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = ReservedCall(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			CSimpleString str;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
 
 	bool SafeDelete()
 	{

+ 36 - 0
Module/mod_guiconsole/GUIConsole_def_g.h

@@ -26,6 +26,7 @@ namespace GUIConsole {
 #define GUIConsoleService_Method_GetHelpDetail 11
 #define GUIConsoleService_Method_OpenCommonPage 12
 #define GUIConsoleService_Method_CloseCommonPage 13
+#define GUIConsoleService_Method_ReservedCall 14
 
 #define GUIConsoleService_MethodSignature_OpenLogSender -744778557
 #define GUIConsoleService_MethodSignature_CloseLogSender -1838250527
@@ -41,6 +42,7 @@ namespace GUIConsole {
 #define GUIConsoleService_MethodSignature_GetHelpDetail -45426198
 #define GUIConsoleService_MethodSignature_OpenCommonPage 15213547
 #define GUIConsoleService_MethodSignature_CloseCommonPage 1463237030
+#define GUIConsoleService_MethodSignature_ReservedCall -1877416012
 
 #define GUIConsoleService_LogCode_OpenLogSender "QLR040250800"
 #define GUIConsoleService_LogCode_CloseLogSender "QLR040250801"
@@ -56,6 +58,7 @@ namespace GUIConsole {
 #define GUIConsoleService_LogCode_GetHelpDetail "QLR040250811"
 #define GUIConsoleService_LogCode_OpenCommonPage "QLR040250812"
 #define GUIConsoleService_LogCode_CloseCommonPage "QLR040250813"
+#define GUIConsoleService_LogCode_ReservedCall "QLR040250814"
 
 struct GUIConsoleService_OpenLogSender_Req
 {
@@ -427,6 +430,39 @@ struct GUIConsoleService_CloseCommonPage_Ans
 
 };
 
+struct GUIConsoleService_ReservedCall_Req
+{
+	CSimpleStringA reqType;
+	CSimpleStringA reqStr1;
+	CSimpleStringA reqStr2;
+	CSimpleStringA reqStr3;
+	int reqInt1;
+	int reqInt2;
+	int reqInt3;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & reqType & reqStr1 & reqStr2 & reqStr3 & reqInt1 & reqInt2 & reqInt3;
+	}
+
+};
+
+struct GUIConsoleService_ReservedCall_Ans
+{
+	CSimpleStringA retStr1;
+	CSimpleStringA retStr2;
+	CSimpleStringA retStr3;
+	int retInt1;
+	int retInt2;
+	int retInt3;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & retStr1 & retStr2 & retStr3 & retInt1 & retInt2 & retInt3;
+	}
+
+};
+
 
 ///////////////////////////
 

+ 27 - 0
Module/mod_guiconsole/GUIConsole_server_g.h

@@ -128,6 +128,13 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case GUIConsoleService_Method_ReservedCall:
+			if (dwSignature == GUIConsoleService_MethodSignature_ReservedCall) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -209,6 +216,11 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case GUIConsoleService_Method_ReservedCall:
+			if (dwSignature != GUIConsoleService_MethodSignature_ReservedCall) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -286,6 +298,11 @@ public:
 	/// override by user
 	}
 
+	virtual void Handle_ReservedCall(SpReqAnsContext<GUIConsoleService_ReservedCall_Req, GUIConsoleService_ReservedCall_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
 	virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		CAutoBuffer Buf;
@@ -442,6 +459,16 @@ public:
 						Handle_CloseCommonPage(ctx);
 					}
 					break;
+				case GUIConsoleService_Method_ReservedCall:
+					{
+						SpReqAnsContext<GUIConsoleService_ReservedCall_Req,GUIConsoleService_ReservedCall_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<GUIConsoleService_ReservedCall_Req,GUIConsoleService_ReservedCall_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						pTransactionContext->GetLinkContext(ctx->link);
+						EntityResource::setLink(ctx->link);
+						Handle_ReservedCall(ctx);
+					}
+					break;
 				default:
 					assert(0);
 					break;

+ 19 - 0
Module/mod_guiconsole/GuiConsole.xml

@@ -282,6 +282,25 @@
 				<param name="additionalMsg" type="string"/>
 			</res>
 		</twoway>
+		<twoway name="ReservedCall" overlap="true" simpleret="true">
+			<req>
+				<param name="reqType" type="string"/>
+				<param name="reqStr1" type="string"/>
+				<param name="reqStr2" type="string"/>
+				<param name="reqStr3" type="string"/>
+				<param name="reqInt1" type="int"/>
+				<param name="reqInt2" type="int"/>
+				<param name="reqInt3" type="int"/>
+			</req>
+			<res>
+				<param name="retStr1" type="string"/>
+				<param name="retStr2" type="string"/>
+				<param name="retStr3" type="string"/>
+				<param name="retInt1" type="int"/>
+				<param name="retInt2" type="int"/>
+				<param name="retInt3" type="int"/>
+			</res>
+		</twoway>
 	</class>