├── src ├── main │ ├── webapp │ │ ├── WEB-INF │ │ │ ├── layout │ │ │ │ └── none.vm │ │ │ ├── velocity │ │ │ │ ├── getAuthorization.vm │ │ │ │ ├── menu.vm │ │ │ │ ├── userInfo.vm │ │ │ │ ├── authCode.vm │ │ │ │ ├── user.vm │ │ │ │ ├── accountList.vm │ │ │ │ └── login.vm │ │ │ └── toolbox.xml │ │ ├── font │ │ │ ├── se7en.ttf │ │ │ ├── se7en.woff │ │ │ ├── fontawesome-webfont.woff │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ └── glyphicons-halflings-regular.woff │ │ ├── images │ │ │ ├── alpha.png │ │ │ ├── image5.jpg │ │ │ ├── image6.png │ │ │ ├── image7.png │ │ │ ├── nature1.jpg │ │ │ ├── nature2.jpg │ │ │ ├── nature3.jpg │ │ │ ├── nature4.jpg │ │ │ ├── noimage.gif │ │ │ ├── select2.png │ │ │ ├── chat-left.png │ │ │ ├── chat-right.png │ │ │ ├── checkmark.png │ │ │ ├── image-iso.png │ │ │ ├── image-iso2.jpg │ │ │ ├── image-iso3.png │ │ │ ├── image-iso4.png │ │ │ ├── image-iso5.png │ │ │ ├── image-iso6.png │ │ │ ├── image-iso7.png │ │ │ ├── image-iso8.png │ │ │ ├── image-iso9.png │ │ │ ├── img-coast.jpg │ │ │ ├── nav-sprite.png │ │ │ ├── se7en-logo.png │ │ │ ├── avatar-male.jpg │ │ │ ├── avatar-male2.png │ │ │ ├── icon-search.png │ │ │ ├── social-image.jpg │ │ │ ├── avatar-female.jpg │ │ │ ├── avatar-female.png │ │ │ ├── avatar-female2.png │ │ │ ├── login-blurry-bg.jpg │ │ │ ├── logo-login@2x.png │ │ │ └── info-data-sprite.png │ │ ├── index.jsp │ │ └── stylesheets │ │ │ ├── morris.css │ │ │ └── typeahead.css │ ├── java │ │ └── site │ │ │ └── lovecode │ │ │ └── wechat │ │ │ ├── support │ │ │ ├── bean │ │ │ │ ├── TemplateBean.java │ │ │ │ ├── IdBean.java │ │ │ │ ├── TagsIdList.java │ │ │ │ ├── UserOpenidReq.java │ │ │ │ ├── FuncInfoObject.java │ │ │ │ ├── IndustryIdBean.java │ │ │ │ ├── ArticleHourBean.java │ │ │ │ ├── ArticleDayBean.java │ │ │ │ ├── UserInfoListResp.java │ │ │ │ ├── ArticleShareDayBean.java │ │ │ │ ├── ArticleShareHourBean.java │ │ │ │ ├── ArticleSummaryBean.java │ │ │ │ ├── UserListReq.java │ │ │ │ ├── PreAuthCodeBean.java │ │ │ │ ├── TagBean.java │ │ │ │ ├── ArticleTotalBean.java │ │ │ │ ├── ComponentAccessTokenBean.java │ │ │ │ ├── UserCumulateBean.java │ │ │ │ ├── ArticleTotalSubBean.java │ │ │ │ ├── GetAuthorizerOptionBean.java │ │ │ │ ├── TagsBean.java │ │ │ │ ├── XmlEncryptingBean.java │ │ │ │ ├── WechatXmlMessage.java │ │ │ │ ├── TagsUserBean.java │ │ │ │ ├── IndustryBean.java │ │ │ │ ├── AuthorizerTokenBean.java │ │ │ │ └── OpenidBean.java │ │ │ ├── enums │ │ │ │ ├── IEnum.java │ │ │ │ ├── PlatEnum.java │ │ │ │ ├── ReplyOpenEnum.java │ │ │ │ ├── MatchModeEnum.java │ │ │ │ ├── ReplyModeEnum.java │ │ │ │ ├── ReplyTypeEnum.java │ │ │ │ ├── AuthorizationStatusEnum.java │ │ │ │ ├── OfficialAccountTypeEnum.java │ │ │ │ ├── BusinessInfoEnum.java │ │ │ │ ├── AuthorizationInfoTypeEnum.java │ │ │ │ ├── VerifyTypeInfoOfEnum.java │ │ │ │ ├── MenuOfTypeEnum.java │ │ │ │ ├── FuncInfoStatusEnum.java │ │ │ │ ├── MenuOfLevelEnum.java │ │ │ │ ├── MediaShowCoverPicOfEnum.java │ │ │ │ ├── MessageTypeEnum.java │ │ │ │ └── FuncInfoEnum.java │ │ │ ├── constant │ │ │ │ ├── WechatParameterConstant.java │ │ │ │ └── WechatUrlConstant.java │ │ │ ├── singleton │ │ │ │ └── MessageRouterSingleton.java │ │ │ ├── common │ │ │ │ ├── ResponseHead.java │ │ │ │ ├── CodeConstants.java │ │ │ │ ├── WebException.java │ │ │ │ └── Response.java │ │ │ ├── AjaxResult.java │ │ │ └── config │ │ │ │ └── WechatConfig.java │ │ │ ├── mapper │ │ │ ├── TempMapper.java │ │ │ ├── EventMapper.java │ │ │ ├── MessageMapper.java │ │ │ ├── OaTempMapper.java │ │ │ ├── FuncInfoMapper.java │ │ │ ├── IndustryMapper.java │ │ │ ├── ErrorCodeMapper.java │ │ │ ├── MediaNewsMapper.java │ │ │ ├── SystemUserMapper.java │ │ │ ├── TagsMapper.java │ │ │ ├── BusinessInfoMapper.java │ │ │ ├── IndustryTempMapper.java │ │ │ ├── MassMessageMapper.java │ │ │ ├── MenuSettingMapper.java │ │ │ ├── PreAuthCodeMapper.java │ │ │ ├── ReplySettingMapper.java │ │ │ ├── TempMessageMapper.java │ │ │ ├── UserLocationMapper.java │ │ │ ├── CustomServiceMapper.java │ │ │ ├── ArticleSummaryMapper.java │ │ │ ├── MediaNewsImageMapper.java │ │ │ ├── MessageSendDayMapper.java │ │ │ ├── ArticleShareDayMapper.java │ │ │ ├── MessageSendHourMapper.java │ │ │ ├── ArticleShareHourMapper.java │ │ │ ├── InterfaceSummaryMapper.java │ │ │ ├── PersonalUserTagsMapper.java │ │ │ ├── ArticleTotalDetailMapper.java │ │ │ ├── UserOfficialAccountMapper.java │ │ │ ├── OfficialAccountInfoMapper.java │ │ │ ├── ComponentAccessTokenMapper.java │ │ │ ├── InterfaceSummaryHourMapper.java │ │ │ ├── AuthenticationMessageMapper.java │ │ │ ├── KeywordReplySettingNewMapper.java │ │ │ ├── MessageDistributionDayMapper.java │ │ │ ├── WechatThirdPartyConfigMapper.java │ │ │ ├── KeywordReplySettingReplyMapper.java │ │ │ ├── KeywordReplySettingKeywordMapper.java │ │ │ ├── AuthorizerAccessTokenMapper.java │ │ │ ├── ComponentVerifyTicketMapper.java │ │ │ ├── AuthorizerInfoMapper.java │ │ │ ├── OrgOfficialAccountMapper.java │ │ │ ├── OfficialAccountAccessTokenMapper.java │ │ │ ├── KeywordReplySettingMapper.java │ │ │ ├── UserDataMapper.java │ │ │ ├── MediaMapper.java │ │ │ ├── MenuMapper.java │ │ │ ├── OfficialAccountMapper.java │ │ │ ├── ArticleTotalMapper.java │ │ │ ├── ArticleHourMapper.java │ │ │ └── ArticleDayMapper.java │ │ │ ├── common │ │ │ └── mybatis │ │ │ │ ├── CommonMapper.java │ │ │ │ ├── ReplaceMapper.java │ │ │ │ ├── Identity.java │ │ │ │ ├── PageMapper.java │ │ │ │ ├── BatchMapper.java │ │ │ │ └── PageProvider.java │ │ │ ├── annotation │ │ │ ├── Batch.java │ │ │ ├── Read.java │ │ │ ├── Write.java │ │ │ └── TableName.java │ │ │ ├── service │ │ │ ├── TempMessageService.java │ │ │ ├── ITempService.java │ │ │ ├── IOfficialAccountService.java │ │ │ ├── IErrorCodeService.java │ │ │ ├── IWechatService.java │ │ │ ├── IMenuService.java │ │ │ ├── IReplySettingService.java │ │ │ ├── impl │ │ │ │ ├── ErrorCodeServiceImpl.java │ │ │ │ └── TempServiceImpl.java │ │ │ ├── IArticleTotalService.java │ │ │ ├── IArticleHourService.java │ │ │ ├── IArticleDayService.java │ │ │ ├── IWechatThridPartyService.java │ │ │ ├── ITagsService.java │ │ │ └── IUserDataService.java │ │ │ ├── jedis │ │ │ ├── RedisCommands.java │ │ │ └── RedisProxyFactory.java │ │ │ ├── module │ │ │ ├── impl │ │ │ │ ├── AbstractModule.java │ │ │ │ ├── ErrorCodeModuleImpl.java │ │ │ │ └── OfficialAccountModuleImpl.java │ │ │ ├── IErrorCodeModule.java │ │ │ ├── IOfficialAccountModule.java │ │ │ ├── IMenuModule.java │ │ │ └── IReplySettingModule.java │ │ │ ├── dto │ │ │ ├── MediaNewsDto.java │ │ │ ├── MenuMediaDto.java │ │ │ ├── PersonalUserIdReqDto.java │ │ │ ├── MenuDto.java │ │ │ ├── MediaDto.java │ │ │ ├── KeywordReplySettingReplyDto.java │ │ │ ├── OfficialAccountAuthorizerInfoDto.java │ │ │ ├── PersonalUserDto.java │ │ │ ├── FuncInfoDto.java │ │ │ ├── PersonalUserTagReqDto.java │ │ │ ├── ArticleSummaryDto.java │ │ │ ├── PersonalUserTagBatchReqDto.java │ │ │ ├── TagsDto.java │ │ │ ├── ArticleHourDto.java │ │ │ ├── MediaNewsReqDto.java │ │ │ ├── ArticleTotalDto.java │ │ │ ├── PersonalUserTagsDto.java │ │ │ ├── KeywordReplySettingDto.java │ │ │ └── PersonalUserTermDto.java │ │ │ ├── ase │ │ │ ├── ByteGroup.java │ │ │ ├── PKCS7Encoder.java │ │ │ └── SHA1.java │ │ │ ├── util │ │ │ ├── WechatMsgCryptUtil.java │ │ │ └── WechatCryptUtil.java │ │ │ └── controller │ │ │ ├── MenuController.java │ │ │ └── OfficialAccountController.java │ └── resources │ │ ├── mybatis-config.xml │ │ ├── logback.xml │ │ └── site │ │ └── lovecode │ │ └── wechat │ │ └── mapper │ │ ├── ErrorCodeMapper.xml │ │ ├── FuncInfoMapper.xml │ │ ├── IndustryTempMapper.xml │ │ ├── UserOfficialAccountMapper.xml │ │ ├── MediaNewsImageMapper.xml │ │ ├── OaTempMapper.xml │ │ ├── PreAuthCodeMapper.xml │ │ ├── PersonalUserTagsMapper.xml │ │ ├── MenuSettingMapper.xml │ │ ├── KeywordReplySettingReplyMapper.xml │ │ ├── BusinessInfoMapper.xml │ │ ├── TagsMapper.xml │ │ ├── SystemUserMapper.xml │ │ ├── MessageSendDayMapper.xml │ │ ├── MessageDistributionDayMapper.xml │ │ ├── KeywordReplySettingKeywordMapper.xml │ │ ├── OrgOfficialAccountMapper.xml │ │ ├── TempMessageMapper.xml │ │ ├── MessageSendHourMapper.xml │ │ ├── ArticleShareDayMapper.xml │ │ ├── ComponentAccessTokenMapper.xml │ │ ├── IndustryMapper.xml │ │ ├── ArticleShareHourMapper.xml │ │ ├── InterfaceSummaryMapper.xml │ │ ├── TempMapper.xml │ │ ├── ReplySettingMapper.xml │ │ ├── InterfaceSummaryHourMapper.xml │ │ ├── EventMapper.xml │ │ ├── CustomServiceMapper.xml │ │ ├── OfficialAccountInfoMapper.xml │ │ ├── ComponentVerifyTicketMapper.xml │ │ ├── OfficialAccountAccessTokenMapper.xml │ │ ├── KeywordReplySettingNewMapper.xml │ │ ├── AuthorizerInfoMapper.xml │ │ ├── UserLocationMapper.xml │ │ ├── AuthenticationMessageMapper.xml │ │ ├── MediaNewsMapper.xml │ │ ├── AuthorizerAccessTokenMapper.xml │ │ ├── WechatThirdPartyConfigMapper.xml │ │ └── UserDataMapper.xml └── test │ └── java │ └── site │ └── lovecode │ └── wechat │ └── weixin │ └── AsyncTest.java ├── settings.gradle └── readme.md /src/main/webapp/WEB-INF/layout/none.vm: -------------------------------------------------------------------------------- 1 | $screen_content -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'wechat-3rd-party' 2 | 3 | -------------------------------------------------------------------------------- /src/main/webapp/font/se7en.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/font/se7en.ttf -------------------------------------------------------------------------------- /src/main/webapp/font/se7en.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/font/se7en.woff -------------------------------------------------------------------------------- /src/main/webapp/images/alpha.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/alpha.png -------------------------------------------------------------------------------- /src/main/webapp/images/image5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/image5.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/image6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/image6.png -------------------------------------------------------------------------------- /src/main/webapp/images/image7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/image7.png -------------------------------------------------------------------------------- /src/main/webapp/images/nature1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/nature1.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/nature2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/nature2.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/nature3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/nature3.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/nature4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/nature4.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/noimage.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/noimage.gif -------------------------------------------------------------------------------- /src/main/webapp/images/select2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/select2.png -------------------------------------------------------------------------------- /src/main/webapp/images/chat-left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/chat-left.png -------------------------------------------------------------------------------- /src/main/webapp/images/chat-right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/chat-right.png -------------------------------------------------------------------------------- /src/main/webapp/images/checkmark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/checkmark.png -------------------------------------------------------------------------------- /src/main/webapp/images/image-iso.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/image-iso.png -------------------------------------------------------------------------------- /src/main/webapp/images/image-iso2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/image-iso2.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/image-iso3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/image-iso3.png -------------------------------------------------------------------------------- /src/main/webapp/images/image-iso4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/image-iso4.png -------------------------------------------------------------------------------- /src/main/webapp/images/image-iso5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/image-iso5.png -------------------------------------------------------------------------------- /src/main/webapp/images/image-iso6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/image-iso6.png -------------------------------------------------------------------------------- /src/main/webapp/images/image-iso7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/image-iso7.png -------------------------------------------------------------------------------- /src/main/webapp/images/image-iso8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/image-iso8.png -------------------------------------------------------------------------------- /src/main/webapp/images/image-iso9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/image-iso9.png -------------------------------------------------------------------------------- /src/main/webapp/images/img-coast.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/img-coast.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/nav-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/nav-sprite.png -------------------------------------------------------------------------------- /src/main/webapp/images/se7en-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/se7en-logo.png -------------------------------------------------------------------------------- /src/main/webapp/images/avatar-male.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/avatar-male.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/avatar-male2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/avatar-male2.png -------------------------------------------------------------------------------- /src/main/webapp/images/icon-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/icon-search.png -------------------------------------------------------------------------------- /src/main/webapp/images/social-image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/social-image.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/avatar-female.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/avatar-female.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/avatar-female.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/avatar-female.png -------------------------------------------------------------------------------- /src/main/webapp/images/avatar-female2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/avatar-female2.png -------------------------------------------------------------------------------- /src/main/webapp/images/login-blurry-bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/login-blurry-bg.jpg -------------------------------------------------------------------------------- /src/main/webapp/images/logo-login@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/logo-login@2x.png -------------------------------------------------------------------------------- /src/main/webapp/images/info-data-sprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/images/info-data-sprite.png -------------------------------------------------------------------------------- /src/main/webapp/font/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/font/fontawesome-webfont.woff -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/velocity/getAuthorization.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 获取授权 4 | 5 | 6 | 获取授权 7 | 8 | -------------------------------------------------------------------------------- /src/main/webapp/font/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/font/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/webapp/font/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NormanGyllenhaal/wechat-3rd-party/HEAD/src/main/webapp/font/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/velocity/menu.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include("head.vm") 4 | 5 | 6 | #include("navbar.vm") 7 | 8 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/TemplateBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | /** 4 | * Created by Administrator on 2016/5/3. 5 | */ 6 | public class TemplateBean { 7 | 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/TempMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.Temp; 6 | 7 | public interface TempMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/EventMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.Event; 6 | 7 | public interface EventMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/MessageMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.Message; 6 | 7 | public interface MessageMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/OaTempMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.OaTemp; 6 | 7 | public interface OaTempMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/FuncInfoMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.FuncInfo; 6 | 7 | public interface FuncInfoMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/IndustryMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.Industry; 6 | 7 | public interface IndustryMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/ErrorCodeMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.ErrorCode; 6 | 7 | public interface ErrorCodeMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/MediaNewsMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.MediaNews; 6 | 7 | public interface MediaNewsMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/SystemUserMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | import site.lovecode.wechat.common.mybatis.CommonMapper; 4 | import site.lovecode.wechat.entity.SystemUser; 5 | 6 | public interface SystemUserMapper extends CommonMapper { 7 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/TagsMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.Tags; 6 | 7 | public interface TagsMapper extends CommonMapper { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/BusinessInfoMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.BusinessInfo; 6 | 7 | public interface BusinessInfoMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/IndustryTempMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.IndustryTemp; 6 | 7 | public interface IndustryTempMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/MassMessageMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.MassMessage; 6 | 7 | public interface MassMessageMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/MenuSettingMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.MenuSetting; 6 | 7 | public interface MenuSettingMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/PreAuthCodeMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.PreAuthCode; 6 | 7 | public interface PreAuthCodeMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/ReplySettingMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.ReplySetting; 6 | 7 | public interface ReplySettingMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/TempMessageMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.TempMessage; 6 | 7 | public interface TempMessageMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/UserLocationMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.UserLocation; 6 | 7 | public interface UserLocationMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/CustomServiceMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.CustomService; 6 | 7 | public interface CustomServiceMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/ArticleSummaryMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.ArticleSummary; 6 | 7 | public interface ArticleSummaryMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/MediaNewsImageMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.MediaNewsImage; 6 | 7 | public interface MediaNewsImageMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/MessageSendDayMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.MessageSendDay; 6 | 7 | public interface MessageSendDayMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/velocity/userInfo.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include("head.vm") 4 | 5 | 6 | #include("navbar.vm") 7 | 微信测试 8 | 用户信息 9 | $user.nickname 10 | $user.sex 11 | $user.city 12 | $user.language 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/ArticleShareDayMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.ArticleShareDay; 6 | 7 | public interface ArticleShareDayMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/MessageSendHourMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.MessageSendHour; 6 | 7 | public interface MessageSendHourMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/ArticleShareHourMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.ArticleShareHour; 6 | 7 | public interface ArticleShareHourMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/InterfaceSummaryMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.InterfaceSummary; 6 | 7 | public interface InterfaceSummaryMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/PersonalUserTagsMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.PersonalUserTags; 6 | 7 | public interface PersonalUserTagsMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/velocity/authCode.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 公众号信息 4 | 5 | 6 | 公众号信息:
7 | 微信公众号名称:$info.authorizerInfo.nickName
8 | 公众号头像:
9 | appid: $info.authorizeationInfo.authorizerAppid 10 | 11 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/ArticleTotalDetailMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.ArticleTotalDetail; 6 | 7 | public interface ArticleTotalDetailMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/UserOfficialAccountMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | import site.lovecode.wechat.common.mybatis.CommonMapper; 4 | import site.lovecode.wechat.entity.UserOfficialAccount; 5 | 6 | public interface UserOfficialAccountMapper extends CommonMapper { 7 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/common/mybatis/CommonMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.common.mybatis; 2 | 3 | import tk.mybatis.mapper.common.Mapper; 4 | 5 | /** 6 | * Created by Administrator on 2016/4/12. 7 | */ 8 | public interface CommonMapper extends Mapper, ReplaceMapper, BatchMapper, PageMapper {} 9 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/OfficialAccountInfoMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.OfficialAccountInfo; 6 | 7 | public interface OfficialAccountInfoMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/annotation/Batch.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 标示语句是批处理语句 7 | *

8 | */ 9 | @Target( { ElementType.METHOD } ) 10 | @Retention( RetentionPolicy.RUNTIME ) 11 | @Inherited 12 | @Documented 13 | public @interface Batch {} 14 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/ComponentAccessTokenMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.ComponentAccessToken; 6 | 7 | public interface ComponentAccessTokenMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/InterfaceSummaryHourMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.InterfaceSummaryHour; 6 | 7 | public interface InterfaceSummaryHourMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/AuthenticationMessageMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.AuthenticationMessage; 6 | 7 | public interface AuthenticationMessageMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/KeywordReplySettingNewMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.KeywordReplySettingNew; 6 | 7 | public interface KeywordReplySettingNewMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/MessageDistributionDayMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.MessageDistributionDay; 6 | 7 | public interface MessageDistributionDayMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/WechatThirdPartyConfigMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.WechatThirdPartyConfig; 6 | 7 | public interface WechatThirdPartyConfigMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/KeywordReplySettingReplyMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.KeywordReplySettingReply; 6 | 7 | public interface KeywordReplySettingReplyMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/TempMessageService.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.service; 2 | 3 | import me.chanjar.weixin.common.exception.WxErrorException; 4 | 5 | /** 6 | * Created by Administrator on 2016/5/3. 7 | */ 8 | public interface TempMessageService { 9 | 10 | 11 | void sendTempMessage() throws WxErrorException; 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/KeywordReplySettingKeywordMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.KeywordReplySettingKeyword; 6 | 7 | public interface KeywordReplySettingKeywordMapper extends CommonMapper { 8 | } -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/annotation/Read.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 标示语句是查询语句 7 | *

8 | */ 9 | @Target({ ElementType.METHOD }) 10 | @Retention(RetentionPolicy.RUNTIME) 11 | @Inherited 12 | @Documented 13 | public @interface Read { 14 | //String vaule() default "read"; 15 | } 16 | -------------------------------------------------------------------------------- /src/main/resources/mybatis-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: Administrator 4 | Date: 2016/3/29 5 | Time: 16:35 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 9 | 10 | 11 | $Title$ 12 | 13 | 14 | $END$ 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/common/mybatis/ReplaceMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.common.mybatis; 2 | 3 | import org.apache.ibatis.annotations.InsertProvider; 4 | 5 | /** 6 | * Created by Administrator on 2016/4/12. 7 | */ 8 | public interface ReplaceMapper { 9 | 10 | 11 | @InsertProvider( type = ReplaceProvider.class, method = "dynamicSQL" ) 12 | Integer replace(T record); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/AuthorizerAccessTokenMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.AuthorizerAccessToken; 6 | 7 | public interface AuthorizerAccessTokenMapper extends CommonMapper { 8 | 9 | Integer updateToken(AuthorizerAccessToken authorizerAccessToken); 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/ComponentVerifyTicketMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.ComponentVerifyTicket; 6 | 7 | public interface ComponentVerifyTicketMapper extends CommonMapper { 8 | 9 | 10 | ComponentVerifyTicket selectOrderByCreateTime(String componentAppId); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/annotation/Write.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.annotation; 2 | 3 | import java.lang.annotation.*; 4 | 5 | /** 6 | * 标示语句是更新语句 7 | *

8 | */ 9 | @Target({ ElementType.METHOD }) 10 | @Retention(RetentionPolicy.RUNTIME) 11 | @Inherited 12 | @Documented 13 | public @interface Write { 14 | //String vaule() default "write"; 15 | //判断是否从写库查询的条件mvel表达式,结果为boolean型,true从写库查,false从从库查 16 | String value(); 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/ITempService.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.service; 2 | 3 | import me.chanjar.weixin.common.exception.WxErrorException; 4 | import me.chanjar.weixin.mp.bean.WxMpTemplateMessage; 5 | 6 | /** 7 | * Created by Administrator on 2016/6/22. 8 | */ 9 | public interface ITempService { 10 | 11 | 12 | void sendTempMessage(Long orgId, WxMpTemplateMessage wxMpTemplateMessage) throws WxErrorException; 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | UTF-8 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/webapp/stylesheets/morris.css: -------------------------------------------------------------------------------- 1 | 2 | .morris-hover{position:absolute;z-index:1000;}.morris-hover.morris-default-style{border-radius:10px;padding:6px;color:#666;background:rgba(255, 255, 255, 0.8);border:solid 2px rgba(230, 230, 230, 0.8);font-family:sans-serif;font-size:12px;text-align:center;}.morris-hover.morris-default-style .morris-hover-row-label{font-weight:bold;margin:0.25em 0;} 3 | .morris-hover.morris-default-style .morris-hover-point{white-space:nowrap;margin:0.1em 0;} 4 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/common/mybatis/Identity.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Identity.java net.yunxiaoyuan Copyright (c) 2014,norman. 3 | */ 4 | 5 | package site.lovecode.wechat.common.mybatis; 6 | 7 | 8 | /** 9 | * 实体实现此接口表示有主键id,且如果插入时为null, 则自动通过idworker获取id并赋值 10 | *

11 | * 12 | * @author norman 13 | * @date 2014年11月13日 14 | * @version 1.0.0 15 | */ 16 | public interface Identity { 17 | 18 | public void setId(Long id); 19 | 20 | 21 | public Long getId(); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/IdBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/6. 5 | */ 6 | public class IdBean { 7 | 8 | private Integer Id; 9 | 10 | 11 | public Integer getId() { 12 | return Id; 13 | } 14 | 15 | 16 | public void setId( Integer id ) { 17 | Id = id; 18 | } 19 | 20 | 21 | @Override 22 | public String toString() { 23 | return "IdBean{" + "Id='" + Id + '\'' + '}'; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/jedis/RedisCommands.java: -------------------------------------------------------------------------------- 1 | /** 2 | * JedisCommands.java com.jiajiao.core.cache.jedis Copyright (c) 2014, 3 | *norman. 4 | */ 5 | 6 | package site.lovecode.wechat.jedis; 7 | 8 | import redis.clients.jedis.BinaryJedisCommands; 9 | import redis.clients.jedis.JedisCommands; 10 | 11 | /** 12 | * redis访问接口 13 | *

14 | * 15 | * @author norman 16 | * @Date 2014-7-18 17 | */ 18 | public interface RedisCommands extends JedisCommands, BinaryJedisCommands { 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/velocity/user.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 用户信息 4 | 5 | 6 | 微信测试 7 | 用户列表 8 | #foreach($user in $userList) 9 | 用户openid: $user.openid 向这个用户发送一条消息: 10 |

11 | 12 | 13 | 14 |
15 | #end 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/IOfficialAccountService.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.service; 2 | 3 | 4 | import site.lovecode.wechat.dto.OfficialAccountReqDto; 5 | import site.lovecode.wechat.entity.OfficialAccount; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Administrator on 2016/4/18. 11 | */ 12 | public interface IOfficialAccountService { 13 | 14 | void saveOfficialAccount(OfficialAccountReqDto officialAccountReqDto); 15 | 16 | 17 | List getAllOfficialAccount(); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/AuthorizerInfoMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import org.apache.ibatis.annotations.Param; 5 | import site.lovecode.wechat.common.mybatis.CommonMapper; 6 | import site.lovecode.wechat.entity.AuthorizerInfo; 7 | 8 | public interface AuthorizerInfoMapper extends CommonMapper { 9 | 10 | Integer updateAuthorizationStatus( 11 | @Param("authorizationStatus") Integer authorizationStatus, 12 | @Param("authorizerAppid") String authorizerAppid); 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/annotation/TableName.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.annotation; 2 | 3 | import java.io.Serializable; 4 | import java.lang.annotation.*; 5 | 6 | /** 7 | * 通用操作注解 8 | *

9 | */ 10 | @Target({ ElementType.TYPE }) 11 | @Retention(RetentionPolicy.RUNTIME) 12 | @Inherited 13 | @Documented 14 | public @interface TableName { 15 | 16 | //表名称 17 | String table(); 18 | 19 | 20 | //主键名称,默认id 21 | String id() default "id"; 22 | 23 | 24 | //映射的实体名称 25 | Class entity(); 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/IEnum.java: -------------------------------------------------------------------------------- 1 | /** 2 | * IEnum.java cn.vko.core.common.enums Copyright (c) 2014, 北京微课九天教育科技有限公司版权所有. 3 | */ 4 | 5 | package site.lovecode.wechat.support.enums; 6 | 7 | 8 | /** 9 | * 定义所有枚举类的接口类型 10 | *

11 | * 所有枚举类必须实现此接口 12 | * 13 | * @author malei 14 | * @date 2014-11-11 15 | * @version 1.0.0 16 | */ 17 | public interface IEnum { 18 | 19 | /** 20 | * 定义枚举值 21 | */ 22 | public int key(); 23 | 24 | 25 | /** 26 | * 定义枚举描述 27 | */ 28 | public String desc(); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/OrgOfficialAccountMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import site.lovecode.wechat.common.mybatis.CommonMapper; 5 | import site.lovecode.wechat.entity.OrgOfficialAccount; 6 | 7 | public interface OrgOfficialAccountMapper extends CommonMapper { 8 | 9 | 10 | /** 11 | * 12 | * 根据机构id获取公众号id 13 | *

14 | * 15 | * 16 | * @param orgId 公众号id 17 | * @return TODO(这里描述每个参数,如果有返回值描述返回值,如果有异常描述异常) 18 | */ 19 | Long getOfficialAccountIdByOrgId(Long orgId); 20 | } 21 | -------------------------------------------------------------------------------- /src/test/java/site/lovecode/wechat/weixin/AsyncTest.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.weixin; 2 | 3 | import org.springframework.scheduling.annotation.Async; 4 | 5 | 6 | /** 7 | * Created by Administrator on 2016/4/29. 8 | */ 9 | public class AsyncTest { 10 | 11 | public void testAsync(){ 12 | try { 13 | Thread.sleep(5000); 14 | System.out.println("--------------------"+Thread.currentThread().getName()); 15 | } catch (InterruptedException e) { 16 | e.printStackTrace(); 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/IErrorCodeService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * IErrorCodeService.java site.lovecode.wechat.service Copyright 3 | * (c) 2016, norman. 4 | */ 5 | 6 | package site.lovecode.wechat.service; 7 | 8 | 9 | import site.lovecode.wechat.entity.ErrorCode; 10 | import site.lovecode.wechat.util.Page; 11 | 12 | /** 13 | * 测试分页查询 14 | *

15 | * 16 | * 17 | * @author yangpeng 18 | * @date 2016年5月5日 19 | * @version 1.0.0 20 | */ 21 | public interface IErrorCodeService { 22 | 23 | 24 | Page getErrorCodePage(Page page); 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/TagsIdList.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by Administrator on 2016/5/10. 9 | */ 10 | public class TagsIdList { 11 | 12 | 13 | @JSONField( name = "tagid_list" ) 14 | private List tagidList; 15 | 16 | 17 | public List getTagidList() { 18 | return tagidList; 19 | } 20 | 21 | 22 | public void setTagidList( List tagidList ) { 23 | this.tagidList = tagidList; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/UserOpenidReq.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/21. 5 | */ 6 | public class UserOpenidReq { 7 | 8 | private String openid; 9 | 10 | private String lang; 11 | 12 | 13 | public String getOpenid() { 14 | return openid; 15 | } 16 | 17 | 18 | public void setOpenid( String openid ) { 19 | this.openid = openid; 20 | } 21 | 22 | 23 | public String getLang() { 24 | return lang; 25 | } 26 | 27 | 28 | public void setLang( String lang ) { 29 | this.lang = lang; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/OfficialAccountAccessTokenMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import org.apache.ibatis.annotations.Param; 5 | import site.lovecode.wechat.common.mybatis.CommonMapper; 6 | import site.lovecode.wechat.entity.OfficialAccountAccessToken; 7 | 8 | public interface OfficialAccountAccessTokenMapper extends CommonMapper { 9 | 10 | 11 | Integer updateByOfficialAccount( 12 | @Param("accessToken") String accessToken, @Param("expiresIn") Long expiresIn, 13 | @Param("officialAccountId") Long officialAccountId); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/PlatEnum.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.enums; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/25. 5 | */ 6 | public enum PlatEnum { 7 | 8 | weixin(1, "weixin"), 9 | 10 | my(2, "my"); 11 | 12 | 13 | // 枚举值 14 | private final int key; 15 | 16 | // 枚举描述 17 | private final String desc; 18 | 19 | 20 | PlatEnum( final int key, final String desc ) { 21 | this.key = key; 22 | this.desc = desc; 23 | } 24 | 25 | 26 | public int key() { 27 | return key; 28 | } 29 | 30 | 31 | public String desc() { 32 | return desc; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/module/impl/AbstractModule.java: -------------------------------------------------------------------------------- 1 | /** 2 | * AbstractModule.java cn.vko.core.common.module Copyright (c) 2014, 3 | * . 4 | */ 5 | 6 | package site.lovecode.wechat.module.impl; 7 | 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | 11 | 12 | /** 13 | * 这里是所有MODULE实现都需要继承的父类 14 | *

15 | * 在这里你可以定义很多便于使用的抽象方法实现 16 | * 17 | * @author malei 18 | * @date 2014-11-19 19 | * @version 1.0.0 20 | */ 21 | public abstract class AbstractModule extends AbstractResponse { 22 | 23 | protected Logger logger = LoggerFactory.getLogger(this.getClass()); 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/MediaNewsDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MediaNewsDto.java site.lovecode.wechat.dto Copyright (c) 3 | * 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | 10 | import site.lovecode.wechat.entity.MediaNews; 11 | 12 | /** 13 | * TODO(这里用一句话描述这个类的作用) 14 | *

15 | * TODO(这里描述这个类补充说明 – 可选) 16 | * 17 | * @author Administrator 18 | * @date 2016年5月18日 19 | * @version 1.0.0 20 | */ 21 | public class MediaNewsDto extends MediaNews { 22 | 23 | /** 24 | * TODO(用一句话描述这个变量的含义) 25 | */ 26 | 27 | private static final long serialVersionUID = 1L; 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/ReplyOpenEnum.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.enums; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/26. 5 | */ 6 | public enum ReplyOpenEnum { 7 | 8 | 9 | close(0, "close"), 10 | 11 | open(1, "open"); 12 | 13 | // 枚举值 14 | private final int key; 15 | 16 | // 枚举描述 17 | private final String desc; 18 | 19 | 20 | ReplyOpenEnum( final int key, final String desc ) { 21 | this.key = key; 22 | this.desc = desc; 23 | } 24 | 25 | 26 | public int key() { 27 | return key; 28 | } 29 | 30 | 31 | public String desc() { 32 | return desc; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/MatchModeEnum.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.enums; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/25. 5 | */ 6 | public enum MatchModeEnum { 7 | 8 | contain(1, "contain"), 9 | 10 | equal(2, "equal"); 11 | 12 | 13 | // 枚举值 14 | private final int key; 15 | 16 | // 枚举描述 17 | private final String desc; 18 | 19 | 20 | MatchModeEnum( final int key, final String desc ) { 21 | this.key = key; 22 | this.desc = desc; 23 | } 24 | 25 | 26 | public int key() { 27 | return key; 28 | } 29 | 30 | 31 | public String desc() { 32 | return desc; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/ErrorCodeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/ReplyModeEnum.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.enums; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/25. 5 | */ 6 | public enum ReplyModeEnum { 7 | 8 | reply_all(1, "reply_all"), 9 | 10 | random_one(2, "random_one"); 11 | 12 | 13 | // 枚举值 14 | private final int key; 15 | 16 | // 枚举描述 17 | private final String desc; 18 | 19 | 20 | ReplyModeEnum( final int key, final String desc ) { 21 | this.key = key; 22 | this.desc = desc; 23 | } 24 | 25 | 26 | public int key() { 27 | return key; 28 | } 29 | 30 | 31 | public String desc() { 32 | return desc; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/module/IErrorCodeModule.java: -------------------------------------------------------------------------------- 1 | /** 2 | * IErrorCodeModule.java cn.vko.peixun.core.module.communication Copyright (c) 3 | * 2016, . 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.module; 8 | 9 | 10 | import site.lovecode.wechat.entity.ErrorCode; 11 | import site.lovecode.wechat.support.common.Response; 12 | import site.lovecode.wechat.util.Page; 13 | 14 | /** 15 | * 示例代码 16 | *

17 | * 18 | * @author Administrator 19 | * @date 2016年5月5日 20 | * @version 1.0.0 21 | */ 22 | public interface IErrorCodeModule { 23 | 24 | 25 | Response> getErrorCodePage(Page page); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/KeywordReplySettingMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import org.apache.ibatis.annotations.Param; 5 | import site.lovecode.wechat.common.mybatis.CommonMapper; 6 | import site.lovecode.wechat.dto.KeywordReplySettingDto; 7 | import site.lovecode.wechat.entity.KeywordReplySetting; 8 | 9 | import java.util.List; 10 | 11 | public interface KeywordReplySettingMapper extends CommonMapper { 12 | 13 | List selectJoin( 14 | @Param("officialAccountId") Long officialAccountId, @Param("replyOpen") Integer replyOpen, 15 | @Param("plat") Integer plat); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/ReplyTypeEnum.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.enums; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/25. 5 | */ 6 | public enum ReplyTypeEnum { 7 | 8 | ADDFRIENDREPLYOPEN(1, "addFriendReplyOpen"), 9 | 10 | AUTOREPLYOPEN(2, "autoReplyOpen"); 11 | 12 | 13 | // 枚举值 14 | private final int key; 15 | 16 | // 枚举描述 17 | private final String desc; 18 | 19 | 20 | ReplyTypeEnum( final int key, final String desc ) { 21 | this.key = key; 22 | this.desc = desc; 23 | } 24 | 25 | 26 | public int key() { 27 | return key; 28 | } 29 | 30 | 31 | public String desc() { 32 | return desc; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/FuncInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/IndustryTempMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/AuthorizationStatusEnum.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.enums; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/12. 5 | */ 6 | public enum AuthorizationStatusEnum { 7 | 8 | AUTHORIZED(0, "authorized"), 9 | 10 | UNAUTHORIZED(1, "unauthorized"); 11 | 12 | 13 | // 枚举值 14 | private final int key; 15 | 16 | // 枚举描述 17 | private final String desc; 18 | 19 | 20 | AuthorizationStatusEnum( final int key, final String desc ) { 21 | this.key = key; 22 | this.desc = desc; 23 | } 24 | 25 | 26 | public int key() { 27 | return key; 28 | } 29 | 30 | 31 | public String desc() { 32 | return desc; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/ase/ByteGroup.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.ase; 2 | 3 | import java.util.ArrayList; 4 | 5 | class ByteGroup { 6 | 7 | ArrayList byteContainer = new ArrayList(); 8 | 9 | 10 | public byte[] toBytes() { 11 | byte[] bytes = new byte[byteContainer.size()]; 12 | for ( int i = 0 ; i < byteContainer.size() ; i++ ) { 13 | bytes[i] = byteContainer.get(i); 14 | } 15 | return bytes; 16 | } 17 | 18 | 19 | public ByteGroup addBytes( byte[] bytes ) { 20 | for ( byte b : bytes ) { 21 | byteContainer.add(b); 22 | } 23 | return this; 24 | } 25 | 26 | 27 | public int size() { 28 | return byteContainer.size(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/OfficialAccountTypeEnum.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.enums; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/15. 5 | */ 6 | public enum OfficialAccountTypeEnum { 7 | 8 | 9 | AUTHORIZATION(1, "授权绑定"), 10 | 11 | UNAUTHORIZATION(2, "非授权绑定"); 12 | 13 | 14 | // 枚举值 15 | private final int key; 16 | 17 | // 枚举描述 18 | private final String desc; 19 | 20 | 21 | OfficialAccountTypeEnum( final int key, final String desc ) { 22 | this.key = key; 23 | this.desc = desc; 24 | } 25 | 26 | 27 | public int key() { 28 | return key; 29 | } 30 | 31 | 32 | public String desc() { 33 | return desc; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/common/mybatis/PageMapper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PageMapper.java site.lovecode.wechat.mybatis.mybatis.mapper Copyright (c) 2016, 3 | * norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.common.mybatis; 8 | 9 | import org.apache.ibatis.annotations.SelectProvider; 10 | import site.lovecode.wechat.util.Page; 11 | 12 | import java.util.List; 13 | 14 | 15 | 16 | 17 | /** 18 | * 分页查询 19 | *

20 | * 21 | * @author yangpeng 22 | * @date 2016年5月5日 23 | * @version 1.0.0 24 | */ 25 | public interface PageMapper { 26 | 27 | 28 | @SelectProvider( type = PageProvider.class, method = "dynamicSQL" ) 29 | List selectPage(Page page); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/UserOfficialAccountMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/UserDataMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import org.apache.ibatis.annotations.Param; 5 | import site.lovecode.wechat.common.mybatis.CommonMapper; 6 | import site.lovecode.wechat.entity.UserData; 7 | import site.lovecode.wechat.util.Page; 8 | 9 | import java.sql.Date; 10 | import java.util.List; 11 | 12 | public interface UserDataMapper extends CommonMapper { 13 | 14 | 15 | List selectByItem( 16 | @Param("page") Page page, @Param("beginDate") Date beginDate, 17 | @Param("endDate") Date endDate, @Param("userSource") Integer userSource, 18 | @Param("officialAccountId") Long officialAccountId); 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/MenuMediaDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MenuMediaDto.java site.lovecode.wechat.dto Copyright (c) 3 | * 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | 10 | import site.lovecode.wechat.entity.Menu; 11 | 12 | /** 13 | * 14 | *

15 | * 16 | * 17 | * @author yangpeng 18 | * @date 2016年5月25日 19 | * @version 1.0.0 20 | */ 21 | 22 | 23 | public class MenuMediaDto extends Menu { 24 | 25 | 26 | private static final long serialVersionUID = 1L; 27 | 28 | private MediaDto media; 29 | 30 | 31 | public MediaDto getMedia() { 32 | return media; 33 | } 34 | 35 | 36 | public void setMedia( MediaDto media ) { 37 | this.media = media; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/MediaNewsImageMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/OaTempMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/PreAuthCodeMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/PersonalUserIdReqDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PersonalUserIdReqDto.java site.lovecode.wechat.dto 3 | * Copyright (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | import java.util.List; 10 | 11 | 12 | /** 13 | * 用户id数据体 14 | *

15 | * 16 | * 17 | * @author yangpeng 18 | * @date 2016年5月13日 19 | * @version 1.0.0 20 | */ 21 | public class PersonalUserIdReqDto { 22 | 23 | 24 | private List personalUserIdList; 25 | 26 | 27 | public List getPersonalUserIdList() { 28 | return personalUserIdList; 29 | } 30 | 31 | 32 | public void setPersonalUserIdList( List personalUserIdList ) { 33 | this.personalUserIdList = personalUserIdList; 34 | } 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/FuncInfoObject.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | /** 6 | * Created by Administrator on 2016/4/6. 7 | */ 8 | public class FuncInfoObject { 9 | 10 | @JSONField( name = "funcscope_category" ) 11 | private IdBean funcscopeCategory; 12 | 13 | 14 | public IdBean getFuncscopeCategory() { 15 | return funcscopeCategory; 16 | } 17 | 18 | 19 | public void setFuncscopeCategory( IdBean funcscopeCategory ) { 20 | this.funcscopeCategory = funcscopeCategory; 21 | } 22 | 23 | 24 | @Override 25 | public String toString() { 26 | return "FuncInfoObject{" + "funcscopeCategory=" + funcscopeCategory + '}'; 27 | } 28 | 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/PersonalUserTagsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/MenuSettingMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/MenuDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MenuDto.java site.lovecode.wechat.dto Copyright (c) 2016, 3 | *norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | 10 | import site.lovecode.wechat.entity.Menu; 11 | 12 | import java.util.List; 13 | 14 | 15 | /** 16 | * 17 | *

18 | * 19 | * 20 | * @author yangpeng 21 | * @date 2016年5月24日 22 | * @version 1.0.0 23 | */ 24 | 25 | 26 | public class MenuDto extends Menu { 27 | 28 | 29 | private static final long serialVersionUID = 1L; 30 | 31 | 32 | List

subMenu; 33 | 34 | 35 | public List getSubMenu() { 36 | return subMenu; 37 | } 38 | 39 | 40 | public void setSubMenu( List subMenu ) { 41 | this.subMenu = subMenu; 42 | } 43 | 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/BusinessInfoEnum.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.enums; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/12. 5 | */ 6 | public enum BusinessInfoEnum { 7 | 8 | 9 | OPEN_STORE(1, "open_store"), 10 | 11 | OPEN_SCAN(2, "open_scan"), 12 | 13 | OPEN_PAY(3, "open_pay"), 14 | 15 | OPEN_CARD(4, "open_card"), 16 | 17 | OPEN_SHAKE(5, "open_shake"); 18 | 19 | // 枚举值 20 | private final int key; 21 | 22 | // 枚举描述 23 | private final String desc; 24 | 25 | 26 | BusinessInfoEnum( final int key, final String desc ) { 27 | this.key = key; 28 | this.desc = desc; 29 | } 30 | 31 | 32 | public int key() { 33 | return key; 34 | } 35 | 36 | 37 | public String desc() { 38 | return desc; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/MediaMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import org.apache.ibatis.annotations.Param; 5 | import site.lovecode.wechat.common.mybatis.CommonMapper; 6 | import site.lovecode.wechat.dto.MediaDto; 7 | import site.lovecode.wechat.entity.Media; 8 | import site.lovecode.wechat.util.Page; 9 | 10 | import java.util.List; 11 | 12 | public interface MediaMapper extends CommonMapper { 13 | 14 | 15 | List selectJoinMediaNews( 16 | @Param("page") Page page, @Param("oaid") Long oaid, @Param("type") Integer type, 17 | @Param("mediaType") Integer mediaType); 18 | 19 | 20 | List selectByTypePage( 21 | @Param("page") Page page, @Param("oaid") Long oaid, @Param("type") Integer type); 22 | } 23 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/KeywordReplySettingReplyMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/BusinessInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/MenuMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import org.apache.ibatis.annotations.Param; 5 | import site.lovecode.wechat.common.mybatis.CommonMapper; 6 | import site.lovecode.wechat.dto.MenuDto; 7 | import site.lovecode.wechat.dto.MenuMediaDto; 8 | import site.lovecode.wechat.entity.Menu; 9 | 10 | public interface MenuMapper extends CommonMapper { 11 | 12 | 13 | /** 14 | * 查询一二级菜单列表 15 | * 16 | *

17 | * 18 | * 19 | * @param oaid 20 | * @return 21 | */ 22 | MenuDto selectMenuJoinSelf(@Param("oaid") Long oaid); 23 | 24 | 25 | /** 26 | * 27 | * 根据菜单id查询菜单设置 28 | *

29 | * 30 | * 31 | * @param menuId 32 | * @return 33 | */ 34 | MenuMediaDto selectJoinMedia(@Param("menuId") Long menuId); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/IndustryIdBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | /** 6 | * Created by Administrator on 2016/4/28. 7 | */ 8 | public class IndustryIdBean { 9 | 10 | @JSONField( name = "industry_id1" ) 11 | private Integer industry1; 12 | 13 | @JSONField( name = "industry_id2" ) 14 | private Integer industry2; 15 | 16 | 17 | public Integer getIndustry1() { 18 | return industry1; 19 | } 20 | 21 | 22 | public void setIndustry1( Integer industry1 ) { 23 | this.industry1 = industry1; 24 | } 25 | 26 | 27 | public Integer getIndustry2() { 28 | return industry2; 29 | } 30 | 31 | 32 | public void setIndustry2( Integer industry2 ) { 33 | this.industry2 = industry2; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/AuthorizationInfoTypeEnum.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.enums; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/12. 5 | */ 6 | public enum AuthorizationInfoTypeEnum { 7 | 8 | COMPONENT_VERIFY_TICKET(1, "component_verify_ticket"), 9 | 10 | UNAUTHORIZED(2, "unauthorized"), 11 | 12 | AUTHORIZED(3, "authorized"), 13 | 14 | UPDATEAUTHORIZED(4, "updateauthorized"); 15 | 16 | 17 | // 枚举值 18 | private final int key; 19 | 20 | // 枚举描述 21 | private final String desc; 22 | 23 | 24 | AuthorizationInfoTypeEnum( final int key, final String desc ) { 25 | this.key = key; 26 | this.desc = desc; 27 | } 28 | 29 | 30 | public int key() { 31 | return key; 32 | } 33 | 34 | 35 | public String desc() { 36 | return desc; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/TagsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/SystemUserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/MessageSendDayMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/ArticleHourBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ArticleHourBean.java site.lovecode.wechat.support.bean 3 | * Copyright (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.support.bean; 8 | 9 | 10 | import com.alibaba.fastjson.annotation.JSONField; 11 | import site.lovecode.wechat.entity.ArticleHour; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * 获取图文统计分时数据 18 | *

19 | * 20 | * 21 | * @author yangpeng 22 | * @date 2016年5月16日 23 | * @version 1.0.0 24 | */ 25 | public class ArticleHourBean { 26 | 27 | @JSONField( name = "list" ) 28 | private List list; 29 | 30 | 31 | public List getList() { 32 | return list; 33 | } 34 | 35 | 36 | public void setList( List list ) { 37 | this.list = list; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/ArticleDayBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ArticleDayBean.java site.lovecode.wechat.support.bean Copyright 3 | * (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.support.bean; 8 | 9 | 10 | import com.alibaba.fastjson.annotation.JSONField; 11 | import site.lovecode.wechat.entity.ArticleDay; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * TODO(这里用一句话描述这个类的作用) 18 | *

19 | * TODO(这里描述这个类补充说明 – 可选) 20 | * 21 | * @author Administrator 22 | * @date 2016年5月16日 23 | * @version 1.0.0 24 | */ 25 | public class ArticleDayBean { 26 | 27 | @JSONField( name = "list" ) 28 | private List list; 29 | 30 | 31 | public List getList() { 32 | return list; 33 | } 34 | 35 | 36 | public void setList( List list ) { 37 | this.list = list; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/UserInfoListResp.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | import java.io.Serializable; 6 | import java.util.List; 7 | 8 | /** 9 | * Created by Administrator on 2016/4/21. 10 | */ 11 | public class UserInfoListResp implements Serializable { 12 | 13 | /** 14 | * TODO(用一句话描述这个变量的含义) 15 | */ 16 | 17 | private static final long serialVersionUID = 1L; 18 | 19 | @JSONField( name = "user_info_list" ) 20 | private List list; 21 | 22 | 23 | public List getList() { 24 | return list; 25 | } 26 | 27 | 28 | public void setList( List list ) { 29 | this.list = list; 30 | } 31 | 32 | 33 | @Override 34 | public String toString() { 35 | return "UserInfoListResp{" + "list=" + list + '}'; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/MessageDistributionDayMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/KeywordReplySettingKeywordMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/MediaDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MediaDto.java site.lovecode.wechat.dto Copyright (c) 2016, 3 | *norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | 10 | import site.lovecode.wechat.entity.Media; 11 | import site.lovecode.wechat.entity.MediaNews; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * 素材信息数据载体 17 | *

18 | * 19 | * 20 | * @author yangpeng 21 | * @date 2016年5月18日 22 | * @version 1.0.0 23 | */ 24 | public class MediaDto extends Media { 25 | 26 | 27 | private static final long serialVersionUID = 1L; 28 | 29 | private List mediaNewsList; 30 | 31 | 32 | public List getMediaNewsList() { 33 | return mediaNewsList; 34 | } 35 | 36 | 37 | public void setMediaNewsList( List mediaNewsList ) { 38 | this.mediaNewsList = mediaNewsList; 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/OrgOfficialAccountMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 16 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/TempMessageMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/MessageSendHourMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/ArticleShareDayBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ArticleShareDayBean.java site.lovecode.wechat.support.bean 3 | * Copyright (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.support.bean; 8 | 9 | 10 | import com.alibaba.fastjson.annotation.JSONField; 11 | import site.lovecode.wechat.entity.ArticleShareDay; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * TODO(这里用一句话描述这个类的作用) 18 | *

19 | * TODO(这里描述这个类补充说明 – 可选) 20 | * 21 | * @author Administrator 22 | * @date 2016年5月16日 23 | * @version 1.0.0 24 | */ 25 | public class ArticleShareDayBean { 26 | 27 | @JSONField( name = "list" ) 28 | private List list; 29 | 30 | 31 | public List getList() { 32 | return list; 33 | } 34 | 35 | 36 | public void setList( List list ) { 37 | this.list = list; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/ArticleShareHourBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ArticleShareHourBean.java site.lovecode.wechat.support.bean 3 | * Copyright (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.support.bean; 8 | 9 | 10 | import com.alibaba.fastjson.annotation.JSONField; 11 | import site.lovecode.wechat.entity.ArticleShareHour; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * TODO(这里用一句话描述这个类的作用) 18 | *

19 | * TODO(这里描述这个类补充说明 – 可选) 20 | * 21 | * @author Administrator 22 | * @date 2016年5月16日 23 | * @version 1.0.0 24 | */ 25 | public class ArticleShareHourBean { 26 | 27 | @JSONField( name = "list" ) 28 | private List list; 29 | 30 | 31 | public List getList() { 32 | return list; 33 | } 34 | 35 | 36 | public void setList( List list ) { 37 | this.list = list; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/constant/WechatParameterConstant.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.constant; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/6. 5 | */ 6 | public class WechatParameterConstant { 7 | 8 | public static final String COMPONENT_APPID = "component_appid"; 9 | 10 | 11 | public static final String COMPONENT_APPSECRET = "component_appsecret"; 12 | 13 | 14 | public static final String COMPONENT_VERIFY_TICKET = "component_verify_ticket"; 15 | 16 | 17 | public static final String AUTHORIZATION_CODE = "authorization_code"; 18 | 19 | 20 | public static final String AUTHORIZER_APPID = "authorizer_appid"; 21 | 22 | 23 | public static final String AUTHORIZER_REFRESH_TOKEN = "authorizer_refresh_token"; 24 | 25 | 26 | public static final String OPTION_NAME = "option_name"; 27 | 28 | 29 | public static final String OPTION_VALUE = "option_value"; 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/IWechatService.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.service; 2 | 3 | 4 | import site.lovecode.wechat.dto.OfficialAccountDto; 5 | import site.lovecode.wechat.support.config.WechatConfig; 6 | 7 | /** 8 | * Created by Administrator on 2016/4/13. 9 | */ 10 | public interface IWechatService { 11 | 12 | 13 | /** 14 | * 生成消息处理器 15 | *

16 | * 17 | * 18 | * @param oaid 公众号id 19 | * @param userName 公众号原始id 20 | */ 21 | void generateMessageRouter(Long oaid, String userName); 22 | 23 | 24 | /** 25 | * 26 | * 获取公众号配置信息 27 | *

28 | * 29 | * 30 | * @param vo 31 | * @return 32 | */ 33 | WechatConfig getWechatConfig(OfficialAccountDto vo); 34 | 35 | 36 | /** 37 | * 38 | * 添加公众号配置到redis中 39 | *

40 | * 41 | * 42 | * @param officialAccountId 43 | */ 44 | public void addWechatConfigInRedis(Long officialAccountId); 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/VerifyTypeInfoOfEnum.java: -------------------------------------------------------------------------------- 1 | /** 2 | * VerifyTypeInfoOfEnum.java site.lovecode.wechat.support.enums 3 | * Copyright (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.support.enums; 8 | 9 | 10 | /** 11 | * TODO(这里用一句话描述这个类的作用) 12 | *

13 | * TODO(这里描述这个类补充说明 – 可选) 14 | * 15 | * @author Administrator 16 | * @date 2016年5月14日 17 | * @version 1.0.0 18 | */ 19 | public enum VerifyTypeInfoOfEnum { 20 | 21 | 22 | unverify(-1, "unverify"), 23 | 24 | verify(0, "verify"); 25 | 26 | 27 | // 枚举值 28 | private final int key; 29 | 30 | // 枚举描述 31 | private final String desc; 32 | 33 | 34 | VerifyTypeInfoOfEnum( final int key, final String desc ) { 35 | this.key = key; 36 | this.desc = desc; 37 | } 38 | 39 | 40 | public int key() { 41 | return key; 42 | } 43 | 44 | 45 | public String desc() { 46 | return desc; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/ArticleShareDayMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/webapp/stylesheets/typeahead.css: -------------------------------------------------------------------------------- 1 | 2 | .typeahead, 3 | .tt-query, 4 | .tt-hint { 5 | width: 400px; 6 | height: 34px; 7 | font-size: 16px; 8 | outline: none; 9 | } 10 | 11 | .tt-query { 12 | padding: 0px 0 0 12px; 13 | } 14 | 15 | .tt-hint { 16 | color: #999; 17 | padding: 0px 0 0 11px; 18 | } 19 | 20 | .tt-dropdown-menu { 21 | width: 422px; 22 | margin-top: 4px; 23 | padding: 6px 0; 24 | box-shadow: 0 1px 2px rgba(0,0,0,.2); 25 | background: #FFF; 26 | background: rgba(255,255,255,.98); 27 | border: 1px solid #DDD; 28 | border-radius: 4px; 29 | z-index: 1000 !important; 30 | } 31 | 32 | .tt-suggestion { 33 | padding: 3px 15px; 34 | font-size: 16px; 35 | line-height: 24px; 36 | } 37 | 38 | .tt-suggestion.tt-is-under-cursor { 39 | color: #fff; 40 | background-color: #007aff; 41 | } 42 | 43 | .tt-suggestion p { 44 | margin: 0; 45 | } 46 | 47 | .gist { 48 | font-size: 14px; 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/KeywordReplySettingReplyDto.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.dto; 2 | 3 | 4 | import site.lovecode.wechat.entity.KeywordReplySettingNew; 5 | import site.lovecode.wechat.entity.KeywordReplySettingReply; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Administrator on 2016/4/26. 11 | */ 12 | public class KeywordReplySettingReplyDto extends KeywordReplySettingReply { 13 | 14 | /** 15 | * TODO(用一句话描述这个变量的含义) 16 | */ 17 | 18 | private static final long serialVersionUID = 1L; 19 | 20 | private List keywordReplySettingNewList; 21 | 22 | 23 | public List getKeywordReplySettingNewList() { 24 | return keywordReplySettingNewList; 25 | } 26 | 27 | 28 | public void setKeywordReplySettingNewList( List keywordReplySettingNewList ) { 29 | this.keywordReplySettingNewList = keywordReplySettingNewList; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/OfficialAccountMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import org.apache.ibatis.annotations.Param; 5 | import site.lovecode.wechat.common.mybatis.CommonMapper; 6 | import site.lovecode.wechat.dto.OfficialAccountAuthorizerInfoDto; 7 | import site.lovecode.wechat.dto.OfficialAccountDto; 8 | import site.lovecode.wechat.entity.OfficialAccount; 9 | 10 | import java.util.List; 11 | 12 | public interface OfficialAccountMapper extends CommonMapper { 13 | 14 | 15 | List selectJoinAuthorizerAccessToken(@Param("id") Long id); 16 | 17 | 18 | List selectJoinInfoAndAccessToken(); 19 | 20 | 21 | List selectJoinAuthorizerInfo( 22 | @Param("accountType") Integer accountType, @Param("verifyTypeInfo") Integer verifyTypeInfo, 23 | @Param("authorizationStatus") Integer authorizationStatus); 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/OfficialAccountAuthorizerInfoDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * OfficialAccountAuthorizerInfoDto.java 3 | * site.lovecode.wechat.dto Copyright (c) 2016, 4 | *norman. 5 | */ 6 | 7 | 8 | package site.lovecode.wechat.dto; 9 | 10 | 11 | import site.lovecode.wechat.entity.AuthorizerInfo; 12 | import site.lovecode.wechat.entity.OfficialAccount; 13 | 14 | /** 15 | * 微信公众账号基本信息表 16 | *

17 | * 18 | * @author Administrator 19 | * @date 2016年5月14日 20 | * @version 1.0.0 21 | */ 22 | public class OfficialAccountAuthorizerInfoDto extends OfficialAccount { 23 | 24 | 25 | private static final long serialVersionUID = 1L; 26 | 27 | 28 | private AuthorizerInfo authorizerInfo; 29 | 30 | 31 | public AuthorizerInfo getAuthorizerInfo() { 32 | return authorizerInfo; 33 | } 34 | 35 | 36 | public void setAuthorizerInfo( AuthorizerInfo authorizerInfo ) { 37 | this.authorizerInfo = authorizerInfo; 38 | } 39 | 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/PersonalUserDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PersonalUserDto.java site.lovecode.wechat.dto Copyright 3 | * (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | 10 | import site.lovecode.wechat.entity.PersonalUser; 11 | import site.lovecode.wechat.entity.PersonalUserTags; 12 | 13 | import java.util.List; 14 | 15 | /** 16 | * 微信粉丝数据体 17 | *

18 | * 19 | * 20 | * @author yangpeng 21 | * @date 2016年5月10日 22 | * @version 1.0.0 23 | */ 24 | public class PersonalUserDto extends PersonalUser { 25 | 26 | /** 27 | * TODO(用一句话描述这个变量的含义) 28 | */ 29 | 30 | private static final long serialVersionUID = 1L; 31 | 32 | 33 | private List tagsList; 34 | 35 | 36 | public List getTagsList() { 37 | return tagsList; 38 | } 39 | 40 | 41 | public void setTagsList( List tagsList ) { 42 | this.tagsList = tagsList; 43 | } 44 | 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/ArticleSummaryBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ArticleSummaryBean.java site.lovecode.wechat.support.bean 3 | * Copyright (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.support.bean; 8 | 9 | 10 | import com.alibaba.fastjson.annotation.JSONField; 11 | import site.lovecode.wechat.entity.ArticleSummary; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * 图文群发数据 18 | *

19 | * 20 | * 21 | * @author Administrator 22 | * @date 2016年5月16日 23 | * @version 1.0.0 24 | */ 25 | public class ArticleSummaryBean { 26 | 27 | 28 | @JSONField( name = "list" ) 29 | private List articleSummaryList; 30 | 31 | 32 | public List getArticleSummaryList() { 33 | return articleSummaryList; 34 | } 35 | 36 | 37 | public void setArticleSummaryList( List articleSummaryList ) { 38 | this.articleSummaryList = articleSummaryList; 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/MenuOfTypeEnum.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MenuOfTypeEnum.java site.lovecode.wechat.support.enums 3 | * Copyright (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.support.enums; 8 | 9 | 10 | /** 11 | * 12 | *

13 | * 14 | * 15 | * @author yangpeng 16 | * @date 2016年5月24日 17 | * @version 1.0.0 18 | */ 19 | 20 | 21 | public enum MenuOfTypeEnum { 22 | 23 | 24 | text(1, "text"), 25 | 26 | img(2, "img"), 27 | 28 | voice(3, "voice"), 29 | 30 | video(4, "video"), 31 | 32 | news(5, "news"), 33 | 34 | view(6, "view"); 35 | 36 | 37 | // 枚举值 38 | private final int key; 39 | 40 | // 枚举描述 41 | private final String desc; 42 | 43 | 44 | MenuOfTypeEnum( final int key, final String desc ) { 45 | this.key = key; 46 | this.desc = desc; 47 | } 48 | 49 | 50 | public int key() { 51 | return key; 52 | } 53 | 54 | 55 | public String desc() { 56 | return desc; 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/ComponentAccessTokenMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/UserListReq.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | import java.util.List; 6 | import java.util.stream.Collectors; 7 | 8 | /** 9 | * Created by Administrator on 2016/4/21. 10 | */ 11 | public class UserListReq { 12 | 13 | @JSONField( name = "user_list" ) 14 | private List userOpenidReqList; 15 | 16 | 17 | public List getUserOpenidReqList() { 18 | return userOpenidReqList; 19 | } 20 | 21 | 22 | public void setUserOpenidReqList( List userOpenidReqList ) { 23 | this.userOpenidReqList = userOpenidReqList; 24 | } 25 | 26 | 27 | public void setUserOpenidList( List openidList ) { 28 | this.userOpenidReqList = openidList.stream().map(s -> new UserOpenidReq() { 29 | 30 | { 31 | setOpenid(s); 32 | setLang("zh-CN"); 33 | } 34 | }).collect(Collectors.toList()); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/FuncInfoStatusEnum.java: -------------------------------------------------------------------------------- 1 | /** 2 | * FuncInfoStatusEnum.java site.lovecode.wechat.support.enums 3 | * Copyright (c) 2016,norman. 4 | */ 5 | /** 6 | * FuncInfoStatusEnum.java site.lovecode.wechat.support.enums 7 | * Copyright (c) 2016,norman. 8 | */ 9 | 10 | 11 | package site.lovecode.wechat.support.enums; 12 | 13 | 14 | /** 15 | * 权限状态枚举值 16 | *

17 | * 18 | * 19 | * @author yangpegn 20 | * @date 2016年5月7日 21 | * @version 1.0.0 22 | */ 23 | public enum FuncInfoStatusEnum { 24 | 25 | 26 | close(0, "close"), 27 | 28 | open(1, "open"); 29 | 30 | // 枚举值 31 | private final int key; 32 | 33 | // 枚举描述 34 | private final String desc; 35 | 36 | 37 | FuncInfoStatusEnum( final int key, final String desc ) { 38 | this.key = key; 39 | this.desc = desc; 40 | } 41 | 42 | 43 | public int key() { 44 | return key; 45 | } 46 | 47 | 48 | public String desc() { 49 | return desc; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/IndustryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/IMenuService.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.service; 2 | 3 | 4 | import me.chanjar.weixin.common.exception.WxErrorException; 5 | import site.lovecode.wechat.dto.MenuDto; 6 | import site.lovecode.wechat.dto.MenuMediaDto; 7 | import site.lovecode.wechat.dto.MenuReqDto; 8 | 9 | /** 10 | * Created by Administrator on 2016/4/19. 11 | */ 12 | public interface IMenuService { 13 | 14 | 15 | /** 16 | * 17 | * 创建自定义菜单 18 | *

19 | * 20 | * 21 | * @param menuReqDto 菜单列表 22 | * @param orgId 23 | */ 24 | void createMenu(MenuReqDto menuReqDto, Long orgId) throws WxErrorException; 25 | 26 | 27 | /** 28 | * 29 | * 根据机构id获取菜单列表 30 | *

31 | * 32 | * 33 | * @param orgId 34 | * @return 35 | */ 36 | MenuDto getMenu(Long orgId); 37 | 38 | 39 | /** 40 | * 41 | * 根据菜单id获取菜单信息 42 | *

43 | * 44 | * 45 | * @param menuId 46 | * @return 47 | */ 48 | MenuMediaDto getMenuOne(Long menuId); 49 | 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/PreAuthCodeBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | /** 6 | * Created by Administrator on 2016/4/5. 7 | */ 8 | public class PreAuthCodeBean { 9 | 10 | @JSONField( name = "pre_auth_code" ) 11 | private String preAuthCode; 12 | 13 | @JSONField( name = "expires_in" ) 14 | private String expiresIn; 15 | 16 | 17 | public String getPreAuthCode() { 18 | return preAuthCode; 19 | } 20 | 21 | 22 | public void setPreAuthCode( String preAuthCode ) { 23 | this.preAuthCode = preAuthCode; 24 | } 25 | 26 | 27 | public String getExpiresIn() { 28 | return expiresIn; 29 | } 30 | 31 | 32 | public void setExpiresIn( String expiresIn ) { 33 | this.expiresIn = expiresIn; 34 | } 35 | 36 | 37 | @Override 38 | public String toString() { 39 | return "PreAuthCodeBean{" + "preAuthCode='" + preAuthCode + '\'' + ", expiresIn='" + expiresIn + '\'' + '}'; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/ArticleShareHourMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/FuncInfoDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * FuncInfoDto.java site.lovecode.wechat.dto Copyright (c) 3 | * 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | 10 | import site.lovecode.wechat.entity.FuncInfo; 11 | 12 | /** 13 | * 微信授权方公众号权限 14 | *

15 | * 16 | * 17 | * @author yangpeng 18 | * @date 2016年5月7日 19 | * @version 1.0.0 20 | */ 21 | public class FuncInfoDto extends FuncInfo { 22 | 23 | /** 24 | * TODO(用一句话描述这个变量的含义) 25 | */ 26 | 27 | private static final long serialVersionUID = 1L; 28 | 29 | 30 | private String funcDesc; 31 | 32 | 33 | private Integer status; 34 | 35 | 36 | public String getFuncDesc() { 37 | return funcDesc; 38 | } 39 | 40 | 41 | public void setFuncDesc( String funcDesc ) { 42 | this.funcDesc = funcDesc; 43 | } 44 | 45 | 46 | public Integer getStatus() { 47 | return status; 48 | } 49 | 50 | 51 | public void setStatus( Integer status ) { 52 | this.status = status; 53 | } 54 | 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/IReplySettingService.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.service; 2 | 3 | import me.chanjar.weixin.common.exception.WxErrorException; 4 | 5 | /** 6 | * Created by Administrator on 2016/4/22. 7 | */ 8 | public interface IReplySettingService { 9 | 10 | /** 11 | * 12 | * 获取自动回复设置 13 | *

14 | * 15 | * 16 | * @param oaid 17 | * @throws WxErrorException 18 | */ 19 | void getAutoReplySetting(Long oaid) throws WxErrorException; 20 | 21 | 22 | /** 23 | * 24 | * 设置被添加自动回复 25 | *

26 | * 27 | * 28 | * @param oaid 29 | * @param type 30 | * @param content TODO(这里描述每个参数,如果有返回值描述返回值,如果有异常描述异常) 31 | */ 32 | void setAddFriendReplySetting(Long oaid, Integer type, String content); 33 | 34 | 35 | /** 36 | * 37 | * 设置消息自动回复 38 | *

39 | * 40 | * 41 | * @param oaid 42 | * @param type 43 | * @param content TODO(这里描述每个参数,如果有返回值描述返回值,如果有异常描述异常) 44 | */ 45 | void setAutoReplySetting(Long oaid, Integer type, String content); 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/TagBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * TagBean.java site.lovecode.wechat.support.bean Copyright (c) 3 | * 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.support.bean; 8 | 9 | 10 | /** 11 | * 标签bean 12 | *

13 | * 14 | * @author yangpeng 15 | * @date 2016年5月10日 16 | * @version 1.0.0 17 | */ 18 | public class TagBean { 19 | 20 | 21 | private Tag tag; 22 | 23 | 24 | public Tag getTag() { 25 | return tag; 26 | } 27 | 28 | 29 | public void setTag( Tag tag ) { 30 | this.tag = tag; 31 | } 32 | 33 | 34 | public static class Tag { 35 | 36 | private String name; 37 | 38 | private Integer id; 39 | 40 | 41 | public String getName() { 42 | return name; 43 | } 44 | 45 | 46 | public void setName( String name ) { 47 | this.name = name; 48 | } 49 | 50 | 51 | public Integer getId() { 52 | return id; 53 | } 54 | 55 | 56 | public void setId( Integer id ) { 57 | this.id = id; 58 | } 59 | 60 | 61 | } 62 | 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/InterfaceSummaryMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/ArticleTotalBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ArticleTotalBean.java site.lovecode.wechat.support.bean 3 | * Copyright (c) 2016,norman. 4 | */ 5 | /** 6 | * ArticleTotalBean.java site.lovecode.wechat.support.bean 7 | * Copyright (c) 2016,norman. 8 | */ 9 | 10 | 11 | package site.lovecode.wechat.support.bean; 12 | 13 | import com.alibaba.fastjson.annotation.JSONField; 14 | 15 | import java.util.List; 16 | 17 | 18 | /** 19 | * 图文群发总数据 20 | *

21 | * TODO(这里描述这个类补充说明 – 可选) 22 | * 23 | * @author yangpeng 24 | * @date 2016年5月16日 25 | * @version 1.0.0 26 | */ 27 | public class ArticleTotalBean { 28 | 29 | @JSONField( name = "list" ) 30 | private List articleTotalList; 31 | 32 | 33 | public List getArticleTotalList() { 34 | return articleTotalList; 35 | } 36 | 37 | 38 | public void setArticleTotalList( List articleTotalList ) { 39 | this.articleTotalList = articleTotalList; 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/impl/ErrorCodeServiceImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ErrorCodeServiceImpl.java site.lovecode.wechat.service.impl 3 | * Copyright (c) 2016, norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.service.impl; 8 | 9 | 10 | import org.springframework.stereotype.Service; 11 | import site.lovecode.wechat.entity.ErrorCode; 12 | import site.lovecode.wechat.mapper.ErrorCodeMapper; 13 | import site.lovecode.wechat.service.IErrorCodeService; 14 | import site.lovecode.wechat.util.Page; 15 | 16 | import javax.annotation.Resource; 17 | 18 | 19 | /** 20 | * 21 | *

22 | * 23 | * 24 | * @author yangpeng 25 | * @date 2016年5月5日 26 | * @version 1.0.0 27 | */ 28 | @Service 29 | public class ErrorCodeServiceImpl implements IErrorCodeService { 30 | 31 | 32 | @Resource 33 | private ErrorCodeMapper errorCodeMapper; 34 | 35 | 36 | @Override 37 | public Page getErrorCodePage(Page page ) { 38 | //errorCodeMapper.selectPage(page); 39 | return page; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/TempMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/ReplySettingMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/IArticleTotalService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * IArticleTotalService.java site.lovecode.wechat.service 3 | * Copyright (c) 2016, norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.service; 8 | 9 | 10 | import site.lovecode.wechat.dto.ArticleTotalDto; 11 | import site.lovecode.wechat.util.Page; 12 | 13 | import java.sql.Date; 14 | 15 | 16 | /** 17 | * 图文分析接口 18 | *

19 | * 20 | * 21 | * @author yangpeng 22 | * @date 2016年5月21日 23 | * @version 1.0.0 24 | */ 25 | 26 | 27 | public interface IArticleTotalService { 28 | 29 | 30 | /** 31 | * 32 | * 分页获取文章分页 33 | *

34 | * 35 | * 36 | * @param page 分页 37 | * @param orgId 机构id 38 | * @return 39 | */ 40 | Page getArticleOne(Page page, Long orgId, Date beigiDate, Date endDate); 41 | 42 | 43 | /** 44 | * 获取单篇文章的详情信息 45 | * @param beigiDate 46 | * @param endDate 47 | * @return 48 | */ 49 | ArticleTotalDto getArticleOneDetail(Long articleTotalId, Date beigiDate, Date endDate); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/PersonalUserTagReqDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PersonalUserTagReqDto.java site.lovecode.wechat.dto 3 | * Copyright (c) 2016,norman. 4 | */ 5 | /** 6 | * PersonalUserTagReqDto.java site.lovecode.wechat.dto 7 | * Copyright (c) 2016,norman. 8 | */ 9 | 10 | 11 | package site.lovecode.wechat.dto; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * 18 | *

19 | * TODO(这里描述这个类补充说明 – 可选) 20 | * 21 | * @author yangpeng 22 | * @date 2016年5月12日 23 | * @version 1.0.0 24 | */ 25 | public class PersonalUserTagReqDto { 26 | 27 | private Long personalUserId; 28 | 29 | private List tagIdList; 30 | 31 | 32 | public Long getPersonalUserId() { 33 | return personalUserId; 34 | } 35 | 36 | 37 | public void setPersonalUserId( Long personalUserId ) { 38 | this.personalUserId = personalUserId; 39 | } 40 | 41 | 42 | public List getTagIdList() { 43 | return tagIdList; 44 | } 45 | 46 | 47 | public void setTagIdList( List tagIdList ) { 48 | this.tagIdList = tagIdList; 49 | } 50 | 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/module/IOfficialAccountModule.java: -------------------------------------------------------------------------------- 1 | /** 2 | * IOfficialAccountModule.java cn.vko.peixun.core.module.communication Copyright 3 | * (c) 2016, . 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.module; 8 | 9 | 10 | import site.lovecode.wechat.dto.OfficialAccountReqDto; 11 | import site.lovecode.wechat.entity.OfficialAccount; 12 | import site.lovecode.wechat.support.common.Response; 13 | 14 | import java.util.List; 15 | 16 | /** 17 | * 微信公众号基本信息业务接口 18 | *

19 | * 20 | * @author yangpeng 21 | * @date 2016年5月9日 22 | * @version 1.0.0 23 | */ 24 | public interface IOfficialAccountModule { 25 | 26 | 27 | /** 28 | * 29 | * 保存手动绑定的公众号信息 30 | *

31 | * 32 | * 33 | * @param officialAccountReqDto 公众号信息 34 | */ 35 | public void saveOfficialAccountInfo(OfficialAccountReqDto officialAccountReqDto); 36 | 37 | 38 | /** 39 | * 40 | * 获取所有公众号列表 41 | *

42 | * 43 | * 44 | * @return TODO(这里描述每个参数,如果有返回值描述返回值,如果有异常描述异常) 45 | */ 46 | public Response> getOfficialAccount(); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/MenuOfLevelEnum.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MenuOfLevelEnum.java site.lovecode.wechat.support.enums 3 | * Copyright (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.support.enums; 8 | 9 | 10 | /** 11 | * 12 | *

13 | * 14 | * 15 | * @author yangpeng 16 | * @date 2016年5月24日 17 | * @version 1.0.0 18 | */ 19 | 20 | 21 | public enum MenuOfLevelEnum { 22 | 23 | 24 | one(1, "one"), 25 | 26 | 27 | two(2, "two"); 28 | 29 | 30 | // 枚举值 31 | private final int key; 32 | 33 | // 枚举描述 34 | private final String desc; 35 | 36 | 37 | MenuOfLevelEnum( final int key, final String desc ) { 38 | this.key = key; 39 | this.desc = desc; 40 | } 41 | 42 | 43 | public static Boolean getBoolean( Integer key ) { 44 | if ( key.equals(0) ) { 45 | return false; 46 | } else if ( key.equals(1) ) { 47 | return true; 48 | } else { 49 | return null; 50 | } 51 | } 52 | 53 | 54 | public int key() { 55 | return key; 56 | } 57 | 58 | 59 | public String desc() { 60 | return desc; 61 | } 62 | 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/InterfaceSummaryHourMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/ArticleTotalMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import org.apache.ibatis.annotations.Param; 5 | import site.lovecode.wechat.common.mybatis.CommonMapper; 6 | import site.lovecode.wechat.dto.ArticleTotalDto; 7 | import site.lovecode.wechat.entity.ArticleTotal; 8 | import site.lovecode.wechat.util.Page; 9 | 10 | import java.sql.Date; 11 | import java.util.List; 12 | 13 | public interface ArticleTotalMapper extends CommonMapper { 14 | 15 | 16 | /** 17 | * 18 | * @param beginDate 19 | * @param endDate 20 | * @return 21 | */ 22 | ArticleTotalDto selectJoinDetailAndSummary(@Param("articleTotalId") Long articleTotalId, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate); 23 | 24 | /** 25 | * 26 | * @param page 27 | * @param oaid 28 | * @param beginDate 29 | * @param endDate 30 | * @return 31 | */ 32 | List selectJoinDetail(@Param("page") Page page, @Param("oaid") Long oaid, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/EventMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/ComponentAccessTokenBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | /** 6 | * Created by Administrator on 2016/4/1. 7 | */ 8 | public class ComponentAccessTokenBean { 9 | 10 | @JSONField( name = "component_access_token" ) 11 | private String componentAccessToken; 12 | 13 | @JSONField( name = "expires_in" ) 14 | private Integer expiresIn; 15 | 16 | 17 | public String getComponentAccessToken() { 18 | return componentAccessToken; 19 | } 20 | 21 | 22 | public void setComponentAccessToken( String componentAccessToken ) { 23 | this.componentAccessToken = componentAccessToken; 24 | } 25 | 26 | 27 | public Integer getExpiresIn() { 28 | return expiresIn; 29 | } 30 | 31 | 32 | public void setExpiresIn( Integer expiresIn ) { 33 | this.expiresIn = expiresIn; 34 | } 35 | 36 | 37 | @Override 38 | public String toString() { 39 | return "ComponentAccessTokenBean{" 40 | + "componentAccessToken='" + componentAccessToken + '\'' + ", expiresIn='" + expiresIn + '\'' + '}'; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/ArticleSummaryDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ArticleSummaryDto.java site.lovecode.wechat.dto Copyright 3 | * (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | 10 | import site.lovecode.wechat.entity.ArticleSummary; 11 | import site.lovecode.wechat.util.Page; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * 18 | *

19 | * 20 | * 21 | * @author yangpeng 22 | * @date 2016年5月24日 23 | * @version 1.0.0 24 | */ 25 | 26 | 27 | public class ArticleSummaryDto extends ArticleSummary { 28 | 29 | /** 30 | * TODO(用一句话描述这个变量的含义) 31 | */ 32 | 33 | private static final long serialVersionUID = 1L; 34 | 35 | 36 | private List list; 37 | 38 | 39 | private Page page; 40 | 41 | 42 | public List getList() { 43 | return list; 44 | } 45 | 46 | public void setList(List list) { 47 | this.list = list; 48 | } 49 | 50 | public Page getPage() { 51 | return page; 52 | } 53 | 54 | public void setPage(Page page) { 55 | this.page = page; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/singleton/MessageRouterSingleton.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.singleton; 2 | 3 | import me.chanjar.weixin.mp.api.WxMpMessageRouter; 4 | 5 | import java.util.Map; 6 | import java.util.concurrent.ConcurrentHashMap; 7 | 8 | /** 9 | * Created by Administrator on 2016/4/27. 10 | */ 11 | public class MessageRouterSingleton { 12 | 13 | private static MessageRouterSingleton messageRouterSingleton = new MessageRouterSingleton(); 14 | 15 | 16 | private MessageRouterSingleton() { 17 | this.wxMpMessageRouterMap = new ConcurrentHashMap<>(); 18 | } 19 | 20 | 21 | public static MessageRouterSingleton getInstance() { 22 | return messageRouterSingleton; 23 | } 24 | 25 | private final Map wxMpMessageRouterMap; 26 | 27 | 28 | public WxMpMessageRouter getWxMpMessageRouter( String userName ) { 29 | return this.wxMpMessageRouterMap.get(userName); 30 | } 31 | 32 | 33 | public void putWxMpMessageRouter( String userName, WxMpMessageRouter wxMpMessageRouter ) { 34 | wxMpMessageRouterMap.put(userName, wxMpMessageRouter); 35 | } 36 | 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/PersonalUserTagBatchReqDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PersonalUserTagBatchReqDto.java site.lovecode.wechat.dto 3 | * Copyright (c) 2016,norman. 4 | */ 5 | /** 6 | * PersonalUserTagBatchReqDto.java site.lovecode.wechat.dto 7 | * Copyright (c) 2016,norman. 8 | */ 9 | 10 | 11 | package site.lovecode.wechat.dto; 12 | 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * 18 | *

19 | * 20 | * 21 | * @author Administrator 22 | * @date 2016年5月13日 23 | * @version 1.0.0 24 | */ 25 | public class PersonalUserTagBatchReqDto { 26 | 27 | 28 | private List tagIdList; 29 | 30 | 31 | private List personalUserIdList; 32 | 33 | 34 | public List getTagIdList() { 35 | return tagIdList; 36 | } 37 | 38 | 39 | public void setTagIdList( List tagIdList ) { 40 | this.tagIdList = tagIdList; 41 | } 42 | 43 | 44 | public List getPersonalUserIdList() { 45 | return personalUserIdList; 46 | } 47 | 48 | 49 | public void setPersonalUserIdList( List personalUserIdList ) { 50 | this.personalUserIdList = personalUserIdList; 51 | } 52 | 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/MediaShowCoverPicOfEnum.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MediaShowCoverPicOfEnum.java site.lovecode.wechat.support.enums 3 | * Copyright (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.support.enums; 8 | 9 | 10 | /** 11 | * 媒体封面枚举 12 | *

13 | * TODO(这里描述这个类补充说明 – 可选) 14 | * 15 | * @author yangpeng 16 | * @date 2016年5月19日 17 | * @version 1.0.0 18 | */ 19 | public enum MediaShowCoverPicOfEnum { 20 | 21 | 22 | display(0, "display"), 23 | 24 | 25 | show(1, "show"); 26 | 27 | 28 | // 枚举值 29 | private final int key; 30 | 31 | // 枚举描述 32 | private final String desc; 33 | 34 | 35 | MediaShowCoverPicOfEnum( final int key, final String desc ) { 36 | this.key = key; 37 | this.desc = desc; 38 | } 39 | 40 | 41 | public static Boolean getBoolean( Integer key ) { 42 | if ( key.equals(0) ) { 43 | return false; 44 | } else if ( key.equals(1) ) { 45 | return true; 46 | } else { 47 | return null; 48 | } 49 | } 50 | 51 | 52 | public int key() { 53 | return key; 54 | } 55 | 56 | 57 | public String desc() { 58 | return desc; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/CustomServiceMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/module/impl/ErrorCodeModuleImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ErrorCodeModule.java cn.vko.peixun.module.communication.module Copyright (c) 3 | * 2016, . 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.module.impl; 8 | 9 | 10 | import org.springframework.stereotype.Service; 11 | import site.lovecode.wechat.entity.ErrorCode; 12 | import site.lovecode.wechat.module.IErrorCodeModule; 13 | import site.lovecode.wechat.service.IErrorCodeService; 14 | import site.lovecode.wechat.support.common.Response; 15 | import site.lovecode.wechat.util.Page; 16 | 17 | import javax.annotation.Resource; 18 | 19 | 20 | /** 21 | * 示例代码 22 | *

23 | 24 | * 25 | * @author Administrator 26 | * @date 2016年5月5日 27 | * @version 1.0.0 28 | */ 29 | @Service 30 | public class ErrorCodeModuleImpl extends AbstractModule implements IErrorCodeModule { 31 | 32 | 33 | @Resource( name = "errorCodeServiceImpl" ) 34 | private IErrorCodeService errorCodeServiceImpl; 35 | 36 | 37 | @Override 38 | public Response> getErrorCodePage(Page page ) { 39 | return success(errorCodeServiceImpl.getErrorCodePage(page)); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/OfficialAccountInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/ComponentVerifyTicketMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 18 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/OfficialAccountAccessTokenMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | update WX_OFFICIAL_ACCOUNT_ACCESS_TOKEN set accessToken = #{accessToken},expiresIn = #{expiresIn} where officialAccountId = #{officialAccountId} 18 | 19 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/KeywordReplySettingNewMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/common/ResponseHead.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ResponseHead.java cn.vko.core.common.response Copyright (c) 2014, 3 | * . 4 | */ 5 | 6 | package site.lovecode.wechat.support.common; 7 | 8 | import java.io.Serializable; 9 | 10 | 11 | /** 12 | * 所有应答的应答头部信息 13 | *

14 | * 15 | * @author malei 16 | * @date 2014-11-18 17 | * @version 1.0.0 18 | */ 19 | public class ResponseHead implements Serializable { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | // 应答码 24 | private String statusCode; 25 | 26 | // 文字描述 27 | private String desc; 28 | 29 | 30 | // 默认构造器 31 | public ResponseHead() { 32 | } 33 | 34 | 35 | // 用于构造数据结构的构造器 36 | public ResponseHead(String statusCode, String desc ) { 37 | this.statusCode = statusCode; 38 | this.desc = desc; 39 | } 40 | 41 | 42 | public String getStatusCode() { 43 | return statusCode; 44 | } 45 | 46 | 47 | public void setStatusCode( String statusCode ) { 48 | this.statusCode = statusCode; 49 | } 50 | 51 | 52 | public String getDesc() { 53 | return desc; 54 | } 55 | 56 | 57 | public void setDesc( String desc ) { 58 | this.desc = desc; 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/common/CodeConstants.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Code.java cn.vko.core.common.code Copyright (c) 2014, . 3 | */ 4 | 5 | package site.lovecode.wechat.support.common; 6 | 7 | 8 | /** 9 | * 这里定义所有的返回异常的代码 10 | * 11 | * @author malei 12 | * @date 2015-11-22 13 | * @version 1.0.0 14 | */ 15 | public class CodeConstants { 16 | 17 | // 正确返回数据时的应答码 18 | public static String SUCCESS = "000000"; 19 | 20 | // 异常时返回的应答码 21 | public static String EXCEPTION = "000001"; 22 | 23 | // 参数校验未通过时的应答码 24 | public static String PARAM_ERROR = "000002"; 25 | 26 | // 校验登陆信息异常时的应答码 27 | public static String AUTH_ERROR = "000003"; 28 | 29 | // 无权限访问时的应答码 30 | public static String NO_PERMISSION = "000004"; 31 | 32 | // TOKEN失效时返回应答码 33 | public static String TOKEN_INVALID = "000005"; 34 | 35 | 36 | // 参数校验未通过文本描述 37 | public static String PARAM_ERROR_DESC = "参数校验未通过,请检查."; 38 | 39 | // 无权访问的文本描述 40 | public static String NO_PERMISSION_DESC = "您未获访问此链接的权限,请联系管理员."; 41 | 42 | // module层发生异常的描述信息 43 | public static String EXCEPTION_MODULE_DESC = "module层发生异常,请联系接口开发人员."; 44 | 45 | // WEB层发生异常的描述信息 46 | public static String EXCEPTION_WEB_DESC = "系统忙,请稍后再试."; 47 | 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/TagsDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * TagsDto.java site.lovecode.wechat.dto Copyright (c) 2016, 3 | *norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | 10 | import site.lovecode.wechat.entity.Tags; 11 | 12 | import java.io.Serializable; 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * 用户标签数据载体 18 | *

19 | * 20 | * 21 | * @author yangpeng 22 | * @date 2016年5月11日 23 | * @version 1.0.0 24 | */ 25 | public class TagsDto implements Serializable { 26 | 27 | 28 | private static final long serialVersionUID = 1L; 29 | 30 | 31 | private Integer userCount; 32 | 33 | 34 | private List tagsList; 35 | 36 | 37 | public Integer getUserCount() { 38 | return userCount; 39 | } 40 | 41 | 42 | public void setUserCount( Integer userCount ) { 43 | this.userCount = userCount; 44 | } 45 | 46 | 47 | public List getTagsList() { 48 | return tagsList; 49 | } 50 | 51 | 52 | public void setTagsList( List tagsList ) { 53 | this.tagsList = tagsList; 54 | } 55 | 56 | 57 | @Override 58 | public String toString() { 59 | return "TagsDto [userCount=" + userCount + ", tagsList=" + tagsList + "]"; 60 | } 61 | 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/common/mybatis/BatchMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.common.mybatis; 2 | 3 | 4 | import org.apache.ibatis.annotations.DeleteProvider; 5 | import org.apache.ibatis.annotations.InsertProvider; 6 | import org.apache.ibatis.annotations.UpdateProvider; 7 | import site.lovecode.wechat.annotation.Batch; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * Created by Administrator on 2016/4/12. 13 | */ 14 | public interface BatchMapper { 15 | 16 | 17 | @Batch 18 | @InsertProvider( type = BatchProvider.class, method = "dynamicSQL" ) 19 | Integer batchInsert(List recordList); 20 | 21 | 22 | @Batch 23 | @InsertProvider( type = BatchProvider.class, method = "dynamicSQL" ) 24 | Integer batchInsertSelective(List recordList); 25 | 26 | 27 | @Batch 28 | @UpdateProvider( type = BatchProvider.class, method = "dynamicSQL" ) 29 | Integer batchUpdate(List recordList); 30 | 31 | 32 | @Batch 33 | @UpdateProvider( type = BatchProvider.class, method = "dynamicSQL" ) 34 | Integer batchUpdateSelective(List recordList); 35 | 36 | 37 | @Batch 38 | @DeleteProvider( type = BatchProvider.class, method = "dynamicSQL" ) 39 | Integer batchDelete(List recoreList); 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/UserCumulateBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by Administrator on 2016/5/14. 9 | */ 10 | public class UserCumulateBean { 11 | 12 | /** 13 | * ref_date : 2014-12-07 14 | * cumulate_user : 1217056 15 | */ 16 | 17 | @JSONField( name = "list" ) 18 | private List list; 19 | 20 | 21 | public List getList() { 22 | return list; 23 | } 24 | 25 | 26 | public void setList( List list ) { 27 | this.list = list; 28 | } 29 | 30 | public static class ListBean { 31 | 32 | @JSONField( name = "ref_date" ) 33 | private String refDate; 34 | 35 | @JSONField( name = "cumulate_user" ) 36 | private int cumulateUser; 37 | 38 | 39 | public String getRefDate() { 40 | return refDate; 41 | } 42 | 43 | 44 | public void setRefDate( String refDate ) { 45 | this.refDate = refDate; 46 | } 47 | 48 | 49 | public int getCumulateUser() { 50 | return cumulateUser; 51 | } 52 | 53 | 54 | public void setCumulateUser( int cumulateUser ) { 55 | this.cumulateUser = cumulateUser; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/ArticleTotalSubBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ArticleTotalSubBean.java site.lovecode.wechat.support.bean 3 | * Copyright (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.support.bean; 8 | 9 | 10 | import com.alibaba.fastjson.annotation.JSONField; 11 | import site.lovecode.wechat.entity.ArticleTotal; 12 | import site.lovecode.wechat.entity.ArticleTotalDetail; 13 | 14 | import java.util.List; 15 | 16 | 17 | /** 18 | * 19 | *

20 | * TODO(这里描述这个类补充说明 – 可选) 21 | * 22 | * @author yangpeng 23 | * @date 2016年5月16日 24 | * @version 1.0.0 25 | */ 26 | public class ArticleTotalSubBean extends ArticleTotal { 27 | 28 | 29 | /** 30 | * TODO(用一句话描述这个变量的含义) 31 | */ 32 | 33 | private static final long serialVersionUID = 1L; 34 | 35 | @JSONField( name = "details" ) 36 | private List details; 37 | 38 | 39 | public List getDetails() { 40 | return details; 41 | } 42 | 43 | 44 | public void setDetails( List details ) { 45 | this.details = details; 46 | } 47 | 48 | 49 | @Override 50 | public String toString() { 51 | return "ArticleTotalSubBean [details=" + details + "]"; 52 | } 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/ArticleHourDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ArticleHourDto.java site.lovecode.wechat.dto Copyright (c) 3 | * 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | 10 | import site.lovecode.wechat.util.Page; 11 | 12 | import java.io.Serializable; 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * 微信小时报数据体 18 | *

19 | * 20 | * 21 | * @author yangpeng 22 | * @date 2016年5月24日 23 | * @version 1.0.0 24 | */ 25 | 26 | 27 | public class ArticleHourDto extends ArticleHourGroupDto implements Serializable{ 28 | 29 | 30 | public ArticleHourDto( List list, Page page) { 31 | this.list = list; 32 | this.page = page; 33 | } 34 | 35 | public ArticleHourDto() { 36 | } 37 | 38 | 39 | private List list; 40 | 41 | 42 | private Page page; 43 | 44 | 45 | 46 | public List getList() { 47 | return list; 48 | } 49 | 50 | public void setList(List list) { 51 | this.list = list; 52 | } 53 | 54 | public Page getPage() { 55 | return page; 56 | } 57 | 58 | public void setPage(Page page) { 59 | this.page = page; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/ArticleHourMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import org.apache.ibatis.annotations.Param; 5 | import site.lovecode.wechat.common.mybatis.CommonMapper; 6 | import site.lovecode.wechat.dto.ArticleHourDto; 7 | import site.lovecode.wechat.dto.ArticleHourGroupDto; 8 | import site.lovecode.wechat.entity.ArticleHour; 9 | 10 | import java.sql.Date; 11 | import java.util.List; 12 | 13 | public interface ArticleHourMapper extends CommonMapper { 14 | 15 | 16 | /** 17 | * 18 | * 根据日期查询小时统计信息 19 | *

20 | * 21 | * 22 | * @param oaid 23 | * @param date 24 | * @return 25 | */ 26 | List selectArticleHour(@Param("oaid") Long oaid, @Param("refDate") Date date, @Param("index") Integer index, @Param("size") Integer size); 27 | 28 | 29 | /** 30 | * 根据日期查询来源总数 31 | * @param oaid 32 | * @param date 33 | * @return 34 | */ 35 | ArticleHourDto selectArticleHourTotal(@Param("oaid") Long oaid, @Param("refDate") Date date); 36 | 37 | 38 | /** 39 | * 根据日期查询总条数 40 | * @param oaid 41 | * @param date 42 | * @return 43 | */ 44 | Integer selectArticleHourCount(@Param("oaid") Long oaid, @Param("refDate") Date date); 45 | 46 | 47 | 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/MediaNewsReqDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MediaNewsReqDto.java site.lovecode.wechat.dto Copyright 3 | * (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | 10 | import site.lovecode.wechat.entity.MediaNews; 11 | 12 | import java.io.Serializable; 13 | import java.util.List; 14 | 15 | 16 | /** 17 | * 图文素材数据载体 18 | *

19 | * TODO(这里描述这个类补充说明 – 可选) 20 | * 21 | * @author yangpeng 22 | * @date 2016年5月19日 23 | * @version 1.0.0 24 | */ 25 | public class MediaNewsReqDto implements Serializable { 26 | 27 | 28 | private static final long serialVersionUID = 1L; 29 | 30 | private Long id; 31 | 32 | private Long orgId; 33 | 34 | private List mediaNewsList; 35 | 36 | 37 | public Long getId() { 38 | return id; 39 | } 40 | 41 | 42 | public void setId( Long id ) { 43 | this.id = id; 44 | } 45 | 46 | 47 | public Long getOrgId() { 48 | return orgId; 49 | } 50 | 51 | 52 | public void setOrgId( Long orgId ) { 53 | this.orgId = orgId; 54 | } 55 | 56 | 57 | public List getMediaNewsList() { 58 | return mediaNewsList; 59 | } 60 | 61 | 62 | public void setMediaNewsList( List mediaNewsList ) { 63 | this.mediaNewsList = mediaNewsList; 64 | } 65 | 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/impl/TempServiceImpl.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.service.impl; 2 | 3 | import site.lovecode.wechat.client.WechatClient; 4 | import site.lovecode.wechat.client.WechatFactory; 5 | import site.lovecode.wechat.mapper.OrgOfficialAccountMapper; 6 | import site.lovecode.wechat.service.ITempService; 7 | import me.chanjar.weixin.common.exception.WxErrorException; 8 | import me.chanjar.weixin.mp.bean.WxMpTemplateMessage; 9 | import org.springframework.stereotype.Service; 10 | 11 | import javax.annotation.Resource; 12 | 13 | /** 14 | * Created by Administrator on 2016/6/22. 15 | */ 16 | @Service 17 | public class TempServiceImpl implements ITempService { 18 | 19 | 20 | @Resource 21 | private WechatFactory wechatFactory; 22 | 23 | 24 | @Resource 25 | private OrgOfficialAccountMapper orgOfficialAccountMapper; 26 | 27 | 28 | public void sendTempMessage(Long orgId,WxMpTemplateMessage wxMpTemplateMessage) throws WxErrorException { 29 | WechatClient wechatClient = wechatFactory.getInstance(getOaid(orgId)); 30 | wechatClient.templateSend(wxMpTemplateMessage); 31 | } 32 | 33 | 34 | Long getOaid( Long orgId ) { 35 | return orgOfficialAccountMapper.getOfficialAccountIdByOrgId(orgId); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/toolbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | date 5 | application 6 | org.apache.velocity.tools.generic.DateTool 7 | 8 | 9 | math 10 | application 11 | org.apache.velocity.tools.generic.MathTool 12 | 13 | 14 | number 15 | application 16 | org.apache.velocity.tools.generic.NumberTool 17 | 18 | 19 | render 20 | application 21 | org.apache.velocity.tools.generic.RenderTool 22 | 23 | 24 | esc 25 | application 26 | org.apache.velocity.tools.generic.EscapeTool 27 | 28 | 29 | alternator 30 | application 31 | org.apache.velocity.tools.generic.AlternatorTool 32 | 33 | 34 | parser 35 | application 36 | org.apache.velocity.tools.generic.ValueParser 37 | 38 | 39 | sorter 40 | application 41 | org.apache.velocity.tools.generic.SortTool 42 | 43 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/module/IMenuModule.java: -------------------------------------------------------------------------------- 1 | /** 2 | * IMenuModule.java cn.vko.peixun.core.module.communication Copyright (c) 2016, 3 | * . 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.module; 8 | 9 | 10 | import org.apache.struts.util.ModuleException; 11 | import site.lovecode.wechat.dto.MenuDto; 12 | import site.lovecode.wechat.dto.MenuMediaDto; 13 | import site.lovecode.wechat.dto.MenuReqDto; 14 | import site.lovecode.wechat.support.common.Response; 15 | 16 | /** 17 | * 自定义菜单服务层接口 18 | *

19 | * 20 | * 21 | * @author yangpeng 22 | * @date 2016年5月25日 23 | * @version 1.0.0 24 | */ 25 | 26 | 27 | public interface IMenuModule { 28 | 29 | 30 | /** 31 | * 32 | * 创建菜单 33 | *

34 | * 35 | * 36 | * @param menuReqDto 37 | * @param orgId 38 | * @return 39 | */ 40 | public Response createMenu(MenuReqDto menuReqDto, Long orgId) throws ModuleException; 41 | 42 | 43 | /** 44 | * 45 | * 获取菜单列表 46 | *

47 | * 48 | * 49 | * @param orgId 50 | * @return 51 | */ 52 | public Response getMenu(Long orgId); 53 | 54 | 55 | /** 56 | * 57 | * 获取一个菜单详细信息 58 | *

59 | * 60 | * 61 | * @param menuId 62 | * @return 63 | */ 64 | public Response getMenuOne(Long menuId); 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/AuthorizerInfoMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | update WX_AUTHORIZER_INFO set authorizationStatus = #{authorizationStatus} where authorizerAppid = #{authorizerAppid} 19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/UserLocationMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/module/IReplySettingModule.java: -------------------------------------------------------------------------------- 1 | /** 2 | * IReplySettingModule.java cn.vko.peixun.core.module.communication Copyright 3 | * (c) 2016, . 4 | */ 5 | /** 6 | * IReplySettingModule.java cn.vko.peixun.core.module.communication Copyright 7 | * (c) 2016, . 8 | */ 9 | 10 | 11 | package site.lovecode.wechat.module; 12 | 13 | 14 | import org.apache.struts.util.ModuleException; 15 | import site.lovecode.wechat.support.common.Response; 16 | 17 | /** 18 | * 自动回复信息接口 19 | *

20 | * 21 | * 22 | * @author Administrator 23 | * @date 2016年5月17日 24 | * @version 1.0.0 25 | */ 26 | public interface IReplySettingModule { 27 | 28 | 29 | /** 30 | * 31 | * 添加被添加自动回复 32 | *

33 | * 34 | * 35 | * @param oaid 36 | * @param type 37 | * @param content 38 | * @return TODO(这里描述每个参数,如果有返回值描述返回值,如果有异常描述异常) 39 | */ 40 | public Response addFriendReplySetting(Long oaid, Integer type, String content) throws ModuleException; 41 | 42 | 43 | /** 44 | * 45 | * 添加消息自动回复 46 | *

47 | * 48 | * 49 | * @param oaid 50 | * @param type 51 | * @param content 52 | * @return TODO(这里描述每个参数,如果有返回值描述返回值,如果有异常描述异常) 53 | */ 54 | public Response addAutoReplySetting(Long oaid, Integer type, String content) throws ModuleException; 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/GetAuthorizerOptionBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/11. 5 | */ 6 | public class GetAuthorizerOptionBean { 7 | 8 | 9 | /** 10 | * 授权公众号appid 11 | */ 12 | private String authorizerAppid; 13 | 14 | /** 15 | * 选项名称 16 | */ 17 | private String OptionName; 18 | 19 | /** 20 | * 选项值 21 | */ 22 | private String OptionValue; 23 | 24 | 25 | public String getAuthorizerAppid() { 26 | return authorizerAppid; 27 | } 28 | 29 | 30 | public void setAuthorizerAppid( String authorizerAppid ) { 31 | this.authorizerAppid = authorizerAppid; 32 | } 33 | 34 | 35 | public String getOptionName() { 36 | return OptionName; 37 | } 38 | 39 | 40 | public void setOptionName( String optionName ) { 41 | OptionName = optionName; 42 | } 43 | 44 | 45 | public String getOptionValue() { 46 | return OptionValue; 47 | } 48 | 49 | 50 | public void setOptionValue( String optionValue ) { 51 | OptionValue = optionValue; 52 | } 53 | 54 | 55 | @Override 56 | public String toString() { 57 | return "GetAuthorizerOptionBean{" 58 | + "authorizerAppid='" + authorizerAppid + '\'' + ", OptionName='" + OptionName + '\'' 59 | + ", OptionValue='" + OptionValue + '\'' + '}'; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/IArticleHourService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * IArticleHourService.java site.lovecode.wechat.service Copyright 3 | * (c) 2016, norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.service; 8 | 9 | 10 | import site.lovecode.wechat.dto.ArticleHourDto; 11 | import site.lovecode.wechat.dto.ArticleHourGroupDto; 12 | import site.lovecode.wechat.util.Page; 13 | 14 | import java.sql.Date; 15 | import java.util.List; 16 | 17 | 18 | /** 19 | * 获取图文小时 20 | *

21 | * 22 | * 23 | * @author yangpeng 24 | * @date 2016年5月24日 25 | * @version 1.0.0 26 | */ 27 | 28 | 29 | public interface IArticleHourService { 30 | 31 | 32 | /** 33 | * 34 | * 获取小时报 35 | *

36 | * 37 | * 38 | * @param orgId 39 | * @param date 40 | * @return 41 | */ 42 | ArticleHourDto getArticleHour(Long orgId, Date date, Page page); 43 | 44 | 45 | /** 46 | * 47 | * @param orgId 48 | * @param date 49 | * @param page 50 | * @return 51 | */ 52 | Page getArticleHourPage(Long orgId, Date date, Page page); 53 | 54 | 55 | 56 | /** 57 | * 获取文章小时列表 58 | * @param orgId 59 | * @param date 60 | * @return 61 | */ 62 | List getArticleHourList(Long orgId, Date date); 63 | 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/TagsBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by Administrator on 2016/5/10. 9 | */ 10 | public class TagsBean { 11 | 12 | 13 | /** 14 | * id : 1 15 | * name : 黑名单 16 | * count : 0 17 | */ 18 | 19 | @JSONField( name = "tags" ) 20 | private List tags; 21 | 22 | 23 | public List getTags() { 24 | return tags; 25 | } 26 | 27 | 28 | public void setTags( List tags ) { 29 | this.tags = tags; 30 | } 31 | 32 | public static class Tags { 33 | 34 | @JSONField( name = "id" ) 35 | private int id; 36 | 37 | @JSONField( name = "name" ) 38 | private String name; 39 | 40 | @JSONField( name = "count" ) 41 | private int count; 42 | 43 | 44 | public int getId() { 45 | return id; 46 | } 47 | 48 | 49 | public void setId( int id ) { 50 | this.id = id; 51 | } 52 | 53 | 54 | public String getName() { 55 | return name; 56 | } 57 | 58 | 59 | public void setName( String name ) { 60 | this.name = name; 61 | } 62 | 63 | 64 | public int getCount() { 65 | return count; 66 | } 67 | 68 | 69 | public void setCount( int count ) { 70 | this.count = count; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/XmlEncryptingBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.thoughtworks.xstream.annotations.XStreamAlias; 4 | import com.thoughtworks.xstream.annotations.XStreamConverter; 5 | import me.chanjar.weixin.common.util.xml.XStreamCDataConverter; 6 | 7 | import java.io.Serializable; 8 | 9 | /** 10 | * Created by Administrator on 2016/4/1. 11 | */ 12 | @XStreamAlias( "xml" ) 13 | public class XmlEncryptingBean implements Serializable { 14 | 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | @XStreamAlias( "AppId" ) 19 | @XStreamConverter( value = XStreamCDataConverter.class ) 20 | private String appId; 21 | 22 | @XStreamAlias( "Encrypt" ) 23 | @XStreamConverter( value = XStreamCDataConverter.class ) 24 | private String encrypt; 25 | 26 | 27 | public String getEncrypt() { 28 | return encrypt; 29 | } 30 | 31 | 32 | public void setEncrypt( String encrypt ) { 33 | this.encrypt = encrypt; 34 | } 35 | 36 | 37 | public String getAppId() { 38 | return appId; 39 | } 40 | 41 | 42 | public void setAppId( String appId ) { 43 | this.appId = appId; 44 | } 45 | 46 | 47 | @Override 48 | public String toString() { 49 | return "XmlEncryptingBean{" + "appId='" + appId + '\'' + ", encrypt='" + encrypt + '\'' + '}'; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/AuthenticationMessageMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/MediaNewsMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/ArticleTotalDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ArticleTotalDto.java site.lovecode.wechat.dto Copyright 3 | * (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | 10 | import site.lovecode.wechat.entity.ArticleSummary; 11 | import site.lovecode.wechat.entity.ArticleTotal; 12 | import site.lovecode.wechat.entity.ArticleTotalDetail; 13 | 14 | import java.util.List; 15 | 16 | 17 | /** 18 | * 微信群发总数据载体 19 | *

20 | * 21 | * 22 | * @author yangpeng 23 | * @date 2016年5月21日 24 | * @version 1.0.0 25 | */ 26 | 27 | 28 | public class ArticleTotalDto extends ArticleTotal { 29 | 30 | 31 | private static final long serialVersionUID = 1L; 32 | 33 | 34 | private ArticleTotalDetail articleTotalDetail; 35 | 36 | 37 | private List articleSummaryList; 38 | 39 | 40 | public ArticleTotalDetail getArticleTotalDetail() { 41 | return articleTotalDetail; 42 | } 43 | 44 | 45 | public void setArticleTotalDetail( ArticleTotalDetail articleTotalDetail ) { 46 | this.articleTotalDetail = articleTotalDetail; 47 | } 48 | 49 | 50 | public List getArticleSummaryList() { 51 | return articleSummaryList; 52 | } 53 | 54 | 55 | public void setArticleSummaryList( List articleSummaryList ) { 56 | this.articleSummaryList = articleSummaryList; 57 | } 58 | 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/PersonalUserTagsDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PersonalUserTagsDto.java site.lovecode.wechat.dto 3 | * Copyright (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.dto; 8 | 9 | 10 | import site.lovecode.wechat.util.Page; 11 | 12 | import java.io.Serializable; 13 | 14 | 15 | /** 16 | * 用户列表和标签数据载体 17 | *

18 | * 19 | * 20 | * @author yangeng 21 | * @date 2016年5月12日 22 | * @version 1.0.0 23 | */ 24 | public class PersonalUserTagsDto implements Serializable { 25 | 26 | /** 27 | * TODO(用一句话描述这个变量的含义) 28 | */ 29 | 30 | private static final long serialVersionUID = 1L; 31 | 32 | 33 | /** 34 | * 创建 PersonalUserTagsDto对象. 35 | * 36 | * @param page 37 | * @param tagsDto 38 | */ 39 | 40 | public PersonalUserTagsDto(Page page, TagsDto tagsDto ) { 41 | super(); 42 | this.page = page; 43 | this.tagsDto = tagsDto; 44 | } 45 | 46 | 47 | private Page page; 48 | 49 | private TagsDto tagsDto; 50 | 51 | 52 | public Page getPage() { 53 | return page; 54 | } 55 | 56 | 57 | public void setPage( Page page ) { 58 | this.page = page; 59 | } 60 | 61 | 62 | public TagsDto getTagsDto() { 63 | return tagsDto; 64 | } 65 | 66 | 67 | public void setTagsDto( TagsDto tagsDto ) { 68 | this.tagsDto = tagsDto; 69 | } 70 | 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/velocity/accountList.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include("head.vm") 4 | 5 | 6 | #include("navbar.vm") 7 | 8 |

9 |
10 |
11 | 我的公众号列表 12 |
13 |
14 |
    15 | #foreach($account in $accountList) 16 |
  • 17 | 获取用户列表:获取用户列表 18 | 获取自动回复配置 19 | 获取自定义菜单 20 | 发送模板消息 21 | 公众号id: $account.id 22 | 公众号appid: $account.appid 23 |
    24 | 公众号名称:$account.nickName 25 | 公众号类型: 26 | #if($account.accountType==1) 27 | 授权绑定 28 | #elseif($account.accountType==2) 29 | 手动绑定 30 | 31 |
  • 32 | #end 33 | #end 34 |
35 |
36 |
37 |
38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/KeywordReplySettingDto.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.dto; 2 | 3 | import site.lovecode.wechat.entity.KeywordReplySetting; 4 | import site.lovecode.wechat.entity.KeywordReplySettingKeyword; 5 | import java.util.List; 6 | 7 | 8 | 9 | /** 10 | * Created by Administrator on 2016/4/26. 11 | */ 12 | public class KeywordReplySettingDto extends KeywordReplySetting { 13 | 14 | /** 15 | * TODO(用一句话描述这个变量的含义) 16 | */ 17 | 18 | private static final long serialVersionUID = 1L; 19 | 20 | private List keywordReplySettingKeywordList; 21 | 22 | private List keywordReplySettingReplyVoList; 23 | 24 | 25 | public List getKeywordReplySettingKeywordList() { 26 | return keywordReplySettingKeywordList; 27 | } 28 | 29 | 30 | public void setKeywordReplySettingKeywordList( List keywordReplySettingKeywordList ) { 31 | this.keywordReplySettingKeywordList = keywordReplySettingKeywordList; 32 | } 33 | 34 | 35 | public List getKeywordReplySettingReplyVoList() { 36 | return keywordReplySettingReplyVoList; 37 | } 38 | 39 | 40 | public void setKeywordReplySettingReplyVoList( List keywordReplySettingReplyVoList ) { 41 | this.keywordReplySettingReplyVoList = keywordReplySettingReplyVoList; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/IArticleDayService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * IArticleDayService.java site.lovecode.wechat.service Copyright 3 | * (c) 2016, norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.service; 8 | 9 | 10 | import site.lovecode.wechat.dto.ArticleDayDto; 11 | import site.lovecode.wechat.dto.ArticleSummaryDto; 12 | import site.lovecode.wechat.util.Page; 13 | 14 | import java.sql.Date; 15 | import java.util.List; 16 | 17 | 18 | /** 19 | * 图文每日数据业务逻辑层 20 | *

21 | * 22 | * 23 | * @author yangpeng 24 | * @date 2016年5月24日 25 | * @version 1.0.0 26 | */ 27 | 28 | 29 | public interface IArticleDayService { 30 | 31 | 32 | /** 33 | * 34 | * 获取到图文日报 35 | *

36 | * 37 | * 38 | * @param orgId 39 | * @param beginDate 40 | * @param endDate 41 | * @return 42 | */ 43 | ArticleSummaryDto getArticleDay(Long orgId, Date beginDate, Date endDate, Page page); 44 | 45 | 46 | /** 47 | * 分页获取图文日报 48 | * @param orgId 49 | * @param beginDate 50 | * @param endDate 51 | * @return 52 | */ 53 | Page getArticleDayPage(Long orgId, Date beginDate, Date endDate, Page page); 54 | 55 | 56 | 57 | /** 58 | * 获取每日图文数据列表 59 | * @param orgId 60 | * @param beginDate 61 | * @param endDate 62 | * @return 63 | */ 64 | List getArticleDayList(Long orgId, Date beginDate, Date endDate); 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/mapper/ArticleDayMapper.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.mapper; 2 | 3 | 4 | import org.apache.ibatis.annotations.Param; 5 | import site.lovecode.wechat.common.mybatis.CommonMapper; 6 | import site.lovecode.wechat.dto.ArticleDayDto; 7 | import site.lovecode.wechat.dto.ArticleSummaryDto; 8 | import site.lovecode.wechat.entity.ArticleDay; 9 | 10 | import java.sql.Date; 11 | import java.util.List; 12 | 13 | public interface ArticleDayMapper extends CommonMapper { 14 | 15 | 16 | /** 17 | * @param beginDate 18 | * @param endDate 19 | * @return 20 | */ 21 | ArticleSummaryDto selectJoinArticleSummary(@Param("oaid") Long oaid, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate); 22 | 23 | 24 | /** 25 | * 条件查询总数 26 | * 27 | * @param oaid 28 | * @param beginDate 29 | * @param endDate 30 | * @return 31 | */ 32 | Integer selectJoinSummaryCount(@Param("oaid") Long oaid, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate); 33 | 34 | 35 | /** 36 | * 分页获取每天图文统计 37 | * 38 | * @param oaid 39 | * @param beginDate 40 | * @param endDate 41 | * @return 42 | */ 43 | List selectJoinSummaryPage(@Param("oaid") Long oaid, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("index") Integer index, @Param("size") Integer size); 44 | } 45 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/AuthorizerAccessTokenMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | update WX_AUTHORIZER_ACCESS_TOKEN set authorizerAccessToken = #{authorizerAccessToken} ,authorizerRefreshToken = #{authorizerRefreshToken},createTime = #{createTime},expiresIn= #{expiresIn} where authorizerAppid = #{authorizerAppid} 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/common/mybatis/PageProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PageProvider.java site.lovecode.wechat.mybatis.mybatis.mapper Copyright (c) 3 | * 2016, norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.common.mybatis; 8 | 9 | import org.apache.ibatis.mapping.MappedStatement; 10 | import tk.mybatis.mapper.mapperhelper.MapperHelper; 11 | import tk.mybatis.mapper.mapperhelper.MapperTemplate; 12 | import tk.mybatis.mapper.mapperhelper.SqlHelper; 13 | 14 | 15 | /** 16 | * 分页查询实现 17 | *

18 | * 19 | * @author Administrator 20 | * @date 2016年5月5日 21 | * @version 1.0.0 22 | */ 23 | public class PageProvider extends MapperTemplate { 24 | 25 | 26 | /** 27 | * 创建 PageProvider对象. 28 | * 29 | * @param mapperClass 30 | * @param mapperHelper 31 | */ 32 | 33 | public PageProvider( Class mapperClass, MapperHelper mapperHelper ) { 34 | super(mapperClass, mapperHelper); 35 | } 36 | 37 | 38 | /** 39 | * 分页查询所有结果 40 | * 41 | * @param ms 42 | * @return 43 | */ 44 | public String selectPage( MappedStatement ms ) { 45 | final Class entityClass = getEntityClass(ms); 46 | // 修改返回值类型为实体类型 47 | setResultType(ms, entityClass); 48 | StringBuilder sql = new StringBuilder(); 49 | sql.append(SqlHelper.selectAllColumns(entityClass)); 50 | sql.append(SqlHelper.fromTable(entityClass, tableName(entityClass))); 51 | sql.append(SqlHelper.orderByDefault(entityClass)); 52 | return sql.toString(); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/WechatXmlMessage.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | 4 | import me.chanjar.weixin.mp.bean.WxMpXmlMessage; 5 | import org.apache.commons.io.IOUtils; 6 | import site.lovecode.wechat.entity.WechatThirdPartyConfig; 7 | import site.lovecode.wechat.util.WechatCryptUtil; 8 | 9 | import java.io.IOException; 10 | import java.io.InputStream; 11 | 12 | /** 13 | * Created by Administrator on 2016/4/25. 14 | */ 15 | public class WechatXmlMessage extends WxMpXmlMessage { 16 | 17 | /** 18 | * TODO(用一句话描述这个变量的含义) 19 | */ 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | 24 | public static WxMpXmlMessage fromEncryptedXml( 25 | InputStream is, WechatThirdPartyConfig wechatThirdPartyConfig, String timestamp, String nonce, 26 | String msgSignature ) { 27 | try { 28 | return fromEncryptedXml( 29 | IOUtils.toString(is, "UTF-8"), wechatThirdPartyConfig, timestamp, nonce, msgSignature); 30 | } catch ( IOException e ) { 31 | throw new RuntimeException(e); 32 | } 33 | } 34 | 35 | 36 | public static WxMpXmlMessage fromEncryptedXml( 37 | String encryptedXml, WechatThirdPartyConfig wechatThirdPartyConfig, String timestamp, String nonce, 38 | String msgSignature ) { 39 | WechatCryptUtil cryptUtil = new WechatCryptUtil(wechatThirdPartyConfig); 40 | String plainText = cryptUtil.decrypt(msgSignature, timestamp, nonce, encryptedXml); 41 | return fromXml(plainText); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/AjaxResult.java: -------------------------------------------------------------------------------- 1 | /** 2 | * AjaxResult.java net.yunxiaoyuan.common Copyright (c) 2014, 3 | * . 4 | */ 5 | 6 | package site.lovecode.wechat.support; 7 | 8 | 9 | /** 10 | * ajax返回结果信息,用此对象封装后转成json,传到浏览器 11 | *

12 | * 13 | * @author haozipu 14 | * @date 2014-11-20 15 | * @version 1.0.0 16 | */ 17 | public class AjaxResult { 18 | 19 | /** 20 | * 是否成功 21 | */ 22 | private boolean success = true; 23 | 24 | /** 25 | * 失败或成功的提示信息 26 | */ 27 | private String message; 28 | 29 | /** 30 | * 返回的数据 31 | */ 32 | private Object data; 33 | 34 | 35 | public AjaxResult(boolean success, String message ) { 36 | this(success, message, null); 37 | } 38 | 39 | 40 | public AjaxResult(Object data ) { 41 | this(true, null, data); 42 | } 43 | 44 | 45 | public AjaxResult(boolean success, String message, Object data ) { 46 | this.success = success; 47 | this.message = message; 48 | this.data = data; 49 | } 50 | 51 | 52 | public String getMessage() { 53 | return message; 54 | } 55 | 56 | 57 | public void setMessage( String message ) { 58 | this.message = message; 59 | } 60 | 61 | 62 | public Object getData() { 63 | return data; 64 | } 65 | 66 | 67 | public void setData( Object data ) { 68 | this.data = data; 69 | } 70 | 71 | 72 | public boolean isSuccess() { 73 | return success; 74 | } 75 | 76 | 77 | public void setSuccess( boolean success ) { 78 | this.success = success; 79 | } 80 | 81 | 82 | } 83 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/MessageTypeEnum.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.enums; 2 | 3 | import java.util.EnumSet; 4 | import java.util.HashMap; 5 | import java.util.Map; 6 | 7 | /** 8 | * Created by Administrator on 2016/4/25. 9 | */ 10 | public enum MessageTypeEnum { 11 | 12 | text(1, "text"), 13 | 14 | img(2, "img"), 15 | 16 | voice(3, "voice"), 17 | 18 | video(4, "video"), 19 | 20 | news(5, "news"); 21 | 22 | private final int key; 23 | 24 | // 枚举描述 25 | private final String desc; 26 | 27 | private static Map map = new HashMap<>(); 28 | 29 | static { 30 | for ( MessageTypeEnum messageTypeEnum : EnumSet.allOf(MessageTypeEnum.class) ) { 31 | map.put(messageTypeEnum.getDesc(), messageTypeEnum.getKey()); 32 | } 33 | } 34 | 35 | 36 | MessageTypeEnum( final int key, final String desc ) { 37 | this.key = key; 38 | this.desc = desc; 39 | } 40 | 41 | 42 | public static MessageTypeEnum valueOf( int value ) { 43 | switch ( value ) { 44 | case 1 : 45 | return text; 46 | case 2 : 47 | return img; 48 | case 3 : 49 | return voice; 50 | case 4 : 51 | return video; 52 | case 5 : 53 | return news; 54 | default: 55 | return null; 56 | } 57 | } 58 | 59 | 60 | public int getKey() { 61 | return key; 62 | } 63 | 64 | 65 | public String getDesc() { 66 | return desc; 67 | } 68 | 69 | 70 | public static Integer getValue( String str ) { 71 | return map.get(str); 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/WechatThirdPartyConfigMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/util/WechatMsgCryptUtil.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.util; 2 | 3 | import com.thoughtworks.xstream.XStream; 4 | import me.chanjar.weixin.common.util.xml.XStreamInitializer; 5 | import site.lovecode.wechat.ase.AesException; 6 | import site.lovecode.wechat.ase.WXBizMsgCrypt; 7 | import site.lovecode.wechat.client.impl.WechatThirdPartyClientImpl; 8 | import site.lovecode.wechat.support.bean.XmlEncryptingBean; 9 | 10 | ; 11 | 12 | /** 13 | * Created by Administrator on 2016/4/11. 14 | */ 15 | public class WechatMsgCryptUtil { 16 | 17 | 18 | private static final String FORMAT = ""; 19 | 20 | 21 | public static String WechatMsgDecrypt( String str, String msgSignature, String timestamp, String nonce ) 22 | throws AesException { 23 | WXBizMsgCrypt wxBizMsgCrypt = new WXBizMsgCrypt( 24 | WechatThirdPartyClientImpl.wechatThirdPartyConfig.getToken(), 25 | WechatThirdPartyClientImpl.wechatThirdPartyConfig.getEncodeingAesKey(), 26 | WechatThirdPartyClientImpl.wechatThirdPartyConfig.getComponentAppid()); 27 | XStream xStream = XStreamInitializer.getInstance(); 28 | xStream.processAnnotations(new Class[ ] { XmlEncryptingBean.class }); 29 | XmlEncryptingBean xmlEncryptingBean = (XmlEncryptingBean) xStream.fromXML(str); 30 | return wxBizMsgCrypt.decryptMsg( 31 | msgSignature, timestamp, nonce, String.format(FORMAT, xmlEncryptingBean.getEncrypt())); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/common/WebException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * WebException.java cn.vko.core.common.exception Copyright (c) 2014, 3 | * . 4 | */ 5 | 6 | package site.lovecode.wechat.support.common; 7 | 8 | 9 | /** 10 | * 所有应用层需要抛的异常类型 11 | *

12 | * 13 | * @author malei 14 | * @date 2014-11-20 15 | * @version 1.0.0 16 | */ 17 | public class WebException extends RuntimeException { 18 | 19 | private static final long serialVersionUID = 8604424364318396626L; 20 | 21 | 22 | // 异常代码 23 | private String code; 24 | 25 | // 异常说明 26 | private String desc; 27 | 28 | 29 | public WebException() { 30 | super(); 31 | } 32 | 33 | 34 | public WebException(String message ) { 35 | super(message); 36 | this.desc = message; 37 | } 38 | 39 | 40 | public WebException(String code, String desc ) { 41 | this.code = code; 42 | this.desc = desc; 43 | } 44 | 45 | 46 | public WebException(String code, String desc, Throwable cause ) { 47 | super(cause); 48 | this.code = code; 49 | this.desc = desc; 50 | } 51 | 52 | 53 | public WebException(String code, String desc, String message ) { 54 | super(message); 55 | this.code = code; 56 | this.desc = desc; 57 | } 58 | 59 | 60 | public String getCode() { 61 | return code; 62 | } 63 | 64 | 65 | public String getDesc() { 66 | return desc; 67 | } 68 | 69 | 70 | @Override 71 | public String getMessage() { 72 | if ( super.getMessage() == null ) { return desc; } 73 | return super.getMessage(); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/TagsUserBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by Administrator on 2016/5/10. 9 | */ 10 | public class TagsUserBean { 11 | 12 | 13 | /** 14 | * count : 2 15 | * data : {"openid":["ocYxcuAEy30bX0NXmGn4ypqx3tI0","ocYxcuBt0mRugKZ7tGAHPnUaOW7Y"]} 16 | * next_openid : ocYxcuBt0mRugKZ7tGAHPnUaOW7Y 17 | */ 18 | 19 | @JSONField( name = "count" ) 20 | private int count; 21 | 22 | @JSONField( name = "data" ) 23 | private DataBean data; 24 | 25 | @JSONField( name = "next_openid" ) 26 | private String nextOpenid; 27 | 28 | 29 | public int getCount() { 30 | return count; 31 | } 32 | 33 | 34 | public void setCount( int count ) { 35 | this.count = count; 36 | } 37 | 38 | 39 | public DataBean getData() { 40 | return data; 41 | } 42 | 43 | 44 | public void setData( DataBean data ) { 45 | this.data = data; 46 | } 47 | 48 | 49 | public String getNextOpenid() { 50 | return nextOpenid; 51 | } 52 | 53 | 54 | public void setNextOpenid( String nextOpenid ) { 55 | this.nextOpenid = nextOpenid; 56 | } 57 | 58 | public static class DataBean { 59 | 60 | @JSONField( name = "openid" ) 61 | private List openid; 62 | 63 | 64 | public List getOpenid() { 65 | return openid; 66 | } 67 | 68 | 69 | public void setOpenid( List openid ) { 70 | this.openid = openid; 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | 2 | **本项目已不再维护,推荐各位使用 https://github.com/wechat-group/weixin-java-tools** 3 | 4 | ## wechat-3rd-party 微信第三方平台介绍 5 | 微信第三方平台使用使用java8开发,使用了较多的java8的新特性,如lambda表达式和stream api,该项目使用了 [weixin-java-tools](https://github.com/chanjarster/weixin-java-tools)已经实现的功能,在其上又做了扩展,使其具备了微信第三方平台的功能,并增加数据持久化支持和简单的界面,使用它可以快速搭建一个微信的第三方平台,项目功能将不断增加完善,非常欢迎对本项目发起Pull Request 6 | --- 7 | * 已经使用的技术列表 8 | * java8 9 | * spring framework 4.2.5.RELEASE https://github.com/spring-projects/spring-framework 10 | * orm框架 mybatis 3.2.8 https://github.com/mybatis/mybatis-3 11 | * 模板引擎 velocity 12 | * 数据库 mysql 5.6 13 | * 内存数据库 redis 3.2 14 | * json处理 fastjson https://github.com/alibaba/fastjson 15 | * 构建工具 gradle https://github.com/gradle/gradle 16 | * 数据库连接池 druid 1.0.18 https://github.com/alibaba/druid 17 | * 微信sdk weixin-java-mp https://github.com/chanjarster/weixin-java-tools 18 | * mybatis工具 mybatis-mapper https://github.com/abel533/Mapper 19 | * web server jetty9 20 | * 开发工具 IntelliJ IDEA 15 21 | * 前端框架 Bootstrap angluarJS 22 | * 数据建模 powerdesgin 23 | * 项目结构 24 | db 数据字典和sql执行文件 25 | * 项目关键类说明 26 | - 微信所有接口都在site.lovecode.client包下 27 | * WechatClient 微信公众号接口 28 | * WechatThridPartyClient 微信第三方平台接口 29 | * WechatFactory 微信公众号工厂类 30 | * 项目实现的功能 31 | * 微信第三方平台授权绑定 手动绑定和授权绑定 32 | * 微信消息自动回复设置 33 | * 公众号数据统计 34 | * 自定义菜单管理 35 | * 素材管理 36 | * 用户管理 37 | * 项目部署说明 38 | * 首先执行db文件夹中的sql,创建数据库 39 | * 启动redis 40 | * 启动jetty,运行项目 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/IndustryBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | /** 6 | * Created by Administrator on 2016/4/28. 7 | */ 8 | public class IndustryBean { 9 | 10 | @JSONField( name = "primary_industry" ) 11 | private Industry primaryIndustry; 12 | 13 | @JSONField( name = "secondary_industry" ) 14 | private Industry secondaryIndustry; 15 | 16 | 17 | public Industry getPrimaryIndustry() { 18 | return primaryIndustry; 19 | } 20 | 21 | 22 | public void setPrimaryIndustry( Industry primaryIndustry ) { 23 | this.primaryIndustry = primaryIndustry; 24 | } 25 | 26 | 27 | public Industry getSecondaryIndustry() { 28 | return secondaryIndustry; 29 | } 30 | 31 | 32 | public void setSecondaryIndustry( Industry secondaryIndustry ) { 33 | this.secondaryIndustry = secondaryIndustry; 34 | } 35 | 36 | public static class Industry { 37 | 38 | @JSONField( name = "first_class" ) 39 | private String firstClass; 40 | 41 | @JSONField( name = "second_class" ) 42 | private String secondClass; 43 | 44 | 45 | public String getFirstClass() { 46 | return firstClass; 47 | } 48 | 49 | 50 | public void setFirstClass( String firstClass ) { 51 | this.firstClass = firstClass; 52 | } 53 | 54 | 55 | public String getSecondClass() { 56 | return secondClass; 57 | } 58 | 59 | 60 | public void setSecondClass( String secondClass ) { 61 | this.secondClass = secondClass; 62 | } 63 | } 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/IWechatThridPartyService.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.service; 2 | 3 | 4 | import me.chanjar.weixin.common.exception.WxErrorException; 5 | import site.lovecode.wechat.dto.AuthorizerInfoDto; 6 | import site.lovecode.wechat.support.bean.XmlDecryptingBean; 7 | 8 | import java.io.IOException; 9 | 10 | /** 11 | * Created by Administrator on 2016/4/8. 12 | */ 13 | public interface IWechatThridPartyService { 14 | 15 | /** 16 | * 保存 component_verify_ticket 17 | * 18 | * @param xmlDecryptingBean 19 | */ 20 | void saveComponentVerifyTicket(XmlDecryptingBean xmlDecryptingBean) throws WxErrorException; 21 | 22 | 23 | /** 24 | * 授权成功执行的操作 25 | * 1.保存公众号基本信息 26 | * 2.保存公众号详细信息 27 | * 3.保存公众号access_token 28 | * 4.保存公众号权限信息 29 | * 5.保存公众号商业信息 30 | * 异步执行的操作 31 | * 1.批量拉取用户信息 32 | * 2.获取用户自动回复配置,并初始化微信消息接收器 33 | * 3.批量拉取用户永久素材 34 | * 35 | * 36 | * @throws IOException 37 | */ 38 | AuthorizerInfoDto saveInfo(String authCode) throws Exception; 39 | 40 | 41 | /** 42 | * 生成用户的授权页面 43 | * @return 44 | * @throws IOException 45 | */ 46 | String getCompoentLoginUrl() throws IOException, WxErrorException; 47 | 48 | 49 | /** 50 | * 51 | * 用户取消授权,变更授权状态为取消 52 | * @param authorizerAppid 53 | */ 54 | void changeAuthorizationStatus(String authorizerAppid); 55 | 56 | 57 | 58 | /** 59 | * 60 | * 刷新用户数据 61 | *

62 | * 63 | * 64 | * @return TODO(这里描述每个参数,如果有返回值描述返回值,如果有异常描述异常) 65 | */ 66 | void refreshData(Long oaid) throws Exception; 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/AuthorizerTokenBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | /** 6 | * Created by Administrator on 2016/4/13. 7 | */ 8 | public class AuthorizerTokenBean { 9 | 10 | @JSONField( name = "authorizer_access_token" ) 11 | private String authorizerAccessToken; 12 | 13 | @JSONField( name = "expires_in" ) 14 | private Integer expiresIn; 15 | 16 | @JSONField( name = "authorizer_refresh_token" ) 17 | private String authorizerRefreshToken; 18 | 19 | 20 | public String getAuthorizerAccessToken() { 21 | return authorizerAccessToken; 22 | } 23 | 24 | 25 | public void setAuthorizerAccessToken( String authorizerAccessToken ) { 26 | this.authorizerAccessToken = authorizerAccessToken; 27 | } 28 | 29 | 30 | public Integer getExpiresIn() { 31 | return expiresIn; 32 | } 33 | 34 | 35 | public void setExpiresIn( Integer expiresIn ) { 36 | this.expiresIn = expiresIn; 37 | } 38 | 39 | 40 | public String getAuthorizerRefreshToken() { 41 | return authorizerRefreshToken; 42 | } 43 | 44 | 45 | public void setAuthorizerRefreshToken( String authorizerRefreshToken ) { 46 | this.authorizerRefreshToken = authorizerRefreshToken; 47 | } 48 | 49 | 50 | @Override 51 | public String toString() { 52 | return "AuthorizerTokenBean{" 53 | + "authorizerAccessToken='" + authorizerAccessToken + '\'' + ", expiresIn=" + expiresIn 54 | + ", authorizerRefreshToken='" + authorizerRefreshToken + '\'' + '}'; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/resources/site/lovecode/wechat/mapper/UserDataMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 29 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/controller/MenuController.java: -------------------------------------------------------------------------------- 1 | /** 2 | * MenuController.java cn.vko.peixun.web.communicaion.controller Copyright (c) 3 | * 2016, . 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.controller; 8 | 9 | 10 | import org.apache.struts.util.ModuleException; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.web.bind.annotation.RequestMapping; 13 | import org.springframework.web.bind.annotation.ResponseBody; 14 | import site.lovecode.wechat.dto.MenuReqDto; 15 | import site.lovecode.wechat.module.IMenuModule; 16 | 17 | import javax.annotation.Resource; 18 | 19 | 20 | /** 21 | * 自定义菜单接口 22 | *

23 | * 24 | * 25 | * @author yangpeng 26 | * @date 2016年5月25日 27 | * @version 1.0.0 28 | */ 29 | 30 | @Controller 31 | @RequestMapping( "/communication/menu" ) 32 | public class MenuController extends BaseController { 33 | 34 | @Resource 35 | private IMenuModule menuModuleImpl; 36 | 37 | 38 | @RequestMapping( "/createMenu" ) 39 | @ResponseBody 40 | public String createMenu( MenuReqDto menuReqDto ) throws ModuleException { 41 | return callback(menuModuleImpl.createMenu(menuReqDto, getOrgId()).getBody(), "创建失败"); 42 | } 43 | 44 | 45 | @RequestMapping( "/getMenu" ) 46 | public String getMenu() { 47 | return callbackSuccess(menuModuleImpl.getMenu(getOrgId()).getBody()); 48 | } 49 | 50 | 51 | @RequestMapping( "/getMenuOne" ) 52 | @ResponseBody 53 | public String getMenuOne( Long menuId ) { 54 | return callbackSuccess(menuModuleImpl.getMenuOne(menuId).getBody()); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/config/WechatConfig.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.config; 2 | 3 | import me.chanjar.weixin.mp.api.WxMpInMemoryConfigStorage; 4 | 5 | import java.io.Serializable; 6 | 7 | /** 8 | * Created by Administrator on 2016/4/13. 9 | */ 10 | public class WechatConfig extends WxMpInMemoryConfigStorage implements Serializable { 11 | 12 | /** 13 | * TODO(用一句话描述这个变量的含义) 14 | */ 15 | 16 | private static final long serialVersionUID = 1L; 17 | 18 | /** 19 | * refreshToken 20 | */ 21 | private String refreshToken; 22 | 23 | /** 24 | * 账号绑定类型 25 | */ 26 | private Integer accountType; 27 | 28 | /** 29 | * 微信公众账号基本信息id 30 | */ 31 | private Long officialAccountId; 32 | 33 | 34 | /** 35 | * 微信号原始id 36 | */ 37 | private String userName; 38 | 39 | 40 | public String getRefreshToken() { 41 | return refreshToken; 42 | } 43 | 44 | 45 | public void setRefreshToken( String refreshToken ) { 46 | this.refreshToken = refreshToken; 47 | } 48 | 49 | 50 | public Integer getAccountType() { 51 | return accountType; 52 | } 53 | 54 | 55 | public void setAccountType( Integer accountType ) { 56 | this.accountType = accountType; 57 | } 58 | 59 | 60 | public Long getOfficialAccountId() { 61 | return officialAccountId; 62 | } 63 | 64 | 65 | public void setOfficialAccountId( Long officialAccountId ) { 66 | this.officialAccountId = officialAccountId; 67 | } 68 | 69 | 70 | public String getUserName() { 71 | return userName; 72 | } 73 | 74 | 75 | public void setUserName( String userName ) { 76 | this.userName = userName; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/util/WechatCryptUtil.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.util; 2 | 3 | import me.chanjar.weixin.mp.bean.WxMpXmlOutMessage; 4 | import me.chanjar.weixin.mp.util.xml.XStreamTransformer; 5 | import org.apache.commons.codec.binary.Base64; 6 | import site.lovecode.wechat.entity.WechatThirdPartyConfig; 7 | 8 | 9 | /** 10 | * Created by Administrator on 2016/4/25. 11 | */ 12 | public class WechatCryptUtil extends me.chanjar.weixin.common.util.crypto.WxCryptUtil { 13 | 14 | 15 | /** 16 | * 构造函数 17 | * 18 | * @param wechatThirdPartyConfig 19 | */ 20 | public WechatCryptUtil( WechatThirdPartyConfig wechatThirdPartyConfig ) { 21 | /* 22 | * @param token 公众平台上,开发者设置的token 23 | * @param encodingAesKey 公众平台上,开发者设置的EncodingAESKey 24 | * @param appId 公众平台appid 25 | */ 26 | String encodingAesKey = wechatThirdPartyConfig.getEncodeingAesKey(); 27 | String token = wechatThirdPartyConfig.getToken(); 28 | String appId = wechatThirdPartyConfig.getComponentAppid(); 29 | 30 | this.token = token; 31 | this.appidOrCorpid = appId; 32 | this.aesKey = Base64.decodeBase64(encodingAesKey + "="); 33 | } 34 | 35 | 36 | /** 37 | * 转换成加密的xml格式 38 | * @return 39 | */ 40 | public static String toEncryptedXml( 41 | WechatThirdPartyConfig wechatThirdPartyConfig, WxMpXmlOutMessage wxMpXmlOutMessage ) { 42 | String plainXml = XStreamTransformer.toXml((Class) wxMpXmlOutMessage.getClass(), wxMpXmlOutMessage); 43 | WechatCryptUtil wechatCryptUtil = new WechatCryptUtil(wechatThirdPartyConfig); 44 | return wechatCryptUtil.encrypt(plainXml); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/velocity/login.vm: -------------------------------------------------------------------------------- 1 | 2 | 3 | #include("head.vm") 4 | 5 | 6 |

36 | 37 | 38 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/bean/OpenidBean.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.bean; 2 | 3 | import com.alibaba.fastjson.annotation.JSONField; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by Administrator on 2016/4/11. 9 | */ 10 | public class OpenidBean { 11 | 12 | 13 | private Integer total; 14 | 15 | private Integer count; 16 | 17 | private Openid data; 18 | 19 | @JSONField( name = "next_openid" ) 20 | private String nextOpenid; 21 | 22 | 23 | public class Openid { 24 | 25 | protected List openid; 26 | 27 | 28 | public List getOpenid() { 29 | return openid; 30 | } 31 | 32 | 33 | public void setOpenid( List openid ) { 34 | this.openid = openid; 35 | } 36 | } 37 | 38 | 39 | public Integer getTotal() { 40 | return total; 41 | } 42 | 43 | 44 | public void setTotal( Integer total ) { 45 | this.total = total; 46 | } 47 | 48 | 49 | public Integer getCount() { 50 | return count; 51 | } 52 | 53 | 54 | public void setCount( Integer count ) { 55 | this.count = count; 56 | } 57 | 58 | 59 | public Openid getData() { 60 | return data; 61 | } 62 | 63 | 64 | public void setData( Openid data ) { 65 | this.data = data; 66 | } 67 | 68 | 69 | public String getNextOpenid() { 70 | return nextOpenid; 71 | } 72 | 73 | 74 | public void setNextOpenid( String nextOpenid ) { 75 | this.nextOpenid = nextOpenid; 76 | } 77 | 78 | 79 | @Override 80 | public String toString() { 81 | return "OpenidBean{" 82 | + "total=" + total + ", count=" + count + ", data=" + data + ", nextOpenid='" + nextOpenid + '\'' + '}'; 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/jedis/RedisProxyFactory.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.jedis; 2 | 3 | import java.lang.reflect.InvocationHandler; 4 | import java.lang.reflect.Method; 5 | import java.lang.reflect.Proxy; 6 | import java.lang.reflect.UndeclaredThrowableException; 7 | 8 | import org.springframework.beans.factory.FactoryBean; 9 | 10 | import redis.clients.util.Pool; 11 | 12 | /** 13 | * 代理类,获取操作对象 14 | *

15 | * 16 | * @author norman 17 | * @Date 2014-5-21 18 | */ 19 | public class RedisProxyFactory implements InvocationHandler, FactoryBean { 20 | 21 | private final Pool pool; 22 | 23 | private final RedisCommands proxy; 24 | 25 | 26 | public RedisProxyFactory( Pool pool ) { 27 | this.pool = pool; 28 | proxy = (RedisCommands) Proxy.newProxyInstance( 29 | Thread.currentThread().getContextClassLoader(), new Class[ ] { RedisCommands.class }, this); 30 | } 31 | 32 | 33 | @Override 34 | public Object invoke( @SuppressWarnings( "hiding" ) Object proxy, Method method, Object[] args ) throws Throwable { 35 | Object jedis = pool.getResource(); 36 | try { 37 | return method.invoke(jedis, args); 38 | } catch ( UndeclaredThrowableException e ) { 39 | throw e.getUndeclaredThrowable(); 40 | } finally { 41 | pool.returnResource(jedis); 42 | } 43 | } 44 | 45 | 46 | @Override 47 | public RedisCommands getObject() throws Exception { 48 | return proxy; 49 | } 50 | 51 | 52 | @Override 53 | public Class getObjectType() { 54 | return RedisCommands.class; 55 | } 56 | 57 | 58 | @Override 59 | public boolean isSingleton() { 60 | return true; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/common/Response.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Response.java cn.vko.core.common.response Copyright (c) 2014, 3 | * . 4 | */ 5 | 6 | package site.lovecode.wechat.support.common; 7 | 8 | 9 | import java.io.Serializable; 10 | 11 | 12 | /** 13 | * 所有返回数据的超级父类 14 | *

15 | * 16 | * @author malei 17 | * @date 2014-11-18 18 | * @version 1.0.0 19 | */ 20 | public class Response implements Serializable { 21 | 22 | private static final long serialVersionUID = -6906299699467228288L; 23 | 24 | // 头信息 25 | private ResponseHead head; 26 | 27 | // 数据区 28 | private T body; 29 | 30 | 31 | // 用于构造包含head和body的返回数据 32 | public Response(ResponseHead head, T body ) { 33 | this.head = head; 34 | this.body = body; 35 | } 36 | 37 | 38 | // 用于构造返回数据 39 | public Response(String statusCode, String msg, T body ) { 40 | head = new ResponseHead(statusCode, msg); 41 | this.body = body; 42 | } 43 | 44 | 45 | public ResponseHead getHead() { 46 | return head; 47 | } 48 | 49 | 50 | public String getStatusCode() { 51 | return head.getStatusCode(); 52 | } 53 | 54 | 55 | public boolean isSuccess() { 56 | return CodeConstants.SUCCESS.equals(getStatusCode()); 57 | } 58 | 59 | 60 | public void setHead( ResponseHead head ) { 61 | this.head = head; 62 | } 63 | 64 | 65 | public T getBody() { 66 | if ( !this.isSuccess() ) { throw new WebException(this.getStatusCode(), this.getHead().getDesc()); } 67 | return body; 68 | } 69 | 70 | 71 | public void setBody( T body ) { 72 | this.body = body; 73 | } 74 | 75 | 76 | public T getNotSuccessBody() { 77 | 78 | return body; 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/controller/OfficialAccountController.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.controller; 2 | 3 | 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.ResponseBody; 7 | import site.lovecode.wechat.dto.OfficialAccountReqDto; 8 | import site.lovecode.wechat.module.IOfficialAccountModule; 9 | 10 | import javax.annotation.Resource; 11 | 12 | /** 13 | * Created by Administrator on 2016/4/15. 14 | */ 15 | @Controller 16 | @RequestMapping( "/communication" ) 17 | public class OfficialAccountController extends BaseController { 18 | 19 | 20 | @Resource( name = "officialAccountModuleImpl" ) 21 | private IOfficialAccountModule officialAccountModuleImpl; 22 | 23 | 24 | /** 25 | * 26 | * 手动绑定公众号表单页面 27 | *

28 | * 29 | * 30 | * @return 31 | */ 32 | @RequestMapping( "/binding" ) 33 | public String binding() { 34 | return "communication/authorization/binding"; 35 | } 36 | 37 | 38 | /** 39 | * 帮助页面 40 | * @return 41 | */ 42 | @RequestMapping("/help") 43 | public String help(){ 44 | return "communication/authorization/help"; 45 | } 46 | 47 | 48 | /** 49 | * 50 | * 接收公众号表单信息 51 | *

52 | * @param officialAccountReqDto 公众号信息 53 | * @return 54 | */ 55 | @RequestMapping( "/toBinding" ) 56 | @ResponseBody 57 | public String toBinding( OfficialAccountReqDto officialAccountReqDto ) { 58 | logger.info(officialAccountReqDto.toString()); 59 | officialAccountModuleImpl.saveOfficialAccountInfo(officialAccountReqDto); 60 | return callbackSuccess("success"); 61 | } 62 | 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/module/impl/OfficialAccountModuleImpl.java: -------------------------------------------------------------------------------- 1 | /** 2 | * OfficialAccountModuleImpl.java cn.vko.peixun.module.communication.module 3 | * Copyright (c) 2016, . 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.module.impl; 8 | 9 | 10 | import org.springframework.stereotype.Service; 11 | import site.lovecode.wechat.dto.OfficialAccountReqDto; 12 | import site.lovecode.wechat.entity.OfficialAccount; 13 | import site.lovecode.wechat.module.IOfficialAccountModule; 14 | import site.lovecode.wechat.service.IOfficialAccountService; 15 | import site.lovecode.wechat.support.common.Response; 16 | 17 | import javax.annotation.Resource; 18 | import java.util.List; 19 | 20 | 21 | /** 22 | * 微信公众号基本信息业务层实现 23 | *

24 | * 25 | * 26 | * @author yangpeng 27 | * @date 2016年5月9日 28 | * @version 1.0.0 29 | */ 30 | @Service 31 | public class OfficialAccountModuleImpl extends AbstractModule implements IOfficialAccountModule { 32 | 33 | @Resource 34 | private IOfficialAccountService officialAccountService; 35 | 36 | 37 | /** 38 | * 39 | * 保存手动绑定的公众号信息 40 | *

41 | * 42 | * 43 | * @param officialAccountReqDto 公众号信息 44 | */ 45 | @Override 46 | public void saveOfficialAccountInfo( OfficialAccountReqDto officialAccountReqDto ) { 47 | officialAccountService.saveOfficialAccount(officialAccountReqDto); 48 | } 49 | 50 | 51 | /** 52 | * 53 | * 获取所有公众号列表 54 | *

55 | * 56 | * 57 | * @return TODO(这里描述每个参数,如果有返回值描述返回值,如果有异常描述异常) 58 | */ 59 | @Override 60 | public Response> getOfficialAccount() { 61 | return success(officialAccountService.getAllOfficialAccount()); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/ase/PKCS7Encoder.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 对公众平台发送给公众账号的消息加解密示例代码. 3 | * 4 | * @copyright Copyright (c) 1998-2014 Tencent Inc. 5 | */ 6 | 7 | // ------------------------------------------------------------------------ 8 | 9 | package site.lovecode.wechat.ase; 10 | 11 | import java.nio.charset.Charset; 12 | import java.util.Arrays; 13 | 14 | /** 15 | * 提供基于PKCS7算法的加解密接口. 16 | */ 17 | class PKCS7Encoder { 18 | 19 | static Charset CHARSET = Charset.forName("utf-8"); 20 | 21 | static int BLOCK_SIZE = 32; 22 | 23 | 24 | /** 25 | * 获得对明文进行补位填充的字节. 26 | * 27 | * @param count 需要进行填充补位操作的明文字节个数 28 | * @return 补齐用的字节数组 29 | */ 30 | static byte[] encode( int count ) { 31 | // 计算需要填充的位数 32 | int amountToPad = BLOCK_SIZE - (count % BLOCK_SIZE); 33 | if ( amountToPad == 0 ) { 34 | amountToPad = BLOCK_SIZE; 35 | } 36 | // 获得补位所用的字符 37 | char padChr = chr(amountToPad); 38 | String tmp = new String(); 39 | for ( int index = 0 ; index < amountToPad ; index++ ) { 40 | tmp += padChr; 41 | } 42 | return tmp.getBytes(CHARSET); 43 | } 44 | 45 | 46 | /** 47 | * 删除解密后明文的补位字符 48 | * 49 | * @param decrypted 解密后的明文 50 | * @return 删除补位字符后的明文 51 | */ 52 | static byte[] decode( byte[] decrypted ) { 53 | int pad = decrypted[decrypted.length - 1]; 54 | if ( pad < 1 || pad > 32 ) { 55 | pad = 0; 56 | } 57 | return Arrays.copyOfRange(decrypted, 0, decrypted.length - pad); 58 | } 59 | 60 | 61 | /** 62 | * 将数字转化成ASCII码对应的字符,用于对明文进行补码 63 | * 64 | * @param a 需要转化的数字 65 | * @return 转化得到的字符 66 | */ 67 | static char chr( int a ) { 68 | byte target = (byte) (a & 0xFF); 69 | return (char) target; 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/enums/FuncInfoEnum.java: -------------------------------------------------------------------------------- 1 | /** 2 | * FuncInfoEnum.java site.lovecode.wechat.support.enums Copyright 3 | * (c) 2016,norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.support.enums; 8 | 9 | import java.util.EnumSet; 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | 13 | 14 | /** 15 | * 微信功能列表枚举 16 | *

17 | * 18 | * 19 | * @author yangpeng 20 | * @date 2016年5月7日 21 | * @version 1.0.0 22 | */ 23 | public enum FuncInfoEnum { 24 | 25 | 26 | msg(1, "消息管理权限"), 27 | 28 | user(2, "用户管理权限"), 29 | 30 | account(3, "账号服务权限"), 31 | 32 | web(4, "网页服务权限"), 33 | 34 | store(5, "微信小店权限"), 35 | 36 | service(6, "微信多客服权限"), 37 | 38 | mass(7, "群发与通知权限"), 39 | 40 | card(8, "微信卡券权限"), 41 | 42 | sweep(9, "微信扫一扫权限"), 43 | 44 | wifi(10, "微信连WIFI权限"), 45 | 46 | source(11, "素材管理权限"), 47 | 48 | round(12, "微信摇周边权限"), 49 | 50 | doorStore(13, "微信门店权限"), 51 | 52 | pay(14, "微信支付权限"), 53 | 54 | menu(15, "自定义菜单权限"); 55 | 56 | 57 | private final int key; 58 | 59 | // 枚举描述 60 | private final String desc; 61 | 62 | private static Map map = new HashMap<>(); 63 | 64 | static { 65 | for ( FuncInfoEnum funcInfoEnum : EnumSet.allOf(FuncInfoEnum.class) ) { 66 | map.put(funcInfoEnum.getKey(), funcInfoEnum.getDesc()); 67 | } 68 | } 69 | 70 | 71 | FuncInfoEnum( final int key, final String desc ) { 72 | this.key = key; 73 | this.desc = desc; 74 | } 75 | 76 | 77 | public static String valueOf( int key ) { 78 | return map.get(key); 79 | } 80 | 81 | 82 | public int getKey() { 83 | return key; 84 | } 85 | 86 | 87 | public String getDesc() { 88 | return desc; 89 | } 90 | 91 | 92 | } 93 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/ase/SHA1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * 对公众平台发送给公众账号的消息加解密示例代码. 3 | * 4 | * @copyright Copyright (c) 1998-2014 Tencent Inc. 5 | */ 6 | 7 | // ------------------------------------------------------------------------ 8 | 9 | package site.lovecode.wechat.ase; 10 | 11 | import java.security.MessageDigest; 12 | import java.util.Arrays; 13 | 14 | /** 15 | * SHA1 class 16 | * 17 | * 计算公众平台的消息签名接口. 18 | */ 19 | class SHA1 { 20 | 21 | /** 22 | * 用SHA1算法生成安全签名 23 | * @param token 票据 24 | * @param timestamp 时间戳 25 | * @param nonce 随机字符串 26 | * @param encrypt 密文 27 | * @return 安全签名 28 | * @throws AesException 29 | */ 30 | public static String getSHA1( String token, String timestamp, String nonce, String encrypt ) throws AesException { 31 | try { 32 | String[] array = new String[ ] { token, timestamp, nonce, encrypt }; 33 | StringBuffer sb = new StringBuffer(); 34 | // 字符串排序 35 | Arrays.sort(array); 36 | for ( int i = 0 ; i < 4 ; i++ ) { 37 | sb.append(array[i]); 38 | } 39 | String str = sb.toString(); 40 | // SHA1签名生成 41 | MessageDigest md = MessageDigest.getInstance("SHA-1"); 42 | md.update(str.getBytes()); 43 | byte[] digest = md.digest(); 44 | 45 | StringBuffer hexstr = new StringBuffer(); 46 | String shaHex = ""; 47 | for ( int i = 0 ; i < digest.length ; i++ ) { 48 | shaHex = Integer.toHexString(digest[i] & 0xFF); 49 | if ( shaHex.length() < 2 ) { 50 | hexstr.append(0); 51 | } 52 | hexstr.append(shaHex); 53 | } 54 | return hexstr.toString(); 55 | } catch ( Exception e ) { 56 | e.printStackTrace(); 57 | throw new AesException(AesException.ComputeSignatureError); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/ITagsService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * ITagsService.java site.lovecode.wechat.service Copyright (c) 3 | * 2016, norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.service; 8 | 9 | 10 | import me.chanjar.weixin.common.exception.WxErrorException; 11 | import site.lovecode.wechat.entity.Tags; 12 | import site.lovecode.wechat.util.Page; 13 | 14 | import java.util.List; 15 | 16 | 17 | /** 18 | * 用户标签业务层 19 | *

20 | * 21 | * 22 | * @author yangpeng 23 | * @date 2016年5月10日 24 | * @version 1.0.0 25 | */ 26 | public interface ITagsService { 27 | 28 | 29 | /** 30 | * 31 | * 分页获取公众号所有标签 32 | *

33 | * 34 | * @return 35 | */ 36 | Page getTagsListByPage(Long orgId); 37 | 38 | 39 | /** 40 | * 41 | * 获取公众号所有标签 42 | *

43 | * 44 | * @return 45 | */ 46 | List getTagsList(Long orgId); 47 | 48 | 49 | /** 50 | * 51 | * 创建公众号标签 52 | *

53 | * 54 | * 55 | * @param orgId 公众号id 56 | * @param tagsName 标签名称 57 | * @return 58 | */ 59 | List createTags(Long orgId, String tagsName) throws WxErrorException; 60 | 61 | 62 | /** 63 | * 64 | * 修改标签 65 | *

66 | * 67 | * 68 | * @param orgId id 69 | * @param tagName 标签名称 70 | * @return 71 | * @throws WxErrorException 72 | */ 73 | List modifyTags(Long orgId, String tagName, Long id) throws WxErrorException; 74 | 75 | 76 | /** 77 | * 78 | * 删除标签 79 | *

80 | * 81 | * 82 | * @param orgId 公众号id 83 | * @param id 标签id 84 | * @return 85 | * @throws WxErrorException TODO(这里描述每个参数,如果有返回值描述返回值,如果有异常描述异常) 86 | */ 87 | List deleteTag(Long orgId, Long id) throws WxErrorException; 88 | 89 | } 90 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/service/IUserDataService.java: -------------------------------------------------------------------------------- 1 | /** 2 | * IUserDataService.java site.lovecode.wechat.service Copyright 3 | * (c) 2016, norman. 4 | */ 5 | 6 | 7 | package site.lovecode.wechat.service; 8 | 9 | 10 | import site.lovecode.wechat.dto.PersonalUserGroupDto; 11 | import site.lovecode.wechat.dto.PersonalUserGroupJoinDto; 12 | import site.lovecode.wechat.entity.UserData; 13 | import site.lovecode.wechat.util.Page; 14 | 15 | import java.sql.Date; 16 | import java.util.List; 17 | 18 | 19 | /** 20 | * 用户数据逻辑业务接口 21 | *

22 | * 23 | * 24 | * @author yangpeng 25 | * @date 2016年5月20日 26 | * @version 1.0.0 27 | */ 28 | public interface IUserDataService { 29 | 30 | 31 | /** 32 | * 33 | * 分页获取用户分析数据 34 | *

35 | * 36 | * 37 | * @param page 分页对象 38 | * @param beginDate 开始时间 39 | * @param endDate 结束时间 40 | * @param userSource 关注方式 41 | * @param orgId 机构id 42 | * @return 分页对象 43 | */ 44 | Page getUserDataPageByTerm( 45 | Page page, Date beginDate, Date endDate, Integer userSource, Long orgId); 46 | 47 | 48 | /** 49 | * 获取用户属性分析数据 50 | * @param orgId 机构id 51 | * @return 52 | */ 53 | PersonalUserGroupJoinDto getUserProperty(Long orgId); 54 | 55 | 56 | /** 57 | * 根据用户省份获取用户人数统计 58 | * @param orgId 59 | * @param province 60 | * @return 61 | */ 62 | List getUserCountByProvince(Long orgId, String province); 63 | 64 | 65 | /** 66 | * 根据条件获取用户数据列表 67 | * @param beginDate 68 | * @param endDate 69 | * @param userSource 70 | * @param orgId 71 | * @return 72 | */ 73 | List getUserDataList(Date beginDate, Date endDate, Integer userSource, Long orgId); 74 | 75 | } 76 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/dto/PersonalUserTermDto.java: -------------------------------------------------------------------------------- 1 | /** 2 | * PersonalUserTermDto.java site.lovecode.wechat.dto 3 | * Copyright (c) 2016,norman. 4 | */ 5 | 6 | package site.lovecode.wechat.dto; 7 | 8 | 9 | /** 10 | * 用户查询条件 11 | *

12 | * 13 | * @author Administrator 14 | * @date 2016年5月10日 15 | * @version 1.0.0 16 | */ 17 | public class PersonalUserTermDto { 18 | 19 | 20 | private Long officialAccountId; 21 | 22 | private Long personalUserId; 23 | 24 | private String nickName; 25 | 26 | private Integer status; 27 | 28 | private Integer tagId; 29 | 30 | private String openId; 31 | 32 | 33 | public Long getOfficialAccountId() { 34 | return officialAccountId; 35 | } 36 | 37 | 38 | public void setOfficialAccountId( Long officialAccountId ) { 39 | this.officialAccountId = officialAccountId; 40 | } 41 | 42 | 43 | public Long getPersonalUserId() { 44 | return personalUserId; 45 | } 46 | 47 | 48 | public void setPersonalUserId( Long personalUserId ) { 49 | this.personalUserId = personalUserId; 50 | } 51 | 52 | 53 | public String getNickName() { 54 | return nickName; 55 | } 56 | 57 | 58 | public void setNickName( String nickName ) { 59 | this.nickName = nickName; 60 | } 61 | 62 | 63 | public Integer getStatus() { 64 | return status; 65 | } 66 | 67 | 68 | public void setStatus( Integer status ) { 69 | this.status = status; 70 | } 71 | 72 | 73 | public Integer getTagId() { 74 | return tagId; 75 | } 76 | 77 | 78 | public void setTagId( Integer tagId ) { 79 | this.tagId = tagId; 80 | } 81 | 82 | 83 | public String getOpenId() { 84 | return openId; 85 | } 86 | 87 | 88 | public void setOpenId( String openId ) { 89 | this.openId = openId; 90 | } 91 | 92 | 93 | } 94 | -------------------------------------------------------------------------------- /src/main/java/site/lovecode/wechat/support/constant/WechatUrlConstant.java: -------------------------------------------------------------------------------- 1 | package site.lovecode.wechat.support.constant; 2 | 3 | /** 4 | * Created by Administrator on 2016/4/6. 5 | */ 6 | public class WechatUrlConstant { 7 | 8 | /** 9 | * 获取component_access_token的url 10 | */ 11 | public static final String API_COMPONENT_TOKEN = "https://api.weixin.qq.com/cgi-bin/component/api_component_token"; 12 | 13 | /** 14 | * 获取预授权码url 15 | */ 16 | public static final String API_CREATE_PREAUTHCODE = "https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode?component_access_token="; 17 | 18 | 19 | /** 20 | *获取授权页面地址 21 | */ 22 | public static final String COMPONENT_LOGIN_PAGE = "https://mp.weixin.qq.com/cgi-bin/componentloginpage?"; 23 | 24 | 25 | /** 26 | * 使用授权码换取公众号的接口调用凭据和授权信息url 27 | */ 28 | public static final String API_QUERY_AUTH = "https://api.weixin.qq.com/cgi-bin/component/api_query_auth?component_access_token="; 29 | 30 | 31 | /** 32 | * 获取授权方公账号信息 33 | */ 34 | public static final String API_GET_AUTHORIZER_INFO = "https://api.weixin.qq.com/cgi-bin/component/api_get_authorizer_info?component_access_token="; 35 | 36 | 37 | /** 38 | * 获取(刷新)授权公众号的接口调用凭据(令牌) 39 | */ 40 | public static final String API_AUTHORIZER_TOKEN = "https://api.weixin.qq.com/cgi-bin/component/api_authorizer_token?component_access_token="; 41 | 42 | 43 | /** 44 | * 获取授权方选项设置信息 45 | */ 46 | public static final String API_GET_AUTHORIZER_OPTION = "https://api.weixin.qq.com/cgi-bin/component/ api_get_authorizer_option?component_access_token="; 47 | 48 | 49 | /** 50 | * 设置授权方选项信息 51 | */ 52 | public static final String API_SET_AUTHORIZER_OPTION = "https://api.weixin.qq.com/cgi-bin/component/ api_set_authorizer_option?component_access_token="; 53 | 54 | 55 | } 56 | --------------------------------------------------------------------------------