| | |
| | | </parent> |
| | | <modelVersion>4.0.0</modelVersion> |
| | | |
| | | <artifactId>app</artifactId> |
| | | <artifactId>dsp</artifactId> |
| | | |
| | | <packaging>jar</packaging> |
| | | |
| | |
| | | <dependency> |
| | | <groupId>com.ks</groupId> |
| | | <artifactId>facade-push</artifactId> |
| | | <version>0.0.2</version> |
| | | <version>0.0.4</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | |
| | | |
| | | |
| | | <build> |
| | | <finalName>app</finalName> |
| | | <finalName>dsp</finalName> |
| | | <plugins> |
| | | <plugin> |
| | | <groupId>org.springframework.boot</groupId> |
| | |
| | | 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; |
| | |
| | | SystemConfigKey.course, |
| | | SystemConfigKey.unRegister, |
| | | SystemConfigKey.privacyComplain, |
| | | SystemConfigKey.vipLink |
| | | SystemConfigKey.helpLink, |
| | | SystemConfigKey.disclaimerLink |
| | | }; |
| | | |
| | | for (SystemConfigKey config : configs) { |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | @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()); |
| | |
| | | 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(), "参数错误"); |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | /** |
| | | * @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 |
| | |
| | | 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); |
| | | } |
| | | } |
New file |
| | |
| | | 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; |
| | | } |
| | | } |
| | |
| | | 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, "提现配置"), |
| | |
| | | //金币设置 |
| | | signInGoldCorn(SystemConfigType.goldCorn, "连续签到金币分布"), |
| | | |
| | | |
| | | ; |
| | | |
| | | |
| | |
| | | system("系統相关"), |
| | | extract("提现"), |
| | | team("团队"), |
| | | ad("广告") |
| | | ; |
| | | |
| | | private String name; |
| | |
| | | |
| | | @Override |
| | | public void notify(UserMsg userMsg) { |
| | | //推送站外消息 |
| | | try { |
| | | userMsgService.add(userMsg); |
| | | } catch (Exception e) { |
| | |
| | | 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; |
| | |
| | | @Component |
| | | public class PushManager { |
| | | |
| | | //@Reference(version = "1.0") |
| | | // @Reference(version = "1.0",check = false) |
| | | private BDeviceTokenService bdeviceTokenService; |
| | | |
| | | @Resource |
| | |
| | | vo.setActive(!finish); |
| | | |
| | | StringBuffer processBuffer = new StringBuffer(); |
| | | processBuffer.append("今日进度 ("); |
| | | processBuffer.append("("); |
| | | if (task.getType() == GoldCornGetType.watchVideo) { |
| | | vo.setActionName("去完成"); |
| | | vo.setPrice(price.getCornNum()); |
| | |
| | | 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 |
| | |
| | | </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"></i> |
| | | <cite>客户端参数</cite></a> |
| | | </li> |
| | | |
| | | <li> |
| | | <a onclick="xadmin.add_tab('广告配置','config/system_config_list.html?type=ad')"> |
| | | <i class="iconfont"></i> |
| | | <cite>广告配置</cite></a> |
| | | </li> |
| | | |
| | | </ul> |
| | | </li> |
| | | </ul> |
| | |
| | | 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: "流水号"}, |
| | |
| | | |
| | | @Test |
| | | public void addMsg() { |
| | | userMsgNotifyService.notify(UserMsgFactory.createExtractFail(22384L, new BigDecimal(10), "这是测试备注,测试备注,测试备注")); |
| | | userMsgNotifyService.notify(UserMsgFactory.createExtractFail(22392L, new BigDecimal(10), "这是测试备注,测试备注,测试备注")); |
| | | } |
| | | |
| | | } |