├── .github └── workflows │ └── mavenpublish.yml ├── .gitignore ├── .travis.yml ├── LICENSE ├── README.md ├── README_OLD.md ├── lib ├── HikariCP-java6-2.3.13.jar ├── apiguardian-api-1.1.0.jar ├── c3p0-0.9.5.2.jar ├── commons-beanutils-1.9.3.jar ├── commons-codec-1.9.jar ├── commons-collections-3.2.2.jar ├── commons-logging-1.2.jar ├── console-plus-1.2.1.jar ├── fastjson-1.2.54.jar ├── httpclient-4.5.jar ├── httpcore-4.4.1.jar ├── hutool-core-5.3.5.jar ├── junit-jupiter-5.7.0-M1.jar ├── junit-jupiter-api-5.7.0-M1.jar ├── junit-jupiter-engine-5.7.0-M1.jar ├── junit-jupiter-params-5.7.0-M1.jar ├── junit-platform-commons-1.7.0-M1.jar ├── junit-platform-engine-1.7.0-M1.jar ├── mchange-commons-java-0.2.11.jar ├── opentest4j-1.2.0.jar ├── quartz-2.3.0.jar ├── simple-plusutils-1.3.1.jar └── slf4j-api-1.7.7.jar ├── pom.xml ├── src └── main │ ├── java │ └── com │ │ └── forte │ │ ├── common │ │ └── annotation │ │ │ ├── Comment.java │ │ │ └── SimbotTODO.java │ │ ├── config │ │ ├── Conf.java │ │ ├── ConfigurationHelper.java │ │ ├── InjectableConfig.java │ │ ├── InjectableConfiguration.java │ │ ├── package-info.java │ │ └── resolve │ │ │ └── ConfigResolvor.java │ │ ├── lang │ │ ├── Iterators.java │ │ ├── Language.java │ │ ├── LanguageInitException.java │ │ └── package-info.java │ │ └── qqrobot │ │ ├── Application.java │ │ ├── AutoResourceApplication.java │ │ ├── BaseApplication.java │ │ ├── BaseConfiguration.java │ │ ├── BotRuntime.java │ │ ├── ConfigApplication.java │ │ ├── ConfigProperties.java │ │ ├── ConfigurationProperty.java │ │ ├── CoreConfiguration.java │ │ ├── DefaultBotSender.java │ │ ├── MsgParser.java │ │ ├── MsgProcessable.java │ │ ├── MsgProcessor.java │ │ ├── PriorityConstant.java │ │ ├── ResourceApplication.java │ │ ├── ResourceDispatchCenter.java │ │ ├── SimpleRobotApplication.java │ │ ├── SimpleRobotConfiguration.java │ │ ├── SimpleRobotContext.java │ │ ├── StartResult.java │ │ ├── anno │ │ ├── AnnotateMapping.java │ │ ├── Async.java │ │ ├── Block.java │ │ ├── BlockFilter.java │ │ ├── ByNameField.java │ │ ├── ByNameFrom.java │ │ ├── ByNameType.java │ │ ├── Config.java │ │ ├── Constr.java │ │ ├── CoreVersion.java │ │ ├── DIYFilter.java │ │ ├── ExceptionCatch.java │ │ ├── Filter.java │ │ ├── HttpTemplate.java │ │ ├── Ignore.java │ │ ├── Key.java │ │ ├── Listen.java │ │ ├── ListenBody.java │ │ ├── ListenBreak.java │ │ ├── ListenBreakPlugin.java │ │ ├── ListenerAPI.java │ │ ├── Spare.java │ │ ├── Version.java │ │ ├── data │ │ │ ├── Block.java │ │ │ ├── BlockFilter.java │ │ │ ├── Filter.java │ │ │ └── Listen.java │ │ ├── depend │ │ │ ├── AllBeans.java │ │ │ ├── AutoBeans.java │ │ │ ├── Beans.java │ │ │ ├── BeansOn.java │ │ │ ├── Depend.java │ │ │ └── FilterValue.java │ │ ├── template │ │ │ ├── OnDiscuss.java │ │ │ ├── OnFriendAdd.java │ │ │ ├── OnFriendAddRequest.java │ │ │ ├── OnFriendDelete.java │ │ │ ├── OnGroup.java │ │ │ ├── OnGroupAddRequest.java │ │ │ ├── OnGroupAdminChange.java │ │ │ ├── OnGroupBan.java │ │ │ ├── OnGroupFileUpload.java │ │ │ ├── OnGroupMemberIncrease.java │ │ │ ├── OnGroupMemberReduce.java │ │ │ ├── OnGroupMsgDelete.java │ │ │ ├── OnPrivate.java │ │ │ ├── OnPrivateMsgDelete.java │ │ │ └── package-info.java │ │ └── timetask │ │ │ ├── CronTask.java │ │ │ ├── FixedRateTask.java │ │ │ ├── TypeTask.java │ │ │ └── package-info.java │ │ ├── beans │ │ ├── cqcode │ │ │ ├── AppendList.java │ │ │ ├── CQAppendList.java │ │ │ ├── CQCode.java │ │ │ └── ImageCQCode.java │ │ ├── function │ │ │ ├── ExFunction.java │ │ │ ├── MostDIYTypeFilter.java │ │ │ ├── MostTypeFilter.java │ │ │ ├── PathAssembler.java │ │ │ ├── ToBotInfo.java │ │ │ ├── ToBotInfoImpl.java │ │ │ └── VerifyFunction.java │ │ ├── messages │ │ │ ├── CodesAble.java │ │ │ ├── FlagAble.java │ │ │ ├── GroupCodeAble.java │ │ │ ├── NickOrRemark.java │ │ │ ├── NicknameAble.java │ │ │ ├── OriginalAble.java │ │ │ ├── PowerAble.java │ │ │ ├── QQCodeAble.java │ │ │ ├── RemarkAble.java │ │ │ ├── RootBean.java │ │ │ ├── ThisCodeAble.java │ │ │ ├── TimeAble.java │ │ │ ├── get │ │ │ │ ├── GetAnonInfo.java │ │ │ │ ├── GetAuthInfo.java │ │ │ │ ├── GetBanList.java │ │ │ │ ├── GetFileInfo.java │ │ │ │ ├── GetFriendList.java │ │ │ │ ├── GetGroupHomeworkList.java │ │ │ │ ├── GetGroupInfo.java │ │ │ │ ├── GetGroupLinkList.java │ │ │ │ ├── GetGroupList.java │ │ │ │ ├── GetGroupMemberInfo.java │ │ │ │ ├── GetGroupMemberList.java │ │ │ │ ├── GetGroupNoteList.java │ │ │ │ ├── GetGroupTopNote.java │ │ │ │ ├── GetImageInfo.java │ │ │ │ ├── GetLoginQQInfo.java │ │ │ │ ├── GetShareList.java │ │ │ │ ├── GetStrangerInfo.java │ │ │ │ └── InfoGet.java │ │ │ ├── msgget │ │ │ │ ├── AbstractDiscussMsg.java │ │ │ │ ├── AbstractEventGet.java │ │ │ │ ├── AbstractFriendAdd.java │ │ │ │ ├── AbstractFriendAddRequest.java │ │ │ │ ├── AbstractGroupAddRequest.java │ │ │ │ ├── AbstractGroupAdminChange.java │ │ │ │ ├── AbstractGroupBan.java │ │ │ │ ├── AbstractGroupFileUpload.java │ │ │ │ ├── AbstractGroupMemberIncrease.java │ │ │ │ ├── AbstractGroupMemberReduce.java │ │ │ │ ├── AbstractGroupMsg.java │ │ │ │ ├── AbstractMsgGet.java │ │ │ │ ├── AbstractPrivateMsg.java │ │ │ │ ├── DiscussMsg.java │ │ │ │ ├── EventGet.java │ │ │ │ ├── FriendAdd.java │ │ │ │ ├── FriendAddRequest.java │ │ │ │ ├── FriendDelete.java │ │ │ │ ├── GroupAddRequest.java │ │ │ │ ├── GroupAdminChange.java │ │ │ │ ├── GroupBan.java │ │ │ │ ├── GroupFileUpload.java │ │ │ │ ├── GroupMemberIncrease.java │ │ │ │ ├── GroupMemberReduce.java │ │ │ │ ├── GroupMsg.java │ │ │ │ ├── GroupMsgDelete.java │ │ │ │ ├── MsgGet.java │ │ │ │ ├── PrivateMsg.java │ │ │ │ └── PrivateMsgDelete.java │ │ │ ├── package-info.java │ │ │ ├── result │ │ │ │ ├── AbstractAnonInfo.java │ │ │ │ ├── AbstractAuthInfo.java │ │ │ │ ├── AbstractBanList.java │ │ │ │ ├── AbstractFileInfo.java │ │ │ │ ├── AbstractFriendList.java │ │ │ │ ├── AbstractGroupHomeworkList.java │ │ │ │ ├── AbstractGroupInfo.java │ │ │ │ ├── AbstractGroupLinkList.java │ │ │ │ ├── AbstractGroupList.java │ │ │ │ ├── AbstractGroupMemberInfo.java │ │ │ │ ├── AbstractGroupMemberList.java │ │ │ │ ├── AbstractGroupNoteList.java │ │ │ │ ├── AbstractGroupTopNote.java │ │ │ │ ├── AbstractImageInfo.java │ │ │ │ ├── AbstractInfoResult.java │ │ │ │ ├── AbstractInfoResultList.java │ │ │ │ ├── AbstractLoginInfo.java │ │ │ │ ├── AbstractLoginQQInfo.java │ │ │ │ ├── AbstractResultInner.java │ │ │ │ ├── AbstractShareList.java │ │ │ │ ├── AbstractStrangerInfo.java │ │ │ │ ├── AnonInfo.java │ │ │ │ ├── AuthInfo.java │ │ │ │ ├── BanList.java │ │ │ │ ├── FileInfo.java │ │ │ │ ├── FriendList.java │ │ │ │ ├── GroupHomeworkList.java │ │ │ │ ├── GroupInfo.java │ │ │ │ ├── GroupLinkList.java │ │ │ │ ├── GroupList.java │ │ │ │ ├── GroupMemberInfo.java │ │ │ │ ├── GroupMemberList.java │ │ │ │ ├── GroupNoteList.java │ │ │ │ ├── GroupTopNote.java │ │ │ │ ├── ImageInfo.java │ │ │ │ ├── InfoResult.java │ │ │ │ ├── InfoResultList.java │ │ │ │ ├── LoginQQInfo.java │ │ │ │ ├── ResultInner.java │ │ │ │ ├── ShareList.java │ │ │ │ ├── StrangerInfo.java │ │ │ │ └── inner │ │ │ │ │ ├── AbstractBanInfo.java │ │ │ │ │ ├── AbstractContent.java │ │ │ │ │ ├── AbstractFriend.java │ │ │ │ │ ├── AbstractGroup.java │ │ │ │ │ ├── AbstractGroupHomework.java │ │ │ │ │ ├── AbstractGroupLink.java │ │ │ │ │ ├── AbstractGroupMember.java │ │ │ │ │ ├── AbstractGroupNote.java │ │ │ │ │ ├── AbstractShare.java │ │ │ │ │ ├── BanInfo.java │ │ │ │ │ ├── Content.java │ │ │ │ │ ├── Friend.java │ │ │ │ │ ├── Group.java │ │ │ │ │ ├── GroupHomework.java │ │ │ │ │ ├── GroupLink.java │ │ │ │ │ ├── GroupMember.java │ │ │ │ │ ├── GroupNote.java │ │ │ │ │ └── Share.java │ │ │ └── types │ │ │ │ ├── GroupAddRequestType.java │ │ │ │ ├── GroupAdminChangeType.java │ │ │ │ ├── GroupBanType.java │ │ │ │ ├── GroupMsgType.java │ │ │ │ ├── IncreaseType.java │ │ │ │ ├── MsgGetTypes.java │ │ │ │ ├── PowerType.java │ │ │ │ ├── PrivateMsgType.java │ │ │ │ ├── ReduceType.java │ │ │ │ └── SexType.java │ │ └── types │ │ │ ├── BreakType.java │ │ │ ├── CQCodeTypes.java │ │ │ ├── CacheTimeTypes.java │ │ │ ├── CacheTypes.java │ │ │ ├── KeywordMatchType.java │ │ │ ├── MostDIYType.java │ │ │ ├── MostType.java │ │ │ ├── ResultSelectType.java │ │ │ ├── TimeTaskTemplate.java │ │ │ └── TimeType.java │ │ ├── bot │ │ ├── BotInfo.java │ │ ├── BotInfoImpl.java │ │ ├── BotManager.java │ │ ├── BotManagerImpl.java │ │ ├── BotSender.java │ │ └── LoginInfo.java │ │ ├── code │ │ ├── CatCode.java │ │ ├── CatCodeTypes.java │ │ ├── CatCodeUtil.java │ │ └── CodeConversionable.java │ │ ├── constant │ │ └── PriorityConstant.java │ │ ├── depend │ │ ├── AdditionalDepends.java │ │ ├── AutoApplicationReader.java │ │ ├── AutoDependReader.java │ │ ├── BasicDepend.java │ │ ├── BasicResourceWarehouse.java │ │ ├── Beans.java │ │ ├── BeansData.java │ │ ├── BeansFactory.java │ │ ├── Depend.java │ │ ├── DependCenter.java │ │ ├── DependGetter.java │ │ ├── DependInjector.java │ │ ├── NameTypeEntry.java │ │ ├── package-info.java │ │ ├── parameter │ │ │ ├── NormalParamNameGetter.java │ │ │ ├── NullParamNameGetter.java │ │ │ ├── ParamGetterManager.java │ │ │ └── ParamNameGetter.java │ │ └── util │ │ │ └── DependUtil.java │ │ ├── exception │ │ ├── AnnotationException.java │ │ ├── BlockException.java │ │ ├── BotVerifyException.java │ │ ├── CQParamsException.java │ │ ├── CQParseException.java │ │ ├── ConfigurationException.java │ │ ├── DefaultHttpClientException.java │ │ ├── DependResourceException.java │ │ ├── EnumFactoryException.java │ │ ├── EnumInstantiationException.java │ │ ├── EnumInstantiationRequireException.java │ │ ├── ExceptionProcessException.java │ │ ├── FilterException.java │ │ ├── HttpClientHelperException.java │ │ ├── HttpResponseException.java │ │ ├── ListenerException.java │ │ ├── ModuleException.java │ │ ├── NoBlockException.java │ │ ├── NoSuchBlockNameException.java │ │ ├── NoSuchExceptionHandleException.java │ │ ├── RobotApiException.java │ │ ├── RobotDevException.java │ │ ├── RobotException.java │ │ ├── RobotRunException.java │ │ ├── RobotRuntimeException.java │ │ ├── TimeTaskException.java │ │ └── safe │ │ │ ├── SRSafeError.java │ │ │ └── package-info.java │ │ ├── factory │ │ ├── BaseFactory.java │ │ ├── BreakTypeFactory.java │ │ ├── CQCodeTypeFactory.java │ │ ├── KeywordMatchTypeFactory.java │ │ ├── MostTypeFactory.java │ │ ├── MsgGetTypeFactory.java │ │ ├── TimeTaskTemplateFactory.java │ │ ├── TypeFactoryException.java │ │ └── package-info.java │ │ ├── intercept │ │ ├── BaseContext.java │ │ ├── Context.java │ │ ├── Intercept.java │ │ ├── Interceptor.java │ │ └── package-info.java │ │ ├── listener │ │ ├── Filterable.java │ │ ├── ListenContext.java │ │ ├── ListenIntercept.java │ │ ├── ListenerInfo.java │ │ ├── MsgGetContext.java │ │ ├── MsgIntercept.java │ │ ├── error │ │ │ ├── ExceptionHandle.java │ │ │ ├── ExceptionHandleContext.java │ │ │ ├── ExceptionHandleContextImpl.java │ │ │ └── ExceptionProcessCenter.java │ │ ├── invoker │ │ │ ├── AtDetection.java │ │ │ ├── FilterParameterMatcher.java │ │ │ ├── FilterParameterMatcherImpl.java │ │ │ ├── ListenInterceptContext.java │ │ │ ├── ListenerFilter.java │ │ │ ├── ListenerManager.java │ │ │ ├── ListenerMethod.java │ │ │ ├── ListenerMethodScanner.java │ │ │ ├── MsgReceiver.java │ │ │ └── plug │ │ │ │ ├── ListenerPlug.java │ │ │ │ └── Plug.java │ │ └── result │ │ │ ├── BasicResultParser.java │ │ │ ├── BodyResultParser.java │ │ │ ├── ListenResult.java │ │ │ ├── ListenResultImpl.java │ │ │ └── ListenResultParser.java │ │ ├── log │ │ ├── LogLevel.java │ │ ├── QQLog.java │ │ ├── QQLogBack.java │ │ └── QQLogLang.java │ │ ├── package-info.java │ │ ├── plugins │ │ └── Plugin.java │ │ ├── record │ │ └── package-info.java │ │ ├── safe │ │ └── PoliceStation.java │ │ ├── scanner │ │ ├── FileScanner.java │ │ ├── Register.java │ │ └── ScannerManager.java │ │ ├── sender │ │ ├── BaseAPITemplate.java │ │ ├── BlockAble.java │ │ ├── CacheGetterFactory.java │ │ ├── HttpClientAble.java │ │ ├── HttpClientHelper.java │ │ ├── HttpResp.java │ │ ├── HttpRespImpl.java │ │ ├── Methodable.java │ │ ├── MsgSender.java │ │ ├── ProxyRootSender.java │ │ ├── Sender.java │ │ ├── Senderable.java │ │ ├── intercept │ │ │ ├── GetContext.java │ │ │ ├── InterceptValue.java │ │ │ ├── SendContext.java │ │ │ ├── SenderContext.java │ │ │ ├── SenderGetIntercept.java │ │ │ ├── SenderIntercept.java │ │ │ ├── SenderInterceptException.java │ │ │ ├── SenderInterceptFactory.java │ │ │ ├── SenderListAPI.java │ │ │ ├── SenderSendIntercept.java │ │ │ ├── SenderSetIntercept.java │ │ │ └── SetContext.java │ │ ├── package-info.java │ │ └── senderlist │ │ │ ├── BaseGetList.java │ │ │ ├── BaseGetter.java │ │ │ ├── BaseRootSender.java │ │ │ ├── BaseRootSenderList.java │ │ │ ├── BaseSendList.java │ │ │ ├── BaseSender.java │ │ │ ├── BaseSetList.java │ │ │ ├── BaseSetter.java │ │ │ ├── Getter.java │ │ │ ├── GetterUpper.java │ │ │ ├── RootSender.java │ │ │ ├── RootSenderList.java │ │ │ ├── RootSenderUpper.java │ │ │ ├── Sender.java │ │ │ ├── SenderGet.java │ │ │ ├── SenderGetList.java │ │ │ ├── SenderList.java │ │ │ ├── SenderSend.java │ │ │ ├── SenderSendList.java │ │ │ ├── SenderSet.java │ │ │ ├── SenderSetList.java │ │ │ ├── Setter.java │ │ │ └── SetterUpper.java │ │ ├── system │ │ ├── CoreClassLoader.java │ │ ├── CoreSystem.java │ │ ├── RunParameter.java │ │ ├── RunParameterImpl.java │ │ ├── RunParameterType.java │ │ ├── RunParameterUtils.java │ │ ├── RunParameters.java │ │ └── limit │ │ │ ├── Limit.java │ │ │ ├── LimitIntercept.java │ │ │ └── ListenLimit.java │ │ ├── timetask │ │ ├── BaseTimeJob.java │ │ ├── TimeJob.java │ │ ├── TimeTaskContext.java │ │ └── TimeTaskManager.java │ │ └── utils │ │ ├── AnnotationByNameUtils.java │ │ ├── AnnotationUtils.java │ │ ├── AnnotationValueUtils.java │ │ ├── BaseLocalThreadPool.java │ │ ├── BeansUtils.java │ │ ├── BooleanMap.java │ │ ├── CQCodeUtil.java │ │ ├── CQUtils.java │ │ ├── DefaultHttpClientTemplate.java │ │ ├── EmptyInputStream.java │ │ ├── EmptyIterator.java │ │ ├── EnumValues.java │ │ ├── FieldUtils.java │ │ ├── HttpClientUtil.java │ │ ├── JSONUtils.java │ │ ├── MethodUtil.java │ │ ├── ObjectsPlus.java │ │ ├── RandomUtil.java │ │ ├── ReaderProperties.java │ │ ├── ResourcesUtils.java │ │ ├── SingleFactory.java │ │ ├── StringListReader.java │ │ └── proxyhelper │ │ ├── JSONParameterCreatorHelper.java │ │ └── UrlParameterCreatorHelper.java │ └── resources │ ├── conf-demo.properties │ ├── lang │ ├── README.txt │ ├── component │ │ ├── README.txt │ │ ├── en_US.lang │ │ ├── ja_JP.lang │ │ └── zh_CN.lang │ ├── core │ │ ├── README.txt │ │ ├── en_US.lang │ │ ├── ja_JP.lang │ │ └── zh_CN.lang │ ├── en_US.lang │ ├── modules │ │ ├── en_US.lang │ │ └── zh_CN.lang │ └── zh_CN.lang │ └── simbot │ └── factory │ └── module.factory ├── update.md └── 更新计划.md /.github/workflows/mavenpublish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a package using Maven and then publish it to GitHub packages when a release is created 2 | # For more information see: https://github.com/actions/setup-java#apache-maven-with-a-settings-path 3 | 4 | name: Maven Package 5 | 6 | on: 7 | release: 8 | types: [created] 9 | 10 | jobs: 11 | build: 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - uses: actions/checkout@v2 17 | - name: Set up JDK 1.8 18 | uses: actions/setup-java@v1 19 | with: 20 | java-version: 1.8 21 | server-id: github # Value of the distributionManagement/repository/id field of the pom.xml 22 | settings-path: ${{ github.workspace }} # location for the settings.xml file 23 | 24 | - name: Build with Maven 25 | run: mvn -B package --file pom.xml 26 | 27 | - name: Publish to GitHub Packages Apache Maven 28 | run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml 29 | env: 30 | GITHUB_TOKEN: ${{ github.token }} 31 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java -------------------------------------------------------------------------------- /lib/HikariCP-java6-2.3.13.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/HikariCP-java6-2.3.13.jar -------------------------------------------------------------------------------- /lib/apiguardian-api-1.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/apiguardian-api-1.1.0.jar -------------------------------------------------------------------------------- /lib/c3p0-0.9.5.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/c3p0-0.9.5.2.jar -------------------------------------------------------------------------------- /lib/commons-beanutils-1.9.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/commons-beanutils-1.9.3.jar -------------------------------------------------------------------------------- /lib/commons-codec-1.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/commons-codec-1.9.jar -------------------------------------------------------------------------------- /lib/commons-collections-3.2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/commons-collections-3.2.2.jar -------------------------------------------------------------------------------- /lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /lib/console-plus-1.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/console-plus-1.2.1.jar -------------------------------------------------------------------------------- /lib/fastjson-1.2.54.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/fastjson-1.2.54.jar -------------------------------------------------------------------------------- /lib/httpclient-4.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/httpclient-4.5.jar -------------------------------------------------------------------------------- /lib/httpcore-4.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/httpcore-4.4.1.jar -------------------------------------------------------------------------------- /lib/hutool-core-5.3.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/hutool-core-5.3.5.jar -------------------------------------------------------------------------------- /lib/junit-jupiter-5.7.0-M1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/junit-jupiter-5.7.0-M1.jar -------------------------------------------------------------------------------- /lib/junit-jupiter-api-5.7.0-M1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/junit-jupiter-api-5.7.0-M1.jar -------------------------------------------------------------------------------- /lib/junit-jupiter-engine-5.7.0-M1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/junit-jupiter-engine-5.7.0-M1.jar -------------------------------------------------------------------------------- /lib/junit-jupiter-params-5.7.0-M1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/junit-jupiter-params-5.7.0-M1.jar -------------------------------------------------------------------------------- /lib/junit-platform-commons-1.7.0-M1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/junit-platform-commons-1.7.0-M1.jar -------------------------------------------------------------------------------- /lib/junit-platform-engine-1.7.0-M1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/junit-platform-engine-1.7.0-M1.jar -------------------------------------------------------------------------------- /lib/mchange-commons-java-0.2.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/mchange-commons-java-0.2.11.jar -------------------------------------------------------------------------------- /lib/opentest4j-1.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/opentest4j-1.2.0.jar -------------------------------------------------------------------------------- /lib/quartz-2.3.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/quartz-2.3.0.jar -------------------------------------------------------------------------------- /lib/simple-plusutils-1.3.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/simple-plusutils-1.3.1.jar -------------------------------------------------------------------------------- /lib/slf4j-api-1.7.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/lib/slf4j-api-1.7.7.jar -------------------------------------------------------------------------------- /src/main/java/com/forte/common/annotation/Comment.java: -------------------------------------------------------------------------------- 1 | package com.forte.common.annotation; 2 | 3 | import java.lang.annotation.Documented; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | import java.lang.annotation.Target; 7 | 8 | import static java.lang.annotation.ElementType.*; 9 | 10 | /** 11 | * 用来给那些没下载源码的人看注释用的 12 | * 虽然并不一定每个地方都会用这个注释,用不用主要看心情 13 | * @author ForteScarlet 14 | * @date 2020/8/1 15 | */ 16 | @Documented 17 | @Retention(RetentionPolicy.CLASS) 18 | @Target({FIELD, TYPE, METHOD, PARAMETER, PACKAGE, CONSTRUCTOR}) 19 | public @interface Comment { 20 | String[] value() default {}; 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/forte/common/annotation/SimbotTODO.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SimbotTODO.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | package com.forte.common.annotation; 14 | 15 | import java.lang.annotation.Documented; 16 | import java.lang.annotation.Retention; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.Target; 19 | 20 | import static java.lang.annotation.ElementType.*; 21 | import static java.lang.annotation.ElementType.CONSTRUCTOR; 22 | 23 | /** 24 | * 25 | * 给开发者我自己看的。 26 | * 标注一些可能需要大改的地方. 27 | * 简单来说就是开发者的备忘录. 28 | * 29 | * 非运行时,不会被加载 30 | * Created by lcy on 2020/8/19. 31 | * 32 | * @author ForteScarlet 33 | */ 34 | @Documented 35 | @Retention(RetentionPolicy.SOURCE) 36 | @Target({FIELD, TYPE, METHOD, PARAMETER, PACKAGE, CONSTRUCTOR}) 37 | public @interface SimbotTODO { 38 | String[] value() default {}; 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/forte/config/InjectableConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File InjectableConfig.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.config; 15 | 16 | import java.util.Map; 17 | import java.util.Properties; 18 | 19 | /** 20 | * 21 | * 可注入的配置接口 22 | * 23 | * @author ForteScarlet <[email]ForteScarlet@163.com> 24 | * @since JDK1.8 25 | **/ 26 | public interface InjectableConfig { 27 | 28 | /** 29 | * 通过properties注入 30 | */ 31 | T inject(T config, Properties data); 32 | 33 | /** 34 | * 通过map注入 35 | */ 36 | T inject(T config, Map data); 37 | 38 | /** 39 | * 通过单个键值对儿添加 40 | */ 41 | T inject(T config, String name, Object value); 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/com/forte/config/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File package-info.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | /** 15 | * 提供配置注入功能 16 | */ 17 | package com.forte.config; -------------------------------------------------------------------------------- /src/main/java/com/forte/lang/LanguageInitException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File LanguageInitException.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.lang; 15 | 16 | /** 17 | * 语言加载器初始化异常,不使用RobotException相关 18 | * 一般会抛出此异常的时候,都是语言还没有初始化完成的时候 19 | */ 20 | public class LanguageInitException extends RuntimeException { 21 | public LanguageInitException() { 22 | } 23 | 24 | public LanguageInitException(String message) { 25 | super(message); 26 | } 27 | 28 | public LanguageInitException(String message, Throwable cause) { 29 | super(message, cause); 30 | } 31 | 32 | public LanguageInitException(Throwable cause) { 33 | super(cause); 34 | } 35 | 36 | public LanguageInitException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { 37 | super(message, cause, enableSuppression, writableStackTrace); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/forte/lang/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File package-info.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | /** 15 | * 国际语言化相关包 16 | * @since 1.7.0 17 | */ 18 | package com.forte.lang; -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/ConfigApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File ConfigApplication.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot; 15 | 16 | /** 17 | * 18 | * 允许使用配置文件的接口。 19 | * 20 | * 目前暂时仅支持properties(因为简单且不需要其他依赖 21 | * 22 | * @author ForteScarlet <[email]ForteScarlet@163.com> 23 | * @since JDK1.8 24 | **/ 25 | public interface ConfigApplication extends Application { 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/ConfigurationProperty.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File ConfigurationProperty.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot; 15 | 16 | import java.lang.annotation.ElementType; 17 | import java.lang.annotation.Retention; 18 | import java.lang.annotation.RetentionPolicy; 19 | import java.lang.annotation.Target; 20 | 21 | /** 22 | * config property, 以注解的方式来代替property文件 23 | * @author ForteScarlet 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) //注解会在class字节码文件中存在,在运行时可以通过反射获取到 26 | @Target({ElementType.TYPE}) //接口、类、枚举、注解、方法 27 | public @interface ConfigurationProperty { 28 | 29 | /** 30 | * 键 31 | */ 32 | String key(); 33 | 34 | /** 35 | * 值 36 | */ 37 | String value(); 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/MsgParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File MsgParser.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot; 15 | 16 | import com.forte.qqrobot.beans.messages.msgget.MsgGet; 17 | 18 | /** 19 | * 20 | * 消息转化器,接收一个消息字符串,转化为消息封装类{@link com.forte.qqrobot.beans.messages.msgget.MsgGet} 21 | * 22 | * @author ForteScarlet <[email]ForteScarlet@163.com> 23 | * @since JDK1.8 24 | **/ 25 | public interface MsgParser { 26 | 27 | /** 28 | * 将一个从插件那里得到的监听消息的原始字符串转化为一个对应的消息封装类。 29 | * @param msg 监听消息字符串 30 | * @return {@link MsgGet} 31 | */ 32 | MsgGet parse(String msg); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/MsgProcessable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File MsgProcessable.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot; 15 | 16 | import com.forte.qqrobot.beans.messages.msgget.MsgGet; 17 | import com.forte.qqrobot.listener.result.ListenResult; 18 | 19 | /** 20 | *
 消息处理器,将一个MsgGet消息交由监听函数处理器进行处理。
21 |  * 
 一般配合抽象类{@link }
22 |  * 
 此过程一般来讲是单线程的,所以如果你选择了自己使用这个功能,你可以拥有更多选择。
23 |  * 
 例如,线程池、消息队列..
24 |  * 
 最终结果一般来讲是一个最终的执行数组,不过提供了一个默认的方法以得到一个经过默认条件筛选的最终结果。
25 |  *      这个筛选的方式是{@link com.forte.qqrobot.beans.types.ResultSelectType}, 在配置中是可配置的。
26 |  * 
 此接口一般是面向组件开发者的,他需要组件开发者在内部实现对于MsgSender的构建逻辑。
27 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
28 |  * @since JDK1.8
29 |  **/
30 | public interface MsgProcessable {
31 | 
32 |     /**
33 |      * 监听一个消息,返回监听响应结果集
34 |      * @param msgGet 监听消息
35 |      * @return 监听响应集
36 |      */
37 |     ListenResult[] onMsg(MsgGet msgGet);
38 | 
39 | 
40 | 
41 | }
42 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/SimpleRobotConfiguration.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     SimpleRobotConfiguration.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  * @author  ForteScarlet 
23 |  */
24 | @Retention(RetentionPolicy.RUNTIME)    //注解会在class字节码文件中存在,在运行时可以通过反射获取到
25 | @Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE}) //接口、类、枚举、注解、方法
26 | public @interface SimpleRobotConfiguration {
27 | 
28 |     /**
29 |      * 额外的配置信息。此信息会覆盖文件读取到的信息。
30 |      * @return 额外的配置信息
31 |      */
32 |     ConfigurationProperty[] value() default {};
33 | 
34 | }
35 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/AnnotateMapping.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Mapping.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.*;
17 | 
18 | /**
19 |  * 用于内部的注解继承映射
20 |  *
21 |  * 标注的注解方法的返回值类型应该与被映射的父类的方法返回值一致
22 |  *
23 |  * @author  ForteScarlet 
24 |  */
25 | @Retention(RetentionPolicy.RUNTIME)    //注解会在class字节码文件中存在,在运行时可以通过反射获取到
26 | @Target({ElementType.METHOD}) // 使用在注解的方法上
27 | public @interface AnnotateMapping {
28 | 
29 |     /**
30 |      * 映射的父类注解
31 |      */
32 |     Class type();
33 | 
34 |     /**
35 |      * 映射的父类注解的名称
36 |      * 默认为空,为空的时候默认认为name与当前方法名一致
37 |      */
38 |     String name() default "";
39 | 
40 | }
41 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/Async.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Async.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  * 标定当前监听函数为异步函数。
23 |  * 异步函数的函数返回值、break注解等解析均会失效,默认认为其执行成功。
24 |  *
25 |  * 目前来讲,异步任务暂时无法捕获异常。因此请注意异常处理。
26 |  *
27 |  * @author  ForteScarlet 
28 |  */
29 | @Retention(RetentionPolicy.RUNTIME)
30 | @Target({ElementType.METHOD})
31 | public @interface Async {
32 |     /**
33 |      * 异步函数执行成功的默认值。
34 |      * 默认认为其执行成功。
35 |      *
36 |      * 此值会直接作为返回值返回,因此请不要标记{@link ListenBody}注解
37 |      */
38 |     boolean success() default true;
39 | 
40 | }
41 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/Block.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Block.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  * 阻塞注解
23 |  * 标注在类上的时候,类下的全部函数全都会被标记上此注解
24 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
25 |  * @date Created in 2019/3/29 10:22
26 |  * @since JDK1.8
27 |  **/
28 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
29 | @Target({ElementType.TYPE, ElementType.METHOD}) //接口、类、枚举、注解、方法
30 | public @interface Block {
31 | 
32 |     /** 阻塞的名称,相同名称的阻塞方法共享阻塞状态,阻塞名称可以有多个,没有名称的函数将会以 类名#函数名(参数列表) 的规则来命名 */
33 |     String[] value() default {};
34 | 
35 | 
36 | }
37 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/ByNameField.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ByNameField.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  *
23 |  * 为那些ByName的注解提供对应关系
24 |  * 标注在对应ByName的注解上
25 |  * 方法必须是字符串或者字符串数组类型
26 |  * 其对应的主注解类型与其对应的必须一致
27 |  *
28 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
29 |  * @since JDK1.8
30 |  **/
31 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
32 | @Target({ElementType.METHOD}) //接口、类、枚举、注解、方法
33 | public @interface ByNameField {
34 | 
35 |     /** 某个枚举的值, 标注在byName注解的方法上 */
36 |     Class> value();
37 | 
38 | }
39 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/ByNameFrom.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ByNameFrom.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.*;
17 | 
18 | /**
19 |  *
20 |  * 此注解指定一个ByName注解所对应的父类注解
21 |  *
22 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
23 |  * @since JDK1.8
24 |  **/
25 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
26 | @Target({ElementType.ANNOTATION_TYPE}) //接口、类、枚举、注解、方法
27 | public @interface ByNameFrom {
28 | 
29 |     /** byName所唯一对应的父类注解 */
30 |     Class value();
31 | 
32 | }
33 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/ByNameType.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ByNameType.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.*;
17 | 
18 | /**
19 |  *
20 |  * 此注解指定一个注解所对应的byName注解
21 |  *
22 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
23 |  * @since JDK1.8
24 |  **/
25 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
26 | @Target({ElementType.ANNOTATION_TYPE}) //注解
27 | public @interface ByNameType {
28 | 
29 |     /**
30 |      * 此注解对应的ByName注解
31 |      * 或许ByName注解存在的不止一个,可能存在很多扩展用的,但是官方指定的只能存在一个
32 |      * */
33 |     Class value();
34 | 
35 | }
36 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/Config.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Config.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  *
23 |  * 此注解用于标注一些可以在配置类中进行注入的值。
24 |  * 仅用作标记,无参数
25 |  * 使用在类上
26 |  *
27 |  * @deprecated 未实现
28 |  *
29 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
30 |  * @since JDK1.8
31 |  **/
32 | @Retention(RetentionPolicy.RUNTIME)
33 | @Target(ElementType.TYPE)
34 | @Deprecated
35 | public @interface Config {
36 | }
37 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/Constr.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Constr.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  * 使用在监听器类中
23 |  * 当监听器的实例化需要参数而不是无参构造的时候,使用此注解标注一个静态方法
24 |  * 方法的返回值应为此监听器的类型
25 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
26 |  * @date Created in 2019/3/26 11:45
27 |  * @since JDK1.8
28 |  **/
29 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
30 | @Target({ElementType.METHOD}) //接口、类、枚举、注解、方法
31 | public @interface Constr {
32 | }
33 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/CoreVersion.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     CoreVersion.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.*;
17 | 
18 | /**
19 |  * 核心版本注解,内部使用
20 |  * 然而实际上压根没使用
21 |  *
22 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
23 |  * @since JDK1.8
24 |  **/
25 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
26 | @Target({ElementType.TYPE}) //接口、类、枚举、注解、方法
27 | @Documented
28 | @Inherited  //可继承的
29 | public @interface CoreVersion {
30 |     //版本
31 |     String version();
32 |     //开发者
33 |     String author();
34 |     //其他注释一类的东西?
35 |     String comment() default "";
36 |     String email() default "";
37 |     String QQ() default "";
38 |     String phone() default "";
39 |     /** 主页 */
40 |     String home() default "";
41 |     /** maven地址 */
42 |     String mavenUrl() default "https://mvnrepository.com/artifact/io.github.ForteScarlet/simple-robot-core";
43 |     /** git地址 */
44 |     String[] git() default {
45 |         "https://github.com/ForteScarlet/simple-robot-core",
46 |         "https://gitee.com/ForteScarlet/simple-coolQ"
47 |     };
48 | }
49 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/DIYFilter.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     DIYFilter.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import com.forte.qqrobot.anno.depend.Beans;
17 | 
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 | 
23 | /**
24 |  * 自定义过滤规则的
25 |  * @author  ForteScarlet 
26 |  */
27 | @Retention(RetentionPolicy.RUNTIME)    //注解会在class字节码文件中存在,在运行时可以通过反射获取到
28 | @Target({ElementType.TYPE}) //接口、类、枚举、注解、方法
29 | @Beans
30 | public @interface DIYFilter {
31 | 
32 |     /**
33 |      * 自定义filter的名称。如果不填或者使用的是@Beans注解,则使用类名小写作为名称。
34 |      * 此名称也同样会映射为{@link Beans}的依赖名称
35 |      */
36 |     String value() default "";
37 | 
38 |     /** 是否为单例,默认为单例 */
39 |     @AnnotateMapping(type = Beans.class)
40 |     boolean single() default true;
41 | 
42 | 
43 |     /** 根据参数类型列表来指定构造函数,默认为无参构造。仅标注在类上的时候有效 */
44 |     @AnnotateMapping(type = Beans.class)
45 |     Class[] constructor() default {};
46 | 
47 | 
48 | 
49 | }
50 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/ExceptionCatch.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ExceptionCatch.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import com.forte.qqrobot.anno.depend.Beans;
17 | 
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 | 
23 | /**
24 |  * 在监听器中进行异常处理, 标注在实现了ExceptionHandle接口的类上
25 |  *
26 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
27 |  * @since JDK1.8
28 |  **/
29 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
30 | @Target({ElementType.TYPE, ElementType.METHOD, ElementType.ANNOTATION_TYPE}) //接口、类、枚举、注解、方法
31 | @Beans
32 | public @interface ExceptionCatch {
33 | 
34 |     /** 捕获的异常类型,默认为{@link Exception}类型 */
35 |     Class[] value() default java.lang.Exception.class;
36 | 
37 | }
38 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/HttpTemplate.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     HttpTemplate.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import com.forte.qqrobot.anno.depend.Beans;
17 | 
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 | 
23 | /**
24 |  * 将标注的、实现了{@link com.forte.qqrobot.sender.HttpClientAble}的类注册到{@link com.forte.qqrobot.sender.HttpClientHelper}中
25 |  * @author  ForteScarlet 
26 |  */
27 | @Retention(RetentionPolicy.RUNTIME)    //注解会在class字节码文件中存在,在运行时可以通过反射获取到
28 | @Target({ElementType.TYPE}) //接口、类、枚举、注解、方法
29 | @Beans
30 | public @interface HttpTemplate {
31 | 
32 |     /**
33 |      * 注册到{@link com.forte.qqrobot.sender.HttpClientHelper}的时候使用的注册名称
34 |      */
35 |     String value();
36 | 
37 |     /**
38 |      * 是否将其作为默认使用的http模板,默认为false
39 |      */
40 |     boolean beDefault() default false;
41 | 
42 | }
43 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/Ignore.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Ignore.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  * 如果你在类上标注了@Listen注解,但是类下有方法不想被注册,请使用此方法来忽略一个方法
23 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
24 |  * @date Created in 2019/3/27 11:54
25 |  * @since JDK1.8
26 |  **/
27 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
28 | @Target({ElementType.METHOD}) //接口、类、枚举、注解、方法
29 | public @interface Ignore {
30 | }
31 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/Key.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Key.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  * 此注解主要用于简化开发者的开发,使用在方法参数上
23 |  * 通过对一个接口进行代理,将会根据返回值与参数构建一个Bean或者一个JSON字符串
24 |  *
25 |  * @see com.forte.qqrobot.utils.proxyhelper.JSONParameterCreatorHelper
26 |  * @see com.forte.qqrobot.utils.proxyhelper.UrlParameterCreatorHelper
27 |  *
28 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
29 |  * @since JDK1.8
30 |  **/
31 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
32 | @Target(ElementType.PARAMETER)//使用在方法参数上
33 | public @interface Key {
34 | 
35 |     /**
36 |      * 唯一参数,指定此方法的参数对应的key值名称
37 |      * 如果没有注解则默认尝试通过Parameter对象获取
38 |      * 如果要通过Parameter对象获取,请在pom中添加-parameters参数
39 |      */
40 |      String value();
41 | }
42 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/ListenBody.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ListenBody.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  *
23 |  * 当监听函数标记此注解,则函数的返回值将会直接转化为ListenResult中的data参数。
24 |  * 否则将会根据实际情况进行转化。
25 |  *
26 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
27 |  * @since JDK1.8
28 |  **/
29 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
30 | @Target({ElementType.TYPE, ElementType.METHOD}) //接口、类、枚举、注解、方法
31 | public @interface ListenBody {
32 | }
33 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/ListenerAPI.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ListenerAPI.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  *
23 |  * 用于标记一个监听函数的API信息
24 |  * 仅能使用在method上, 且只有被注册的ListenMethod生效
25 |  * 就算此注解不存在,也会生成相应信息,但是所有信息均为默认值
26 |  *
27 |  * 没有什么实际意义。类似的api统计功能会考虑通过模组形式来实现
28 |  *
29 |  * @author ForteScarlet
30 |  */
31 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
32 | @Target({ElementType.METHOD}) //接口、类、枚举、注解、方法
33 | @Deprecated
34 | public @interface ListenerAPI {
35 | 
36 |     /**
37 |      * API的名称简述,例如:私聊复读,默认为{类名}.{方法名}
38 |      */
39 |     String value() default "";
40 | 
41 |     /**
42 |      * 监听API的详细描述,默认为空
43 |      */
44 |     String description() default "";
45 | 
46 | 
47 | 
48 | 
49 | }
50 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/Spare.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Spare.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  * Spare:备用
23 |  * 被此注解标驻的监听器方法将会在没有其他监听器被触发的时候再被触发
24 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
25 |  * @date Created in 2019/3/11 17:29
26 |  * @since JDK1.8
27 |  **/
28 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
29 | @Target({ElementType.TYPE, ElementType.METHOD}) //接口、类、枚举、注解、方法
30 | public @interface Spare {
31 | }
32 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/Version.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Version.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno;
15 | 
16 | import java.lang.annotation.*;
17 | 
18 | /**
19 |  * 备用注解,用于开发者来标注版本号等信息,暂未使用
20 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
24 | @Target({ElementType.TYPE}) //接口、类、枚举、注解、方法
25 | @Documented
26 | @Inherited  //可继承的
27 | public @interface Version {
28 |     /** 版本 */
29 |     String version();
30 |     String versionFamily();
31 |     String groupId() default "io.github.ForteScarlet";
32 |     String artifactId() default "simple-robot-core";
33 |     /** 组件名称 */
34 |     String value() default "";
35 |     //开发者
36 |     String author() default "ForteScarlet";
37 |     //其他注释一类的东西?
38 |     String comment() default "";
39 |     String email() default "";
40 |     String QQ() default "";
41 |     String phone() default "";
42 |     /** 主页 */
43 |     String home() default "";
44 |     /** maven地址 */
45 |     String mavenUrl() default "";
46 |     /** git地址 */
47 |     String[] git() default {};
48 | 
49 | }
50 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/data/Block.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Block.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno.data;
15 | 
16 | /**
17 |  * 注解的参数类
18 |  * @see com.forte.qqrobot.anno.Block 此注解的封装类
19 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
20 |  * @since JDK1.8
21 |  **/
22 | public class Block {
23 | 
24 |     private final String[] value;
25 | 
26 |     //**************** 默认值 ****************//
27 | 
28 |     private static final String[] DEFAULT_VALUE = {};
29 | 
30 |     private static final Block DEFAULT = new Block(DEFAULT_VALUE);
31 | 
32 |     private Block(String[] value) {
33 |         this.value = value;
34 |     }
35 | 
36 |     public static Block build(String[] value){
37 |         return new Block(value);
38 |     }
39 | 
40 |     public static Block build(com.forte.qqrobot.anno.Block blockAnnotation){
41 |         return build(blockAnnotation.value());
42 |     }
43 | 
44 |     public static Block build(){
45 |         return DEFAULT;
46 |     }
47 | 
48 |     public String[] value(){
49 |         return value;
50 |     }
51 | 
52 | }
53 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/data/Listen.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Listen.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno.data;
15 | 
16 | public class Listen {
17 | 
18 | 	private final com.forte.qqrobot.beans.messages.types.MsgGetTypes[] value;
19 | 
20 | 
21 | 	/** 私有构造 */
22 | 	private Listen(com.forte.qqrobot.beans.messages.types.MsgGetTypes[] value){
23 | 		this.value = value;
24 | 	}
25 | 
26 | 	/** 工厂方法 */
27 | 	public static Listen build(com.forte.qqrobot.beans.messages.types.MsgGetTypes[] value){
28 | 		return new Listen(value);
29 | 	}
30 | 
31 | 	/** 工厂方法 */
32 | 	public static Listen build(com.forte.qqrobot.anno.Listen annotation) {
33 | 		return build(annotation.value());
34 | 	}
35 | 
36 | 
37 | 	/**
38 | 	 * 注解参数 {@link com.forte.qqrobot.anno.Listen#value()}
39 | 	 */
40 | 	public com.forte.qqrobot.beans.messages.types.MsgGetTypes[] value() {
41 | 		return value;
42 | 	}
43 | 
44 | 
45 | }


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/depend/AllBeans.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AllBeans.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno.depend;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  * 此注解仅可以使用在启动器上
23 |  * 此注解标注的包路径将会
24 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
25 |  * @since JDK1.8
26 |  **/
27 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
28 | @Target({ElementType.TYPE, ElementType.METHOD}) //类、方法
29 | public @interface AllBeans {
30 | 
31 |     /** 全部加入的包路径, 默认为全包路径 */
32 |     String[] value() default {};
33 | 
34 |     /** 扫描的时候默认使用的Beans注解对象,默认尝试自动注入所有字段 */
35 |     Beans beans() default @Beans(allDepend = true);
36 | }
37 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/depend/BeansOn.java:
--------------------------------------------------------------------------------
 1 | package com.forte.qqrobot.anno.depend;
 2 | 
 3 | import java.lang.annotation.ElementType;
 4 | import java.lang.annotation.Retention;
 5 | import java.lang.annotation.RetentionPolicy;
 6 | import java.lang.annotation.Target;
 7 | 
 8 | /**
 9 |  *
10 |  * TODO
11 |  *
12 |  *  beans on, 实现在注入依赖的时候进行一些条件判断
13 |  * 不能直接代替为{@link Beans}, 需要与其一同使用
14 |  *
15 |  *
16 |  * @author ForteScarlet 
17 |  * @date 2020/7/19
18 |  */
19 | @Retention(RetentionPolicy.RUNTIME)
20 | @Target({ElementType.TYPE, ElementType.METHOD})
21 | public @interface BeansOn {
22 | 
23 |     /**
24 |      * 判断类型
25 |      */
26 |     BeansOn.Type onType();
27 | 
28 |     /**
29 |      * 检测对象。
30 |      * 例如当哪些类型存在才会注入,
31 |      * 或者当哪些类型不存在才会注入之类的。
32 |      */
33 |     Class[] detect();
34 | 
35 | 
36 |     /**
37 |      * 判断类型。
38 |      */
39 |     enum Type {
40 |         /** 当xx存在才会生效 */
41 |         EXIST,
42 |         /** 当xx不存在才会生效 */
43 |         MISS
44 |     }
45 | 
46 | }
47 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/depend/FilterValue.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     FilterValue.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno.depend;
15 | 
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.RetentionPolicy;
18 | import java.lang.annotation.Target;
19 | 
20 | import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
21 | import static java.lang.annotation.ElementType.PARAMETER;
22 | 
23 | /**
24 |  * 字段参数提取注解
25 |  * @author  ForteScarlet 
26 |  */
27 | @Retention(RetentionPolicy.RUNTIME)
28 | @Target({PARAMETER, ANNOTATION_TYPE})
29 | public @interface FilterValue {
30 |     String value();
31 | }
32 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/template/OnFriendDelete.java:
--------------------------------------------------------------------------------
 1 | package com.forte.qqrobot.anno.template;
 2 | 
 3 | import com.forte.qqrobot.anno.AnnotateMapping;
 4 | import com.forte.qqrobot.anno.Listen;
 5 | import com.forte.qqrobot.beans.messages.types.MsgGetTypes;
 6 | 
 7 | import java.lang.annotation.ElementType;
 8 | import java.lang.annotation.Retention;
 9 | import java.lang.annotation.RetentionPolicy;
10 | import java.lang.annotation.Target;
11 | 
12 | /**
13 |  *
14 |  * (被)好友删除事件
15 |  *
16 |  * @author ForteScarlet 
17 |  * @date 2020/8/1
18 |  */
19 | @Retention(RetentionPolicy.RUNTIME)    //注解会在class字节码文件中存在,在运行时可以通过反射获取到
20 | @Target({ElementType.TYPE, ElementType.METHOD}) //接口、类、枚举、注解、方法
21 | @Listen(MsgGetTypes.friendDelete)
22 | public @interface OnFriendDelete {
23 |     /**
24 |      * 假如出现了多个监听器处理同一个消息,使用此参数对其进行排序,默认值为1
25 |      * 2020/1/28  ver1.6.3  修改为100
26 |      * @see Listen#sort()
27 |      */
28 |     @AnnotateMapping(type = Listen.class)
29 |     int sort() default 100;
30 | 
31 |     /**
32 |      * 相当于一个ID,此参数为空的时候会自动根据包、类、方法名、参数列表生成一个唯一ID
33 |      * @see Listen#name()
34 |      */
35 |     @AnnotateMapping(type = Listen.class)
36 |     String name() default "";
37 | }
38 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/template/package-info.java:
--------------------------------------------------------------------------------
1 | /**
2 |  * 提供针对于{@link com.forte.qqrobot.anno.Listen}注解的简化模板注解。
3 |  */
4 | package com.forte.qqrobot.anno.template;


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/timetask/CronTask.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     CronTask.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno.timetask;
15 | 
16 | import java.lang.annotation.ElementType;
17 | import java.lang.annotation.Retention;
18 | import java.lang.annotation.RetentionPolicy;
19 | import java.lang.annotation.Target;
20 | 
21 | /**
22 |  * 使用Cron表达式进行记时的注解
23 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
24 |  * @since JDK1.8
25 |  **/
26 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
27 | @Target({ElementType.TYPE}) //类
28 | public @interface CronTask {
29 |     /** 标记的定时任务类的id,如果为空则默认为类名 */
30 |     String id() default "";
31 | 
32 |     /** cron表达式的内容 */
33 |     String value();
34 | }
35 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/timetask/FixedRateTask.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     FixedRateTask.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.anno.timetask;
15 | 
16 | import com.forte.qqrobot.beans.types.TimeType;
17 | 
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 | 
23 | /**
24 |  * 使用固定时间间隔进行记时的注解
25 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
26 |  * @since JDK1.8
27 |  **/
28 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
29 | @Target(ElementType.TYPE) //类
30 | public @interface FixedRateTask {
31 |     /** 标记的定时任务类的id,如果为空则默认为类名 */
32 |     String id() default "";
33 | 
34 |     /** 时间间隔的内容:毫秒、秒、分等等,类型由{@link #timeType()}决定,默认为秒 */
35 |     long value();
36 | 
37 |     /** 时间类型,默认为秒 */
38 |     TimeType timeType() default TimeType.second;
39 | 
40 |     /** 开始后的重复次数,默认为-1,-1为无限重复 */
41 |     int RepeatCount() default -1;
42 | 
43 | 
44 | }
45 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/anno/timetask/package-info.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     package-info.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | /**
15 |  * 定时任务框架 - quartz 进行整合的相关注解
16 |  * 包下的所有注解均需要实现quartz框架中的{@link org.quartz.Job}接口。
17 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
18 |  * @since JDK1.8
19 |  **/
20 | package com.forte.qqrobot.anno.timetask;


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/function/ExFunction.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ExFunction.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.function;
15 | 
16 | /**
17 |  * this is a functionInterface like {@link java.util.function.Function} but there are 3 parameters
18 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
19 |  * @since JDK1.8
20 |  **/
21 | @FunctionalInterface
22 | public interface ExFunction {
23 | 
24 | 
25 |     R apply(P1 p1, P2 p2, P3 p3);
26 | 
27 | }
28 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/function/MostDIYTypeFilter.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     MostDIYTypeFilter.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.function;
15 | 
16 | import com.forte.qqrobot.anno.data.Filter;
17 | import com.forte.qqrobot.beans.messages.msgget.MsgGet;
18 | import com.forte.qqrobot.listener.Filterable;
19 | import com.forte.qqrobot.listener.ListenContext;
20 | import com.forte.qqrobot.listener.invoker.AtDetection;
21 | 
22 | /**
23 |  * 为枚举{@link com.forte.qqrobot.beans.types.MostDIYType}服务, 作为函数接口使用。
24 |  * @author  ForteScarlet 
25 |  */
26 | @FunctionalInterface
27 | public interface MostDIYTypeFilter {
28 | 
29 |     boolean test(Filter filter, MsgGet msg, AtDetection at, ListenContext context, Filterable[] filters);
30 | 
31 | }
32 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/function/MostTypeFilter.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     MostTypeFilter.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.function;
15 | 
16 | import java.util.function.BiPredicate;
17 | import java.util.regex.Pattern;
18 | 
19 | /**
20 |  * 为枚举{@link com.forte.qqrobot.beans.types.MostType}服务, 作为函数接口使用。
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @date Created in 2019/3/12 15:58
23 |  * @since JDK1.8
24 |  **/
25 | @FunctionalInterface
26 | public interface MostTypeFilter {
27 | 
28 |     /**
29 |      * 传入一个字符串数组为关键词数组,和一个匹配规则,返回一个匹配结果。
30 |      * 一般来讲,msg就是接收到的消息,keywords就是指注解Filter中写的匹配字符串,
31 |      * 而filter就是指单个Filter的匹配规则,例如全匹配啊、正则匹配等等。
32 |      * 当keywords出现多个的时候,通过此函数来规定多个匹配词的时候的整体规则。
33 |      * 例如:只有一个匹配成功就可以,或者需要全部匹配等等。
34 |      * @param msg       文本消息
35 |      * @param keywords  我想要进行过滤的词或者想要匹配的正则的数组
36 |      * @param filter    单个规则匹配的匹配规则
37 |      * @return 是否匹配 (旧版本
38 |      * @return 匹配的元素的索引,如果没有匹配,返回小于0的值,比如说-1
39 |      */
40 |     int test(String msg, Pattern[] keywords, BiPredicate filter);
41 | 
42 | }
43 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/function/PathAssembler.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     PathAssembler.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.function;
15 | 
16 | /**
17 |  * 路径拼接器,通过ip、端口、请求路径拼接最终全路径
18 |  * @author  ForteScarlet 
19 |  */
20 | public interface PathAssembler extends ExFunction {
21 | 
22 | }
23 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/function/ToBotInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ToBotInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.function;
15 | 
16 | import com.forte.qqrobot.bot.BotInfo;
17 | 
18 | import java.util.function.BiFunction;
19 | 
20 | /**
21 |  * 将数据转化为ToBotInfo的工具性质函数,提供一个默认的impl对象。
22 |  * 其转化类型为数据封装,并不用于验证后的botInfo
23 |  * @author  ForteScarlet 
24 |  */
25 | public interface ToBotInfo {
26 | 
27 |     BotInfo toBotInfo(String code, String ip, int port, String path);
28 |     BotInfo toBotInfo(String code, String urlPath);
29 | 
30 | 
31 |     default ToBotInfo getInstance(ExFunction toFullPath, BiFunction toBot){
32 |         return new ToBotInfoImpl(toFullPath, toBot);
33 |     }
34 | 
35 | }
36 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/function/VerifyFunction.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     VerifyFunction.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.function;
15 | 
16 | import com.forte.qqrobot.bot.BotInfo;
17 | 
18 | import java.util.function.Function;
19 | 
20 | /**
21 |  * Bot验证函数
22 |  * @author  ForteScarlet 
23 |  */
24 | public interface VerifyFunction extends Function {
25 | }
26 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/CodesAble.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     CodesAble.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages;
15 | 
16 | /**
17 |  * 同时实现两个接口{@link QQCodeAble}, {@link GroupCodeAble}
18 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
19 |  * @since JDK1.8
20 |  **/
21 | public interface CodesAble extends QQCodeAble, GroupCodeAble, NickOrRemark {
22 | }
23 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/FlagAble.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     FlagAble.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages;
15 | 
16 | /**
17 |  * 存在可以获取标识的信息中的标识获取接口
18 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
19 |  * @since JDK1.8
20 |  **/
21 | public interface FlagAble {
22 | 
23 |     /** 获取标识 */
24 |     String getFlag();
25 | 
26 | }
27 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/NickOrRemark.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     NickOrRemark.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages;
15 | 
16 | /**
17 |  * @author  ForteScarlet 
18 |  */
19 | public interface NickOrRemark extends NicknameAble, RemarkAble {
20 | 
21 |     /**
22 |      * 尝试获取备注,如果没用备注则获取昵称
23 |      * @return 备注,或者昵称
24 |      */
25 |     default String getRemarkOrNickname(){
26 |         final String remark = getRemark();
27 |         return remark == null ? getNickname() : remark;
28 |     }
29 | }
30 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/NicknameAble.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     NicknameAble.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages;
15 | 
16 | /**
17 |  * 可以获取昵称
18 |  *
19 |  *  一般来讲,能得到qq号的地方,就能拿到昵称。
20 |  *
21 |  * @author  ForteScarlet 
22 |  */
23 | public interface NicknameAble {
24 |     /**
25 |      * 可以获取昵称
26 |      * @return nickname
27 |      */
28 |     String getNickname();
29 | }
30 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/OriginalAble.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     OriginalAble.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | 
18 | /**
19 |  * 用于获取原生数据字符串的接口
20 |  * 一般来讲,所有可获取到的消息都应实现此接口
21 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface OriginalAble {
25 | 
26 |     /** 获取原本的数据 originalData */
27 |     @JSONField(serialize = false)
28 |     String getOriginalData();
29 | 
30 | 
31 | 
32 | }
33 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/PowerAble.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     PowerAble.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages;
15 | 
16 | import com.forte.qqrobot.beans.messages.types.PowerType;
17 | 
18 | /**
19 |  * 用于获取群权限相关数据
20 |  * @author  ForteScarlet 
21 |  */
22 | public interface PowerAble {
23 | 
24 |     /**
25 |      * 获取此人在群里的权限
26 |      * @return 权限,例如群员、管理员等
27 |      */
28 |     PowerType getPowerType();
29 | 
30 |     /**
31 |      * 重新定义此人的权限
32 |      * @param powerType 权限
33 |      */
34 |     void setPowerType(PowerType powerType);
35 | 
36 | }
37 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/RemarkAble.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     RemarkAble.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages;
15 | 
16 | /**
17 |  * 可以获取备注信息。一般出现在好友信息或者群信息中
18 |  *
19 |  * 一般来讲,能拿到群号的地方,就能拿到备注。
20 |  *
21 |  * @author  ForteScarlet 
22 |  */
23 | public interface RemarkAble {
24 | 
25 |     /**
26 |      * 获取备注信息,例如群备注,或者好友备注。
27 |      * @return 备注信息
28 |      */
29 |     String getRemark();
30 | 
31 | }
32 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/ThisCodeAble.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ThisCodeAble.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages;
15 | 
16 | /**
17 |  * 提供接口以支持消息获取当前Bot的账号信息
18 |  * @author  ForteScarlet 
19 |  */
20 | public interface ThisCodeAble {
21 |     /**
22 |      * 此消息获取的时候,代表的是哪个账号获取到的消息。
23 |      * @return 接收到此消息的账号。
24 |      */
25 |     String getThisCode();
26 | 
27 |     /**
28 |      * 允许重新定义Code以实现在存在多个机器人的时候切换处理。
29 |      * @param code code
30 |      */
31 |     void setThisCode(String code);
32 | }
33 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetAnonInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetAnonInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.AnonInfo;
18 | 
19 | /**
20 |  * 获取匿名群员信息
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface GetAnonInfo extends InfoGet {
25 | 
26 |     /**
27 |      * 获取通过此类型请求而获取到的参数的返回值的类型
28 |      */
29 |     @Override
30 |     @JSONField(serialize = false)
31 |     default Class resultType(){
32 |         return AnonInfo.class;
33 |     }
34 | 
35 |     /**
36 |      * 获取匿名消息标识
37 |      */
38 |     String getFlag();
39 | 
40 | }
41 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetAuthInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetAuthInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.AuthInfo;
18 | 
19 | /**
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public interface GetAuthInfo extends InfoGet {
24 | 
25 | 
26 |     /**
27 |      * 获取通过此类型请求而获取到的参数的返回值的类型
28 |      */
29 |     @Override
30 |     @JSONField(serialize = false)
31 |     default Class resultType(){
32 |         return AuthInfo.class;
33 |     }
34 | 
35 | }
36 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetBanList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetBanList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.BanList;
18 | 
19 | /**
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public interface GetBanList extends InfoGet {
24 | 
25 |     /**
26 |      * 获取通过此类型请求而获取到的参数的返回值的类型
27 |      */
28 |     @Override
29 |     @JSONField(serialize = false)
30 |     default Class resultType(){
31 |         return BanList.class;
32 |     }
33 | 
34 |     /**
35 |      * 获取群号
36 |      */
37 |     String getGroup();
38 | 
39 | }
40 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetFileInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetFileInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.FileInfo;
18 | 
19 | /**
20 |  * 获取群文件信息
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface GetFileInfo extends InfoGet {
25 |     /**
26 |      * 获取通过此类型请求而获取到的参数的返回值的类型
27 |      */
28 |     @Override
29 |     @JSONField(serialize = false)
30 |     default Class resultType(){
31 |         return FileInfo.class;
32 |     }
33 | 
34 |     String getFlag();
35 | 
36 | }
37 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetFriendList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetFriendList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.FriendList;
18 | 
19 | /**
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public interface GetFriendList extends InfoGet {
24 |     /**
25 |      * 获取通过此类型请求而获取到的参数的返回值的类型
26 |      */
27 |     @Override
28 |     @JSONField(serialize = false)
29 |     default Class resultType(){
30 |         return FriendList.class;
31 |     }
32 | }
33 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetGroupHomeworkList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetGroupHomeworkList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.GroupHomeworkList;
18 | 
19 | /**
20 |  * 获取群作业列表
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface GetGroupHomeworkList extends InfoGet {
25 | 
26 |     /**
27 |      * 获取通过此类型请求而获取到的参数的返回值的类型
28 |      */
29 |     @Override
30 |     @JSONField(serialize = false)
31 |     default Class resultType(){
32 |         return GroupHomeworkList.class;
33 |     }
34 | 
35 |     String getGroup();
36 | 
37 | }
38 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetGroupInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetGroupInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.GroupInfo;
18 | 
19 | /**
20 |  * 取群详细信息
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface GetGroupInfo extends InfoGet {
25 |     /**
26 |      * 获取通过此类型请求而获取到的参数的返回值的类型
27 |      */
28 |     @Override
29 |     @JSONField(serialize = false)
30 |     default Class resultType(){
31 |         return GroupInfo.class;
32 |     }
33 | 
34 |     String getGroup();
35 | }
36 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetGroupLinkList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetGroupLinkList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.GroupLinkList;
18 | 
19 | /**
20 |  * 获取群链接列表
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface GetGroupLinkList extends InfoGet {
25 |     /**
26 |      * 获取通过此类型请求而获取到的参数的返回值的类型
27 |      */
28 |     @Override
29 |     @JSONField(serialize = false)
30 |     default Class resultType(){
31 |         return GroupLinkList.class;
32 |     }
33 | 
34 |     String getGroup();
35 | 
36 | }
37 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetGroupList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetGroupList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.GroupList;
18 | 
19 | /**
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public interface GetGroupList extends InfoGet {
24 | 
25 |     /**
26 |      * 获取通过此类型请求而获取到的参数的返回值的类型
27 |      */
28 |     @Override
29 |     @JSONField(serialize = false)
30 |     default Class resultType(){
31 |         return GroupList.class;
32 |     }
33 | 
34 | }
35 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetGroupMemberInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetGroupMemberInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | 
17 | import com.alibaba.fastjson.annotation.JSONField;
18 | import com.forte.qqrobot.beans.messages.result.GroupMemberInfo;
19 | 
20 | /**
21 |  * 获取群成员信息
22 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
23 |  * @since JDK1.8
24 |  **/
25 | public interface GetGroupMemberInfo extends InfoGet {
26 | 
27 |     /**
28 |      * 获取通过此类型请求而获取到的参数的返回值的类型
29 |      */
30 |     @Override
31 |     @JSONField(serialize = false)
32 |     default Class resultType(){
33 |         return GroupMemberInfo.class;
34 |     }
35 | 
36 |     String getGroup();
37 |     String getQQ();
38 | 
39 | }
40 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetGroupMemberList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetGroupMemberList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | 
17 | import com.alibaba.fastjson.annotation.JSONField;
18 | import com.forte.qqrobot.beans.messages.result.GroupMemberList;
19 | 
20 | /**
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface GetGroupMemberList extends InfoGet {
25 |     /**
26 |      * 获取通过此类型请求而获取到的参数的返回值的类型
27 |      */
28 |     @Override
29 |     @JSONField(serialize = false)
30 |     default Class resultType(){
31 |         return GroupMemberList.class;
32 |     }
33 | 
34 |     String getGroup();
35 | 
36 | }
37 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetGroupNoteList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetGroupNoteList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.GroupNoteList;
18 | 
19 | /**
20 |  * 获取群公告列表
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface GetGroupNoteList extends InfoGet {
25 | 
26 |     /**
27 |      * 获取通过此类型请求而获取到的参数的返回值的类型
28 |      */
29 |     @Override
30 |     @JSONField(serialize = false)
31 |     default Class resultType(){
32 |         return GroupNoteList.class;
33 |     }
34 | 
35 |     String getGroup();
36 | 
37 | }
38 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetGroupTopNote.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetGroupTopNote.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.GroupTopNote;
18 | 
19 | /**
20 |  * 获取置顶公告
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface GetGroupTopNote extends InfoGet {
25 | 
26 |     /**
27 |      * 获取通过此类型请求而获取到的参数的返回值的类型
28 |      */
29 |     @Override
30 |     @JSONField(serialize = false)
31 |     default Class resultType(){
32 |         return GroupTopNote.class;
33 |     }
34 | 
35 |     String getGroup();
36 | }
37 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetImageInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetImageInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.ImageInfo;
18 | 
19 | /**
20 |  * 取图片信息
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface GetImageInfo extends InfoGet {
25 | 
26 |     /**
27 |      * 获取通过此类型请求而获取到的参数的返回值的类型
28 |      */
29 |     @Override
30 |     @JSONField(serialize = false)
31 |     default Class resultType(){
32 |         return ImageInfo.class;
33 |     }
34 | 
35 |     String getFlag();
36 | 
37 | }
38 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetLoginQQInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetLoginQQInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.LoginQQInfo;
18 | 
19 | /**
20 |  * 获取登录qq的信息
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface GetLoginQQInfo extends InfoGet {
25 | 
26 | 
27 | 
28 |     /**
29 |      * 获取通过此类型请求而获取到的参数的返回值的类型
30 |      */
31 |     @Override
32 |     @JSONField(serialize = false)
33 |     default Class resultType(){
34 |         return LoginQQInfo.class;
35 |     }
36 | 
37 | }
38 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetShareList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetShareList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | 
17 | import com.alibaba.fastjson.annotation.JSONField;
18 | import com.forte.qqrobot.beans.messages.result.ShareList;
19 | 
20 | /**
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface GetShareList extends InfoGet {
25 | 
26 | 
27 |     /**
28 |      * 获取通过此类型请求而获取到的参数的返回值的类型
29 |      */
30 |     @Override
31 |     @JSONField(serialize = false)
32 |     default Class resultType(){
33 |         return ShareList.class;
34 |     }
35 | 
36 |     String getGroup();
37 | }
38 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/GetStrangerInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GetStrangerInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.result.StrangerInfo;
18 | 
19 | /**
20 |  * 获取陌生人信息
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface GetStrangerInfo extends InfoGet {
25 | 
26 | 
27 |     /**
28 |      * 获取通过此类型请求而获取到的参数的返回值的类型
29 |      */
30 |     @Override
31 |     @JSONField(serialize = false)
32 |     default Class resultType(){
33 |         return StrangerInfo.class;
34 |     }
35 | 
36 |     String getQQ();
37 | }
38 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/get/InfoGet.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     InfoGet.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.get;
15 | 
16 | import com.alibaba.fastjson.annotation.JSONField;
17 | import com.forte.qqrobot.beans.messages.RootBean;
18 | import com.forte.qqrobot.beans.messages.result.InfoResult;
19 | 
20 | /**
21 |  * 消息获取类型,用于获取参数的对象
22 |  * v1.0.4之后(不包括)的版本,所有消息获取类型的消息
23 |  * 所有的消息获取类
24 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
25 |  * @since JDK1.8
26 |  **/
27 | public interface InfoGet extends RootBean {
28 | 
29 |     /**
30 |      * 获取通过此类型请求而获取到的参数的返回值的类型
31 |      */
32 |     @JSONField(serialize = false)
33 |     Class resultType();
34 | 
35 |     /**
36 |      * 请求的时候都应该有一个参数标识
37 |      */
38 |     String getId();
39 | 
40 | }
41 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/AbstractEventGet.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractEventGet.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | /**
17 |  * EventGet对应抽象实现
18 |  * @see EventGet
19 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
20 |  * @since JDK1.8
21 |  **/
22 | public abstract class AbstractEventGet extends AbstractMsgGet implements EventGet {
23 | 
24 |     @Override
25 |     public String toString(){
26 |         return super.toString();
27 |     }
28 | 
29 | }
30 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/AbstractFriendAdd.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractFriendAdd.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | /**
17 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
18 |  * @since JDK1.8
19 |  **/
20 | public abstract class AbstractFriendAdd extends AbstractEventGet implements FriendAdd {
21 | 
22 |     private String qq;
23 | 
24 |     public String getQq() {
25 |         return qq;
26 |     }
27 | 
28 |     public void setQq(String qq) {
29 |         this.qq = qq;
30 |     }
31 | 
32 |     @Override
33 |     public String getQQ() {
34 |         return qq;
35 |     }
36 | 
37 |     public void setQQ(String qq) {
38 |         this.qq = qq;
39 |     }
40 | 
41 |     @Override
42 |     public String toString() {
43 |         return "FriendAdd{" +
44 |                 "qq='" + getQQ() + '\'' +
45 |                 "} " + super.toString();
46 |     }
47 | }
48 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/DiscussMsg.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     DiscussMsg.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | import com.forte.qqrobot.beans.messages.CodesAble;
17 | import com.forte.qqrobot.beans.messages.FlagAble;
18 | import com.forte.qqrobot.beans.messages.NickOrRemark;
19 | 
20 | /**
21 |  * 讨论组消息
22 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
23 |  **/
24 | public interface DiscussMsg extends MsgGet, CodesAble, FlagAble, NickOrRemark {
25 | 
26 |     /** 获取讨论组号 */
27 |     String getGroup();
28 | 
29 |     @Override
30 |     default String getGroupCode(){
31 |         return getGroup();
32 |     }
33 | 
34 |     /** 获取发消息的人的QQ */
35 |     String getQQ();
36 | 
37 |     @Override
38 |     default String getQQCode(){
39 |         return getQQ();
40 |     }
41 | 
42 |     /** 标识默认使用getId获取 */
43 |     @Override
44 |     default String getFlag(){
45 |         return getId();
46 |     }
47 | 
48 | 
49 | 
50 | }
51 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/EventGet.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     EventGet.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | /**
17 |  * 事件接收的接口
18 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
19 |  **/
20 | public interface EventGet extends MsgGet {
21 | 
22 |     /**
23 |      * 事件中获取消息默认内容为空
24 |      */
25 |     @Override
26 |     default String getMsg(){
27 |         return null;
28 |     }
29 |     @Override
30 |     default void setMsg(String msg){  }
31 | 
32 |     /**
33 |      * 事件中字体的获取默认为空
34 |      */
35 |     @Override
36 |     default String getFont(){
37 |         return null;
38 |     }
39 |     default void setFont(String font){  }
40 | 
41 | 
42 | }
43 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/FriendAdd.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     FriendAdd.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | import com.forte.qqrobot.beans.messages.QQCodeAble;
17 | 
18 | /**
19 |  * 好友已经添加事件
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  **/
22 | public interface FriendAdd extends EventGet, QQCodeAble {
23 | 
24 |     /** 添加人的QQ */
25 |     String getQQ();
26 | 
27 |     @Override
28 |     default String getQQCode(){
29 |         return getQQ();
30 |     }
31 | }
32 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/FriendAddRequest.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     FriendAddRequest.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | import com.forte.qqrobot.beans.messages.FlagAble;
17 | import com.forte.qqrobot.beans.messages.QQCodeAble;
18 | 
19 | /**
20 |  * 好友添加申请事件
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface FriendAddRequest extends EventGet, QQCodeAble, FlagAble {
25 | 
26 |     /** 请求人QQ */
27 |     String getQQ();
28 | 
29 |     @Override
30 |     default String getQQCode(){
31 |         return getQQ();
32 |     }
33 | 
34 |     /** 请求消息 */
35 |     @Override
36 |     String getMsg();
37 | 
38 | 
39 | 
40 | 
41 | }
42 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/FriendDelete.java:
--------------------------------------------------------------------------------
 1 | package com.forte.qqrobot.beans.messages.msgget;
 2 | 
 3 | import com.forte.qqrobot.beans.messages.NickOrRemark;
 4 | import com.forte.qqrobot.beans.messages.QQCodeAble;
 5 | 
 6 | /**
 7 |  *
 8 |  * 好友删除事件
 9 |  * 基本上与{@link FriendAdd}类似
10 |  *
11 |  * @author ForteScarlet 
12 |  * @date 2020/8/1
13 |  */
14 | public interface FriendDelete extends EventGet, QQCodeAble, NickOrRemark {
15 | }
16 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/GroupAdminChange.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupAdminChange.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | import com.forte.qqrobot.beans.messages.CodesAble;
17 | import com.forte.qqrobot.beans.messages.types.GroupAdminChangeType;
18 | 
19 | /**
20 |  * 群管理员变动事件
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @date Created in 2019/4/18 11:35
23 |  * @since JDK1.8
24 |  **/
25 | public interface GroupAdminChange extends EventGet, CodesAble {
26 | 
27 |     /** 来自的群 */
28 |     String getGroup();
29 | 
30 |     @Override
31 |     default String getGroupCode(){
32 |         return getGroup();
33 |     }
34 | 
35 |     /** 操作者的QQ号 */
36 |     String getOperatorQQ();
37 | 
38 |     /** 被操作者的QQ号 */
39 |     String getBeOperatedQQ();
40 | 
41 |     /** 使用的是被操作者的QQ */
42 |     @Override
43 |     default String getQQCode(){
44 |         return getBeOperatedQQ();
45 |     }
46 | 
47 |     /** 获取管理员变动类型 */
48 |     GroupAdminChangeType getType();
49 | 
50 | 
51 | }
52 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/GroupBan.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupBan.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | import com.forte.qqrobot.beans.messages.CodesAble;
17 | import com.forte.qqrobot.beans.messages.types.GroupBanType;
18 | 
19 | /**
20 |  *
21 |  * 群禁言事件
22 |  *
23 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
24 |  * @since JDK1.8
25 |  **/
26 | public interface GroupBan extends EventGet, CodesAble {
27 | 
28 |     /** 获取禁言类型:禁言/解除禁言 */
29 |     GroupBanType getBanType();
30 | 
31 |     /** 群号 */
32 |     String getGroup();
33 |     @Override
34 |     default String getGroupCode(){
35 |         return getGroup();
36 |     }
37 |     /** 操作者的QQ号 */
38 |     String getOperatorQQ();
39 | 
40 |     /** 被操作者的QQ号 */
41 |     String getBeOperatedQQ();
42 | 
43 |     /** 使用的是被操作者的QQ */
44 |     @Override
45 |     default String getQQCode(){
46 |         return getBeOperatedQQ();
47 |     }
48 | 
49 |     /** 禁言时长-秒 */
50 |     Long time();
51 | 
52 | }
53 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/GroupFileUpload.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupFileUpload.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | import com.forte.qqrobot.beans.messages.CodesAble;
17 | 
18 | /**
19 |  * 群文件上传事件
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  * @date Created in 2019/4/18 11:22
22 |  * @since JDK1.8
23 |  **/
24 | public interface GroupFileUpload extends EventGet, CodesAble {
25 | 
26 |     /** 群号 */
27 |     String getGroup();
28 | 
29 |     @Override
30 |     default String getGroupCode(){
31 |         return getGroup();
32 |     }
33 | 
34 |     /** 发信人QQ */
35 |     String getQQ();
36 | 
37 |     @Override
38 |     default String getQQCode(){
39 |         return getQQ();
40 |     }
41 | 
42 |     /** 文件名 */
43 |     String getFileName();
44 | 
45 |     /** 文件大小 Long类型,字节 */
46 |     Long getFileSize();
47 | 
48 |     /** 获取文件Busid */
49 |     String getFileBusid();
50 | 
51 | 
52 | 
53 | }
54 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/GroupMemberIncrease.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupMemberIncrease.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | import com.forte.qqrobot.beans.messages.CodesAble;
17 | import com.forte.qqrobot.beans.messages.types.IncreaseType;
18 | 
19 | /**
20 |  * 群成员增加
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  **/
23 | public interface GroupMemberIncrease extends EventGet, CodesAble {
24 | 
25 |     /** 获取类型 */
26 |     IncreaseType getType();
27 | 
28 |     /** 群号 */
29 |     String getGroup();
30 | 
31 |     @Override
32 |     default String getGroupCode(){
33 |         return getGroup();
34 |     }
35 | 
36 |     /** 操作者的QQ号 */
37 |     String getOperatorQQ();
38 | 
39 |     /** 被操作者的QQ号 */
40 |     String getBeOperatedQQ();
41 | 
42 |     /** 使用的是被操作者的QQ */
43 |     @Override
44 |     default String getQQCode(){
45 |         return getBeOperatedQQ();
46 |     }
47 | 
48 | 
49 | }
50 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/GroupMemberReduce.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupMemberReduce.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | import com.forte.qqrobot.beans.messages.CodesAble;
17 | import com.forte.qqrobot.beans.messages.types.ReduceType;
18 | 
19 | /**
20 |  * 群成员减少事件
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  **/
23 | public interface GroupMemberReduce extends EventGet, CodesAble {
24 | 
25 |     /** 获取类型 */
26 |     ReduceType getType();
27 | 
28 |     /** 群号 */
29 |     String getGroup();
30 | 
31 |     @Override
32 |     default String getGroupCode(){
33 |         return getGroup();
34 |     }
35 | 
36 |     /** 操作者的QQ号 */
37 |     String getOperatorQQ();
38 | 
39 |     /** 被操作者的QQ号 */
40 |     String getBeOperatedQQ();
41 | 
42 |     /** 使用的是被操作者的QQ */
43 |     @Override
44 |     default String getQQCode(){
45 |         return getBeOperatedQQ();
46 |     }
47 | 
48 | 
49 | }
50 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/GroupMsg.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupMsg.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | import com.forte.qqrobot.beans.messages.CodesAble;
17 | import com.forte.qqrobot.beans.messages.FlagAble;
18 | import com.forte.qqrobot.beans.messages.NickOrRemark;
19 | import com.forte.qqrobot.beans.messages.PowerAble;
20 | import com.forte.qqrobot.beans.messages.types.GroupMsgType;
21 | 
22 | /**
23 |  * 群消息
24 |  **/
25 | public interface GroupMsg extends MsgGet, CodesAble, FlagAble, PowerAble, NickOrRemark {
26 | 
27 |     /** 获取群消息发送人的qq号 */
28 |     String getQQ();
29 | 
30 |     @Override
31 |     default String getQQCode(){
32 |         return getQQ();
33 |     }
34 | 
35 |     /** 获取群消息的群号 */
36 |     String getGroup();
37 | 
38 |     @Override
39 |     default String getGroupCode(){
40 |         return getGroup();
41 |     }
42 | 
43 |     /** 获取消息类型 */
44 |     GroupMsgType getType();
45 | 
46 |     /** flag默认使用id */
47 |     @Override
48 |     default String getFlag(){
49 |         return getId();
50 |     }
51 | 
52 | 
53 | }
54 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/PrivateMsg.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     PrivateMsg.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | import com.forte.qqrobot.beans.messages.FlagAble;
17 | import com.forte.qqrobot.beans.messages.NickOrRemark;
18 | import com.forte.qqrobot.beans.messages.QQCodeAble;
19 | import com.forte.qqrobot.beans.messages.types.PrivateMsgType;
20 | 
21 | /**
22 |  * 私信消息
23 |  **/
24 | public interface PrivateMsg extends MsgGet, QQCodeAble, FlagAble, NickOrRemark {
25 | 
26 |     /** 获取私聊消息类型 */
27 |     PrivateMsgType getType();
28 | 
29 |     /** 获取发送人的QQ号 */
30 |     String getQQ();
31 | 
32 |     @Override
33 |     default String getQQCode(){
34 |         return getQQ();
35 |     }
36 | 
37 |     /** flag默认使用id */
38 |     @Override
39 |     default String getFlag(){
40 |         return getId();
41 |     }
42 | 
43 | }
44 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/msgget/PrivateMsgDelete.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     PrivateMsgDelete.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.msgget;
15 | 
16 | import com.forte.qqrobot.beans.messages.FlagAble;
17 | import com.forte.qqrobot.beans.messages.QQCodeAble;
18 | 
19 | /**
20 |  * 私信消息撤回
21 |  * @author  ForteScarlet 
22 |  */
23 | public interface PrivateMsgDelete extends EventGet, QQCodeAble, FlagAble {
24 |     /**
25 |      * 撤回的消息
26 |      * @return 撤回的消息
27 |      */
28 |     @Override
29 |     String getMsg();
30 | 
31 |     /**
32 |      * 获取此消息的唯一id
33 |      * @return 消息id
34 |      */
35 |     @Override
36 |     String getId();
37 | 
38 |     /**
39 |      * 获取标识,等同于获取消息id
40 |      * @return 消息id
41 |      */
42 |     @Override
43 |     default String getFlag(){
44 |         return getId();
45 |     }
46 | 
47 | }
48 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/package-info.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     package-info.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | /**
15 |  * 所有消息的规范定义接口
16 |  **/
17 | package com.forte.qqrobot.beans.messages;


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AbstractBanList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractBanList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.BanInfo;
17 | 
18 | /**
19 |  * @see BanList
20 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public abstract class AbstractBanList extends AbstractInfoResultList implements BanList {
24 | 
25 | 
26 | 
27 | }
28 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AbstractFriendList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractFriendList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import java.util.Arrays;
17 | import java.util.stream.Collectors;
18 | 
19 | /**
20 |  * @see FriendList
21 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public abstract class AbstractFriendList extends AbstractInfoResult implements FriendList {
25 | 
26 |     @Override
27 |     public String toString(){
28 |         return "FriendList{" +
29 |                 "friendList=" + getFriendList().entrySet().stream().map(e -> "{"+e.getKey()+"="+ Arrays.toString(e.getValue()) +"}").collect(Collectors.joining(", ")) +
30 |                 "} ";
31 |     }
32 | }
33 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AbstractGroupHomeworkList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractGroupHomeworkList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.GroupHomework;
17 | 
18 | /**
19 |  * @see GroupHomeworkList
20 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public abstract class AbstractGroupHomeworkList extends AbstractInfoResultList implements GroupHomeworkList {
24 | }
25 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AbstractGroupLinkList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractGroupLinkList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.GroupLink;
17 | 
18 | /**
19 |  * @see GroupLinkList
20 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public abstract class AbstractGroupLinkList extends AbstractInfoResultList implements GroupLinkList {
24 | }
25 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AbstractGroupList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractGroupList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.Group;
17 | 
18 | /**
19 |  * @see GroupList
20 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public abstract class AbstractGroupList extends AbstractInfoResultList implements GroupList {
24 | }
25 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AbstractGroupMemberList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractGroupMemberList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.GroupMember;
17 | 
18 | /**
19 |  * @see GroupMemberList
20 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public abstract class AbstractGroupMemberList extends AbstractInfoResultList implements GroupMemberList {
24 | 
25 | }
26 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AbstractGroupNoteList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractGroupNoteList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.GroupNote;
17 | 
18 | /**
19 |  * @see GroupNoteList
20 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public abstract class AbstractGroupNoteList extends AbstractInfoResultList implements GroupNoteList {
24 | }
25 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AbstractInfoResult.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractInfoResult.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | /**
17 |  * InfoResult对应抽象类
18 |  * @see InfoResult
19 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
20 |  * @since JDK1.8
21 |  **/
22 | public abstract class AbstractInfoResult implements InfoResult {
23 | 
24 |     private String originalData;
25 | 
26 |     @Override
27 |     public String getOriginalData() {
28 |         return originalData;
29 |     }
30 | 
31 |     public void setOriginalData(String originalData) {
32 |         this.originalData = originalData;
33 |     }
34 | 
35 |     @Override
36 |     public String toString() {
37 |         return "InfoResult{" +
38 |                 "originalData='" + getOriginalData() + '\'' +
39 |                 '}';
40 |     }
41 | }
42 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AbstractInfoResultList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractInfoResultList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import java.util.Arrays;
17 | 
18 | /**
19 |  * InfoResultList的抽象类
20 |  * @see InfoResultList
21 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public abstract class AbstractInfoResultList extends AbstractInfoResult implements InfoResultList {
25 | 
26 |     private T[] list;
27 | 
28 |     @Override
29 |     public T[] getList() {
30 |         return list;
31 |     }
32 | 
33 |     public void setList(T[] list) {
34 |         this.list = list;
35 |     }
36 | 
37 |     @Override
38 |     public String toString() {
39 |         return this.getClass().getSimpleName().replaceAll("Abstract", "") + "{" +
40 |                 "list=" + Arrays.toString(list) +
41 |                 "} " + super.toString();
42 |     }
43 | }
44 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AbstractLoginInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractLoginInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.bot.LoginInfo;
17 | 
18 | import java.util.Objects;
19 | 
20 | /**
21 |  * 登录信息
22 |  * @see com.forte.qqrobot.bot.LoginInfo
23 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
24 |  * @since JDK1.8
25 |  **/
26 | public class AbstractLoginInfo extends AbstractLoginQQInfo implements LoginInfo {
27 | 
28 | 
29 |     @Override
30 |     public boolean equals(Object o) {
31 |         if (this == o) return true;
32 |         if (o == null || getClass() != o.getClass()) return false;
33 |         AbstractLoginInfo that = (AbstractLoginInfo) o;
34 |         return Objects.equals(getCode(), that.getCode());
35 |     }
36 | 
37 |     @Override
38 |     public int hashCode() {
39 |         return Objects.hash(getCode());
40 |     }
41 | }
42 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AbstractResultInner.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractResultInner.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | /**
17 |  * ResultInner对应的抽象类
18 |  * @see ResultInner
19 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
20 |  * @since JDK1.8
21 |  **/
22 | public abstract class AbstractResultInner implements ResultInner {
23 | 
24 |     private String originalData;
25 | 
26 |     @Override
27 |     public String getOriginalData() {
28 |         return originalData;
29 |     }
30 | 
31 |     public void setOriginalData(String originalData) {
32 |         this.originalData = originalData;
33 |     }
34 | 
35 |     @Override
36 |     public String toString() {
37 |         return "ResultInner{" +
38 |                 "originalData='" + getOriginalData() + '\'' +
39 |                 '}';
40 |     }
41 | }
42 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AbstractShareList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AbstractShareList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.Share;
17 | 
18 | /**
19 |  *
20 |  * @see ShareList
21 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public abstract class AbstractShareList extends AbstractInfoResultList implements ShareList {
25 | }
26 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AnonInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AnonInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | /**
17 |  * 匿名信息
18 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
19 |  * @since JDK1.8
20 |  **/
21 | public interface AnonInfo extends InfoResult {
22 | 
23 |     /**
24 |      * 获取ID
25 |      */
26 |     String getId();
27 | 
28 |     /**
29 |      * 获取匿名名称
30 |      */
31 |     String getAnonName();
32 | 
33 |     /**
34 |      * Token, 原数据似乎是数据流形式
35 |      */
36 |     String token();
37 | 
38 | 
39 | }
40 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/AuthInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     AuthInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | /**
17 |  * 权限信息
18 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
19 |  * @since JDK1.8
20 |  **/
21 | public interface AuthInfo extends InfoResult {
22 | 
23 |     /**
24 |      * 获取一个编码
25 |      */
26 |     String getCode();
27 | 
28 |     /**
29 |      * 获取cookies信息
30 |      */
31 |     String getCookies();
32 | 
33 |     /**
34 |      * 获取CsrfToken
35 |      */
36 |     String getCsrfToken();
37 | 
38 | 
39 | 
40 | }
41 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/BanList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     BanList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.BanInfo;
17 | 
18 | /**
19 |  * 禁言列表
20 |  * 注意,很多插件都不支持此api了
21 |  * @author ForteScarlet <[emaIl]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public interface BanList extends InfoResultList {
25 | }
26 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/FileInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     FileInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | /**
17 |  * 群文件信息
18 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
19 |  * @since JDK1.8
20 |  **/
21 | public interface FileInfo extends InfoResult {
22 | 
23 |     /** 获取文件名称 */
24 |     String getFileName();
25 | 
26 |     /** 文件ID */
27 |     String getId();
28 | 
29 |     /** 文件BUSID */
30 |     String getBusid();
31 | 
32 |     /** 获取文件大小-字节 */
33 |     Long getFileSize();
34 | 
35 | 
36 | }
37 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/GroupHomeworkList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupHomeworkList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.GroupHomework;
17 | 
18 | /**
19 |  * 群作业列表
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public interface GroupHomeworkList extends InfoResultList {
24 | 
25 | }
26 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/GroupLinkList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupLinkList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.GroupLink;
17 | 
18 | /**
19 |  * 群链接地址
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public interface GroupLinkList extends InfoResultList {
24 | }
25 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/GroupList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.Group;
17 | 
18 | /**
19 |  * 群列表
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public interface GroupList extends InfoResultList {
24 | }
25 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/GroupMemberList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupMemberList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.GroupMember;
17 | 
18 | /**
19 |  * 群成员列表
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public interface GroupMemberList extends InfoResultList {
24 | }
25 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/GroupNoteList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupNoteList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.GroupNote;
17 | 
18 | /**
19 |  * 群公告列表
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public interface GroupNoteList extends InfoResultList {
24 | 
25 | }
26 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/GroupTopNote.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupTopNote.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.GroupNote;
17 | 
18 | /**
19 |  * 置顶群公告
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public interface GroupTopNote extends InfoResult, GroupNote {
24 | 
25 | }
26 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/ImageInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ImageInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | /**
17 |  * 图片信息
18 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
19 |  * @since JDK1.8
20 |  **/
21 | public interface ImageInfo extends InfoResult {
22 | 
23 |     /** 取图片的MD5值 */
24 |     String getMD5();
25 | 
26 |     /** 图片宽 */
27 |     Double getWidth();
28 |     /** 图片长 */
29 |     Double getHeight();
30 | 
31 |     /** 获取图片大小 字节 */
32 |     Long getSize();
33 | 
34 |     /** 图片路径 */
35 |     String getUrl();
36 |     /** 图片上传到腾讯时候的时间 */
37 |     Long getTime();
38 | 
39 |     /** 图片Base64编码内容 */
40 |     String getFileBase64();
41 | 
42 | }
43 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/InfoResult.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     InfoResult.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.OriginalAble;
17 | import com.forte.qqrobot.beans.messages.RootBean;
18 | 
19 | /**
20 |  * 当用户想要获取一个信息,此接口定义各个类型的请求的返回信息类型
21 |  * v1.0.4版本之后(不包括)所有此类型消息均实现接口{@link com.forte.qqrobot.beans.messages.OriginalAble}
22 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
23 |  * @since JDK1.8
24 |  **/
25 | public interface InfoResult extends RootBean, OriginalAble {
26 | 
27 | }
28 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/ResultInner.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ResultInner.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.OriginalAble;
17 | import com.forte.qqrobot.beans.messages.RootBean;
18 | 
19 | /**
20 |  * 返回值有很多情况会有内部接口,内部接口使用此接口定义
21 |  * v1.0.4版本之后(不包括)所有此类型消息均实现接口{@link com.forte.qqrobot.beans.messages.OriginalAble}
22 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
23 |  * @since JDK1.8
24 |  **/
25 | public interface ResultInner extends RootBean, OriginalAble {
26 | }
27 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/ShareList.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ShareList.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.inner.Share;
17 | 
18 | /**
19 |  * 群共享文件列表
20 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public interface ShareList extends InfoResultList {
24 | }
25 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/inner/BanInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     BanInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result.inner;
15 | 
16 | import com.forte.qqrobot.beans.messages.QQCodeAble;
17 | import com.forte.qqrobot.beans.messages.result.ResultInner;
18 | 
19 | /**
20 |  * 禁言详细信息
21 |  */
22 | public interface BanInfo extends ResultInner, QQCodeAble {
23 |     /**
24 |      * 被禁言者的QQ
25 |      */
26 |     String getQQ();
27 | 
28 |     /**
29 |      * 被禁言成员昵称
30 |      */
31 |     String getNickName();
32 | 
33 |     /**
34 |      * 是否为管理员
35 |      */
36 |     Boolean isManager();
37 | 
38 |     /**
39 |      * 禁言剩余时间
40 |      */
41 |     Long lastTime();
42 | 
43 |     @Override
44 |     default String getQQCode() {
45 |         return getQQ();
46 |     }
47 | }


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/inner/Content.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Content.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result.inner;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.ResultInner;
17 | 
18 | /**
19 |  * 群作业信息
20 |  */
21 | public interface Content extends ResultInner {
22 |     /**
23 |      * 获取内容
24 |      */
25 |     String getText();
26 | 
27 |     /**
28 |      * 获取类型
29 |      */
30 |     String getType();
31 | }


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/inner/Friend.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Friend.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result.inner;
15 | 
16 | import com.forte.qqrobot.beans.messages.NickOrRemark;
17 | import com.forte.qqrobot.beans.messages.QQCodeAble;
18 | import com.forte.qqrobot.beans.messages.result.ResultInner;
19 | 
20 | /**
21 |  * 好友信息
22 |  */
23 | public interface Friend extends ResultInner, QQCodeAble, NickOrRemark {
24 |     /**
25 |      * 获取好友昵称
26 |      */
27 |     String getName();
28 | 
29 |     /**
30 |      * 获取好友QQ号
31 |      */
32 |     String getQQ();
33 | 
34 | 
35 |     @Override
36 |     default String getQQCode() {
37 |         return getQQ();
38 |     }
39 | 
40 |     /**
41 |      * 头像地址
42 |      */
43 |     default String getHeadUrl() {
44 |         if (getCode() == null) {
45 |             return null;
46 |         } else {
47 |             return "http://q.qlogo.cn/headimg_dl?dst_uin=" + getCode() + "&spec=640";
48 |         }
49 |     }
50 | 
51 | }
52 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/inner/Group.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Group.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result.inner;
15 | 
16 | import com.forte.qqrobot.beans.messages.GroupCodeAble;
17 | import com.forte.qqrobot.beans.messages.result.ResultInner;
18 | 
19 | /**
20 |  * 群列表的群信息
21 |  */
22 | public interface Group extends ResultInner, GroupCodeAble {
23 |     /** 群名 */
24 |     String getName();
25 |     /** 群号 */
26 |     String getCode();
27 |     /** 群头像地址, 默认情况下直接使用p.qlogo接口 */
28 |     default String getHeadUrl(){
29 |         String groupCode = getCode();
30 |         return "http://p.qlogo.cn/gh/"+ groupCode +"/"+ groupCode +"/640";
31 |     }
32 | 
33 |     @Override
34 |     default String getGroupCode(){
35 |         return getCode();
36 |     }
37 | }
38 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/inner/GroupLink.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupLink.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result.inner;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.ResultInner;
17 | 
18 | /**
19 |  * 群链接
20 |  */
21 | public interface GroupLink extends ResultInner {
22 |     /**
23 |      * 链接地址
24 |      */
25 |     String getUrl();
26 | 
27 |     /**
28 |      * 链接的封面地址
29 |      */
30 |     String getPicUrl();
31 | 
32 |     /**
33 |      * 发布时间
34 |      */
35 |     Long getTime();
36 | 
37 |     /**
38 |      * 标题
39 |      */
40 |     String getTitle();
41 | 
42 |     /**
43 |      * 该连接的发布者QQ
44 |      */
45 |     String getQQ();
46 | }
47 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/inner/GroupNote.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupNote.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result.inner;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.ResultInner;
17 | 
18 | /**
19 |  * 群公告
20 |  */
21 | public interface GroupNote extends ResultInner {
22 |     /**
23 |      * ID
24 |      */
25 |     String getId();
26 | 
27 |     /**
28 |      * 完整正文
29 |      */
30 |     String getMsg();
31 | 
32 |     /**
33 |      * 预览文
34 |      */
35 |     String getFaceMsg();
36 | 
37 |     /**
38 |      * 标题
39 |      */
40 |     String getTitle();
41 | 
42 |     /**
43 |      * 发布时间
44 |      */
45 |     Long getTime();
46 | 
47 |     /**
48 |      * 已读人数数量
49 |      */
50 |     Integer getReadNum();
51 | 
52 |     /**
53 |      * 是否提醒群员修改群名片
54 |      */
55 |     Boolean isShowEditCard();
56 | 
57 |     /**
58 |      * 发布者QQ
59 |      */
60 |     String getQQ();
61 | 
62 |     /**
63 |      * 公告类型ID
64 |      */
65 |     String getTypeId();
66 | 
67 | }
68 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/result/inner/Share.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Share.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.result.inner;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.ResultInner;
17 | 
18 | /**
19 |  * 分享(文件)
20 |  */
21 | public interface Share extends ResultInner {
22 |     /**
23 |      * BUSID
24 |      */
25 |     String getBusid();
26 | 
27 |     /**
28 |      * 创建时间
29 |      */
30 |     Long getCreateTime();
31 | 
32 |     /**
33 |      * 上传完成时间
34 |      */
35 |     Long getModiflyTime();
36 | 
37 |     /**
38 |      * 下载次数
39 |      */
40 |     Integer getDLTimes();
41 | 
42 |     /**
43 |      * 文件名
44 |      */
45 |     String getName();
46 | 
47 |     /**
48 |      * 文件路径
49 |      */
50 |     String getFilePath();
51 | 
52 |     /**
53 |      * 文件大小
54 |      */
55 |     Long getSize();
56 | 
57 |     /**
58 |      * 本地文件名
59 |      */
60 |     String getLocalName();
61 | 
62 |     /**
63 |      * 上传者群昵称
64 |      */
65 |     String getNick();
66 | 
67 |     /**
68 |      * 上传者QQ号
69 |      */
70 |     String getQQ();
71 | }
72 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/types/GroupAddRequestType.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupAddRequestType.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.types;
15 | 
16 | /**
17 |  * 加群申请类型
18 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
19 |  * @since JDK1.8
20 |  **/
21 | public enum GroupAddRequestType {
22 | 
23 |     /**
24 |      * 邀请 ,此处一般指bot被邀请进入某些群
25 |      */
26 |     INVITE(1),
27 |     /**
28 |      * 添加,此处一般指群里有人加群或者被邀请加群。
29 |      */
30 |     ADD(-1);
31 | 
32 |     public final int TYPE;
33 | 
34 |     GroupAddRequestType(int type){
35 |         this.TYPE = type;
36 |     }
37 | 
38 |     public boolean isInvite(){
39 |         return TYPE == INVITE.TYPE;
40 |     }
41 | 
42 |     public boolean isAdd(){
43 |         return TYPE == ADD.TYPE;
44 |     }
45 | 
46 |     /**
47 |      * 工厂获取
48 |      */
49 |     public static GroupAddRequestType of(int type) {
50 |         for (GroupAddRequestType value : values()) {
51 |             if (value.TYPE == type) {
52 |                 return value;
53 |             }
54 |         }
55 |         return null;
56 |     }
57 | 
58 | 
59 | 
60 | }
61 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/types/GroupAdminChangeType.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupAdminChangeType.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.types;
15 | 
16 | /**
17 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
18 |  * @date Created in 2019/4/18 11:36
19 |  * @since JDK1.8
20 |  **/
21 | public enum GroupAdminChangeType {
22 | 
23 |     /** 成为管理员 */
24 |     BECOME_ADMIN(1),
25 |     /** 被取消管理员 */
26 |     CANCEL_ADMIN(-1);
27 | 
28 |     public final int TYPE;
29 | 
30 |     GroupAdminChangeType(int type){
31 |         this.TYPE = type;
32 |     }
33 | 
34 |     public boolean isBecome(){
35 |         return TYPE == BECOME_ADMIN.TYPE;
36 |     }
37 | 
38 |     public boolean isCancel(){
39 |         return TYPE == CANCEL_ADMIN.TYPE;
40 |     }
41 | 
42 |     /** 工厂获取 */
43 |     public static GroupAdminChangeType of(int type){
44 |         for (GroupAdminChangeType value : values()) {
45 |             if(value.TYPE == type){
46 |                 return value;
47 |             }
48 |         }
49 |         return null;
50 |     }
51 | 
52 | 
53 | }
54 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/types/GroupBanType.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     GroupBanType.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.types;
15 | 
16 | /**
17 |  *
18 |  * 群禁言事件的禁言类型,禁言/解除禁言
19 |  *
20 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
21 |  * @since JDK1.8
22 |  **/
23 | public enum GroupBanType {
24 | 
25 |     /** 禁言 */
26 |     BAN(0),
27 |     /** 取消禁言 */
28 |     LIFT_BAN(1),
29 |     ;
30 | 
31 |     /** 给一个code */
32 |     public final int CODE;
33 | 
34 |     GroupBanType(int code){
35 |         this.CODE = code;
36 |     }
37 | 
38 |     public int getCode(){
39 |         return CODE;
40 |     }
41 | 
42 |     public boolean isBan(){
43 |         return CODE == BAN.CODE;
44 |     }
45 | 
46 |     public boolean isLiftBan(){
47 |         return CODE == LIFT_BAN.CODE;
48 |     }
49 | 
50 | 
51 | }
52 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/types/IncreaseType.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     IncreaseType.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.types;
15 | 
16 | /**
17 |  * 群成员增加事件类型
18 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
19 |  **/
20 | public enum IncreaseType {
21 | 
22 | 
23 |     /** 邀请 */
24 |     INVITE(1),
25 |     /** 通过申请 */
26 |     AGREE(-1);
27 | 
28 |     public final int TYPE;
29 | 
30 |     IncreaseType(int type){
31 |         this.TYPE = type;
32 |     }
33 | 
34 |     public boolean isInvite(){
35 |         return TYPE == INVITE.TYPE;
36 |     }
37 | 
38 |     public boolean isAgree(){
39 |         return TYPE == AGREE.TYPE;
40 |     }
41 | 
42 |     /**
43 |      * 工厂获取
44 |      */
45 |     public static IncreaseType of(int type) {
46 |         for (IncreaseType value : values()) {
47 |             if (value.TYPE == type) {
48 |                 return value;
49 |             }
50 |         }
51 |         return null;
52 |     }
53 | 
54 | }
55 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/messages/types/ReduceType.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ReduceType.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.messages.types;
15 | 
16 | /**
17 |  * 群成员减少事件类型
18 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
19 |  * @date Created in 2019/4/18 11:44
20 |  * @since JDK1.8
21 |  **/
22 | public enum ReduceType {
23 | 
24 |     /** 自行离开 */
25 |     LEAVE(1),
26 |     /** 被踢出 */
27 |     KICK_OUT(-1);
28 | 
29 | 
30 |     public final int TYPE;
31 | 
32 |     ReduceType(int type){
33 |         this.TYPE = type;
34 |     }
35 | 
36 |     public boolean isLevel(){
37 |         return TYPE == LEAVE.TYPE;
38 |     }
39 |     public boolean isKickOut(){
40 |         return TYPE == KICK_OUT.TYPE;
41 |     }
42 | 
43 |     /**
44 |      * 工厂获取
45 |      */
46 |     public static ReduceType of(int type) {
47 |         for (ReduceType value : values()) {
48 |             if (value.TYPE == type) {
49 |                 return value;
50 |             }
51 |         }
52 |         return null;
53 |     }
54 | 
55 | }
56 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/beans/types/CacheTimeTypes.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     CacheTimeTypes.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.beans.types;
15 | 
16 | /**
17 |  * 当使用缓存getter的时候,此枚举定义时间类型
18 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
19 |  * @since JDK1.8
20 |  **/
21 | public enum CacheTimeTypes {
22 | 
23 |     /*
24 |         这几个看名字应该就能才出来了吧
25 |      */
26 |     NANOS,
27 |     SECONDS,
28 |     MINUTES,
29 |     HOURS,
30 |     DAYS,
31 |     MONTH,
32 |     YEAR,
33 |     /** 某个指定的日子 */
34 |     DATE
35 | 
36 | }
37 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/bot/BotInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     BotInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.bot;
15 | 
16 | import java.io.Closeable;
17 | 
18 | /**
19 |  * 一个已注册的机器人的信息标注接口
20 |  *
21 |  * @author  ForteScarlet 
22 |  */
23 | public interface BotInfo extends Closeable {
24 | 
25 |     /**
26 |      * 获取Bot的账号信息
27 |      * @return Bot账号信息
28 |      */
29 |     String getBotCode();
30 | 
31 |     /**
32 |      * 获取此bot的上报信息
33 |      * @return bot上报信息
34 |      */
35 |     String getPath();
36 | 
37 |     /**
38 |      * 获取此账号的登录信息
39 |      * @return 获取登录信息
40 |      */
41 |     LoginInfo getInfo();
42 | 
43 |     /**
44 |      * 获取当前bot所对应的送信器
45 |      * @return 当前账号送信器
46 |      */
47 |     BotSender getSender();
48 | 
49 | }
50 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/bot/LoginInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     LoginInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.bot;
15 | 
16 | import com.forte.qqrobot.beans.messages.result.LoginQQInfo;
17 | 
18 | /**
19 |  * 登录后的信息,为LoginQQInfo的子接口并计划替代LoginQQInfo接口
20 |  * @author  ForteScarlet 
21 |  */
22 | public interface LoginInfo extends LoginQQInfo {
23 | 
24 |     @Override
25 |     default String getCode(){
26 |         return getQQ();
27 |     }
28 | 
29 | }
30 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/code/CatCode.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     CatCode.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.code;
15 | 
16 | /**
17 |  * 直接使用CQ码
18 |  */
19 | @Deprecated
20 | public class CatCode {
21 |     private CatCodeTypes type;
22 | 
23 | }
24 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/code/CatCodeUtil.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     CatCodeUtil.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.code;
15 | 
16 | /**
17 |  *
18 |  * 直接使用CQ码了。此类无用
19 |  *
20 |  * @author  ForteScarlet 
21 |  */
22 | @Deprecated
23 | public class CatCodeUtil {
24 | }
25 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/code/CodeConversionable.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     CodeConversionable.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.code;
15 | 
16 | import com.forte.qqrobot.beans.cqcode.CQCode;
17 | 
18 | @Deprecated
19 | public interface CodeConversionable {
20 | 
21 |     /**
22 |      * 将一个CatCode转化为指定的类型
23 |      * @param CQCode catCode
24 |      * @return 转化后的子类
25 |      */
26 |     T toCode(CQCode CQCode);
27 | 
28 | }
29 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/depend/BasicDepend.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     BasicDepend.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.depend;
15 | 
16 | 
17 | import com.forte.qqrobot.constant.PriorityConstant;
18 | 
19 | /**
20 |  * 基础数据类型的Depend对象
21 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
22 |  * @since JDK1.8
23 |  **/
24 | public class BasicDepend extends Depend {
25 | 
26 |     /**
27 |      * 构造
28 |      * @param name  基础数据类型名称
29 |      * @param type  基础数据类型
30 |      * @param value 值
31 |      */
32 |     public BasicDepend(String name, Class type, V value) {
33 |         super(name, type, true, () -> value, v -> {}, (v, add) -> {}, false, PriorityConstant.FIRST_LAST);
34 |     }
35 | 
36 |     public static  BasicDepend getInstance(String name, T value){
37 |         return new BasicDepend<>(name, (Class) value.getClass(), value);
38 |     }
39 | 
40 | }
41 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/depend/DependInjector.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     DependInjector.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.depend;
15 | 
16 | /**
17 |  * 依赖注入器,获取依赖实例后,通过此接口的实例对象来对对象内部的依赖内容进行注入
18 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
19 |  * @since JDK1.8
20 |  **/
21 | //@FunctionalInterface
22 | public interface DependInjector {
23 | 
24 |     /**
25 |      * 传入一个对象实例,对此对象实例中的所需依赖进行注入
26 |      */
27 | //     void inject(T t);
28 | 
29 | 
30 | }
31 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/depend/package-info.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     package-info.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | /**
15 |  * 此包下为依赖注入相关的内容。
16 |  *
17 |  *
18 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
19 |  * @since JDK1.8
20 |  **/
21 | package com.forte.qqrobot.depend;


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/depend/parameter/NullParamNameGetter.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     NullParamNameGetter.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.depend.parameter;
15 | 
16 | import com.forte.qqrobot.depend.NameTypeEntry;
17 | 
18 | import java.lang.reflect.Parameter;
19 | 
20 | /**
21 |  * 当检测到使用者没有开启参数编译的时候,使用此类
22 |  * 此类中获取的所有参数名称全部为null
23 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
24 |  * @since JDK1.8
25 |  **/
26 | @Deprecated
27 | public class NullParamNameGetter extends NormalParamNameGetter {
28 | 
29 |     @Override
30 |     public String getParameterName(Parameter parameter) {
31 |         return null;
32 |     }
33 | 
34 | 
35 |     @Override
36 |     public NameTypeEntry getNameTypeEntry(Parameter parameter) {
37 |         return NameTypeEntry.getInstanceLower(null, parameter.getType());
38 |     }
39 | 
40 |     NullParamNameGetter() {
41 | 
42 | 
43 | 
44 |     }
45 | }
46 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/depend/parameter/ParamNameGetter.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ParamNameGetter.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.depend.parameter;
15 | 
16 | import com.forte.qqrobot.depend.NameTypeEntry;
17 | 
18 | import java.lang.reflect.Method;
19 | import java.lang.reflect.Parameter;
20 | 
21 | /**
22 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
23 |  * @since JDK1.8
24 |  **/
25 | @Deprecated
26 | public interface ParamNameGetter {
27 | 
28 |     /**
29 |      * 获取参数名称列表
30 |      */
31 |     String[] getNames(Method method);
32 | 
33 |     /**
34 |      * 获取名称参数对应列表
35 |      */
36 |     NameTypeEntry[] getNameTypeEntrys(Method method);
37 | 
38 |     /**
39 |      * 获取参数的变量名称
40 |      */
41 |     String getParameterName(Parameter parameter);
42 | 
43 |     /**
44 |      * 获取名称参数
45 |      */
46 |     NameTypeEntry getNameTypeEntry(Parameter parameter);
47 | 
48 | }
49 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/exception/BlockException.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     BlockException.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.exception;
15 | 
16 | /**
17 |  * 阻断异常
18 |  *
19 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
20 |  * @date Created in 2019/4/2 15:53
21 |  * @since JDK1.8
22 |  **/
23 | public class BlockException extends RobotException {
24 | 
25 |     /**
26 |      * Constructs a new runtime exception with {@code null} as its
27 |      * detail message.  The cause is not initialized, and may subsequently be
28 |      * initialized by a call to {@link #initCause}.
29 |      */
30 |     public BlockException() {
31 |     }
32 | 
33 |     /**
34 |      * Constructs a new runtime exception with the specified detail message.
35 |      * The cause is not initialized, and may subsequently be initialized by a
36 |      * call to {@link #initCause}.
37 |      *
38 |      * @param message the detail message. The detail message is saved for
39 |      *                later retrieval by the {@link #getMessage()} method.
40 |      */
41 |     public BlockException(String message) {
42 |         super(message);
43 |     }
44 | }
45 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/exception/NoBlockException.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     NoBlockException.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.exception;
15 | 
16 | /**
17 |  * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com>
18 |  * @date Created in 2019/4/3 18:17
19 |  * @since JDK1.8
20 |  **/
21 | public class NoBlockException extends RobotRuntimeException {
22 | }
23 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/exception/safe/package-info.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     package-info.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | @Deprecated
15 | package com.forte.qqrobot.exception.safe;


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/factory/TypeFactoryException.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     TypeFactoryException.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.factory;
15 | 
16 | import com.forte.qqrobot.exception.RobotRuntimeException;
17 | 
18 | /**
19 |  *
20 |  * 枚举工厂使用的异常类
21 |  *
22 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
23 |  * @since JDK1.8
24 |  **/
25 | public class TypeFactoryException extends RobotRuntimeException {
26 | 
27 |     public TypeFactoryException() {
28 |     }
29 | 
30 |     public TypeFactoryException(String message) {
31 |         super(message);
32 |     }
33 | 
34 |     public TypeFactoryException(String message, Throwable cause) {
35 |         super(message, cause);
36 |     }
37 | 
38 |     public TypeFactoryException(Throwable cause) {
39 |         super(cause);
40 |     }
41 | 
42 |     public TypeFactoryException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
43 |         super(message, cause, enableSuppression, writableStackTrace);
44 |     }
45 | }
46 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/factory/package-info.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     package-info.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | /**
15 |  * 此包下定义部分工厂,目前为用于注册枚举类型的工厂。
16 |  * 所有的枚举工厂都十分不稳定。
17 |  */
18 | package com.forte.qqrobot.factory;


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/intercept/Intercept.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Intercept.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.intercept;
15 | 
16 | import com.forte.qqrobot.anno.depend.Beans;
17 | 
18 | import java.lang.annotation.ElementType;
19 | import java.lang.annotation.Retention;
20 | import java.lang.annotation.RetentionPolicy;
21 | import java.lang.annotation.Target;
22 | 
23 | /**
24 |  * 拦截器注解,目前暂时仅用于标记@Beans
25 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
26 |  * @since JDK1.8
27 |  **/
28 | @Retention(RetentionPolicy.RUNTIME)	//注解会在class字节码文件中存在,在运行时可以通过反射获取到
29 | @Target(ElementType.TYPE) //类
30 | @Beans
31 | public @interface Intercept {
32 | }
33 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/intercept/Interceptor.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Interceptor.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.intercept;
15 | 
16 | import com.forte.qqrobot.constant.PriorityConstant;
17 | 
18 | /**
19 |  *
20 |  * 拦截器跟接口,定义拦截器接口规范。
21 |  * 每一个拦截器有一个对应的上下文对象,并且返回值为boolean值。
22 |  * 但是我感觉这个规范不怎么受用
23 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
24 |  * @since JDK1.8
25 |  **/
26 | public interface Interceptor> extends Comparable> {
27 | 
28 |     /**
29 |      * 排序方法,默认为{@link PriorityConstant#FIRST_LAST}。
30 |      * 无特殊排序需求则不用重写此方法。
31 |      * @return 优先级,值越小优先级越高。目前理论上支持负值。
32 |      */
33 |     default int sort(){
34 |         return PriorityConstant.FIRST_LAST;
35 |     }
36 | 
37 |     /**
38 |      * 拦截执行函数
39 |      * @param context 上下文对象
40 |      * @return 是否放行
41 |      */
42 |     boolean intercept(C context);
43 | 
44 |     /**
45 |      * 实现的排序方法。
46 |      * 无特殊需求请不要重写此方法。
47 |      * @return 排序值
48 |      */
49 |     @Override
50 |     default int compareTo(Interceptor other){
51 |         return Integer.compare(this.sort(), other.sort());
52 |     }
53 | 
54 | }
55 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/intercept/package-info.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     package-info.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | /**
15 |  * 拦截器包,部分AOP接口
16 |  */
17 | package com.forte.qqrobot.intercept;


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/listener/Filterable.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     Filterable.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.listener;
15 | 
16 | import com.forte.qqrobot.anno.data.Filter;
17 | import com.forte.qqrobot.beans.messages.msgget.MsgGet;
18 | import com.forte.qqrobot.listener.invoker.AtDetection;
19 | 
20 | /**
21 |  * 使用户自己创建自定义的规则判断
22 |  * @author  ForteScarlet 
23 |  */
24 | public interface Filterable {
25 | 
26 |     /**
27 |      * 根据自定义规则对消息进行过滤
28 |      * @param filter  filter注解对象, 如果不存在@Filter,则会为null
29 |      * @param msgget  接收到的消息
30 |      * @param at      判断当前消息是否被at的函数
31 |      * @param context 监听上下文
32 |      * @return 是否通过
33 |      */
34 |     boolean filter(Filter filter, MsgGet msgget, AtDetection at, ListenContext context);
35 | 
36 | }
37 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/listener/ListenIntercept.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ListenIntercept.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.listener;
15 | 
16 | import com.forte.qqrobot.intercept.Interceptor;
17 | import com.forte.qqrobot.listener.invoker.ListenInterceptContext;
18 | import com.forte.qqrobot.listener.invoker.ListenerMethod;
19 | 
20 | /**
21 |  *
22 |  * 监听函数拦截
23 |  *
24 |  * @author ForteScarlet <[email]ForteScarlet@163.com>
25 |  * @since JDK1.8
26 |  **/
27 | public interface ListenIntercept extends Interceptor {
28 | 
29 | 
30 | 
31 | 
32 | }
33 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/listener/ListenerInfo.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     ListenerInfo.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.listener;
15 | 
16 | import com.forte.qqrobot.beans.messages.types.MsgGetTypes;
17 | 
18 | /**
19 |  * 定义一个监听函数所存在的各种消息与参数
20 |  * @author ForteScarlet
21 |  *
22 |  */
23 | public interface ListenerInfo {
24 | 
25 |     /** 获取简述
26 |      * @return simple description
27 |      * */
28 |     String getName();
29 | 
30 |     /**
31 |      * 获取描述
32 |      * @return description
33 |      */
34 |     String getDescription();
35 | 
36 |     /**
37 |      * 获取所监听的消息类型
38 |      * @return listen types
39 |      */
40 |     MsgGetTypes[] listenTypes();
41 | 
42 |     /**
43 |      * 获取指定索引下的监听消息类型
44 |      * @param index 索引
45 |      * @return listen type
46 |      */
47 |     MsgGetTypes listenTypes(int index);
48 | 
49 |     /** 获取所监听的消息类型的数量 */
50 |     int listenTypesLength();
51 | 
52 |     /**
53 |      * 排序索引
54 |      * @return sort number
55 |      */
56 |     int sort();
57 | 
58 | 
59 | 
60 | 
61 | }
62 | 


--------------------------------------------------------------------------------
/src/main/java/com/forte/qqrobot/listener/MsgIntercept.java:
--------------------------------------------------------------------------------
 1 | /*
 2 |  * Copyright (c) 2020. ForteScarlet All rights reserved.
 3 |  * Project  simple-robot-core
 4 |  * File     MsgIntercept.java
 5 |  *
 6 |  * You can contact the author through the following channels:
 7 |  * github https://github.com/ForteScarlet
 8 |  * gitee  https://gitee.com/ForteScarlet
 9 |  * email  ForteScarlet@163.com
10 |  * QQ     1149159218
11 |  *
12 |  */
13 | 
14 | package com.forte.qqrobot.listener;
15 | 
16 | import com.forte.qqrobot.beans.messages.msgget.MsgGet;
17 | import com.forte.qqrobot.intercept.Interceptor;
18 | 
19 | /**
20 |  *
21 |  * 

消息拦截接口

22 | *

消息拦截器在被内部使用的时候仅会被实例化一次,但是同样需要标记@Beans

23 | *

当消息拦截器返回值为false的时候,会终止后续拦截器的执行与监听消息的监听。

24 | *

排序使用正序排序,值越小优先级越高。

25 | * 26 | * @author ForteScarlet <[email]ForteScarlet@163.com> 27 | * @since JDK1.8 28 | **/ 29 | public interface MsgIntercept extends Interceptor{ 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/listener/error/ExceptionHandle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File ExceptionHandle.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.listener.error; 15 | 16 | /** 17 | * 异常处理器接口 18 | * @author ForteScarlet 19 | */ 20 | public interface ExceptionHandle { 21 | 22 | /** 23 | * 进行异常处理 24 | * @param context 异常捕获对象封装 25 | * @return 异常处理后的响应结果。 26 | */ 27 | Object handle(ExceptionHandleContext context); 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/listener/error/ExceptionHandleContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File ExceptionHandleContext.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.listener.error; 15 | 16 | import com.forte.qqrobot.beans.messages.msgget.MsgGet; 17 | import com.forte.qqrobot.intercept.Context; 18 | import com.forte.qqrobot.listener.ListenContext; 19 | import com.forte.qqrobot.sender.MsgSender; 20 | 21 | /** 22 | * 异常处理上下文,提供一些捕获到异常时候的参数。其不属于常见的上下文对象。 23 | * 提供一个实现类{@link ExceptionHandleContextImpl} 24 | * @author ForteScarlet 25 | */ 26 | public interface ExceptionHandleContext extends Context { 27 | 28 | String getId(); 29 | MsgGet getMsgGet(); 30 | int getSort(); 31 | MsgSender getMsgSender(); 32 | ListenContext getListenContext(); 33 | T getException(); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/listener/invoker/AtDetection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File AtDetection.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.listener.invoker; 15 | 16 | /** 17 | * 18 | * 是否被At了的检测 19 | * 函数接口 20 | * 21 | * @author ForteScarlet <[email]ForteScarlet@163.com> 22 | * @since JDK1.8 23 | **/ 24 | @FunctionalInterface 25 | public interface AtDetection { 26 | 27 | /** 28 | * 检测是否被at了 29 | * @return 是否被at 30 | */ 31 | boolean test(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/listener/result/ListenResultParser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File ListenResultParser.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.listener.result; 15 | 16 | /** 17 | * 18 | * 监听函数解析器。根据监听函数的执行结果获取一个ListenResult对象 19 | * 20 | * @author ForteScarlet <[email]ForteScarlet@163.com> 21 | * @since JDK1.8 22 | **/ 23 | public interface ListenResultParser { 24 | 25 | /** 26 | * 结果转化器 27 | * @param t 监听函数的执行结果 28 | * @param sort 排序参数 29 | * @param isBreak 是否跳过后续函数 30 | * @param isBreakPlugin 是否跳过后续插件 31 | * @param e 如果存在异常,此为异常 32 | * @return 监听函数实现类 33 | */ 34 | ListenResult parse(Object t, int sort, boolean isBreak, boolean isBreakPlugin, Exception e); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/log/LogLevel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File LogLevel.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.log; 15 | 16 | /** 17 | * 日志级别 18 | * 每一个日志级别都有一个级别等级。等级数值越大,显示优先级越高。 19 | * 这个数据可能会经常变动,所以如果存在自定义的日志级别,请在判断的时候以此枚举中的元素作为参照物。 20 | * @author ForteScarlet <[email]ForteScarlet@163.com> 21 | * @since JDK1.8 22 | **/ 23 | public enum LogLevel { 24 | 25 | /** error级 */ 26 | ERROR(4), 27 | /** warning级 */ 28 | WARNING(3), 29 | /** success级别 */ 30 | SUCCESS(2), 31 | /** info级 */ 32 | INFO(1), 33 | /** debug级 */ 34 | DEBUG(0) 35 | ; 36 | 37 | /** 日志级别 */ 38 | private final int level; 39 | 40 | /** 构造 */ 41 | LogLevel(int level){ 42 | this.level = level; 43 | } 44 | 45 | /** 获取日志级别 */ 46 | public int getLevel(){ 47 | return level; 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/log/QQLogBack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File QQLogBack.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.log; 15 | 16 | /** 17 | * 日志的回调函数,拦截日志输出并进行各种操作 18 | * @author ForteScarlet <[email]ForteScarlet@163.com> 19 | * @since JDK1.8 20 | **/ 21 | public interface QQLogBack { 22 | 23 | /** 24 | * 拦截QQLog日志的输出,当返回值为true的时候才会输出到控制台。 25 | * @param msg 信息msg,可以直接String.valueOf() 26 | * @param level 日志级别 27 | * @param e 如果存在异常,此为异常 28 | * @return 是否输出此日志 29 | */ 30 | boolean onLog(String msg, LogLevel level, Throwable e); 31 | 32 | /** 33 | * 没有异常的拦截,默认直接使用null 34 | * @param msg 消息类型 35 | * @param logLevel 日志界别 36 | * @return 是否输出此日志 37 | */ 38 | default boolean onLog(String msg, LogLevel logLevel){ 39 | return onLog(msg, logLevel, null); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File package-info.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | /** 15 | * 主要是core所需要的包 16 | */ 17 | package com.forte.qqrobot; -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/plugins/Plugin.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File Plugin.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.plugins; 15 | 16 | /** 17 | * 插件接口,定义了插件接口 18 | * * 尚未完成 * 19 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 20 | * @since JDK1.8 21 | **/ 22 | public interface Plugin { 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/record/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File package-info.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | /** 15 | * 对送信器中的三种送信方式进行统计 16 | */ 17 | package com.forte.qqrobot.record; -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/BlockAble.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File BlockAble.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender; 15 | 16 | /** 17 | * 为送信器提供阻断相关的方法 18 | * 送信器应当存在一个为其服务的监听函数对象 19 | * 此接口提供一种方法以为送信器提供判断是否存在监听函数的方法 20 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 21 | * @since JDK1.8 22 | **/ 23 | public interface BlockAble { 24 | /** 25 | * 是否存在监听器函数 26 | */ 27 | boolean hasMethod(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/HttpResp.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File HttpResp.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender; 15 | 16 | /** 17 | * Http请求响应值 18 | * @author ForteScarlet 19 | */ 20 | public interface HttpResp { 21 | 22 | /** 23 | * 相应数据 24 | * @return 相应数据字符串 25 | */ 26 | String getResponse(); 27 | 28 | /** 29 | * 响应码 30 | * @return 响应码 31 | */ 32 | int getCode(); 33 | 34 | /** 35 | * 响应码说明 36 | * @return 响应码说明 37 | */ 38 | String getReasonPhrase(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/Sender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File Sender.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender; 15 | 16 | /** 17 | * 送信器接口,实现以下接口: 18 | *
    19 | *
  • {@link Senderable} 提供判断送信接口是否存在的方法
  • 20 | *
  • {@link Methodable} 提供判断监听函数是否存在的方法
  • 21 | *
  • {@link BlockAble} 提供将存在的监听函数添加进阻断状态的方法
  • 22 | *
23 | * 24 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 25 | * @since JDK1.8 26 | **/ 27 | interface Sender extends Senderable, Methodable, BlockAble { 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/Senderable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File Senderable.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender; 15 | 16 | /** 17 | * 为送信器提供送信接口是否存在的方法 18 | * 送信器中应当存在三种类型的{@link com.forte.qqrobot.sender.senderlist.SenderList}送信接口以发送消息 19 | * 此接口提供三种方法以为送信器提供送信接口是否存在的方法 20 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 21 | * @since JDK1.8 22 | **/ 23 | public interface Senderable { 24 | 25 | /** 26 | * 是否存在send消息器 27 | */ 28 | boolean isSendAble(); 29 | 30 | /** 31 | * 是否存在set消息器 32 | */ 33 | boolean isSetAble(); 34 | 35 | /** 36 | * 是否存在Get消息器 37 | */ 38 | boolean isGetAble(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/intercept/GetContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File GetContext.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.intercept; 15 | 16 | import com.forte.qqrobot.sender.senderlist.SenderGetList; 17 | 18 | import java.lang.reflect.Method; 19 | import java.util.Map; 20 | import java.util.concurrent.ConcurrentHashMap; 21 | 22 | /** 23 | * @author ForteScarlet <[email]ForteScarlet@163.com> 24 | * @since JDK1.8 25 | **/ 26 | public class GetContext extends SenderContext { 27 | 28 | public final SenderGetList GETTER; 29 | 30 | /** get所使用的全局Map */ 31 | private static final Map GLOBAL_CONTEXT_MAP = new ConcurrentHashMap<>(4); 32 | 33 | public GetContext(SenderGetList value, Method method, Object... params) { 34 | super(value, GLOBAL_CONTEXT_MAP, method, params); 35 | GETTER = value; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/intercept/InterceptValue.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File InterceptValue.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.intercept; 15 | 16 | import java.lang.annotation.ElementType; 17 | import java.lang.annotation.Retention; 18 | import java.lang.annotation.RetentionPolicy; 19 | import java.lang.annotation.Target; 20 | 21 | /** 22 | * 如果api被拦截了,则标注方法的默认返回值。无参数则认为返回值为'' 23 | * 24 | * @author ForteScarlet <[email]ForteScarlet@163.com> 25 | * @since JDK1.8 26 | **/ 27 | @Retention(RetentionPolicy.RUNTIME) //注解会在class字节码文件中存在,在运行时可以通过反射获取到 28 | @Target({ElementType.METHOD}) //接口、类、枚举、注解、方法 29 | public @interface InterceptValue { 30 | /** 31 | * 当API被拦截后的默认失败返回值 32 | */ 33 | String value() default ""; 34 | 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/intercept/SendContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SendContext.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.intercept; 15 | 16 | import com.forte.qqrobot.sender.senderlist.SenderSendList; 17 | 18 | import java.lang.reflect.Method; 19 | import java.util.Map; 20 | import java.util.concurrent.ConcurrentHashMap; 21 | 22 | /** 23 | * 24 | * 提供一个sender对象 25 | * 26 | * @author ForteScarlet <[email]ForteScarlet@163.com> 27 | * @since JDK1.8 28 | **/ 29 | public class SendContext extends SenderContext { 30 | public final SenderSendList SENDER; 31 | 32 | /** send所使用的全局Map */ 33 | private static final Map GLOBAL_CONTEXT_MAP = new ConcurrentHashMap<>(4); 34 | 35 | public SendContext(SenderSendList value, Method method, Object... params) { 36 | super(value, GLOBAL_CONTEXT_MAP, method, params); 37 | SENDER = value; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/intercept/SenderGetIntercept.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SenderGetIntercept.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.intercept; 15 | 16 | import com.forte.qqrobot.sender.senderlist.SenderGetList; 17 | 18 | /** 19 | * @author ForteScarlet <[email]ForteScarlet@163.com> 20 | * @since JDK1.8 21 | **/ 22 | public interface SenderGetIntercept extends SenderIntercept { 23 | /** 24 | * 拦截执行函数 25 | * @param context 上下文对象 26 | * @return 是否放行 27 | */ 28 | @Override 29 | boolean intercept(GetContext context); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/intercept/SenderIntercept.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SenderIntercept.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.intercept; 15 | 16 | import com.forte.qqrobot.intercept.Interceptor; 17 | import com.forte.qqrobot.sender.senderlist.SenderList; 18 | 19 | /** 20 | * 21 | * 送信器拦截器,用于拦截所有送信器的执行流程 22 | * 应当存在三个子接口对应三种拦截:Send、Set、Get 23 | *
24 | * ※注意事项:当返回值为false的时候,代表拦截操作,不执行原方法以及后续拦截,此时会抛出一个异常: 25 | *
26 | *

27 | * 由于java接口机制原因,三个接口无法同时实现在同一个类上。此问题我将会在日后修复 28 | *

29 | * {@link SenderInterceptException} 30 | * 31 | * @author ForteScarlet <[email]ForteScarlet@163.com> 32 | * @since JDK1.8 33 | **/ 34 | public interface SenderIntercept> extends Interceptor { 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/intercept/SenderListAPI.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SenderListAPI.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.intercept; 15 | 16 | 17 | import java.lang.annotation.ElementType; 18 | import java.lang.annotation.Retention; 19 | import java.lang.annotation.RetentionPolicy; 20 | import java.lang.annotation.Target; 21 | 22 | /** 23 | * 送信器接口列表API, 用于标记一个API 24 | * @author ForteScarlet 25 | */ 26 | @Retention(RetentionPolicy.RUNTIME) //注解会在class字节码文件中存在,在运行时可以通过反射获取到 27 | @Target({ElementType.METHOD}) //接口、类、枚举、注解、方法 28 | public @interface SenderListAPI { 29 | /** 30 | * 一般此API可以被拦截,则代表其属于一个父级的API,此处来定义此API的名称 31 | * 此name对应了lang国际化语言中的api.{API_name}.name 32 | * 默认值为""的时候,默认为其方法名 33 | */ 34 | String value() default ""; 35 | 36 | /** 37 | * 是否属于父类接口。 38 | * 一般来讲,标注为default的封装接口不是父类API,那些标注了InterceptValue注解的方法为父类API 39 | * @return 40 | */ 41 | boolean root() default false; 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/intercept/SenderSendIntercept.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SenderSendIntercept.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.intercept; 15 | 16 | import com.forte.qqrobot.sender.senderlist.SenderSendList; 17 | 18 | /** 19 | * @author ForteScarlet <[email]ForteScarlet@163.com> 20 | * @since JDK1.8 21 | **/ 22 | public interface SenderSendIntercept extends SenderIntercept { 23 | /** 24 | * 拦截执行函数 25 | * @param context 上下文对象 26 | * @return 是否放行 27 | */ 28 | @Override 29 | boolean intercept(SendContext context); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/intercept/SenderSetIntercept.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SenderSetIntercept.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.intercept; 15 | 16 | import com.forte.qqrobot.sender.senderlist.SenderSetList; 17 | 18 | /** 19 | * @author ForteScarlet <[email]ForteScarlet@163.com> 20 | * @since JDK1.8 21 | **/ 22 | public interface SenderSetIntercept extends SenderIntercept { 23 | /** 24 | * 拦截执行函数 25 | * @param context 上下文对象 26 | * @return 是否放行 27 | */ 28 | @Override 29 | boolean intercept(SetContext context); 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/intercept/SetContext.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SetContext.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.intercept; 15 | 16 | import com.forte.qqrobot.sender.senderlist.SenderSetList; 17 | 18 | import java.lang.reflect.Method; 19 | import java.util.Map; 20 | import java.util.concurrent.ConcurrentHashMap; 21 | 22 | /** 23 | * @author ForteScarlet <[email]ForteScarlet@163.com> 24 | * @since JDK1.8 25 | **/ 26 | public class SetContext extends SenderContext { 27 | 28 | public final SenderSetList SETTER; 29 | 30 | /** set所使用的全局Map */ 31 | private static final Map GLOBAL_CONTEXT_MAP = new ConcurrentHashMap<>(4); 32 | 33 | public SetContext(SenderSetList value, Method method, Object... params) { 34 | super(value, GLOBAL_CONTEXT_MAP, method, params); 35 | SETTER = value; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/package-info.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File package-info.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | /** 15 | * 此包下定义所有sender相关方法接口并提供一个汇总接口。
16 | * 其中, 17 | *
    18 | *
  • {@link com.forte.qqrobot.sender.senderlist.SenderGetList }
  • 19 | *
  • {@link com.forte.qqrobot.sender.senderlist.SenderSendList}
  • 20 | *
  • {@link com.forte.qqrobot.sender.senderlist.SenderSetList}
  • 21 | *
22 | * 这三个接口均继承{@link com.forte.qqrobot.sender.senderlist.SenderList} 接口,其余接口均作为汇总或增强接口,不会直接使用。 23 | *
24 | * 接口中所有返回值为布尔类型的方法若无特殊标注则均代表方法的执行成功与否。 25 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 26 | * @since JDK1.8 27 | **/ 28 | package com.forte.qqrobot.sender; -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/senderlist/Getter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File Getter.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.senderlist; 15 | 16 | /** 17 | * Get方法相关方法总汇总 18 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 19 | * @since JDK1.8 20 | **/ 21 | public interface Getter extends SenderGetList, SenderGet { 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/senderlist/RootSender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File RootSender.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.senderlist; 15 | 16 | /** 17 | * 消息发送汇总接口, 综合了所有的set,send,get相关方法接口
18 | * 所有方法的布尔返回值均代表方法执行的成功与否。 19 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 20 | * @since JDK1.8 21 | **/ 22 | public interface RootSender extends Sender, Setter, Getter { 23 | 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/senderlist/RootSenderList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File RootSenderList.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.senderlist; 15 | 16 | /** 17 | * 仅送信器列表的汇总接口 18 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 19 | * @since JDK1.8 20 | **/ 21 | public interface RootSenderList extends SenderSendList, SenderSetList, SenderGetList { 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/senderlist/RootSenderUpper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File RootSenderUpper.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.senderlist; 15 | 16 | /** 17 | * 将增加接口进行汇总的接口 18 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 19 | * @since JDK1.8 20 | **/ 21 | public interface RootSenderUpper extends Sender, GetterUpper, SetterUpper{ 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/senderlist/Sender.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File Sender.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.senderlist; 15 | 16 | /** 17 | * 消息发送方法总汇总 18 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 19 | * @since JDK1.8 20 | **/ 21 | public interface Sender extends SenderSendList, SenderSend { 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/senderlist/SenderGet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SenderGet.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.senderlist; 15 | 16 | import com.forte.qqrobot.beans.messages.get.InfoGet; 17 | import com.forte.qqrobot.beans.messages.result.InfoResult; 18 | 19 | /** 20 | * 提供1个方法以汇总Getter方法 21 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 22 | * @since JDK1.8 23 | **/ 24 | public interface SenderGet { 25 | 26 | 27 | /** 28 | * 通过定义好返回值的InfoGet对象获取返回值 29 | * @param infoGet InfoGet对象 30 | * @param InfoGet对象的指定返回值类型 31 | * @return 响应数据封装类 32 | */ 33 | RESULT get(InfoGet infoGet); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/senderlist/SenderList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SenderList.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.senderlist; 15 | 16 | /** 17 | * 作为三个接口方法集合(list)相关的父类接口 18 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 19 | * @since JDK1.8 20 | **/ 21 | public interface SenderList { 22 | 23 | /** 24 | * 是不是送信接口 25 | */ 26 | default boolean isSenderList(){ 27 | return this instanceof SenderSendList; 28 | } 29 | /** 30 | * 是不是设置接口 31 | */ 32 | default boolean isSetterList(){ 33 | return this instanceof SenderSetList; 34 | } 35 | /** 36 | * 是不是获取接口 37 | */ 38 | default boolean isGetterList(){ 39 | return this instanceof SenderGetList; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/senderlist/SenderSend.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SenderSend.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.senderlist; 15 | 16 | import java.util.Map; 17 | 18 | /** 19 | * 消息发送总控接口,提供一个消息发送的总控接口。 20 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 21 | * @since JDK1.8 22 | **/ 23 | public interface SenderSend { 24 | 25 | /** 26 | * 消息发送 27 | * @param params 参数键值对 28 | * @return 是否成功 29 | */ 30 | boolean send(Map params); 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/senderlist/SenderSet.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SenderSet.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.senderlist; 15 | 16 | import java.util.Map; 17 | 18 | /** 19 | * 提供方法以便汇总Set类型方法 20 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 21 | * @since JDK1.8 22 | **/ 23 | public interface SenderSet { 24 | 25 | /** 26 | * 设置类型接口汇总方法 27 | * @param params 参数键值对 28 | * @return 成功与否 29 | */ 30 | boolean set(Map params); 31 | 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/senderlist/Setter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File Setter.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.senderlist; 15 | 16 | /** 17 | * Set相关方法总汇总 18 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 19 | * @since JDK1.8 20 | **/ 21 | public interface Setter extends SenderSetList, SenderSet { 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/sender/senderlist/SetterUpper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File SetterUpper.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.sender.senderlist; 15 | 16 | /** 17 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 18 | * @since JDK1.8 19 | **/ 20 | public interface SetterUpper extends Setter { 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/system/CoreClassLoader.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File CoreClassLoader.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.system; 15 | 16 | /** 17 | * ClassLoader 18 | * @author ForteScarlet 19 | */ 20 | @Deprecated 21 | public class CoreClassLoader extends ClassLoader { 22 | private static final CoreClassLoader CORE_CLASS_LOADER = new CoreClassLoader(); 23 | private CoreClassLoader(){ } 24 | public static CoreClassLoader getCoreClassLoader(){ 25 | return CORE_CLASS_LOADER; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/system/RunParameter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File RunParameter.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.system; 15 | 16 | /** 17 | * 启动程序的时候的参数 18 | * 类型一般就 String, String[] 19 | * @author ForteScarlet 20 | */ 21 | public interface RunParameter { 22 | 23 | public String getBase(); 24 | 25 | String getName(); 26 | 27 | String[] getParameters(); 28 | 29 | String getParameter(int index); 30 | 31 | int parameterLength(); 32 | 33 | default String getParameterFirst(){ 34 | return parameterLength() == 0 ? null : getParameter(0); 35 | } 36 | 37 | RunParameterType getType(); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/system/RunParameterType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File RunParameterType.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.system; 15 | 16 | /** 17 | * 代表启动参数的类型。 18 | * 配置,和指令 19 | * @author ForteScarlet 20 | */ 21 | public enum RunParameterType { 22 | 23 | /** 配置 */ 24 | PROPERTIES, 25 | /** 指令 */ 26 | COMMAND 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/system/limit/ListenLimit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File ListenLimit.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.system.limit; 15 | 16 | /** 17 | * 18 | * 用于记录limit的时长 19 | * 20 | * @author ForteScarlet 21 | */ 22 | public class ListenLimit { 23 | /** 24 | * 失效时间 25 | */ 26 | private volatile long invalidTime = 0; 27 | 28 | /** 29 | * 有效时间 30 | */ 31 | private final long effectiveTime; 32 | 33 | 34 | public ListenLimit(long effectiveTime){ 35 | this.effectiveTime = effectiveTime; 36 | } 37 | 38 | /** 39 | * 检测是否已过期 40 | * 检测当前是否已经超过失效时间,且如果超过,刷新时间 41 | * @return 是否过期 42 | */ 43 | public boolean expired(){ 44 | final long now = System.currentTimeMillis(); 45 | if(invalidTime < now){ 46 | invalidTime = now + effectiveTime; 47 | return true; 48 | } 49 | return false; 50 | } 51 | 52 | 53 | 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/timetask/BaseTimeJob.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File BaseTimeJob.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.timetask; 15 | 16 | import org.quartz.Job; 17 | 18 | /** 19 | * {@link TimeJob} 有时候去实现会出现问题,无法正确覆盖{@link Job}中的方法,故此提供一个新的抽象类以代替原本的TimeJob接口。 20 | *
21 | * 由于有人出现过default方法会报错的问题,所以试试在接口列表里写个job能不能解决这个问题 22 | * @author ForteScarlet 23 | * @since JDK1.8 24 | **/ 25 | public abstract class BaseTimeJob implements TimeJob, Job { 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/utils/EmptyIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File EmptyIterator.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.utils; 15 | 16 | import java.util.Iterator; 17 | 18 | /** 19 | * 空值迭代器 20 | **/ 21 | public class EmptyIterator implements Iterator { 22 | 23 | 24 | private static EmptyIterator emptyIterator = new EmptyIterator(); 25 | 26 | /** 27 | * 由于是空值迭代器,不存在下一个值 28 | */ 29 | @Override 30 | public boolean hasNext() { 31 | return false; 32 | } 33 | 34 | /** 35 | * 由于是空值迭代器,下一个值必定为null 36 | */ 37 | @Override 38 | public T next() { 39 | return null; 40 | } 41 | 42 | /** 静态工厂方法 */ 43 | public static EmptyIterator getInstance(){ 44 | return emptyIterator; 45 | } 46 | 47 | /** 48 | * 构造私有化 49 | */ 50 | private EmptyIterator(){} 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/utils/EnumValues.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File EnumValues.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.utils; 15 | 16 | import com.forte.qqrobot.log.QQLog; 17 | import com.forte.utils.reflect.EnumUtils; 18 | 19 | import java.lang.reflect.Method; 20 | import java.util.function.IntFunction; 21 | 22 | /** 23 | * 用于获取Enum枚举的values对象 24 | * @author ForteScarlet 25 | */ 26 | public class EnumValues { 27 | 28 | public static > T[] values(Class t, IntFunction initArray) { 29 | // 先尝试使用EnumUtils获取 30 | try { 31 | return EnumUtils.values(t, initArray); 32 | }catch (Throwable e){ 33 | try { 34 | // 出现异常,使用正常手段values 35 | Method values = t.getMethod("values"); 36 | return (T[]) values.invoke(null); 37 | }catch (Exception normalValueException){ 38 | QQLog.error("枚举类型[ "+ t +" ]获取values异常。1.", e); 39 | QQLog.error("2.", normalValueException); 40 | return initArray.apply(0); 41 | } 42 | } 43 | 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/com/forte/qqrobot/utils/ObjectsPlus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020. ForteScarlet All rights reserved. 3 | * Project simple-robot-core 4 | * File ObjectsPlus.java 5 | * 6 | * You can contact the author through the following channels: 7 | * github https://github.com/ForteScarlet 8 | * gitee https://gitee.com/ForteScarlet 9 | * email ForteScarlet@163.com 10 | * QQ 1149159218 11 | * 12 | */ 13 | 14 | package com.forte.qqrobot.utils; 15 | 16 | import java.util.Objects; 17 | 18 | /** 19 | * 提供几个判断是否存在null值的方法 20 | * @author ForteScarlet <[163邮箱地址]ForteScarlet@163.com> 21 | * @since JDK1.8 22 | **/ 23 | public class ObjectsPlus { 24 | 25 | 26 | public static void allNonNull(Iterable list, String message){ 27 | list.forEach(i -> Objects.requireNonNull(i, message)); 28 | } 29 | 30 | public static void allNonNull(Iterable list){ 31 | list.forEach(Objects::requireNonNull); 32 | } 33 | 34 | public static void allNonNull(String message, Object... arr){ 35 | for (Object o : Objects.requireNonNull(arr, message)) { 36 | Objects.requireNonNull(o, message); 37 | } 38 | } 39 | 40 | public static void allNonNull(Object... arr){ 41 | for (Object o : Objects.requireNonNull(arr)) { 42 | Objects.requireNonNull(o); 43 | } 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/resources/conf-demo.properties: -------------------------------------------------------------------------------- 1 | ################################ 2 | ## 3 | ### 核心所提供的公共配置, 一般情况下不会存在变化 4 | ## 5 | ################################ 6 | 7 | # IP, 一般可以代表酷Q所在IP,默认127.0.0.1 8 | simple.robot.conf.ip= 9 | # 登录的机器人的QQ号, 如果组件不支持自动获取的话, 请手动填写。 10 | simple.robot.conf.localQQCode= 11 | # 登录的机器人的昵称, 如果组件不支持自动获取的话, 可以手动填写。 12 | simple.robot.conf.localQQNick= 13 | # 编码格式,默认为UTF-8, 大部分存在网络通讯的时候(例如HTTP)会用到此配置 14 | simple.robot.conf.encode= 15 | # 酷Q文件夹根路径。默认没东西。 16 | simple.robot.conf.cqPath= 17 | # 包扫描路径,默认为空,即默认扫描启动器所在包路径 18 | simple.robot.conf.scannerPackage= 19 | 20 | # 本地服务器配置,尚未实装的功能,可以先无视 21 | # 是否启动本地服务器, true/false, 默认为true 22 | simple.robot.conf.localServerEnable= 23 | # 本地服务器使用的端口,默认为8808 24 | simple.robot.conf.localServerPort= 25 | 26 | ########## 27 | # 28 | ## 线程池配置信息 29 | # 30 | ########## 31 | simple.robot.conf.threadPool.corePoolSize= 32 | #8 33 | 34 | simple.robot.conf.threadPool.maximumPoolSize= 35 | # 256 36 | 37 | simple.robot.conf.threadPool.keepAliveTime= 38 | #20 39 | 40 | simple.robot.conf.threadPool.timeUnit= 41 | #SECONDS 42 | 43 | simple.robot.conf.threadPool.workQueue= 44 | #java.util.concurrent.LinkedBlockingQueue 45 | 46 | simple.robot.conf.logLevel= 47 | #INFO 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /src/main/resources/lang/README.txt: -------------------------------------------------------------------------------- 1 | You can create your custom language file from here. It will be automatically loaded according to the system language at startup. 2 | 你可以从这里创建你的自定义语言文件。在启动的时候会根据系统语言自动加载。 -------------------------------------------------------------------------------- /src/main/resources/lang/component/README.txt: -------------------------------------------------------------------------------- 1 | The files in this folder are used to provide the language for the component. You can override them in the same path format, or modify them directly. 2 | 此文件夹中的文件用于为组件(component)提供语言翻译。您可以使用相同的路径格式覆盖它们,或直接修改它们。 -------------------------------------------------------------------------------- /src/main/resources/lang/component/en_US.lang: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/src/main/resources/lang/component/en_US.lang -------------------------------------------------------------------------------- /src/main/resources/lang/component/ja_JP.lang: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/src/main/resources/lang/component/ja_JP.lang -------------------------------------------------------------------------------- /src/main/resources/lang/component/zh_CN.lang: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/src/main/resources/lang/component/zh_CN.lang -------------------------------------------------------------------------------- /src/main/resources/lang/core/README.txt: -------------------------------------------------------------------------------- 1 | The files in this folder are used to provide the language for the core. You can override them in the same path format, or modify them directly. 2 | 此文件夹中的文件用于为核心(core)提供语言翻译。您可以使用相同的路径格式覆盖它们,或直接修改它们。 -------------------------------------------------------------------------------- /src/main/resources/lang/core/ja_JP.lang: -------------------------------------------------------------------------------- 1 | lang.init.finished=言語が初期化されました. 2 | 3 | # 启动时候的系统类型展示,用于debug吧 4 | os.system.name=システム名: {0} 5 | os.system.version=システムバージョン: {0} 6 | os.system.type=システム: {0} 7 | -------------------------------------------------------------------------------- /src/main/resources/lang/en_US.lang: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/src/main/resources/lang/en_US.lang -------------------------------------------------------------------------------- /src/main/resources/lang/modules/en_US.lang: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/src/main/resources/lang/modules/en_US.lang -------------------------------------------------------------------------------- /src/main/resources/lang/modules/zh_CN.lang: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/src/main/resources/lang/modules/zh_CN.lang -------------------------------------------------------------------------------- /src/main/resources/lang/zh_CN.lang: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simple-robot/simple-robot-v1/85461ef0da1296a8e07516c1229b82fada316265/src/main/resources/lang/zh_CN.lang -------------------------------------------------------------------------------- /src/main/resources/simbot/factory/module.factory: -------------------------------------------------------------------------------- 1 | load.bean=com.forte.qqrobot.CoreConfiguration -------------------------------------------------------------------------------- /更新计划.md: -------------------------------------------------------------------------------- 1 | # 更新计划 2 | 3 | - ~~lang语言国际化功能~~ (完成) 4 | - ~~多机器人支持~~ (完成) 5 | - ~~优化文件配置方式,支持注解形式的文件配置~~(完成) 6 | - ~~异常捕获~~(完成) 7 | - ~~异步的延迟执行~~(模组形式完成) 8 | - ~~获取所有的监听函数等数据~~(完成,listenerManager) 9 | - ~~通过配置文件来进行不同环境下的不同启动方案~~(完成) 10 | - ~~close优化~~(完成) 11 | - ~~额外的任意配置~~(完成) 12 | 13 | 14 | - 优化监听器封装类的封装方式 15 | - 增加更多面向未来的API接口,例如qq空间相关、红包相关、个性签名等(待定) 16 | - 增加送信器的返回值接口(2.0) 17 | - 想办法优化enum工厂 18 | 19 | - 动态增加监听函数相关(监听函数接口化) 20 | - 使用接口或者模板进行监听函数注册(同上) 21 | - 优化改版日志功能 22 | - CQCode相关优化 23 | - 尽可能减少核心依赖(2.0) 24 | - 连续对话(2.0) 25 | 26 | 27 | - 各种方面的优化 --------------------------------------------------------------------------------