Browse Source

Z991239-4797 #comment feat: 同步准入接口

陈纪林80310970 2 years ago
parent
commit
37756b2d3b

+ 31 - 0
Module/mod_accessauth/AccessAuthorization_client_g.h

@@ -148,6 +148,37 @@ public:
 		return pFunc->OnewayCall(AccessAuthService_Method_SyncTime, AccessAuthService_MethodSignature_SyncTime, m_context);
 	}
 
+	ErrorCodeEnum GetNetMsg(AccessAuthService_GetNetMsg_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
+	{
+		CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
+		CAutoBuffer Buf = SpObject2Buffer(Req);
+		auto ret = pFunc->AsyncRequest(AccessAuthService_Method_GetNetMsg, AccessAuthService_MethodSignature_GetNetMsg, Buf, spAsyncWait, m_context, dwTimeout);
+		m_context.clear();
+		return ret;
+	}
+	ErrorCodeEnum GetNetMsg(AccessAuthService_GetNetMsg_Req &Req, AccessAuthService_GetNetMsg_Ans &Ans, DWORD dwTimeout)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetNetMsg(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+	ErrorCodeEnum GetNetMsg(AccessAuthService_GetNetMsg_Req &Req, AccessAuthService_GetNetMsg_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
+	{
+		CSmartPointer<IAsynWaitSp> spAsyncWait;
+		ErrorCodeEnum Error = GetNetMsg(Req, spAsyncWait, dwTimeout);
+		if (Error == Error_Succeed) {
+			bool bEnd = false;
+			Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, dwTimeout);
+			LOG_ASSERT(Error || bEnd);
+		}
+		return Error;
+	}
+
 
 	bool SafeDelete()
 	{

+ 25 - 7
Module/mod_accessauth/AccessAuthorization_def_g.h

@@ -18,6 +18,7 @@ namespace AccessAuthorization {
 #define AccessAuthService_Method_UpdateWK 3
 #define AccessAuthService_Method_InitializeNew 4
 #define AccessAuthService_Method_SyncTime 5
+#define AccessAuthService_Method_GetNetMsg 6
 
 #define AccessAuthService_MethodSignature_Regist -1850909100
 #define AccessAuthService_MethodSignature_Unregist 667273038
@@ -25,13 +26,7 @@ namespace AccessAuthorization {
 #define AccessAuthService_MethodSignature_UpdateWK 949758137
 #define AccessAuthService_MethodSignature_InitializeNew 1851143282
 #define AccessAuthService_MethodSignature_SyncTime 1195907872
-
-#define AccessAuthService_LogCode_Regist "QLR040250200"
-#define AccessAuthService_LogCode_Unregist "QLR040250201"
-#define AccessAuthService_LogCode_InitDev "QLR040250202"
-#define AccessAuthService_LogCode_UpdateWK "QLR040250203"
-#define AccessAuthService_LogCode_InitializeNew "QLR040250204"
-#define AccessAuthService_LogCode_SyncTime "QLR040250205"
+#define AccessAuthService_MethodSignature_GetNetMsg 136486236
 
 struct AccessAuthService_Regist_Info
 {
@@ -125,6 +120,29 @@ struct AccessAuthService_SyncTime_Info
 
 };
 
+struct AccessAuthService_GetNetMsg_Req
+{
+
+	void Serialize(SpBuffer &Buf)
+	{
+	}
+
+};
+
+struct AccessAuthService_GetNetMsg_Ans
+{
+	int netStatus;
+	CSimpleStringA netMsg;
+	CSimpleStringA reserved1;
+	CSimpleStringA reserved2;
+
+	void Serialize(SpBuffer &Buf)
+	{
+		auto & buf = Buf & netStatus & netMsg & reserved1 & reserved2;
+	}
+
+};
+
 
 ///////////////////////////
 

+ 26 - 0
Module/mod_accessauth/AccessAuthorization_server_g.h

@@ -72,6 +72,13 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case AccessAuthService_Method_GetNetMsg:
+			if (dwSignature == AccessAuthService_MethodSignature_GetNetMsg) {
+				bOverlap = true;
+			} else {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -113,6 +120,11 @@ public:
 				Error = Error_MethodSignatureFailed;
 			}
 			break;
+		case AccessAuthService_Method_GetNetMsg:
+			if (dwSignature != AccessAuthService_MethodSignature_GetNetMsg) {
+				Error = Error_MethodSignatureFailed;
+			}
+			break;
 		default:
 			Error = Error_MethodNotFound;
 			break;
@@ -150,6 +162,11 @@ public:
 	/// override by user
 	}
 
+	virtual void Handle_GetNetMsg(SpReqAnsContext<AccessAuthService_GetNetMsg_Req, AccessAuthService_GetNetMsg_Ans>::Pointer ctx)
+	{
+	/// override by user
+	}
+
 	virtual void OnRequest(CSmartPointer<ITransactionContext> pTransactionContext)
 	{
 		CAutoBuffer Buf;
@@ -220,6 +237,15 @@ public:
 						Handle_SyncTime(ctx);
 					}
 					break;
+				case AccessAuthService_Method_GetNetMsg:
+					{
+						SpReqAnsContext<AccessAuthService_GetNetMsg_Req,AccessAuthService_GetNetMsg_Ans>::Pointer ctx;
+						ctx.Attach(new SpReqAnsContext<AccessAuthService_GetNetMsg_Req,AccessAuthService_GetNetMsg_Ans>(pTransactionContext));
+						SpBuffer2Object(Buf, ctx->Req);
+						pTransactionContext->GetLinkContext(ctx->link);
+						Handle_GetNetMsg(ctx);
+					}
+					break;
 				default:
 					assert(0);
 					break;