From 7368d0388e78228499f28b33f79891c60639fb57 Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 17 Apr 2022 22:43:19 +0800 Subject: ... --- .../User/RegisterCode/IRegisterCodeService.cs | 51 +++++++++++++++++++--- 1 file changed, 45 insertions(+), 6 deletions(-) (limited to 'BackEnd/Timeline/Services/User/RegisterCode/IRegisterCodeService.cs') diff --git a/BackEnd/Timeline/Services/User/RegisterCode/IRegisterCodeService.cs b/BackEnd/Timeline/Services/User/RegisterCode/IRegisterCodeService.cs index e4aa17fa..65decefc 100644 --- a/BackEnd/Timeline/Services/User/RegisterCode/IRegisterCodeService.cs +++ b/BackEnd/Timeline/Services/User/RegisterCode/IRegisterCodeService.cs @@ -1,17 +1,56 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Timeline.Entities; namespace Timeline.Services.User.RegisterCode { public interface IRegisterCodeService { - string? GetCurrentRegisterCode(long userId); + /// + /// Get the owner of a register code or null if the code does not exist or is not enabled. + /// + /// The register code. + /// If true, only when code is enabled the owner id is returned. + /// A task contains the owner of the register code. Null of the code does not exist or is not enabled. + Task GetCodeOwner(string code, bool onlyEnabled = true); - List GetAllRegisterCodes(long userId); + /// + /// Get the current enabled register code of the user or null if there is none. + /// + /// The user id. + /// A task contains current enabled register code or null if there is none. + Task GetCurrentCode(long userId); - string CreateNewRegisterCode(long userId); + /// + /// Create a new register code for a user, enable it and disable the previous one if there is a previous one. + /// + /// The user id. + /// A task contains the new register code. + Task CreateNewCode(long userId); - List GetUsersIntroducedByCode(string registerCode); + /// + /// Record a register info for a user. + /// + /// The newly-registered user. + /// The introducer user id. + /// The register code. + /// The register time. + /// The created register info. + Task CreateRegisterInfo(long userId, long introducerId, string registerCode, DateTime registerTime); - List GetUsersIntroducedByUser(long userId); + /// + /// Get register info of a user if there is one. + /// + /// The user id. + /// The user register info if there is one. Or null if there is not. + Task GetUserRegisterInfo(long userId); + + /// + /// Get the list of user register info of the specified introducer. + /// + /// + /// The list of user register info. + Task> GetUserRegisterInfoOfIntroducer(long introducerId); } } -- cgit v1.2.3