This repository has been archived by the owner on Dec 6, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #22 from timi137137/develop
Fix can't use request event bug
- Loading branch information
Showing
5 changed files
with
147 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using AuroraNative.Enum; | ||
using System; | ||
|
||
namespace AuroraNative.Attributes | ||
{ | ||
/// <summary> | ||
/// 请求事件 特性 | ||
/// </summary> | ||
[AttributeUsage(AttributeTargets.Method)] | ||
[PostType(PostType.Request)] | ||
public class RequestTypeAttribute : Base, IEquatable<RequestTypeAttribute> | ||
{ | ||
#region --属性-- | ||
|
||
/// <summary> | ||
/// 请求事件 枚举 | ||
/// </summary> | ||
public RequestType RequestType { get => Utils.GetEnumByDescription<RequestType>(Type); set => Type = value.ToString(); } | ||
|
||
#endregion | ||
|
||
#region --构造函数-- | ||
|
||
/// <summary> | ||
/// 请求事件类型构造函数,初始化 <see cref="Base"/> 类的实例 | ||
/// </summary> | ||
/// <param name="RequestType">请求事件类型</param> | ||
public RequestTypeAttribute(RequestType RequestType) | ||
{ | ||
this.RequestType = RequestType; | ||
} | ||
|
||
#endregion | ||
|
||
#region --公开函数-- | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <returns></returns> | ||
public override int GetHashCode() | ||
{ | ||
return base.GetHashCode(); | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="obj"></param> | ||
/// <returns></returns> | ||
public override bool Equals(object obj) | ||
{ | ||
return Equals(obj as MessageTypeAttribute); | ||
} | ||
|
||
/// <summary> | ||
/// | ||
/// </summary> | ||
/// <param name="other"></param> | ||
/// <returns></returns> | ||
public bool Equals(RequestTypeAttribute other) | ||
{ | ||
if (other != null) | ||
{ | ||
return RequestType == other.RequestType; | ||
} | ||
return false; | ||
} | ||
|
||
#endregion | ||
} | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
namespace AuroraNative.Enum | ||
{ | ||
/// <summary> | ||
/// 请求事件 枚举 | ||
/// </summary> | ||
public enum RequestType | ||
{ | ||
/// <summary> | ||
/// 加好友 | ||
/// </summary> | ||
friend = 1, | ||
/// <summary> | ||
/// 加群 | ||
/// </summary> | ||
group = 2 | ||
} | ||
} |
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