admin
2022-05-06 8cc3c660bdaaaa6a46eecadb78e4e9c17a07c227
bug修复
13个文件已修改
1个文件已添加
178 ■■■■■ 已修改文件
app/pom.xml 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/yeshi/makemoney/app/controller/client/api/ConfigController.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/yeshi/makemoney/app/controller/client/api/UserController.java 33 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/yeshi/makemoney/app/dao/goldcorn/GoldCornGetRecordDao.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/yeshi/makemoney/app/dto/config/AdSourceConfig.java 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/yeshi/makemoney/app/entity/config/SystemConfigKey.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/yeshi/makemoney/app/entity/config/SystemConfigType.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/yeshi/makemoney/app/service/impl/msg/UserMsgNotifyServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/yeshi/makemoney/app/service/manager/PushManager.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/yeshi/makemoney/app/vo/goldcorn/GoldCornTaskVO.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/resources/application-pro.yml 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/resources/static/index.html 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/resources/static/money/user_money_record_list.html 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/test/java/test/msg/MsgTest.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/pom.xml
@@ -8,7 +8,7 @@
    </parent>
    <modelVersion>4.0.0</modelVersion>
    <artifactId>app</artifactId>
    <artifactId>dsp</artifactId>
    <packaging>jar</packaging>
@@ -209,7 +209,7 @@
        <dependency>
            <groupId>com.ks</groupId>
            <artifactId>facade-push</artifactId>
            <version>0.0.2</version>
            <version>0.0.4</version>
        </dependency>
        <dependency>
@@ -291,7 +291,7 @@
    <build>
        <finalName>app</finalName>
        <finalName>dsp</finalName>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
app/src/main/java/com/yeshi/makemoney/app/controller/client/api/ConfigController.java
@@ -1,5 +1,7 @@
package com.yeshi.makemoney.app.controller.client.api;
import com.google.gson.Gson;
import com.yeshi.makemoney.app.dto.config.AdSourceConfig;
import com.yeshi.makemoney.app.entity.config.SystemConfigKey;
import com.yeshi.makemoney.app.service.inter.config.SystemConfigService;
import com.yeshi.makemoney.app.vo.AcceptData;
@@ -42,7 +44,8 @@
                SystemConfigKey.course,
                SystemConfigKey.unRegister,
                SystemConfigKey.privacyComplain,
                SystemConfigKey.vipLink
                SystemConfigKey.helpLink,
                SystemConfigKey.disclaimerLink
        };
        for (SystemConfigKey config : configs) {
@@ -50,39 +53,31 @@
            data.put(config.name(), value);
        }
        //TODO 广告K接口配置
        SystemConfigKey[] ads = new SystemConfigKey[]{
                SystemConfigKey.splashAd,
                SystemConfigKey.rewardAd,
                SystemConfigKey.exitAppAd
        };
        JSONObject adConfig = new JSONObject();
        for (SystemConfigKey ad : ads) {
            String value = systemConfigService.getValueCache(acceptData.getSystem(), ad);
            JSONObject valueJSON = JSONObject.fromObject(value);
            String channel = acceptData.getChannel();
            String channel = acceptData.getChannel().toLowerCase();
            if (StringUtil.isNullOrEmpty(channel) || valueJSON.optJSONObject(channel) == null) {
                channel = "qq";
            }
            valueJSON = valueJSON.optJSONObject(channel.toLowerCase());
            if (valueJSON != null) {
                if (acceptData.getVersion() <= valueJSON.optInt("version")) {
                    String pid = valueJSON.optString("pid");
                    String type = valueJSON.optString("type");
                    valueJSON = new JSONObject();
                    valueJSON.put("pid", pid);
                    valueJSON.put("type", type);
                } else {
                    valueJSON = null;
                AdSourceConfig adSourceConfig = new Gson().fromJson(valueJSON.toString(), AdSourceConfig.class);
                if (acceptData.getVersion() <= adSourceConfig.getVersion()) {
                    adConfig.put(ad.name(), new Gson().toJson(adSourceConfig.getTypes()));
                }
            }
            if (valueJSON != null) {
                data.put(ad.name().replace("ad_", ""), valueJSON.toString());
            }
        }
        data.put("ad", adConfig);
        return JsonUtil.loadTrueResult(data);
    }
app/src/main/java/com/yeshi/makemoney/app/controller/client/api/UserController.java
@@ -206,23 +206,23 @@
    @UserLogin(uid = "#uid")
    @ResponseBody
    @RequestMapping("unRegister")
    public String unRegister(AcceptData acceptData, String vcode, String phone) {
    public String unRegister(AcceptData acceptData, Long uid) {
        if (StringUtil.isNullOrEmpty(vcode)) {
            return JsonUtil.loadFalseResult("验证码不能为空");
        }
//        if (StringUtil.isNullOrEmpty(vcode)) {
//            return JsonUtil.loadFalseResult("验证码不能为空");
//        }
//
//        if (StringUtil.isNullOrEmpty(phone)) {
//            return JsonUtil.loadFalseResult("手机号不能为空");
//        }
//
//        if (!verifyCodeManager.isPhoneCodeRight(acceptData.getSystem(), phone, vcode)) {
//            return JsonUtil.loadFalseResult("验证码错误");
//        }
        if (StringUtil.isNullOrEmpty(phone)) {
            return JsonUtil.loadFalseResult("手机号不能为空");
        }
        if (!verifyCodeManager.isPhoneCodeRight(acceptData.getSystem(), phone, vcode)) {
            return JsonUtil.loadFalseResult("验证码错误");
        }
        UserInfo user = userInfoService.selectValidByPhone(acceptData.getSystem(), phone);
        UserInfo user = userInfoService.getAvaiableUser(uid);
        if (user == null) {
            return JsonUtil.loadFalseResult("不存在绑定该手机号的用户");
            return JsonUtil.loadFalseResult("用户不存在或用户已被封禁");
        }
        //注销
        userAccountService.unRegister(user.getId());
@@ -318,11 +318,10 @@
            pushManager.saveToken(acceptData, uid, regId);
            return JsonUtil.loadTrueResult("");
        } catch (BPushDeviceTokenException e) {
            return JsonUtil.loadTrueResult("业务出错");
            return JsonUtil.loadFalseResult(e.getCode(), "业务出错");
        } catch (ParamsException e) {
            return JsonUtil.loadTrueResult("参数错误");
            return JsonUtil.loadFalseResult(e.getCode(), "参数错误");
        }
    }
    /**
app/src/main/java/com/yeshi/makemoney/app/dao/goldcorn/GoldCornGetRecordDao.java
@@ -75,7 +75,7 @@
    }
    /**
     * @return java.util.Map<com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               java.lang.Long>
     * @return java.util.Map<com.yeshi.makemoney.app.entity.goldcorn.GoldCornGetType                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               ,                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               java.lang.Long>
     * @author hxh
     * @description 统计事件数量
     * @date 10:48 2022/4/28
@@ -91,9 +91,11 @@
        Map<GoldCornGetType, Long> resultMap = new HashMap<>();
        if (mapList != null) {
            for (Map map : mapList) {
                GoldCornGetType type = GoldCornGetType.valueOf(map.get("_id")+"");
                Long count = (Long) map.get("eventCount");
                count = count == null ? 0L : count;
                GoldCornGetType type = GoldCornGetType.valueOf(map.get("_id") + "");
                Long count = 0L;
                if (map.get("eventCount") != null) {
                    count = Long.parseLong(map.get("eventCount") + "");
                }
                resultMap.put(type, count);
            }
        }
app/src/main/java/com/yeshi/makemoney/app/dto/config/AdSourceConfig.java
New file
@@ -0,0 +1,51 @@
package com.yeshi.makemoney.app.dto.config;
import java.util.List;
/**
 * @author hxh
 * @title: AdSourceConfig
 * @description: 广告来源配置
 * @date 2022/5/5 15:46
 */
public class AdSourceConfig {
    private int version;
    private List<TypeProbability> types;
    static class TypeProbability {
        String type;
        int weight;
        public String getType() {
            return type;
        }
        public void setType(String type) {
            this.type = type;
        }
        public int getWeight() {
            return weight;
        }
        public void setWeight(int weight) {
            this.weight = weight;
        }
    }
    public int getVersion() {
        return version;
    }
    public void setVersion(int version) {
        this.version = version;
    }
    public List<TypeProbability> getTypes() {
        return types;
    }
    public void setTypes(List<TypeProbability> types) {
        this.types = types;
    }
}
app/src/main/java/com/yeshi/makemoney/app/entity/config/SystemConfigKey.java
@@ -27,7 +27,14 @@
    course(SystemConfigType.common, "教程链接"),
    unRegister(SystemConfigType.common, "注销链接"),
    privacyComplain(SystemConfigType.common, "隐私投诉链接"),
    vipLink(SystemConfigType.common, "会员链接"),
    helpLink(SystemConfigType.common, "帮助中心链接"),
    disclaimerLink(SystemConfigType.common, "免责声明链接"),
    //广告配置
    splashAd(SystemConfigType.ad, "开屏广告"),
    rewardAd(SystemConfigType.ad, "激励视频广告"),
    exitAppAd(SystemConfigType.ad, "退出应用广告"),
    //资金相关配置
    extractConfig(SystemConfigType.extract, "提现配置"),
@@ -37,6 +44,7 @@
    //金币设置
    signInGoldCorn(SystemConfigType.goldCorn, "连续签到金币分布"),
    ;
app/src/main/java/com/yeshi/makemoney/app/entity/config/SystemConfigType.java
@@ -12,6 +12,7 @@
    system("系統相关"),
    extract("提现"),
    team("团队"),
    ad("广告")
    ;
    private String name;
app/src/main/java/com/yeshi/makemoney/app/service/impl/msg/UserMsgNotifyServiceImpl.java
@@ -21,6 +21,7 @@
    @Override
    public void notify(UserMsg userMsg) {
        //推送站外消息
        try {
            userMsgService.add(userMsg);
        } catch (Exception e) {
app/src/main/java/com/yeshi/makemoney/app/service/manager/PushManager.java
@@ -9,6 +9,7 @@
import com.yeshi.makemoney.app.entity.config.SystemConfigKey;
import com.yeshi.makemoney.app.service.inter.config.SystemConfigService;
import com.yeshi.makemoney.app.vo.AcceptData;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@@ -23,7 +24,7 @@
@Component
public class PushManager {
    //@Reference(version = "1.0")
//    @Reference(version = "1.0",check = false)
    private BDeviceTokenService bdeviceTokenService;
    @Resource
app/src/main/java/com/yeshi/makemoney/app/vo/goldcorn/GoldCornTaskVO.java
@@ -33,7 +33,7 @@
        vo.setActive(!finish);
        StringBuffer processBuffer = new StringBuffer();
        processBuffer.append("今日进度 (");
        processBuffer.append("(");
        if (task.getType() == GoldCornGetType.watchVideo) {
            vo.setActionName("去完成");
            vo.setPrice(price.getCornNum());
app/src/main/resources/application-pro.yml
@@ -84,10 +84,10 @@
    admin:
      addresses: http://1.14.235.17:9000/xxl-job-admin
#dubbo:
#  application:
#    name: app-consumer
#  registry:
#    protocol: zookeeper
#    address: zookeeper://172.16.16.46:2181 # 134.175.68.214   134.175.68.214:2181
#    client: curator
dubbo:
  application:
    name: app-consumer
  registry:
    protocol: zookeeper
    address: zookeeper://172.16.16.46:2181 # 134.175.68.214   134.175.68.214:2181
    client: curator
app/src/main/resources/static/index.html
@@ -271,11 +271,17 @@
                    </li>
                    <li>
                        <a onclick="xadmin.add_tab('客户端参数','config/system_config_list.html')">
                        <a onclick="xadmin.add_tab('客户端参数','config/system_config_list.html?type=common')">
                            <i class="iconfont">&#xe6a7;</i>
                            <cite>客户端参数</cite></a>
                    </li>
                    <li>
                        <a onclick="xadmin.add_tab('广告配置','config/system_config_list.html?type=ad')">
                            <i class="iconfont">&#xe6a7;</i>
                            <cite>广告配置</cite></a>
                    </li>
                </ul>
            </li>
        </ul>
app/src/main/resources/static/money/user_money_record_list.html
@@ -201,7 +201,11 @@
                            totalRow: true,
                            cols: [[{type: 'checkbox', title: "ID"},
                                {field: 'id', width: 120, sort: false, title: "ID"},
                                {field: 'user', width: 120, sort: false, title: "用户"},
                                {
                                    field: 'user', width: 120, sort: false, title: "用户", templet: function (res) {
                                        return res.id;
                                    }
                                },
                                {field: 'money', width: 120, sort: false, title: "金额"},
                                {field: 'type', width: 120, sort: false, title: "类型"},
                                {field: 'serialNo', width: 200, sort: false, title: "流水号"},
app/src/test/java/test/msg/MsgTest.java
@@ -36,7 +36,7 @@
    @Test
    public void addMsg() {
        userMsgNotifyService.notify(UserMsgFactory.createExtractFail(22384L, new BigDecimal(10), "这是测试备注,测试备注,测试备注"));
        userMsgNotifyService.notify(UserMsgFactory.createExtractFail(22392L, new BigDecimal(10), "这是测试备注,测试备注,测试备注"));
    }
}