xiaoyong931011
2023-06-01 84f393150ad365c70186743c0a544ccfc155c7d5
twoCoin项目修改
5 files modified
37 ■■■■ changed files
src/main/java/cc/mrbird/febs/common/contants/AppContants.java 1 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/dapp/dto/AKLineDto.java 2 ●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/dapp/service/impl/DappMemberServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java 15 ●●●●● patch | view | raw | blame | history
src/main/resources/mapper/dapp/DappAKlineMapper.xml 17 ●●●● patch | view | raw | blame | history
src/main/java/cc/mrbird/febs/common/contants/AppContants.java
@@ -215,6 +215,7 @@
    /**
     * AK线返回的条数
     */
    public static final String K_LINE_NOW = "K_LINE_NOW";
    public static final String K_LINE_HOUR = "K_LINE_HOUR";
    public static final String K_LINE_DAY = "K_LINE_DAY";
    public static final String K_LINE_WEEK = "K_LINE_WEEK";
src/main/java/cc/mrbird/febs/dapp/dto/AKLineDto.java
@@ -8,7 +8,7 @@
@ApiModel(value = "AKLineDto", description = "入参")
public class AKLineDto {
    @ApiModelProperty(value = "类型 1:小时 2:日 3:周 4:月", example = "1")
    @ApiModelProperty(value = "类型 0:实时 1:小时 2:日 3:周 4:月", example = "1")
    private int type;
}
src/main/java/cc/mrbird/febs/dapp/service/impl/DappMemberServiceImpl.java
@@ -587,7 +587,7 @@
        }else if(4 == type){
            redisKey = AppContants.K_LINE_MONTH;
        }else{
            redisKey = AppContants.K_LINE_HOUR;
            redisKey = AppContants.K_LINE_NOW;
        }
        Object o = redisUtils.get(redisKey);
        if(ObjectUtil.isNotEmpty(o)){
src/main/java/cc/mrbird/febs/dapp/service/impl/DappSystemServiceImpl.java
@@ -1742,6 +1742,19 @@
        dappAKlineEntity.setHighestPrice(coinAPrice);
        dappAKlineEntity.setClosePrice(coinAPrice);
        dappAKlineMapper.insert(dappAKlineEntity);
        List<cn.hutool.json.JSONObject> objects = new ArrayList<>();
        List<AKLineLimitVo> akLineLimitVos = dappAKlineMapper.selectListByTypeAndLimit(0, AppContants.K_LINE_LIMIT);
        if(CollUtil.isNotEmpty(akLineLimitVos)) {
            Collections.reverse(akLineLimitVos);
            for (AKLineLimitVo akLineLimitVo : akLineLimitVos) {
                cn.hutool.json.JSONObject parseObj = JSONUtil.parseObj(akLineLimitVo);
                objects.add(parseObj);
            }
            redisUtils.del(AppContants.K_LINE_NOW);
            redisUtils.set(AppContants.K_LINE_NOW, objects.toString());
        }
    }
    @Override
@@ -1970,7 +1983,7 @@
            redisKey = AppContants.K_LINE_MONTH;
        }else if(0 == type){
            createKDate();
            return;
            redisKey = AppContants.K_LINE_NOW;
        }else{
            return;
        }
src/main/resources/mapper/dapp/DappAKlineMapper.xml
@@ -36,14 +36,15 @@
            a.highest_price highestPrice,
            a.create_time createTime
        from dapp_a_kline a
        <where>
            <if test="type != 1">
                and a.type = #{type}
            </if>
            <if test="type == 1">
                and a.type in (0,1)
            </if>
        </where>
        where a.type = #{type}
<!--        <where>-->
<!--            <if test="type != 1">-->
<!--                and a.type = #{type}-->
<!--            </if>-->
<!--            <if test="type == 1">-->
<!--                and a.type in (0,1)-->
<!--            </if>-->
<!--        </where>-->
        order by a.create_time desc
        limit #{kLineLimit}
    </select>