-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
6,413 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
src/Contracts/FastWiki.Service.Contracts/Feishu/Dto/FeiShuChatResultDto.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
namespace FastWiki.Service.Contracts.Model.Dto; | ||
|
||
public class FeiShuChatResult : FeiShuChatResultBase | ||
{ | ||
public object data { get; set; } | ||
} | ||
public class FeiShuChatResult<T> : FeiShuChatResultBase | ||
{ | ||
public T data { get; set; } | ||
} | ||
public abstract class FeiShuChatResultBase | ||
{ | ||
public int code { get; set; } | ||
public string msg { get; set; } | ||
} |
14 changes: 14 additions & 0 deletions
14
src/Contracts/FastWiki.Service.Contracts/Feishu/Dto/FeiShuChatToken.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace FastWiki.Service.Contracts.Feishu.Dto; | ||
|
||
public sealed class FeiShuChatToken | ||
{ | ||
[JsonPropertyName("tenant_access_token")] | ||
public string TenantAccessToken { get; set; } | ||
|
||
[JsonPropertyName("user_access_token")] | ||
public string UserAccessToken { get; set; } | ||
|
||
[JsonPropertyName("expire")] public int Expire { get; set; } | ||
} |
7 changes: 7 additions & 0 deletions
7
src/Contracts/FastWiki.Service.Contracts/Feishu/Dto/FeishuChatEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace FastWiki.Service.Contracts.Model.Dto; | ||
|
||
public sealed class FeishuChatEvent | ||
{ | ||
public FeishuChatSender sender { get; set; } | ||
public FeishuChatMessage message { get; set; } | ||
} |
11 changes: 11 additions & 0 deletions
11
src/Contracts/FastWiki.Service.Contracts/Feishu/Dto/FeishuChatHeader.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace FastWiki.Service.Contracts.Model.Dto; | ||
|
||
public class FeishuChatHeader | ||
{ | ||
public string event_id { get; set; } | ||
public string event_type { get; set; } | ||
public string create_time { get; set; } | ||
public string token { get; set; } | ||
public string app_id { get; set; } | ||
public string tenant_key { get; set; } | ||
} |
8 changes: 8 additions & 0 deletions
8
src/Contracts/FastWiki.Service.Contracts/Feishu/Dto/FeishuChatId.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace FastWiki.Service.Contracts.Model.Dto; | ||
|
||
public sealed class FeishuChatId | ||
{ | ||
public string union_id { get; set; } | ||
public string user_id { get; set; } | ||
public string open_id { get; set; } | ||
} |
17 changes: 17 additions & 0 deletions
17
src/Contracts/FastWiki.Service.Contracts/Feishu/Dto/FeishuChatInput.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace FastWiki.Service.Contracts.Model.Dto; | ||
|
||
public sealed class FeishuChatInput | ||
{ | ||
public string schema { get; set; } | ||
public FeishuChatHeader header { get; set; } | ||
|
||
[JsonPropertyName("event")] | ||
public FeishuChatEvent _event { get; set; } | ||
|
||
public string? challenge { get; set; } | ||
public string? encrypt { get; set; } | ||
|
||
public string? type { get; set; } | ||
} |
9 changes: 9 additions & 0 deletions
9
src/Contracts/FastWiki.Service.Contracts/Feishu/Dto/FeishuChatMention.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace FastWiki.Service.Contracts.Model.Dto; | ||
|
||
public sealed class FeishuChatMention | ||
{ | ||
public string key { get; set; } | ||
public FeishuChatId id { get; set; } | ||
public string name { get; set; } | ||
public string tenant_key { get; set; } | ||
} |
16 changes: 16 additions & 0 deletions
16
src/Contracts/FastWiki.Service.Contracts/Feishu/Dto/FeishuChatMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace FastWiki.Service.Contracts.Model.Dto; | ||
|
||
public sealed class FeishuChatMessage | ||
{ | ||
public string message_id { get; set; } | ||
public string root_id { get; set; } | ||
public string parent_id { get; set; } | ||
public string create_time { get; set; } | ||
public string update_time { get; set; } | ||
public string chat_id { get; set; } | ||
public string chat_type { get; set; } | ||
public string message_type { get; set; } | ||
public string content { get; set; } | ||
public FeishuChatMention[] mentions { get; set; } | ||
public string user_agent { get; set; } | ||
} |
10 changes: 10 additions & 0 deletions
10
src/Contracts/FastWiki.Service.Contracts/Feishu/Dto/FeishuChatSendMessageInput.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace FastWiki.Service.Contracts.Model.Dto; | ||
|
||
public class FeishuChatSendMessageInput(string content, string msg_type, string receive_id) | ||
{ | ||
public string content { get; set; } = content; | ||
|
||
public string msg_type { get; set; } = msg_type; | ||
|
||
public string receive_id { get; set; } = receive_id; | ||
} |
8 changes: 8 additions & 0 deletions
8
src/Contracts/FastWiki.Service.Contracts/Feishu/Dto/FeishuChatSender.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace FastWiki.Service.Contracts.Model.Dto; | ||
|
||
public class FeishuChatSender | ||
{ | ||
public FeishuChatSenderId sender_id { get; set; } | ||
public string sender_type { get; set; } | ||
public string tenant_key { get; set; } | ||
} |
8 changes: 8 additions & 0 deletions
8
src/Contracts/FastWiki.Service.Contracts/Feishu/Dto/FeishuChatSenderId.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace FastWiki.Service.Contracts.Model.Dto; | ||
|
||
public class FeishuChatSenderId | ||
{ | ||
public string union_id { get; set; } | ||
public string user_id { get; set; } | ||
public string open_id { get; set; } | ||
} |
6 changes: 6 additions & 0 deletions
6
src/Contracts/FastWiki.Service.Contracts/Feishu/Dto/FeishuChatUserInput.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace FastWiki.Service.Contracts.Model.Dto; | ||
|
||
public sealed class FeishuChatUserInput | ||
{ | ||
public string text { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -96,6 +96,13 @@ private static void ConfigEntities(ModelBuilder modelBuilder) | |
.HasConversion( | ||
v => JsonSerializer.Serialize(v, new JsonSerializerOptions()), | ||
v => JsonSerializer.Deserialize<List<long>>(v, new JsonSerializerOptions())); | ||
|
||
entity.Property(x => x.Extend) | ||
.HasConversion( | ||
v => JsonSerializer.Serialize(v, new JsonSerializerOptions()), | ||
v => v.IsNullOrEmpty() | ||
? new Dictionary<string, string>() | ||
: JsonSerializer.Deserialize<Dictionary<string, string>>(v, new JsonSerializerOptions())); | ||
}); | ||
|
||
modelBuilder.Entity<ChatDialog>(entity => | ||
|
@@ -169,9 +176,9 @@ private static void ConfigEntities(ModelBuilder modelBuilder) | |
|
||
var user = new User("admin", "admin", "Aa123456", | ||
"https://blog-simple.oss-cn-shenzhen.aliyuncs.com/Avatar.jpg", "[email protected]", "13049809673", false); | ||
|
||
user.SetAdminRole(); | ||
|
||
// 默认初始账号 | ||
modelBuilder.Entity<User>().HasData(user); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.