更改文件架构

This commit is contained in:
CortexCore
2023-06-07 18:38:07 +08:00
parent 93292b1a59
commit ed84166723
720 changed files with 297 additions and 65 deletions

View File

@@ -0,0 +1,18 @@
{
"name": "BITKit.WXPusher",
"rootNamespace": "",
"references": [
"GUID:14fe60d984bf9f84eac55c6ea033a8f4",
"GUID:49b49c76ee64f6b41bf28ef951cb0e50",
"GUID:be17a8778dbfe454890ed8279279e153"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7eb9c29a8aafb064dbf8d0fef7db9faf
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,41 @@
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using BITKit.HttpNet;
using UnityEngine;
namespace BITKit
{
public class WeChatMessagePusher : MonoBehaviour
{
private const string url = "https://wxpusher.zjiecode.com/api/send/message";
[SerializeField, SerializeReference, SubclassSelector]
private Reference appName;
[SerializeField, SerializeReference, SubclassSelector]
private Reference appToken;
[SerializeField, SerializeReference, SubclassSelector]
private Reference[] uids;
[SerializeField, SerializeReference, SubclassSelector]
private IWebProvider webProvider;
public async void PostMessage(object message)
{
var content = message is string ? message.ToString() : JsonHelper.Get(message);
WeChatMessage wxMessage = new()
{
appToken = appToken,
summary = appName,
content = content
};
if (uids.Length > 0)
{
wxMessage.uids = uids.Select(x => x.Get()).ToArray();
}
await webProvider.PostAsync(url, wxMessage);
}
}
}

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 98295d9f0ccb8744dada94e501ac87b3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: