From 42582856c34d5a2d39712d02833d987da92086ba Mon Sep 17 00:00:00 2001 From: nili Date: Sun, 19 May 2024 15:41:12 +0800 Subject: [PATCH] fx --- .../group/game/service/AdminService.java | 5 +++ .../group/game/service/bo/MatrixAppBo.java | 20 ----------- .../citrus/{AppBo.java => AppCashConfig.java} | 6 ++-- .../game/service/bo/matrix/MatrixAppBo.java | 33 +++++++++++++++++++ .../game/service/citrus/CitrusAppService.java | 6 ++-- .../game/service/citrus/RegisterService.java | 4 +-- .../game/service/citrus/UserService.java | 12 +++---- .../web/rest/citrus/CitrusAppController.java | 4 +-- .../game/web/rest/citrus/OpenController.java | 2 +- .../game/web/rest/matrix/AdminController.java | 5 +-- 10 files changed, 57 insertions(+), 40 deletions(-) delete mode 100644 game-service/src/main/java/awesome/group/game/service/bo/MatrixAppBo.java rename game-service/src/main/java/awesome/group/game/service/bo/citrus/{AppBo.java => AppCashConfig.java} (92%) create mode 100644 game-service/src/main/java/awesome/group/game/service/bo/matrix/MatrixAppBo.java diff --git a/game-service/src/main/java/awesome/group/game/service/AdminService.java b/game-service/src/main/java/awesome/group/game/service/AdminService.java index 6707cb9..b960d86 100644 --- a/game-service/src/main/java/awesome/group/game/service/AdminService.java +++ b/game-service/src/main/java/awesome/group/game/service/AdminService.java @@ -3,6 +3,7 @@ package awesome.group.game.service; import awesome.group.game.dao.bean.*; import awesome.group.game.dao.mapper.*; import awesome.group.game.service.bo.*; +import awesome.group.game.service.bo.matrix.MatrixAppBo; import awesome.group.game.service.common.exception.PaganiException; import awesome.group.game.service.common.exception.PaganiExceptionCode; import awesome.group.game.service.common.log.L; @@ -151,6 +152,10 @@ public class AdminService { return res; } + public List appBoList(Integer adminId) { + List appList = appList(adminId); + return appList.stream().map(MatrixAppBo::new).toList(); + } public List appList(Integer adminId) { List appIds = getAdminAppIds(adminId); if (CollectionUtils.isEmpty(appIds)) { diff --git a/game-service/src/main/java/awesome/group/game/service/bo/MatrixAppBo.java b/game-service/src/main/java/awesome/group/game/service/bo/MatrixAppBo.java deleted file mode 100644 index 6ca1ad3..0000000 --- a/game-service/src/main/java/awesome/group/game/service/bo/MatrixAppBo.java +++ /dev/null @@ -1,20 +0,0 @@ -package awesome.group.game.service.bo; - -import awesome.group.game.dao.bean.MatrixApp; - -public class MatrixAppBo { - public String name; - public String code; - public String img; - public String url; - - public MatrixAppBo() { - } - - public MatrixAppBo(MatrixApp app) { - this.name = app.getName(); - this.code = app.getCode(); - this.img = app.getImg(); - this.url = app.getUrl(); - } -} diff --git a/game-service/src/main/java/awesome/group/game/service/bo/citrus/AppBo.java b/game-service/src/main/java/awesome/group/game/service/bo/citrus/AppCashConfig.java similarity index 92% rename from game-service/src/main/java/awesome/group/game/service/bo/citrus/AppBo.java rename to game-service/src/main/java/awesome/group/game/service/bo/citrus/AppCashConfig.java index d70a2d0..3e07fdd 100644 --- a/game-service/src/main/java/awesome/group/game/service/bo/citrus/AppBo.java +++ b/game-service/src/main/java/awesome/group/game/service/bo/citrus/AppCashConfig.java @@ -8,16 +8,16 @@ import org.springframework.util.StringUtils; import java.util.Arrays; import java.util.List; -public class AppBo { +public class AppCashConfig { public List moneyLadder;//提现梯度,单位分 public Integer noAuditMoney;//不需审核的金额,单位分 public String qqUrl;//qq客服链接 public Integer dayLimit;//每日提现次数 - public AppBo() { + public AppCashConfig() { } - public AppBo(MatrixApp app) { + public AppCashConfig(MatrixApp app) { Gson gson = new Gson(); if (StringUtils.hasText(app.getMoneyLadder())) { this.moneyLadder = gson.fromJson(app.getMoneyLadder(), new TypeToken>() { diff --git a/game-service/src/main/java/awesome/group/game/service/bo/matrix/MatrixAppBo.java b/game-service/src/main/java/awesome/group/game/service/bo/matrix/MatrixAppBo.java new file mode 100644 index 0000000..0a46d03 --- /dev/null +++ b/game-service/src/main/java/awesome/group/game/service/bo/matrix/MatrixAppBo.java @@ -0,0 +1,33 @@ +package awesome.group.game.service.bo.matrix; + +import awesome.group.game.dao.bean.MatrixApp; +import awesome.group.game.service.bo.citrus.AppCashConfig; +import org.springframework.util.StringUtils; + +public class MatrixAppBo { + public String name; + public String code; + public String img; + public String url; + public String channel; + public Integer hide; + public String secret; + public boolean enableCash; + public AppCashConfig config; + + + public MatrixAppBo() { + } + + public MatrixAppBo(MatrixApp app) { + this.name = app.getName(); + this.code = app.getCode(); + this.img = app.getImg(); + this.url = app.getUrl(); + this.channel = app.getChannel(); + this.hide = app.getHide(); + this.secret = app.getSecret(); + this.enableCash = StringUtils.hasText(app.getAliPay()); + this.config = new AppCashConfig(app); + } +} diff --git a/game-service/src/main/java/awesome/group/game/service/citrus/CitrusAppService.java b/game-service/src/main/java/awesome/group/game/service/citrus/CitrusAppService.java index 4c7adda..b71232f 100644 --- a/game-service/src/main/java/awesome/group/game/service/citrus/CitrusAppService.java +++ b/game-service/src/main/java/awesome/group/game/service/citrus/CitrusAppService.java @@ -2,7 +2,7 @@ package awesome.group.game.service.citrus; import awesome.group.game.dao.bean.MatrixApp; import awesome.group.game.dao.mapper.MatrixAppMapper; -import awesome.group.game.service.bo.citrus.AppBo; +import awesome.group.game.service.bo.citrus.AppCashConfig; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -11,8 +11,8 @@ public class CitrusAppService { @Autowired private MatrixAppMapper appMapper; - public AppBo getAppDetail(String appCode) { + public AppCashConfig getAppDetail(String appCode) { MatrixApp app = appMapper.queryByCode(appCode); - return new AppBo(app); + return new AppCashConfig(app); } } diff --git a/game-service/src/main/java/awesome/group/game/service/citrus/RegisterService.java b/game-service/src/main/java/awesome/group/game/service/citrus/RegisterService.java index 1bdab25..fe57891 100644 --- a/game-service/src/main/java/awesome/group/game/service/citrus/RegisterService.java +++ b/game-service/src/main/java/awesome/group/game/service/citrus/RegisterService.java @@ -5,7 +5,7 @@ import awesome.group.game.dao.bean.MatrixUser; import awesome.group.game.dao.mapper.MatrixAppMapper; import awesome.group.game.dao.mapper.MatrixUserMapper; import awesome.group.game.service.SmsService; -import awesome.group.game.service.bo.MatrixAppBo; +import awesome.group.game.service.bo.matrix.MatrixAppBo; import awesome.group.game.service.bo.RegisterBo; import awesome.group.game.service.common.exception.PaganiException; import awesome.group.game.service.common.exception.PaganiExceptionCode; @@ -16,8 +16,6 @@ import org.springframework.stereotype.Service; import org.springframework.util.Assert; import org.springframework.util.StringUtils; -import java.util.concurrent.ThreadLocalRandom; - @Service public class RegisterService { @Autowired diff --git a/game-service/src/main/java/awesome/group/game/service/citrus/UserService.java b/game-service/src/main/java/awesome/group/game/service/citrus/UserService.java index 00fd51f..907121c 100644 --- a/game-service/src/main/java/awesome/group/game/service/citrus/UserService.java +++ b/game-service/src/main/java/awesome/group/game/service/citrus/UserService.java @@ -7,7 +7,7 @@ import awesome.group.game.dao.mapper.MatrixAppMapper; import awesome.group.game.dao.mapper.MatrixMoneyRecordMapper; import awesome.group.game.dao.mapper.MatrixUserMapper; import awesome.group.game.service.SmsService; -import awesome.group.game.service.bo.citrus.AppBo; +import awesome.group.game.service.bo.citrus.AppCashConfig; import awesome.group.game.service.bo.citrus.CashRecord; import awesome.group.game.service.bo.citrus.LoginReq; import awesome.group.game.service.bo.citrus.UserBo; @@ -122,15 +122,15 @@ public class UserService { Assert.isTrue(StringUtils.hasText(u.getName()), "请先填写支付宝实名姓名"); MatrixApp app = appMapper.selectById(u.getAppId()); - AppBo appBo = new AppBo(app); - Assert.isTrue(appBo.moneyLadder.contains(cent), "提现金额不合法"); + AppCashConfig appCashConfig = new AppCashConfig(app); + Assert.isTrue(appCashConfig.moneyLadder.contains(cent), "提现金额不合法"); Timestamp todayBegin = new Timestamp(DateUtil.getDayBeginTimestamp(System.currentTimeMillis())); int size = moneyRecordMapper.queryAfter(uid, todayBegin); - Assert.isTrue(size < appBo.dayLimit, "每天最多提现" + appBo.dayLimit + "次"); + Assert.isTrue(size < appCashConfig.dayLimit, "每天最多提现" + appCashConfig.dayLimit + "次"); size = moneyRecordMapper.queryByAliPayAccount(aliPayAccount, todayBegin); - Assert.isTrue(size < appBo.dayLimit, "每天最多提现" + appBo.dayLimit + "次"); - userService.doApply(u, app.getNoAuditMoney(), cent); + Assert.isTrue(size < appCashConfig.dayLimit, "每天最多提现" + appCashConfig.dayLimit + "次"); + userService.doApply(u, appCashConfig.noAuditMoney, cent); } @Transactional diff --git a/game-web/src/main/java/awesome/group/game/web/rest/citrus/CitrusAppController.java b/game-web/src/main/java/awesome/group/game/web/rest/citrus/CitrusAppController.java index a238ee8..dd2ed95 100644 --- a/game-web/src/main/java/awesome/group/game/web/rest/citrus/CitrusAppController.java +++ b/game-web/src/main/java/awesome/group/game/web/rest/citrus/CitrusAppController.java @@ -1,6 +1,6 @@ package awesome.group.game.web.rest.citrus; -import awesome.group.game.service.bo.citrus.AppBo; +import awesome.group.game.service.bo.citrus.AppCashConfig; import awesome.group.game.service.citrus.CitrusAppService; import awesome.group.game.service.common.response.R; import awesome.group.game.web.aop.RestApi; @@ -18,7 +18,7 @@ public class CitrusAppController { @GetMapping("/getDetail") @RestApi - public R getAppDetail(@RequestParam String appCode) { + public R getAppDetail(@RequestParam String appCode) { return new R<>(appService.getAppDetail(appCode)); } } diff --git a/game-web/src/main/java/awesome/group/game/web/rest/citrus/OpenController.java b/game-web/src/main/java/awesome/group/game/web/rest/citrus/OpenController.java index 96b0238..033342d 100644 --- a/game-web/src/main/java/awesome/group/game/web/rest/citrus/OpenController.java +++ b/game-web/src/main/java/awesome/group/game/web/rest/citrus/OpenController.java @@ -4,7 +4,7 @@ import awesome.group.game.dao.bean.MatrixUser; import awesome.group.game.service.bo.citrus.LoginReq; import awesome.group.game.service.citrus.RegisterService; import awesome.group.game.service.SmsService; -import awesome.group.game.service.bo.MatrixAppBo; +import awesome.group.game.service.bo.matrix.MatrixAppBo; import awesome.group.game.service.bo.RegisterBo; import awesome.group.game.service.citrus.UserService; import awesome.group.game.service.common.response.R; diff --git a/game-web/src/main/java/awesome/group/game/web/rest/matrix/AdminController.java b/game-web/src/main/java/awesome/group/game/web/rest/matrix/AdminController.java index 0bbcf35..4edc668 100644 --- a/game-web/src/main/java/awesome/group/game/web/rest/matrix/AdminController.java +++ b/game-web/src/main/java/awesome/group/game/web/rest/matrix/AdminController.java @@ -8,6 +8,7 @@ import awesome.group.game.service.AdminService; import awesome.group.game.service.MatrixService; import awesome.group.game.service.OSSService; import awesome.group.game.service.bo.*; +import awesome.group.game.service.bo.matrix.MatrixAppBo; import awesome.group.game.service.common.response.R; import awesome.group.game.service.util.JwtUtils; import awesome.group.game.web.RequestContext; @@ -59,8 +60,8 @@ public class AdminController { @GetMapping("/appList") @RestApi - public R> appList() { - List data = adminService.appList(RequestContext.getAdminID()); + public R> appList() { + List data = adminService.appBoList(RequestContext.getAdminID()); return new R<>(R.CODE_SUCCESS, "ok", data); }