51 changed files with 2437 additions and 197 deletions
@ -0,0 +1,86 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 授权回调url反参表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
public class AuthCodeDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 授权方APPID |
|||
*/ |
|||
private String authAppid; |
|||
|
|||
/** |
|||
* 授权码 |
|||
*/ |
|||
private String authCode; |
|||
|
|||
/** |
|||
* 有效期 10min |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,91 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 授权信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
public class AuthorizationInfoDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 授权方 appid |
|||
*/ |
|||
private String authorizerAppid; |
|||
|
|||
/** |
|||
* 接口调用令牌(在授权的公众号/小程序具备 API 权限时,才有此返回值) |
|||
*/ |
|||
private String authorizerAccessToken; |
|||
|
|||
/** |
|||
* authorizer_access_token 的有效期(在授权的公众号/小程序具备API权限时,才有此返回值),单位:秒 |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
/** |
|||
* 刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌。用户重新授权后,之前的刷新令牌会失效 |
|||
*/ |
|||
private String authorizerRefreshToken; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 授权方的刷新令牌表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
public class AuthorizerRefreshTokenDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 授权方的刷新令牌 |
|||
*/ |
|||
private String authorizerRefreshToken; |
|||
|
|||
/** |
|||
* 授权方appid |
|||
*/ |
|||
private String authorizerAppid; |
|||
|
|||
/** |
|||
* 删除标识 0-否,1-是 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 第三方平台调用凭证 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
public class ComponentAccessTokenDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 令牌 【第三方平台接口的调用凭据】 |
|||
*/ |
|||
private String componentAccessToken; |
|||
|
|||
/** |
|||
* 令牌有效期 单位:s 最长 60*60*2 |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
/** |
|||
* 删除状态 0:正常 1:删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,86 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 授权给开发者的权限集列表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
public class FuncInfoDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 权限类别 |
|||
*/ |
|||
private String funcscopeCategory; |
|||
|
|||
/** |
|||
* 权限ID |
|||
*/ |
|||
private String funcscopeId; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 授权方APPID |
|||
*/ |
|||
private String authorizationInfoAppid; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,76 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 预授权码历史记录表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
public class PreAuthTokenDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* id |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 预授权码 【第三方平台方实现授权托管的必备信息,每个预授权码有效期为 10 分钟。需要先获取令牌才能调用】 |
|||
*/ |
|||
private String preAuthToken; |
|||
|
|||
/** |
|||
* 预授权码有效期 单位:s 最长 60*60*2 |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
/** |
|||
* 删除状态 0:正常 1:删除 |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,91 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dto; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
import lombok.Data; |
|||
|
|||
|
|||
/** |
|||
* 获取/刷新接口调用令牌记录表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
public class RefreshAuthorizerAccessTokenDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 授权方令牌 |
|||
*/ |
|||
private String authorizerAccessToken; |
|||
|
|||
/** |
|||
* 有效期,单位:秒 |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
/** |
|||
* 刷新令牌 |
|||
*/ |
|||
private String authorizerRefreshToken; |
|||
|
|||
/** |
|||
* 授权方APPID |
|||
*/ |
|||
private String authAppid; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Integer delFlag; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,50 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/8 17:53 |
|||
*/ |
|||
@Data |
|||
public class AuthCodeFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -6163303184086480522L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 授权方AppId |
|||
*/ |
|||
private String authAppId; |
|||
|
|||
/** |
|||
* 授权码 |
|||
*/ |
|||
private String authCode; |
|||
|
|||
/** |
|||
* 有效期 10min |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
/** |
|||
* 删除状态 0:正常 1:已删除 |
|||
*/ |
|||
private Integer delFlag = 0; |
|||
|
|||
/** |
|||
* 创建者 |
|||
*/ |
|||
private String createdBy = "APP_USER"; |
|||
|
|||
/** |
|||
* 更新者 |
|||
*/ |
|||
private String updatedBy = "APP_USER"; |
|||
} |
@ -0,0 +1,49 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/9 10:30 |
|||
*/ |
|||
@Data |
|||
public class AuthorizationInfoFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -1117036477221128930L; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 授权方 appid |
|||
*/ |
|||
private String authorizerAppid; |
|||
|
|||
/** |
|||
* 接口调用令牌(在授权的公众号/小程序具备 API 权限时,才有此返回值) |
|||
*/ |
|||
private String authorizerAccessToken; |
|||
|
|||
/** |
|||
* authorizer_access_token 的有效期(在授权的公众号/小程序具备API权限时,才有此返回值),单位:秒 |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
/** |
|||
* 刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌。用户重新授权后,之前的刷新令牌会失效 |
|||
*/ |
|||
private String authorizerRefreshToken; |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
private Integer delFlag = 0; |
|||
|
|||
private String createdBy = "APP_USER"; |
|||
|
|||
private String updatedBy = "APP_USER"; |
|||
} |
@ -0,0 +1,47 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/9 17:29 |
|||
*/ |
|||
@Data |
|||
public class AuthorizerAccessTokenFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 268927093061495006L; |
|||
|
|||
/** |
|||
* 授权方令牌 |
|||
*/ |
|||
private String authorizerAccessToken; |
|||
|
|||
/** |
|||
* 有效期,单位:秒 |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
/** |
|||
* 刷新令牌 |
|||
*/ |
|||
private String authorizerRefreshToken; |
|||
|
|||
/** |
|||
* 授权方APPID |
|||
*/ |
|||
private String authAppid; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
private Integer delFlag = 0; |
|||
|
|||
private String createdBy = "APP_USER"; |
|||
|
|||
private String updatedBy = "APP_USER"; |
|||
} |
@ -0,0 +1,40 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/9 8:54 |
|||
*/ |
|||
@Data |
|||
public class ComponentAccessTokenFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -2860559047843944065L; |
|||
|
|||
/** |
|||
* 令牌 【第三方平台接口的调用凭据】 |
|||
*/ |
|||
private String componentAccessToken; |
|||
|
|||
/** |
|||
* 令牌有效期 单位:s 最长 60*60*2 |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
/** |
|||
* 删除状态 0:正常 1:删除 |
|||
*/ |
|||
private Integer delFlag = 0; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy = "APP_USER"; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy = "APP_USER"; |
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/9 10:43 |
|||
*/ |
|||
@Data |
|||
public class FuncInfoFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 5468844633023377254L; |
|||
|
|||
/** |
|||
* 权限类别 |
|||
*/ |
|||
private String funcscopeCategory; |
|||
|
|||
/** |
|||
* 权限ID |
|||
*/ |
|||
private String funcscopeId; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 授权方APPID |
|||
*/ |
|||
private String authorizationInfoAppid; |
|||
|
|||
private Integer delFlag = 0; |
|||
|
|||
private String createdBy = "APP_USER"; |
|||
|
|||
private String updatedBy = "APP_USER"; |
|||
} |
@ -0,0 +1,41 @@ |
|||
package com.epmet.dto.form; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/9 9:15 |
|||
*/ |
|||
@Data |
|||
public class PreAuthTokenFormDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 2970040842154724385L; |
|||
|
|||
/** |
|||
* 预授权码 【第三方平台方实现授权托管的必备信息,每个预授权码有效期为 10 分钟。需要先获取令牌才能调用】 |
|||
*/ |
|||
private String preAuthToken; |
|||
|
|||
/** |
|||
* 预授权码有效期 单位:s 最长 60*60*2 |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
/** |
|||
* 删除状态 0:正常 1:删除 |
|||
*/ |
|||
private Integer delFlag = 0; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy = "APP_USER"; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy = "APP_USER"; |
|||
|
|||
} |
@ -0,0 +1,37 @@ |
|||
package com.epmet.dto.result; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/9 17:01 |
|||
*/ |
|||
@Data |
|||
public class WillOverDueResultDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = -9073227815312384742L; |
|||
|
|||
/** |
|||
* 授权方令牌 |
|||
*/ |
|||
private String authorizerAccessToken; |
|||
|
|||
/** |
|||
* 刷新令牌 |
|||
*/ |
|||
private String authorizerRefreshToken; |
|||
|
|||
/** |
|||
* 授权方AppId |
|||
*/ |
|||
private String authAppId; |
|||
|
|||
/** |
|||
* 客户Id |
|||
*/ |
|||
private String customerId; |
|||
|
|||
|
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.epmet.constant; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/8 17:59 |
|||
*/ |
|||
public interface ThirdApiConstant { |
|||
|
|||
/** |
|||
* |
|||
*/ |
|||
String API_CREATE_PREAUTHCODE_URL = "https://api.weixin.qq.com/cgi-bin/component/api_create_preauthcode"; |
|||
|
|||
/** |
|||
* 使用授权码获取授权信息请求地址 |
|||
*/ |
|||
String API_QUERY_AUTH_URL = "https://api.weixin.qq.com/cgi-bin/component/api_query_auth"; |
|||
|
|||
/** |
|||
* 获取令牌请求地址 |
|||
*/ |
|||
String API_COMPONENT_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/component/api_component_token"; |
|||
|
|||
String API_AUTHORIZER_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/component/api_authorizer_token"; |
|||
|
|||
} |
@ -0,0 +1,45 @@ |
|||
package com.epmet.constant; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/8 18:16 |
|||
*/ |
|||
public interface ThirdRedisKeyConstant { |
|||
|
|||
/** |
|||
* : |
|||
*/ |
|||
String COLON = ":"; |
|||
|
|||
/** |
|||
* component_verify_ticket 【令牌】目录 |
|||
*/ |
|||
String TICKET_REDIS_KEY = "epmet:wechartthird:componentverifyticket"; |
|||
|
|||
/** |
|||
* pre_auth_code 预授权码 |
|||
*/ |
|||
String PRE_AUTH_CODE_REDIS_KEY = "epmet:wechartthird:preauthcode"; |
|||
|
|||
/** |
|||
* component_access_token |
|||
*/ |
|||
String ACCESS_TOKEN_REDIS_KEY = "epmet:wechartthird:componentaccesstoken"; |
|||
|
|||
/** |
|||
* authorizer_refresh_token 刷新令牌,获取授权信息时得到 |
|||
*/ |
|||
String AUTHORIZER_REFRESH_TOKEN_REDIS_KEY = "epmet:wechartthird:authorizerrefreshtoken"; |
|||
|
|||
/** |
|||
* auth_code 授权码 |
|||
*/ |
|||
String AUTH_CODE_REDIS_KEY = "epmet:wechartthird:authcode"; |
|||
|
|||
/** |
|||
* authorization_info 授权信息 |
|||
*/ |
|||
String AUTH_INFO_REDIS_KEY = "epmet:wechartthird:authinfo"; |
|||
|
|||
|
|||
} |
@ -0,0 +1,49 @@ |
|||
package com.epmet.constant; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/10 9:27 |
|||
*/ |
|||
public interface ThirdRunTimeInfoConstant { |
|||
|
|||
String AUTH_TICKET = "====================授权票据【ComponentVerifyTicket】:【%s】===================="; |
|||
|
|||
String ERROR_TICKET = "微信开放平台,第三方平台获取【验证票据】失败"; |
|||
|
|||
String END_TICKET = "==============================结束授权事件接收URL================================="; |
|||
|
|||
String START_RECEIVE = "==============================开始授权事件接收URL================================="; |
|||
|
|||
String URL_TICKET = "授权事件接收URL,验证票据"; |
|||
|
|||
String SUCCESS_TICKET = "第三方平台授权事件接收URL,验证票据成功"; |
|||
|
|||
String ERROR_URL_TICKET = "第三方平台授权事件接收URL,验证票据异常"; |
|||
|
|||
String SUCCESS_ACCESS_TOKEN = "====================结束执行定时任务获取令牌【component_access_token】===================="; |
|||
|
|||
String FAILURE_ACCESS_TOKEN = "微信开放平台,第三方平台获取【令牌】失败"; |
|||
|
|||
String ENCRYPT = "Encrypt:%s"; |
|||
|
|||
String MSG = "msg:%s"; |
|||
|
|||
String START_GET_COMPONENT_ACCESS_TOKEN = "====================开始执行定时任务获取令牌【component_access_token】===================="; |
|||
|
|||
String START_DELETE_COMPONENT_ACCESS_TOKEN = "====================开始逻辑删除【component_access_token】===================="; |
|||
|
|||
String START_GET_PRE_AUTH_CODE = "====================开始执行定时任务获取预授权码【pre_auth_code】===================="; |
|||
|
|||
String POST_RESULT = "====================返回post结果:%s"; |
|||
|
|||
String FAILURE_GET_PRE_AUTH_CODE = "微信开放平台,第三方平台获取【预授权码】失败"; |
|||
|
|||
String END_GET_PRE_AUTH_CODE = "====================结束获取预授权码【pre_auth_code】===================="; |
|||
|
|||
String START_GET_AUTH_INFO = "=====================开始获取【authorization_info】====================="; |
|||
|
|||
String START_INSERT_FUNC_INFO = "================================开始插入【func_info】===================================="; |
|||
|
|||
String END_GET_AUTH_INFO = "=====================结束获取【authorization_info】====================="; |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.commons.tools.annotation.LoginUser; |
|||
import com.epmet.commons.tools.security.dto.TokenDto; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import com.epmet.service.ComponentVerifyTicketService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/10 9:04 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("redirectauthcode") |
|||
public class AuthRedirectController { |
|||
|
|||
@Autowired |
|||
private ComponentVerifyTicketService componentVerifyTicketService; |
|||
|
|||
/** |
|||
* @Description 授权回调URL |
|||
* @param |
|||
* @author zxc |
|||
*/ |
|||
public Result redirectUri(HttpServletRequest request, HttpServletResponse response, @LoginUser TokenDto tokenDto, @RequestParam("authAppId")String authAppId){ |
|||
componentVerifyTicketService.redirectUri(request,response,tokenDto,authAppId); |
|||
return new Result(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,39 @@ |
|||
package com.epmet.controller; |
|||
|
|||
import com.epmet.exception.AesException; |
|||
import com.epmet.service.WarrantService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.dom4j.Document; |
|||
import org.dom4j.DocumentException; |
|||
import org.dom4j.DocumentHelper; |
|||
import org.dom4j.Element; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.BufferedReader; |
|||
import java.io.IOException; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/10 10:41 |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@RequestMapping("warrant") |
|||
public class WarrantController { |
|||
|
|||
@Autowired |
|||
private WarrantService warrantService; |
|||
|
|||
@RequestMapping(value ="/{AppId}/callback") |
|||
public void acceptMessageAndEvent(HttpServletRequest request, @PathVariable("APPID") String appid, |
|||
HttpServletResponse response)throws IOException, DocumentException, AesException { |
|||
warrantService.acceptMessageAndEvent(request, appid, response); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.form.AuthCodeFormDTO; |
|||
import com.epmet.entity.AuthCodeEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 授权回调url反参表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-08 |
|||
*/ |
|||
@Mapper |
|||
public interface AuthCodeDao extends BaseDao<AuthCodeEntity> { |
|||
|
|||
void insertRedirectAuthCode(AuthCodeFormDTO formDTO); |
|||
|
|||
} |
@ -0,0 +1,49 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.form.AuthorizationInfoFormDTO; |
|||
import com.epmet.entity.AuthorizationInfoEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* 授权信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-08 |
|||
*/ |
|||
@Mapper |
|||
public interface AuthorizationInfoDao extends BaseDao<AuthorizationInfoEntity> { |
|||
|
|||
/** |
|||
* @Description 插入 授权信息 |
|||
* @param formDTO |
|||
* @author zxc |
|||
*/ |
|||
void insertAuthorizationInfo(AuthorizationInfoFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Description 逻辑删除授权信息 |
|||
* @param customerId |
|||
* @author zxc |
|||
*/ |
|||
void updateOldAuthorizationInfo(@Param("customerId")String customerId); |
|||
|
|||
} |
@ -0,0 +1,33 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.AuthorizerRefreshTokenEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 授权方的刷新令牌表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-08 |
|||
*/ |
|||
@Mapper |
|||
public interface AuthorizerRefreshTokenDao extends BaseDao<AuthorizerRefreshTokenEntity> { |
|||
|
|||
} |
@ -0,0 +1,43 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.form.ComponentAccessTokenFormDTO; |
|||
import com.epmet.entity.ComponentAccessTokenEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 第三方平台调用凭证 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-08 |
|||
*/ |
|||
@Mapper |
|||
public interface ComponentAccessTokenDao extends BaseDao<ComponentAccessTokenEntity> { |
|||
|
|||
/** |
|||
* @Description 插入component_access_token信息 |
|||
* @param formDTO |
|||
* @author zxc |
|||
*/ |
|||
void insertComponentAccessToken(ComponentAccessTokenFormDTO formDTO); |
|||
|
|||
void updateOldComponentAccessToken(); |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.form.FuncInfoFormDTO; |
|||
import com.epmet.entity.FuncInfoEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 授权给开发者的权限集列表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-08 |
|||
*/ |
|||
@Mapper |
|||
public interface FuncInfoDao extends BaseDao<FuncInfoEntity> { |
|||
|
|||
/** |
|||
* @Description 插入授权列表信息 |
|||
* @param funcInfoList |
|||
* @author zxc |
|||
*/ |
|||
void insertFuncInfo(@Param("funcInfoList") List<FuncInfoFormDTO> funcInfoList); |
|||
|
|||
/** |
|||
* @Description 逻辑删除 权限列表 |
|||
* @param customerId |
|||
* @author zxc |
|||
*/ |
|||
void updateOldFuncInfo(@Param("customerId")String customerId); |
|||
|
|||
} |
@ -0,0 +1,48 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.form.PreAuthTokenFormDTO; |
|||
import com.epmet.entity.PreAuthTokenEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* 预授权码历史记录表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-08 |
|||
*/ |
|||
@Mapper |
|||
public interface PreAuthTokenDao extends BaseDao<PreAuthTokenEntity> { |
|||
|
|||
/** |
|||
* @Description 插入 预授权码 |
|||
* @param formDTO |
|||
* @author zxc |
|||
*/ |
|||
void insertPreAuthToken(PreAuthTokenFormDTO formDTO); |
|||
|
|||
/** |
|||
* @Description 逻辑删 pre_auth_code |
|||
* @param |
|||
* @author zxc |
|||
*/ |
|||
void updateOldPreAuthCode(); |
|||
|
|||
} |
@ -0,0 +1,59 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.dto.form.AuthorizerAccessTokenFormDTO; |
|||
import com.epmet.dto.result.WillOverDueResultDTO; |
|||
import com.epmet.entity.RefreshAuthorizerAccessTokenEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 获取/刷新接口调用令牌记录表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-08 |
|||
*/ |
|||
@Mapper |
|||
public interface RefreshAuthorizerAccessTokenDao extends BaseDao<RefreshAuthorizerAccessTokenEntity> { |
|||
|
|||
/** |
|||
* @Description 查询即将过期的 authorizer_access_token |
|||
* @param |
|||
* @author zxc |
|||
*/ |
|||
List<WillOverDueResultDTO> checkWillOverDue(); |
|||
|
|||
/** |
|||
* @Description 插入 authorizer_access_token |
|||
* @param refreshAccessToken |
|||
* @author zxc |
|||
*/ |
|||
void insertAuthorizerAccessToken(AuthorizerAccessTokenFormDTO refreshAccessToken); |
|||
|
|||
/** |
|||
* @Description 逻辑删除 授权方的authorizer_access_token |
|||
* @param customerId |
|||
* @author zxc |
|||
*/ |
|||
void updateOldAuthorizerAccessToken(@Param("customerId")String customerId); |
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 授权回调url反参表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("auth_code") |
|||
public class AuthCodeEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 授权方APPID |
|||
*/ |
|||
private String authAppid; |
|||
|
|||
/** |
|||
* 授权码 |
|||
*/ |
|||
private String authCode; |
|||
|
|||
/** |
|||
* 有效期 10min |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
} |
@ -0,0 +1,66 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 授权信息表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("authorization_info") |
|||
public class AuthorizationInfoEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 授权方 appid |
|||
*/ |
|||
private String authorizerAppid; |
|||
|
|||
/** |
|||
* 接口调用令牌(在授权的公众号/小程序具备 API 权限时,才有此返回值) |
|||
*/ |
|||
private String authorizerAccessToken; |
|||
|
|||
/** |
|||
* authorizer_access_token 的有效期(在授权的公众号/小程序具备API权限时,才有此返回值),单位:秒 |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
/** |
|||
* 刷新令牌(在授权的公众号具备API权限时,才有此返回值),刷新令牌主要用于第三方平台获取和刷新已授权用户的 authorizer_access_token。一旦丢失,只能让用户重新授权,才能再次拿到新的刷新令牌。用户重新授权后,之前的刷新令牌会失效 |
|||
*/ |
|||
private String authorizerRefreshToken; |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 授权方的刷新令牌表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("authorizer_refresh_token") |
|||
public class AuthorizerRefreshTokenEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 授权方的刷新令牌 |
|||
*/ |
|||
private String authorizerRefreshToken; |
|||
|
|||
/** |
|||
* 授权方appid |
|||
*/ |
|||
private String authorizerAppid; |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 第三方平台调用凭证 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("component_access_token") |
|||
public class ComponentAccessTokenEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 令牌 【第三方平台接口的调用凭据】 |
|||
*/ |
|||
private String componentAccessToken; |
|||
|
|||
/** |
|||
* 令牌有效期 单位:s 最长 60*60*2 |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 授权给开发者的权限集列表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("func_info") |
|||
public class FuncInfoEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 权限类别 |
|||
*/ |
|||
private String funcscopeCategory; |
|||
|
|||
/** |
|||
* 权限ID |
|||
*/ |
|||
private String funcscopeId; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 授权方APPID |
|||
*/ |
|||
private String authorizationInfoAppid; |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 预授权码历史记录表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("pre_auth_token") |
|||
public class PreAuthTokenEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 预授权码 【第三方平台方实现授权托管的必备信息,每个预授权码有效期为 10 分钟。需要先获取令牌才能调用】 |
|||
*/ |
|||
private String preAuthToken; |
|||
|
|||
/** |
|||
* 预授权码有效期 单位:s 最长 60*60*2 |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
} |
@ -0,0 +1,66 @@ |
|||
/** |
|||
* Copyright 2018 人人开源 https://www.renren.io
|
|||
* <p> |
|||
* This program is free software: you can redistribute it and/or modify |
|||
* it under the terms of the GNU General Public License as published by |
|||
* the Free Software Foundation, either version 3 of the License, or |
|||
* (at your option) any later version. |
|||
* <p> |
|||
* This program is distributed in the hope that it will be useful, |
|||
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|||
* GNU General Public License for more details. |
|||
* <p> |
|||
* You should have received a copy of the GNU General Public License |
|||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
*/ |
|||
|
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
|
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 获取/刷新接口调用令牌记录表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2020-07-09 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("refresh_authorizer_access_token") |
|||
public class RefreshAuthorizerAccessTokenEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 授权方令牌 |
|||
*/ |
|||
private String authorizerAccessToken; |
|||
|
|||
/** |
|||
* 有效期,单位:秒 |
|||
*/ |
|||
private Integer expiresIn; |
|||
|
|||
/** |
|||
* 刷新令牌 |
|||
*/ |
|||
private String authorizerRefreshToken; |
|||
|
|||
/** |
|||
* 授权方APPID |
|||
*/ |
|||
private String authAppid; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
} |
@ -0,0 +1,19 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.exception.AesException; |
|||
import org.dom4j.DocumentException; |
|||
import org.springframework.web.bind.annotation.PathVariable; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.IOException; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/10 11:03 |
|||
*/ |
|||
public interface WarrantService { |
|||
|
|||
void acceptMessageAndEvent(HttpServletRequest request,String appid,HttpServletResponse response)throws IOException, DocumentException, AesException; |
|||
|
|||
} |
@ -0,0 +1,51 @@ |
|||
package com.epmet.service.impl; |
|||
|
|||
import com.epmet.exception.AesException; |
|||
import com.epmet.service.WarrantService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.apache.commons.lang3.StringUtils; |
|||
import org.dom4j.Document; |
|||
import org.dom4j.DocumentException; |
|||
import org.dom4j.DocumentHelper; |
|||
import org.dom4j.Element; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import javax.servlet.http.HttpServletRequest; |
|||
import javax.servlet.http.HttpServletResponse; |
|||
import java.io.BufferedReader; |
|||
import java.io.IOException; |
|||
|
|||
/** |
|||
* @Author zxc |
|||
* @CreateTime 2020/7/10 11:03 |
|||
*/ |
|||
@Slf4j |
|||
@Service |
|||
public class WarrantServiceImpl implements WarrantService { |
|||
@Override |
|||
public void acceptMessageAndEvent(HttpServletRequest request, String appid, HttpServletResponse response)throws IOException, DocumentException, AesException { |
|||
String msgSignature = request.getParameter("msg_signature"); |
|||
log.info("第三方平台全网发布-------------{appid}/callback-----------验证开始。。。。msg_signature=" + msgSignature); |
|||
if (!StringUtils.isNotBlank(msgSignature)) { |
|||
return;// 微信推送给第三方开放平台的消息一定是加过密的,无消息加密无法解密消息
|
|||
} |
|||
StringBuilder sb =new StringBuilder(); |
|||
BufferedReader in = request.getReader(); |
|||
String line; |
|||
while ((line = in.readLine()) !=null) { |
|||
sb.append(line); |
|||
} |
|||
in.close(); |
|||
|
|||
String xml = sb.toString(); |
|||
Document doc = DocumentHelper.parseText(xml); |
|||
Element rootElt = doc.getRootElement(); |
|||
String toUserName = rootElt.elementText("ToUserName"); |
|||
|
|||
//微信全网测试账号
|
|||
// if (StringUtils.equalsIgnoreCase(toUserName, APPID)) {
|
|||
log.info("全网发布接入检测消息反馈开始---------------APPID=" + appid +"------------------------toUserName=" + toUserName); |
|||
// checkWeixinAllNetworkCheck(request, response, xml);
|
|||
// }
|
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.AuthCodeDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.AuthCodeEntity" id="authCodeMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="authAppid" column="AUTH_APPID"/> |
|||
<result property="authCode" column="AUTH_CODE"/> |
|||
<result property="expiresIn" column="EXPIRES_IN"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<insert id="insertRedirectAuthCode" parameterType="com.epmet.dto.form.AuthCodeFormDTO"> |
|||
INSERT INTO auth_code ( ID, CUSTOMER_ID, AUTH_APPID, AUTH_CODE, EXPIRES_IN, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) |
|||
VALUES |
|||
( |
|||
REPLACE ( UUID(), '-', '' ), |
|||
#{customerId}, |
|||
#{authAppId}, |
|||
#{authCode}, |
|||
#{expiresIn}, |
|||
#{delFlag}, |
|||
#{createdBy}, |
|||
NOW(), |
|||
#{updatedBy}, |
|||
NOW() |
|||
) |
|||
</insert> |
|||
|
|||
</mapper> |
@ -0,0 +1,44 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.AuthorizationInfoDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.AuthorizationInfoEntity" id="authorizationInfoMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="authorizerAppid" column="AUTHORIZER_APPID"/> |
|||
<result property="authorizerAccessToken" column="AUTHORIZER_ACCESS_TOKEN"/> |
|||
<result property="expiresIn" column="EXPIRES_IN"/> |
|||
<result property="authorizerRefreshToken" column="AUTHORIZER_REFRESH_TOKEN"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<!-- 插入 授权信息 --> |
|||
<insert id="insertAuthorizationInfo" parameterType="com.epmet.dto.form.AuthorizationInfoFormDTO"> |
|||
INSERT INTO authorization_info ( ID, CUSTOMER_ID, AUTHORIZER_APPID, AUTHORIZER_ACCESS_TOKEN, EXPIRES_IN, AUTHORIZER_REFRESH_TOKEN, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) |
|||
VALUES |
|||
( |
|||
REPLACE ( UUID(), '-', '' ), |
|||
#{customerId}, |
|||
#{authorizerAppid}, |
|||
#{authorizerAccessToken}, |
|||
#{expiresIn}, |
|||
#{authorizerRefreshToken}, |
|||
#{delFlag}, |
|||
#{createdBy}, |
|||
NOW(), |
|||
#{updatedBy}, |
|||
NOW() |
|||
) |
|||
</insert> |
|||
|
|||
<!-- 逻辑删除授权信息 --> |
|||
<update id="updateOldAuthorizationInfo"> |
|||
update authorization_info set del_flag = 0 where customer_id = #{customerId} |
|||
</update> |
|||
|
|||
</mapper> |
@ -0,0 +1,18 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.AuthorizerRefreshTokenDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.AuthorizerRefreshTokenEntity" id="authorizerRefreshTokenMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="authorizerRefreshToken" column="AUTHORIZER_REFRESH_TOKEN"/> |
|||
<result property="authorizerAppid" column="AUTHORIZER_APPID"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
|
|||
</mapper> |
@ -0,0 +1,37 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.ComponentAccessTokenDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.ComponentAccessTokenEntity" id="componentAccessTokenMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="componentAccessToken" column="COMPONENT_ACCESS_TOKEN"/> |
|||
<result property="expiresIn" column="EXPIRES_IN"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<!-- 插入component_access_token信息 --> |
|||
<insert id="insertComponentAccessToken" parameterType="com.epmet.dto.form.ComponentAccessTokenFormDTO"> |
|||
INSERT INTO component_access_token ( ID, COMPONENT_ACCESS_TOKEN, EXPIRES_IN, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) |
|||
VALUES |
|||
( |
|||
REPLACE ( UUID(), '-', '' ), |
|||
#{componentAccessToken}, |
|||
#{expiresIn}, |
|||
#{delFlag}, |
|||
#{createdBy}, |
|||
NOW(), |
|||
#{updatedBy}, |
|||
NOW() |
|||
) |
|||
</insert> |
|||
|
|||
<update id="updateOldComponentAccessToken"> |
|||
update component_access_token set del_flag = 1 |
|||
</update> |
|||
|
|||
</mapper> |
@ -0,0 +1,44 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.FuncInfoDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.FuncInfoEntity" id="funcInfoMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="funcscopeCategory" column="FUNCSCOPE_CATEGORY"/> |
|||
<result property="funcscopeId" column="FUNCSCOPE_ID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="authorizationInfoAppid" column="AUTHORIZATION_INFO_APPID"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<!-- 插入授权列表信息 --> |
|||
<insert id="insertFuncInfo" parameterType="com.epmet.dto.form.FuncInfoFormDTO"> |
|||
<foreach collection="funcInfoList" item="func" separator=","> |
|||
INSERT INTO func_info ( ID, FUNCSCOPE_CATEGORY, FUNCSCOPE_ID, CUSTOMER_ID, AUTHORIZATION_INFO_APPID, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) |
|||
VALUES |
|||
( |
|||
REPLACE ( UUID(), '-', '' ), |
|||
#{func.funcscopeCategory}, |
|||
#{func.funcscopeId}, |
|||
#{func.customerId} |
|||
#{func.authorizationInfoAppid}, |
|||
#{func.delFlag}, |
|||
#{func.createdBy}, |
|||
NOW(), |
|||
#{func.updatedBy}, |
|||
NOW() |
|||
) |
|||
</foreach> |
|||
</insert> |
|||
|
|||
<!-- 逻辑删除 权限列表 --> |
|||
<update id="updateOldFuncInfo"> |
|||
update func_info set del_flag = 0 where customer_id = #{customerId} |
|||
</update> |
|||
|
|||
</mapper> |
@ -0,0 +1,38 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.PreAuthTokenDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.PreAuthTokenEntity" id="preAuthTokenMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="preAuthToken" column="PRE_AUTH_TOKEN"/> |
|||
<result property="expiresIn" column="EXPIRES_IN"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<!-- 插入 pre_auth_code --> |
|||
<insert id="insertPreAuthToken" parameterType="com.epmet.dto.form.PreAuthTokenFormDTO"> |
|||
INSERT INTO pre_auth_token ( ID, PRE_AUTH_TOKEN, EXPIRES_IN, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) |
|||
VALUES |
|||
( |
|||
REPLACE ( UUID(), '-', '' ), |
|||
#{preAuthToken}, |
|||
#{expiresIn}, |
|||
#{delFlag}, |
|||
#{createdBy}, |
|||
NOW(), |
|||
#{updatedBy}, |
|||
NOW() |
|||
) |
|||
</insert> |
|||
|
|||
<!-- 逻辑删pre_auth_code --> |
|||
<update id="updateOldPreAuthCode"> |
|||
update pre_auth_token set del_flag = 0 |
|||
</update> |
|||
|
|||
</mapper> |
@ -0,0 +1,57 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.RefreshAuthorizerAccessTokenDao"> |
|||
|
|||
<resultMap type="com.epmet.entity.RefreshAuthorizerAccessTokenEntity" id="refreshAuthorizerAccessTokenMap"> |
|||
<result property="id" column="ID"/> |
|||
<result property="authorizerAccessToken" column="AUTHORIZER_ACCESS_TOKEN"/> |
|||
<result property="expiresIn" column="EXPIRES_IN"/> |
|||
<result property="authorizerRefreshToken" column="AUTHORIZER_REFRESH_TOKEN"/> |
|||
<result property="authAppid" column="AUTH_APPID"/> |
|||
<result property="customerId" column="CUSTOMER_ID"/> |
|||
<result property="delFlag" column="DEL_FLAG"/> |
|||
<result property="createdBy" column="CREATED_BY"/> |
|||
<result property="createdTime" column="CREATED_TIME"/> |
|||
<result property="updatedBy" column="UPDATED_BY"/> |
|||
<result property="updatedTime" column="UPDATED_TIME"/> |
|||
</resultMap> |
|||
|
|||
<select id="checkWillOverDue" resultType="com.epmet.dto.result.WillOverDueResultDTO"> |
|||
SELECT |
|||
authorizer_access_token AS authorizerAccessToken, |
|||
authorizer_refresh_token AS authorizerRefreshToken, |
|||
auth_appid AS authAppId, |
|||
customer_id AS customerId |
|||
FROM |
|||
refresh_authorizer_access_token |
|||
WHERE |
|||
( UNIX_TIMESTAMP( CREATED_TIME ) + EXPIRES_IN ) - UNIX_TIMESTAMP(NOW()) <![CDATA[ <= ]]> 10 |
|||
AND ( UNIX_TIMESTAMP( CREATED_TIME ) + EXPIRES_IN ) - UNIX_TIMESTAMP( NOW()) > 0 |
|||
AND del_flag = 0 |
|||
</select> |
|||
|
|||
<insert id="insertAuthorizerAccessToken" parameterType="com.epmet.dto.form.AuthorizerAccessTokenFormDTO"> |
|||
INSERT INTO refresh_authorizer_access_token ( ID, AUTHORIZER_ACCESS_TOKEN, EXPIRES_IN, AUTHORIZER_REFRESH_TOKEN, AUTH_APPID, CUSTOMER_ID, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) |
|||
VALUES |
|||
( |
|||
REPLACE ( UUID(), '-', '' ), |
|||
#{authorizerAccessToken}, |
|||
#{expiresIn}, |
|||
#{authorizerRefreshToken}, |
|||
#{authAppid}, |
|||
#{customerId}, |
|||
#{delFlag}, |
|||
#{createdBy}, |
|||
NOW(), |
|||
#{updatedBy}, |
|||
NOW() |
|||
) |
|||
</insert> |
|||
|
|||
<!-- 逻辑删 authorizer_access_token --> |
|||
<update id="updateOldAuthorizerAccessToken"> |
|||
update refresh_authorizer_access_token set del_flag = 0 where customer_id = #{customerId} |
|||
</update> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue