|
@@ -99,6 +99,8 @@ namespace TEAMModelOS.Controllers.Learn
|
|
|
request.vote.id = Guid.NewGuid().ToString();
|
|
|
//request.survey.status = 100;
|
|
|
request.vote.progress = "pending";
|
|
|
+ long SequenceNumber = await _serviceBus.GetServiceBusClient().SendLeamMessage<Vote>(Constants.TopicName, request.vote.id, request.vote.code, request.vote.startTime);
|
|
|
+ request.vote.sequenceNumber = SequenceNumber;
|
|
|
vote = await client.GetContainer("TEAMModelOS", "Common").CreateItemAsync(request.vote, new PartitionKey($"{request.vote.code}"));
|
|
|
/*if (request.vote.scope.Equals("school"))
|
|
|
{
|
|
@@ -107,10 +109,7 @@ namespace TEAMModelOS.Controllers.Learn
|
|
|
else
|
|
|
{
|
|
|
vote = await client.GetContainer("TEAMModelOS", "Teacher").CreateItemAsync(request.vote, new PartitionKey($"Vote-{code}"));
|
|
|
- }*/
|
|
|
- await _serviceBus.GetServiceBusClient().SendLeamMessage<Vote>(Constants.TopicName, request.vote.id, request.vote.code, request.vote.startTime);
|
|
|
- //request.vote.sequenceNumber = SequenceNumber;
|
|
|
-
|
|
|
+ }*/
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -120,6 +119,9 @@ namespace TEAMModelOS.Controllers.Learn
|
|
|
return Ok(new { v = "活动正在进行中" });
|
|
|
}
|
|
|
//request.vote.code = info.code;
|
|
|
+ await _serviceBus.GetServiceBusClient().cancelMessage(Constants.TopicName,info.sequenceNumber);
|
|
|
+ long SequenceNumber = await _serviceBus.GetServiceBusClient().SendLeamMessage<Vote>(Constants.TopicName, request.vote.id, request.vote.code, request.vote.startTime);
|
|
|
+ request.vote.sequenceNumber = SequenceNumber;
|
|
|
vote = await client.GetContainer("TEAMModelOS", "Common").ReplaceItemAsync(request.vote, info.id, new PartitionKey($"{info.code}"));
|
|
|
/*if (request.vote.scope.Equals("school"))
|
|
|
{
|