|
| 1 | +// ========================================================================================== |
| 2 | +// GameFrameX 组织及其衍生项目的版权、商标、专利及其他相关权利 |
| 3 | +// GameFrameX organization and its derivative projects' copyrights, trademarks, patents, and related rights |
| 4 | +// 均受中华人民共和国及相关国际法律法规保护。 |
| 5 | +// are protected by the laws of the People's Republic of China and relevant international regulations. |
| 6 | +// |
| 7 | +// 使用本项目须严格遵守相应法律法规及开源许可证之规定。 |
| 8 | +// Usage of this project must strictly comply with applicable laws, regulations, and open-source licenses. |
| 9 | +// |
| 10 | +// 本项目采用 MIT 许可证与 Apache License 2.0 双许可证分发, |
| 11 | +// This project is dual-licensed under the MIT License and Apache License 2.0, |
| 12 | +// 完整许可证文本请参见源代码根目录下的 LICENSE 文件。 |
| 13 | +// please refer to the LICENSE file in the root directory of the source code for the full license text. |
| 14 | +// |
| 15 | +// 禁止利用本项目实施任何危害国家安全、破坏社会秩序、 |
| 16 | +// It is prohibited to use this project to engage in any activities that endanger national security, disrupt social order, |
| 17 | +// 侵犯他人合法权益等法律法规所禁止的行为! |
| 18 | +// or infringe upon the legitimate rights and interests of others, as prohibited by laws and regulations! |
| 19 | +// 因基于本项目二次开发所产生的一切法律纠纷与责任, |
| 20 | +// Any legal disputes and liabilities arising from secondary development based on this project |
| 21 | +// 本项目组织与贡献者概不承担。 |
| 22 | +// shall be borne solely by the developer; the project organization and contributors assume no responsibility. |
| 23 | +// |
| 24 | +// GitHub 仓库:https://github.com/GameFrameX |
| 25 | +// GitHub Repository: https://github.com/GameFrameX |
| 26 | +// Gitee 仓库:https://gitee.com/GameFrameX |
| 27 | +// Gitee Repository: https://gitee.com/GameFrameX |
| 28 | +// 官方文档:https://gameframex.doc.alianblank.com/ |
| 29 | +// Official Documentation: https://gameframex.doc.alianblank.com/ |
| 30 | +// ========================================================================================== |
| 31 | + |
| 32 | +namespace GameFrameX.Apps.Player.Reward.Entity; |
| 33 | + |
| 34 | +/// <summary> |
| 35 | +/// 统一奖励发放接口的请求。 |
| 36 | +/// </summary> |
| 37 | +/// <remarks> |
| 38 | +/// 调用方必须保证 <see cref="RoleId"/> 命中目标玩家、<see cref="SourceType"/>/<see cref="SourceId"/>/<see cref="TraceId"/> 三者共同唯一。 |
| 39 | +/// 幂等键 = <c>RoleId:SourceType:SourceId:TraceId</c>(B6),重复提交不重复发奖、短路返回上次结果。 |
| 40 | +/// </remarks> |
| 41 | +public sealed class RewardGrantRequest |
| 42 | +{ |
| 43 | + /// <summary> |
| 44 | + /// 目标玩家 ID(玩家 Actor 的 <c>ActorId</c>,等同玩家 <c>PlayerState.Id</c>)。 |
| 45 | + /// </summary> |
| 46 | + public long RoleId { get; set; } |
| 47 | + |
| 48 | + /// <summary> |
| 49 | + /// 奖励来源类型。禁止使用 <see cref="RewardSourceType.None"/> 拼接幂等键。 |
| 50 | + /// </summary> |
| 51 | + public RewardSourceType SourceType { get; set; } |
| 52 | + |
| 53 | + /// <summary> |
| 54 | + /// 来源 ID。建议形如 <c>mail:<MailId>:attachment:<AttachmentId></c>,与调用方业务一一对应。 |
| 55 | + /// </summary> |
| 56 | + public string SourceId { get; set; } |
| 57 | + |
| 58 | + /// <summary> |
| 59 | + /// 调用方追踪 ID。与 <see cref="SourceType"/>/<see cref="SourceId"/> 组成幂等键的一部分。 |
| 60 | + /// </summary> |
| 61 | + public string TraceId { get; set; } |
| 62 | + |
| 63 | + /// <summary> |
| 64 | + /// 待发放奖励列表。逐项独立判定成功 / 失败。 |
| 65 | + /// </summary> |
| 66 | + public List<RewardItem> Rewards { get; set; } = new List<RewardItem>(); |
| 67 | +} |
| 68 | + |
| 69 | +/// <summary> |
| 70 | +/// 统一奖励发放接口的结果。 |
| 71 | +/// </summary> |
| 72 | +public sealed class RewardGrantResult |
| 73 | +{ |
| 74 | + /// <summary> |
| 75 | + /// 逐项发放结果。 |
| 76 | + /// </summary> |
| 77 | + public List<RewardGrantItemResult> Items { get; set; } = new List<RewardGrantItemResult>(); |
| 78 | + |
| 79 | + /// <summary> |
| 80 | + /// 整体错误码(<c>OperationStatusCode</c> 整数值): |
| 81 | + /// 全部成功 <c>Ok</c>;部分成功 <c>PartialSuccess</c>;全部失败取首个失败项错误码。 |
| 82 | + /// </summary> |
| 83 | + public int ErrorCode { get; set; } |
| 84 | + |
| 85 | + /// <summary> |
| 86 | + /// 是否全部奖励发放成功。 |
| 87 | + /// </summary> |
| 88 | + public bool AllSuccess { get; set; } |
| 89 | +} |
0 commit comments