Browse Source

更新token缓存时间

master
long 3 years ago
parent
commit
da3c063362
  1. 2
      conflux-admin/src/main/java/com/conflux/web/controller/nft/mapper/NftLogMapper.java
  2. 9
      conflux-admin/src/main/java/com/conflux/web/controller/nft/service/impl/ConfluxServiceImpl.java
  3. 6
      conflux-admin/src/main/java/com/conflux/web/controller/nft/service/impl/NftLogServiceImpl.java
  4. 2
      conflux-system/src/main/resources/mapper/system/NftLogMapper.xml

2
conflux-admin/src/main/java/com/conflux/web/controller/nft/mapper/NftLogMapper.java

@ -61,5 +61,5 @@ public interface NftLogMapper
*/
public int deleteNftLogByIds(Long[] ids);
public int selectSum(String unitName);
public String selectSum(String unitName);
}

9
conflux-admin/src/main/java/com/conflux/web/controller/nft/service/impl/ConfluxServiceImpl.java

@ -194,7 +194,10 @@ public class ConfluxServiceImpl implements ConfluxService {
System.out.println("--------正在铸造----------->");
}
});
return AjaxResult.success("上链成功!");
Map<String,Object> map=new HashMap<>();
map.put("contract",contract);
// map.put("ids",tokenIds);
return AjaxResult.success("上链成功!",map);
}
return AjaxResult.error("token或sign签名失效!");
}
@ -219,8 +222,8 @@ public class ConfluxServiceImpl implements ConfluxService {
map.put("timesTamp", time);
try {
map.put("sign", AESUtil.encrypt(ConfluxArt.SIGN + time));
redisUtils.set(privateKey.getAppId(), token,360000l);//缓存一小时
redisUtils.set(md5Key, AESUtil.encrypt(ConfluxArt.SIGN + time),360000l);
redisUtils.set(privateKey.getAppId(), token,3600l);//缓存一小时
redisUtils.set(md5Key, AESUtil.encrypt(ConfluxArt.SIGN + time),3600l);
map.put("expireTime",3600);//过期时间 单位秒
} catch (Exception e) {
e.printStackTrace();

6
conflux-admin/src/main/java/com/conflux/web/controller/nft/service/impl/NftLogServiceImpl.java

@ -97,6 +97,10 @@ public class NftLogServiceImpl implements INftLogService
@Override
public int selectSum(String unitName) {
return nftLogMapper.selectSum(unitName);
String sum = nftLogMapper.selectSum(unitName);
if (null!=sum){
return Integer.valueOf(sum);
}
return 0;
}
}

2
conflux-system/src/main/resources/mapper/system/NftLogMapper.xml

@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectNftLogVo"/>
where id = #{id}
</select>
<select id="selectSum" resultType="java.lang.Integer">
<select id="selectSum" resultType="java.lang.String">
SELECT SUM(nft_num) FROM `nft_log` WHERE unit_name=#{unitName}
</select>

Loading…
Cancel
Save