Skip to content

Commit 0e2a457

Browse files
authored
Merge pull request #655 from Qtoss-AI/master
improvement
2 parents e2ea78b + b76f9bb commit 0e2a457

File tree

32 files changed

+368
-76
lines changed

32 files changed

+368
-76
lines changed

src/Infrastructure/BotSharp.Abstraction/Knowledges/IKnowledgeHook.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ public interface IKnowledgeHook
55
Task<List<KnowledgeChunk>> CollectChunkedKnowledge()
66
=> Task.FromResult(new List<KnowledgeChunk>());
77

8-
Task<List<string>> GetRelevantKnowledges()
8+
Task<List<string>> GetRelevantKnowledges(string text)
99
=> Task.FromResult(new List<string>());
1010

1111
Task<List<string>> GetGlobalKnowledges()

src/Infrastructure/BotSharp.Abstraction/Knowledges/IKnowledgeService.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public interface IKnowledgeService
1515
Task<bool> DeleteVectorCollectionAllData(string collectionName);
1616
Task<bool> CreateVectorCollectionData(string collectionName, VectorCreateModel create);
1717
Task<bool> UpdateVectorCollectionData(string collectionName, VectorUpdateModel update);
18+
Task<bool> UpsertVectorCollectionData(string collectionName, VectorUpdateModel update);
1819
#endregion
1920

2021
#region Graph

src/Infrastructure/BotSharp.Abstraction/Messaging/Models/RichContent/Template/GenericTemplateMessage.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ public class GenericTemplateMessage<T> : IRichMessage, ITemplateMessage
55
[JsonPropertyName("rich_type")]
66
public string RichType => RichTypeEnum.GenericTemplate;
77

8+
/// <summary>
9+
/// Use model refined content if leaving blank
10+
/// </summary>
811
[JsonPropertyName("text")]
912
[Translate]
1013
public string Text { get; set; } = string.Empty;

src/Infrastructure/BotSharp.Abstraction/Planning/IPlanningHook.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ public interface IPlanningHook
44
{
55
Task<string> GetSummaryAdditionalRequirements(string planner)
66
=> Task.FromResult(string.Empty);
7+
78
Task OnPlanningCompleted(string planner, RoleDialogModel msg)
89
=> Task.CompletedTask;
910
}

src/Infrastructure/BotSharp.Abstraction/Repositories/IBotSharpRepository.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,18 @@ public interface IBotSharpRepository
2121
#region User
2222
User? GetUserByEmail(string email) => throw new NotImplementedException();
2323
User? GetUserByPhone(string phone) => throw new NotImplementedException();
24-
User? GetUserById(string id) => throw new NotImplementedException();
24+
User? GetAffiliateUserByPhone(string phone) => throw new NotImplementedException();
25+
User? GetUserById(string id) => throw new NotImplementedException();
26+
List<User> GetUserByIds(List<string> ids) => throw new NotImplementedException();
27+
User? GetUserByAffiliateId(string affiliateId) => throw new NotImplementedException();
2528
User? GetUserByUserName(string userName) => throw new NotImplementedException();
2629
void CreateUser(User user) => throw new NotImplementedException();
2730
void UpdateUserVerified(string userId) => throw new NotImplementedException();
2831
void UpdateUserVerificationCode(string userId, string verficationCode) => throw new NotImplementedException();
2932
void UpdateUserPassword(string userId, string password) => throw new NotImplementedException();
3033
void UpdateUserEmail(string userId, string email)=> throw new NotImplementedException();
3134
void UpdateUserPhone(string userId, string Iphone) => throw new NotImplementedException();
35+
void UpdateUserIsDisable(string userId, bool isDisable) => throw new NotImplementedException();
3236
#endregion
3337

3438
#region Agent

src/Infrastructure/BotSharp.Abstraction/Users/Enums/UserRole.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ public class UserRole
1313
public const string CSR = "csr";
1414

1515
/// <summary>
16-
/// Client
16+
/// Authorized user
1717
/// </summary>
18-
public const string Client = "client";
18+
public const string User = "user";
1919

2020
/// <summary>
2121
/// Back office operations
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Threading.Tasks;
6+
7+
namespace BotSharp.Abstraction.Users.Enums
8+
{
9+
public static class UserSource
10+
{
11+
public const string Internal = "internal";
12+
}
13+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
namespace BotSharp.Abstraction.Users.Enums;
2+
3+
public class UserType
4+
{
5+
public const string Internal = "internal";
6+
public const string Client = "client";
7+
public const string Affiliate = "affiliate";
8+
}

src/Infrastructure/BotSharp.Abstraction/Users/IUserService.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ public interface IUserService
88
Task<User> GetUser(string id);
99
Task<User> CreateUser(User user);
1010
Task<Token> ActiveUser(UserActivationModel model);
11+
Task<Token?> GetAffiliateToken(string authorization);
1112
Task<Token?> GetToken(string authorization);
1213
Task<User> GetMyProfile();
1314
Task<bool> VerifyUserNameExisting(string userName);
@@ -16,4 +17,6 @@ public interface IUserService
1617
Task<bool> ResetUserPassword(User user);
1718
Task<bool> ModifyUserEmail(string email);
1819
Task<bool> ModifyUserPhone(string phone);
20+
Task<bool> UpdatePassword(string newPassword, string verificationCode);
21+
Task<DateTime> GetUserTokenExpires();
1922
}

src/Infrastructure/BotSharp.Abstraction/Users/Models/User.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ public class User
1212
public string? Phone { get; set; }
1313
public string Salt { get; set; } = string.Empty;
1414
public string Password { get; set; } = string.Empty;
15-
public string Source { get; set; } = "internal";
15+
public string Source { get; set; } = UserSource.Internal;
1616
public string? ExternalId { get; set; }
17-
public string Role { get; set; } = UserRole.Client;
17+
/// <summary>
18+
/// internal, client, affiliate
19+
/// </summary>
20+
public string Type { get; set; } = UserType.Client;
21+
public string Role { get; set; } = UserRole.User;
1822
public string? VerificationCode { get; set; }
1923
public bool Verified { get; set; }
24+
public string? AffiliateId { get; set; }
25+
public bool IsDisabled { get; set; }
2026
public DateTime UpdatedTime { get; set; } = DateTime.UtcNow;
2127
public DateTime CreatedTime { get; set; } = DateTime.UtcNow;
2228
}

0 commit comments

Comments
 (0)