15 changed files with 352 additions and 15 deletions
@ -0,0 +1,37 @@ |
|||||
|
{ |
||||
|
"culture": "en", |
||||
|
"texts": { |
||||
|
"LINGYUN.Abp.Message:01400": "Sending the message failed: The message is incomplete!", |
||||
|
"LINGYUN.Abp.Message:01401": "You have not joined the group and cannot operate!", |
||||
|
"LINGYUN.Abp.Message:02301": "Group application has been sent, waiting for administrator's approval", |
||||
|
"LINGYUN.Abp.Message:02302": "You need to validate the questions to join the group chat", |
||||
|
"LINGYUN.Abp.Message:02400": "The administrator has turned on silence mode!", |
||||
|
"LINGYUN.Abp.Message:02403": "The administrator has banned you from speaking!", |
||||
|
"LINGYUN.Abp.Message:02401": "The administrator does not allow anonymous speaking!", |
||||
|
"LINGYUN.Abp.Message:02404": "Sending the message failed: the group does not exist or is disbanded!", |
||||
|
"LINGYUN.Abp.Message:03301": "Friend request has been sent, waiting for the other party's approval", |
||||
|
"LINGYUN.Abp.Message:03302": "You need to verify the problem to add friends", |
||||
|
"LINGYUN.Abp.Message:03400": "The user has rejected all messages!", |
||||
|
"LINGYUN.Abp.Message:03401": "The user rejects the message you sent!", |
||||
|
"LINGYUN.Abp.Message:03402": "Users do not receive anonymous comments!", |
||||
|
"LINGYUN.Abp.Message:03403": "Sending the message failed: the person needs to agree to add a friend!", |
||||
|
"LINGYUN.Abp.Message:03404": "Sending the message failed: the user does not exist or is deactivated!", |
||||
|
"LINGYUN.Abp.Message:03410": "Users refuse to add friends", |
||||
|
"LINGYUN.Abp.Message:03411": "The other party is already your friend or has sent an authentication request. The operation cannot be repeated!", |
||||
|
"Notifications:MultiTenancy": "Multi Tenancy", |
||||
|
"Notifications:Users": "Users", |
||||
|
"Notifications:NewTenantRegisterd": "Tenant creation notification", |
||||
|
"Notifications:WelcomeToApplication": "User Welcome Notice", |
||||
|
"Notifications:IM": "Instant Messaging", |
||||
|
"Notifications:FriendValidation": "Friend verification notification", |
||||
|
"Notifications:NewFriend": "New friend notification", |
||||
|
"Notifications:RequestAddNewFriend": "User {name} has requested that you be added as a friend", |
||||
|
"Notifications:RequestAddNewFriendDetail": "Description: {description}", |
||||
|
"Notifications:JoinGroup": "Join group notification", |
||||
|
"Notifications:ExitGroup": "Exit group notification", |
||||
|
"Notifications:DissolveGroup": "Dissolve group notification", |
||||
|
"AddNewFriendBySearchId": "Add by account search", |
||||
|
"WelcomeToApplicationFormUser": "User :{User} welcome to join us!", |
||||
|
"Messages:NewFriend": "I have added you as a friend, let's chat together!" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
{ |
||||
|
"culture": "zh-Hans", |
||||
|
"texts": { |
||||
|
"LINGYUN.Abp.Message:01400": "发送消息失败: 消息不完整!", |
||||
|
"LINGYUN.Abp.Message:01401": "您还未加入群组,不能进行操作!", |
||||
|
"LINGYUN.Abp.Message:02301": "已发送群组申请,等待管理员同意", |
||||
|
"LINGYUN.Abp.Message:02302": "你需要验证问题才能加入群聊", |
||||
|
"LINGYUN.Abp.Message:02400": "管理员已开启全员禁言!", |
||||
|
"LINGYUN.Abp.Message:02403": "管理员已禁止您发言!", |
||||
|
"LINGYUN.Abp.Message:02401": "管理员不允许匿名发言!", |
||||
|
"LINGYUN.Abp.Message:02404": "发送消息失败: 群组不存在或已解散!", |
||||
|
"LINGYUN.Abp.Message:03301": "已发送好友申请,等待对方同意", |
||||
|
"LINGYUN.Abp.Message:03302": "你需要验证问题才能添加好友", |
||||
|
"LINGYUN.Abp.Message:03400": "用户已拒接所有消息!", |
||||
|
"LINGYUN.Abp.Message:03401": "用户拒绝您发送的消息!", |
||||
|
"LINGYUN.Abp.Message:03402": "用户不接收匿名发言!", |
||||
|
"LINGYUN.Abp.Message:03403": "需要对方同意添加好友才能发送消息!", |
||||
|
"LINGYUN.Abp.Message:03404": "发送消息失败: 用户不存在或已注销账号!", |
||||
|
"LINGYUN.Abp.Message:03410": "用户拒绝添加好友", |
||||
|
"LINGYUN.Abp.Message:03411": "对方已是您的好友或已发送验证请求,不能重复操作!", |
||||
|
"Notifications:MultiTenancy": "租户通知", |
||||
|
"Notifications:Users": "用户通知", |
||||
|
"Notifications:NewTenantRegisterd": "租户创建通知", |
||||
|
"Notifications:WelcomeToApplication": "用户欢迎通知", |
||||
|
"Notifications:IM": "即时通讯", |
||||
|
"Notifications:FriendValidation": "好友验证通知", |
||||
|
"Notifications:NewFriend": "新好友通知", |
||||
|
"Notifications:RequestAddNewFriend": "用户 {name} 请求添加您为好友", |
||||
|
"Notifications:RequestAddNewFriendDetail": "附加说明: {description}", |
||||
|
"Notifications:JoinGroup": "加入群组通知", |
||||
|
"Notifications:ExitGroup": "退出群组通知", |
||||
|
"Notifications:DissolveGroup": "群组解散通知", |
||||
|
"AddNewFriendBySearchId": "通过账号搜索添加", |
||||
|
"WelcomeToApplicationFormUser": "用户:{User} 欢迎您的加入!", |
||||
|
"Messages:NewFriend": "我已经添加您为好友,让我们一起聊天吧!" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,64 @@ |
|||||
|
using LINGYUN.Abp.WeChat.Features; |
||||
|
using LINGYUN.Abp.WeChat.Localization; |
||||
|
using Volo.Abp.Features; |
||||
|
using Volo.Abp.Localization; |
||||
|
using Volo.Abp.Validation.StringValues; |
||||
|
|
||||
|
namespace LINGYUN.Abp.WeChat.MiniProgram.Features |
||||
|
{ |
||||
|
public class WeChatMiniProgramFeatureDefinitionProvider : FeatureDefinitionProvider |
||||
|
{ |
||||
|
public override void Define(IFeatureDefinitionContext context) |
||||
|
{ |
||||
|
var group = context.GetGroupOrNull(WeChatFeatures.GroupName); |
||||
|
|
||||
|
var miniProgram = group.AddFeature( |
||||
|
name: WeChatMiniProgramFeatures.GroupName, |
||||
|
displayName: L("Features:WeChat.MiniProgram"), |
||||
|
description: L("Features:WeChat.MiniProgramDesc")); |
||||
|
|
||||
|
miniProgram.CreateChild( |
||||
|
name: WeChatMiniProgramFeatures.Enable, |
||||
|
defaultValue: true.ToString(), |
||||
|
displayName: L("Features:WeChat.MiniProgram.Enable"), |
||||
|
description: L("Features:WeChat.MiniProgram.EnableDesc"), |
||||
|
valueType: new ToggleStringValueType(new BooleanValueValidator())); |
||||
|
miniProgram.CreateChild( |
||||
|
name: WeChatMiniProgramFeatures.EnableAuthorization, |
||||
|
defaultValue: true.ToString(), |
||||
|
displayName: L("Features:WeChat.MiniProgram.EnableAuthorization"), |
||||
|
description: L("Features:WeChat.MiniProgram.EnableAuthorizationDesc"), |
||||
|
valueType: new ToggleStringValueType(new BooleanValueValidator())); |
||||
|
|
||||
|
|
||||
|
var message = miniProgram.CreateChild( |
||||
|
name: WeChatMiniProgramFeatures.Messages.Default, |
||||
|
displayName: L("Features:WeChat.MiniProgram.Messages"), |
||||
|
description: L("Features:WeChat.MiniProgram.MessagesDesc")); |
||||
|
|
||||
|
message.CreateChild( |
||||
|
name: WeChatMiniProgramFeatures.Messages.Enable, |
||||
|
defaultValue: true.ToString(), |
||||
|
displayName: L("Features:WeChat.MiniProgram.EnableMessages"), |
||||
|
description: L("Features:WeChat.MiniProgram.EnableMessagesDesc"), |
||||
|
valueType: new ToggleStringValueType(new BooleanValueValidator())); |
||||
|
message.CreateChild( |
||||
|
name: WeChatMiniProgramFeatures.Messages.SendLimit, |
||||
|
defaultValue: WeChatMiniProgramFeatures.Messages.DefaultSendLimit.ToString(), |
||||
|
displayName: L("Features:WeChat.MiniProgram.SendLimit"), |
||||
|
description: L("Features:WeChat.MiniProgram.SendLimitDesc"), |
||||
|
valueType: new FreeTextStringValueType(new NumericValueValidator(1, 100_0000))); |
||||
|
message.CreateChild( |
||||
|
name: WeChatMiniProgramFeatures.Messages.SendLimitInterval, |
||||
|
defaultValue: WeChatMiniProgramFeatures.Messages.DefaultSendLimitInterval.ToString(), |
||||
|
displayName: L("Features:WeChat.MiniProgram.SendLimitInterval"), |
||||
|
description: L("Features:WeChat.MiniProgram.SendLimitIntervalDesc"), |
||||
|
valueType: new FreeTextStringValueType(new NumericValueValidator(1, 100_0000))); |
||||
|
} |
||||
|
|
||||
|
protected LocalizableString L(string name) |
||||
|
{ |
||||
|
return LocalizableString.Create<WeChatResource>(name); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
using LINGYUN.Abp.WeChat.Features; |
||||
|
|
||||
|
namespace LINGYUN.Abp.WeChat.MiniProgram.Features |
||||
|
{ |
||||
|
public static class WeChatMiniProgramFeatures |
||||
|
{ |
||||
|
public const string GroupName = WeChatFeatures.GroupName + ".MiniProgram"; |
||||
|
|
||||
|
public const string Enable = GroupName + ".Enable"; |
||||
|
|
||||
|
public const string EnableAuthorization = GroupName + ".EnableAuthorization"; |
||||
|
|
||||
|
public static class Messages |
||||
|
{ |
||||
|
public const string Default = GroupName + ".Messages"; |
||||
|
|
||||
|
public const string Enable = Default + ".Enable"; |
||||
|
/// <summary>
|
||||
|
/// 发送次数上限
|
||||
|
/// </summary>
|
||||
|
public const string SendLimit = Default + ".SendLimit"; |
||||
|
/// <summary>
|
||||
|
/// 发送次数上限时长
|
||||
|
/// </summary>
|
||||
|
public const string SendLimitInterval = Default + ".SendLimitInterval"; |
||||
|
/// <summary>
|
||||
|
/// 默认发布次数上限
|
||||
|
/// </summary>
|
||||
|
public const int DefaultSendLimit = 1000; |
||||
|
/// <summary>
|
||||
|
/// 默认发布次数上限时长
|
||||
|
/// </summary>
|
||||
|
public const int DefaultSendLimitInterval = 1; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,39 @@ |
|||||
|
using LINGYUN.Abp.WeChat.Features; |
||||
|
using LINGYUN.Abp.WeChat.Localization; |
||||
|
using Volo.Abp.Features; |
||||
|
using Volo.Abp.Localization; |
||||
|
using Volo.Abp.Validation.StringValues; |
||||
|
|
||||
|
namespace LINGYUN.Abp.WeChat.Official.Features |
||||
|
{ |
||||
|
public class WeChatOfficialFeatureDefinitionProvider : FeatureDefinitionProvider |
||||
|
{ |
||||
|
public override void Define(IFeatureDefinitionContext context) |
||||
|
{ |
||||
|
var group = context.GetGroupOrNull(WeChatFeatures.GroupName); |
||||
|
|
||||
|
var official = group.AddFeature( |
||||
|
name: WeChatOfficialFeatures.GroupName, |
||||
|
displayName: L("Features:WeChat.Official"), |
||||
|
description: L("Features:WeChat.OfficialDesc")); |
||||
|
|
||||
|
official.CreateChild( |
||||
|
name: WeChatOfficialFeatures.Enable, |
||||
|
defaultValue: true.ToString(), |
||||
|
displayName: L("Features:WeChat.Official.Enable"), |
||||
|
description: L("Features:WeChat.Official.EnableDesc"), |
||||
|
valueType: new ToggleStringValueType(new BooleanValueValidator())); |
||||
|
official.CreateChild( |
||||
|
name: WeChatOfficialFeatures.EnableAuthorization, |
||||
|
defaultValue: true.ToString(), |
||||
|
displayName: L("Features:WeChat.Official.EnableAuthorization"), |
||||
|
description: L("Features:WeChat.Official.EnableAuthorizationDesc"), |
||||
|
valueType: new ToggleStringValueType(new BooleanValueValidator())); |
||||
|
} |
||||
|
|
||||
|
protected LocalizableString L(string name) |
||||
|
{ |
||||
|
return LocalizableString.Create<WeChatResource>(name); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,13 @@ |
|||||
|
using LINGYUN.Abp.WeChat.Features; |
||||
|
|
||||
|
namespace LINGYUN.Abp.WeChat.Official.Features |
||||
|
{ |
||||
|
public static class WeChatOfficialFeatures |
||||
|
{ |
||||
|
public const string GroupName = WeChatFeatures.GroupName + ".Official"; |
||||
|
|
||||
|
public const string Enable = GroupName + ".Enable"; |
||||
|
|
||||
|
public const string EnableAuthorization = GroupName + ".EnableAuthorization"; |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue