| @@ -3,6 +3,7 @@ | |||||
| <mapper namespace="com.iformall.mapper.WxWeappAuditStatusMapper"> | <mapper namespace="com.iformall.mapper.WxWeappAuditStatusMapper"> | ||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappAuditStatus"> | <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappAuditStatus"> | ||||
| <id column="id" jdbcType="BIGINT" property="id" /> | <id column="id" jdbcType="BIGINT" property="id" /> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | <result column="app_id" jdbcType="VARCHAR" property="appId" /> | ||||
| <result column="type" jdbcType="INTEGER" property="type" /> | <result column="type" jdbcType="INTEGER" property="type" /> | ||||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | ||||
| @@ -14,14 +15,17 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`app_id`,`type`,`user_version`,`version_desc`, `audit_status`,`audit_err_code`,`audit_time` | |||||
| `id`,`tenant_id`,`app_id`,`type`,`user_version`,`version_desc`, `audit_status`,`audit_err_code`,`audit_time` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| where 1 = 1 | where 1 = 1 | ||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and `id` = #{id} | and `id` = #{id} | ||||
| </if> | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != appId "> | <if test=" null != appId "> | ||||
| and `app_id` = #{appId} | and `app_id` = #{appId} | ||||
| </if> | </if> | ||||
| @@ -77,6 +81,7 @@ | |||||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappAuditStatusVo"> | <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappAuditStatusVo"> | ||||
| <id column="id" jdbcType="BIGINT" property="id" /> | <id column="id" jdbcType="BIGINT" property="id" /> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | <result column="app_id" jdbcType="VARCHAR" property="appId" /> | ||||
| <result column="type" jdbcType="INTEGER" property="type" /> | <result column="type" jdbcType="INTEGER" property="type" /> | ||||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | ||||
| @@ -88,7 +93,7 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allVoColumns"> | <sql id="allVoColumns"> | ||||
| c.`id`,c.`app_id`,c.`type`,c.`user_version`,`version_desc`, | |||||
| c.`id`,c.`tenant_id`,c.`app_id`,c.`type`,c.`user_version`,`version_desc`, | |||||
| c.`audit_status`,c.`audit_err_code`,c.`audit_time`, | c.`audit_status`,c.`audit_err_code`,c.`audit_time`, | ||||
| a.`name` | a.`name` | ||||
| </sql> | </sql> | ||||
| @@ -98,6 +103,9 @@ | |||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and c.`id` = #{id} | and c.`id` = #{id} | ||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | |||||
| and c.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != appId "> | <if test=" null != appId "> | ||||
| and c.`app_id` = #{appId} | and c.`app_id` = #{appId} | ||||
| </if> | </if> | ||||
| @@ -3,6 +3,7 @@ | |||||
| <mapper namespace="com.iformall.mapper.WxWeappCodeStatusMapper"> | <mapper namespace="com.iformall.mapper.WxWeappCodeStatusMapper"> | ||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappCodeStatus"> | <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappCodeStatus"> | ||||
| <id column="id" jdbcType="BIGINT" property="id" /> | <id column="id" jdbcType="BIGINT" property="id" /> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | <result column="app_id" jdbcType="VARCHAR" property="appId" /> | ||||
| <result column="type" jdbcType="INTEGER" property="type" /> | <result column="type" jdbcType="INTEGER" property="type" /> | ||||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | ||||
| @@ -13,14 +14,17 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`app_id`,`type`,`user_version`,`version_desc`,`code_status`,`code_err_code`,`code_time` | |||||
| `id`,`tenant_id`,`app_id`,`type`,`user_version`,`version_desc`,`code_status`,`code_err_code`,`code_time` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| where 1 = 1 | where 1 = 1 | ||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and `id` = #{id} | and `id` = #{id} | ||||
| </if> | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != appId "> | <if test=" null != appId "> | ||||
| and `app_id` = #{appId} | and `app_id` = #{appId} | ||||
| </if> | </if> | ||||
| @@ -69,6 +73,7 @@ | |||||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappCodeStatusVo"> | <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappCodeStatusVo"> | ||||
| <id column="id" jdbcType="BIGINT" property="id" /> | <id column="id" jdbcType="BIGINT" property="id" /> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | <result column="app_id" jdbcType="VARCHAR" property="appId" /> | ||||
| <result column="type" jdbcType="INTEGER" property="type" /> | <result column="type" jdbcType="INTEGER" property="type" /> | ||||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | ||||
| @@ -88,6 +93,9 @@ | |||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and c.`id` = #{id} | and c.`id` = #{id} | ||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | |||||
| and c.`tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != appId "> | <if test=" null != appId "> | ||||
| and c.`app_id` = #{appId} | and c.`app_id` = #{appId} | ||||
| </if> | </if> | ||||
| @@ -3,6 +3,7 @@ | |||||
| <mapper namespace="com.iformall.mapper.WxWeappReleaseStatusMapper"> | <mapper namespace="com.iformall.mapper.WxWeappReleaseStatusMapper"> | ||||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappReleaseStatus"> | <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappReleaseStatus"> | ||||
| <id column="id" jdbcType="BIGINT" property="id" /> | <id column="id" jdbcType="BIGINT" property="id" /> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | <result column="app_id" jdbcType="VARCHAR" property="appId" /> | ||||
| <result column="type" jdbcType="INTEGER" property="type" /> | <result column="type" jdbcType="INTEGER" property="type" /> | ||||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | ||||
| @@ -13,15 +14,18 @@ | |||||
| </resultMap> | </resultMap> | ||||
| <sql id="allColumns"> | <sql id="allColumns"> | ||||
| `id`,`app_id`,`type`,`user_version`,`version_desc`,`release_status`,`release_err_code`,`release_time` | |||||
| `id`,`tenant_id`,`app_id`,`type`,`user_version`,`version_desc`,`release_status`,`release_err_code`,`release_time` | |||||
| </sql> | </sql> | ||||
| <sql id="dynamicWhereConditions"> | <sql id="dynamicWhereConditions"> | ||||
| where 1 = 1 | where 1 = 1 | ||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and `id` = #{id} | and `id` = #{id} | ||||
| </if> | |||||
| <if test=" null != appId "> | |||||
| </if> | |||||
| <if test=" null != tenantId "> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != appId "> | |||||
| and `app_id` = #{appId} | and `app_id` = #{appId} | ||||
| </if> | </if> | ||||
| <if test=" null != type "> | <if test=" null != type "> | ||||
| @@ -69,6 +73,7 @@ | |||||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappReleaseStatusVo"> | <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappReleaseStatusVo"> | ||||
| <id column="id" jdbcType="BIGINT" property="id" /> | <id column="id" jdbcType="BIGINT" property="id" /> | ||||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | <result column="app_id" jdbcType="VARCHAR" property="appId" /> | ||||
| <result column="type" jdbcType="INTEGER" property="type" /> | <result column="type" jdbcType="INTEGER" property="type" /> | ||||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | ||||
| @@ -90,6 +95,9 @@ | |||||
| <if test=" null != id "> | <if test=" null != id "> | ||||
| and c.`id` = #{id} | and c.`id` = #{id} | ||||
| </if> | </if> | ||||
| <if test=" null != tenantId "> | |||||
| and `tenant_id` = #{tenantId} | |||||
| </if> | |||||
| <if test=" null != appId "> | <if test=" null != appId "> | ||||
| and c.`app_id` = #{appId} | and c.`app_id` = #{appId} | ||||
| </if> | </if> | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.iformall.service.wechat; | package com.iformall.service.wechat; | ||||
| import com.iformall.mapper.WxAuthorizerInfoMapper; | |||||
| import com.iformall.mapper.WxComponentVerifyTicketMapper; | import com.iformall.mapper.WxComponentVerifyTicketMapper; | ||||
| import me.chanjar.weixin.open.api.impl.WxOpenInMemoryConfigStorage; | import me.chanjar.weixin.open.api.impl.WxOpenInMemoryConfigStorage; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| @@ -30,7 +31,10 @@ public class WxOpenInRedisDBConfigStorage extends WxOpenInMemoryConfigStorage { | |||||
| private String cardApiTicket; | private String cardApiTicket; | ||||
| @Autowired | @Autowired | ||||
| WxComponentVerifyTicketMapper wxComponentVerifyTicketMapper; | |||||
| private WxComponentVerifyTicketMapper wxComponentVerifyTicketMapper; | |||||
| @Autowired | |||||
| private WxAuthorizerInfoMapper wxAuthorizerInfoMapper; | |||||
| public WxOpenInRedisDBConfigStorage(Pool<Jedis> jedisPool) { | public WxOpenInRedisDBConfigStorage(Pool<Jedis> jedisPool) { | ||||
| this.jedisPool = jedisPool; | this.jedisPool = jedisPool; | ||||
| @@ -70,7 +74,6 @@ public class WxOpenInRedisDBConfigStorage extends WxOpenInMemoryConfigStorage { | |||||
| try (Jedis jedis = this.jedisPool.getResource()) { | try (Jedis jedis = this.jedisPool.getResource()) { | ||||
| jedis.set(this.componentVerifyTicketKey, componentVerifyTicket); | jedis.set(this.componentVerifyTicketKey, componentVerifyTicket); | ||||
| } | } | ||||
| // TODO update to DB | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -117,6 +120,7 @@ public class WxOpenInRedisDBConfigStorage extends WxOpenInMemoryConfigStorage { | |||||
| public void setAuthorizerRefreshToken(String appId, String authorizerRefreshToken) { | public void setAuthorizerRefreshToken(String appId, String authorizerRefreshToken) { | ||||
| try (Jedis jedis = this.jedisPool.getResource()) { | try (Jedis jedis = this.jedisPool.getResource()) { | ||||
| jedis.set(this.getKey(this.authorizerRefreshTokenKey, appId), authorizerRefreshToken); | jedis.set(this.getKey(this.authorizerRefreshTokenKey, appId), authorizerRefreshToken); | ||||
| } | } | ||||
| // TODO update to DB | // TODO update to DB | ||||
| } | } | ||||
| @@ -140,7 +144,6 @@ public class WxOpenInRedisDBConfigStorage extends WxOpenInMemoryConfigStorage { | |||||
| try (Jedis jedis = this.jedisPool.getResource()) { | try (Jedis jedis = this.jedisPool.getResource()) { | ||||
| jedis.expire(this.getKey(this.authorizerAccessTokenKey, appId), 0); | jedis.expire(this.getKey(this.authorizerAccessTokenKey, appId), 0); | ||||
| } | } | ||||
| // TODO update to DB | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -148,18 +151,7 @@ public class WxOpenInRedisDBConfigStorage extends WxOpenInMemoryConfigStorage { | |||||
| try (Jedis jedis = this.jedisPool.getResource()) { | try (Jedis jedis = this.jedisPool.getResource()) { | ||||
| jedis.setex(this.getKey(this.authorizerAccessTokenKey, appId), expiresInSeconds - 200, authorizerAccessToken); | jedis.setex(this.getKey(this.authorizerAccessTokenKey, appId), expiresInSeconds - 200, authorizerAccessToken); | ||||
| } | } | ||||
| // TODO update to DB | |||||
| } | |||||
| /* | |||||
| @Override | |||||
| public void changeAuthorizationStatus(String appId) { | |||||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||||
| jedis.expire(this.getKey(this.authorizerAccessTokenKey, appId), 0); | |||||
| } | |||||
| // TODO update to DB | |||||
| } | } | ||||
| */ | |||||
| @Override | @Override | ||||
| public String getJsapiTicket(String appId) { | public String getJsapiTicket(String appId) { | ||||
| @@ -24,6 +24,7 @@ public class WxOpenService extends WxOpenServiceImpl { | |||||
| private WechatOpenProperties wechatProperties; | private WechatOpenProperties wechatProperties; | ||||
| @Autowired | @Autowired | ||||
| private RedisProperies redisProperies; | private RedisProperies redisProperies; | ||||
| private static JedisPool pool; | private static JedisPool pool; | ||||
| private WxOpenMessageRouter wxOpenMessageRouter; | private WxOpenMessageRouter wxOpenMessageRouter; | ||||