Browse Source

加应用市场

master
nili 6 months ago
parent
commit
26262acc54
  1. 11
      game-dao/src/main/java/awesome/group/game/dao/bean/MatrixApp.java
  2. 45
      game-service/src/main/java/awesome/group/game/service/bo/citrus/MarketBo.java
  3. 19
      game-service/src/main/java/awesome/group/game/service/bo/matrix/AppBasicConfig.java
  4. 17
      game-service/src/main/java/awesome/group/game/service/bo/matrix/MarketConfigBo.java
  5. 6
      game-service/src/main/java/awesome/group/game/service/citrus/CitrusAppService.java
  6. 13
      game-service/src/main/java/awesome/group/game/service/matrix/MatrixAppConfigService.java
  7. 7
      game-web/src/main/java/awesome/group/game/web/rest/citrus/OpenController.java
  8. 1
      game-web/src/main/java/awesome/group/game/web/rest/matrix/MatrixUserController.java
  9. 2
      game-web/src/main/java/awesome/group/game/web/rest/matrix/SuperAdminController.java

11
game-dao/src/main/java/awesome/group/game/dao/bean/MatrixApp.java

@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import java.sql.Timestamp;
@Data
public class MatrixApp {
@TableId(value = "id", type = IdType.AUTO)
@ -22,11 +24,6 @@ public class MatrixApp {
private String aliPay;//支付宝的配置数据
private String wx;//微信的配置数据
private String normalConfig;//提现门槛等配置
// private String moneyLadder;
// private Integer noAuditMoney;
// private String qqUrl;
// private Integer dayLimit;//每日提现次数限制
// private Integer maxIncomeEachVideo;
// private String dayRates;
// private Integer defaultRate;
private String marketConfig;
private Timestamp updatedAt;
}

45
game-service/src/main/java/awesome/group/game/service/bo/citrus/MarketBo.java

@ -0,0 +1,45 @@
package awesome.group.game.service.bo.citrus;
import awesome.group.game.dao.bean.MatrixApp;
import awesome.group.game.service.bo.matrix.MarketConfigBo;
import com.google.gson.Gson;
import org.springframework.util.StringUtils;
import java.util.List;
public class MarketBo {
public String name;
public String code;
public String img;
public String url;
public String fileSize;
public Integer version;
public List<String> images;
public String packageName;
public String author;
public int downloadTimes;
public String desc;
public long updatedAt;
public MarketBo() {
}
public MarketBo(MatrixApp app) {
this.name = app.getName();
this.url = app.getUrl();
this.img = app.getImg();
this.version = app.getVersion();
this.updatedAt = app.getUpdatedAt().getTime();
if(StringUtils.hasText(app.getMarketConfig())) {
Gson gson = new Gson();
MarketConfigBo bo = gson.fromJson(app.getMarketConfig(), MarketConfigBo.class);
this.author = bo.author;
this.images = bo.images;
this.fileSize = bo.fileSize;
this.packageName = bo.packageName;
this.desc = bo.desc;
this.downloadTimes = bo.downloadTimes;
}
}
}

19
game-service/src/main/java/awesome/group/game/service/bo/matrix/AppBasicConfig.java

@ -1,8 +1,12 @@
package awesome.group.game.service.bo.matrix;
import awesome.group.game.dao.bean.MatrixApp;
import com.google.gson.Gson;
import org.springframework.util.StringUtils;
public class AppBasicConfig {
import java.util.concurrent.ThreadLocalRandom;
public class AppBasicConfig extends MarketConfigBo {
public Integer id;
public String code;
public String secret;
@ -28,5 +32,18 @@ public class AppBasicConfig {
this.hide = app.getHide();
this.channel = app.getChannel();
this.version = app.getVersion();
if (StringUtils.hasText(app.getMarketConfig())) {
Gson gson = new Gson();
MarketConfigBo bo = gson.fromJson(app.getMarketConfig(), MarketConfigBo.class);
this.author = bo.author;
this.images = bo.images;
this.fileSize = bo.fileSize;
this.packageName = bo.packageName;
this.desc = bo.desc;
this.downloadTimes = bo.downloadTimes;
if (this.downloadTimes < 1) {
this.downloadTimes = ThreadLocalRandom.current().nextInt(1000, 10000);
}
}
}
}

17
game-service/src/main/java/awesome/group/game/service/bo/matrix/MarketConfigBo.java

@ -0,0 +1,17 @@
package awesome.group.game.service.bo.matrix;
import java.util.List;
public class MarketConfigBo {
public String packageName;
public String author;
public String fileSize;
public String desc;
public List<String> images;
public int downloadTimes;
public MarketConfigBo() {
}
}

6
game-service/src/main/java/awesome/group/game/service/citrus/CitrusAppService.java

@ -5,6 +5,7 @@ import awesome.group.game.dao.bean.MatrixEvilApp;
import awesome.group.game.dao.mapper.MatrixAppMapper;
import awesome.group.game.dao.mapper.MatrixEvilAppMapper;
import awesome.group.game.service.bo.citrus.AppBasicInfo;
import awesome.group.game.service.bo.citrus.MarketBo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -23,6 +24,11 @@ public class CitrusAppService {
return AppBasicInfo.getBasic(app);
}
public MarketBo getMarketBo(String appCode) {
MatrixApp app = appMapper.queryByCode(appCode);
return new MarketBo(app);
}
public List<MatrixEvilApp> getEvilApp() {
return evilAppMapper.selectList(null);
}

13
game-service/src/main/java/awesome/group/game/service/matrix/MatrixAppConfigService.java

@ -10,6 +10,8 @@ import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;
import java.util.concurrent.ThreadLocalRandom;
@Service
public class MatrixAppConfigService {
@Autowired
@ -86,6 +88,9 @@ public class MatrixAppConfigService {
app.setImg(config.img);
app.setHide(config.hide);
app.setVersion(config.version);
MarketConfigBo bo = (MarketConfigBo) config;
String str = gson.toJson(bo);
app.setMarketConfig(str);
appMapper.updateById(app);
} else {
MatrixApp app = new MatrixApp();
@ -98,6 +103,14 @@ public class MatrixAppConfigService {
app.setImg(config.img);
app.setHide(config.hide);
app.setVersion(config.version);
MarketConfigBo bo = new MarketConfigBo();
bo.author = config.author;
bo.fileSize = config.fileSize;
bo.packageName = config.packageName;
bo.desc = config.desc;
bo.downloadTimes = ThreadLocalRandom.current().nextInt(1000, 10000);
String str = gson.toJson(bo);
app.setMarketConfig(str);
appMapper.insert(app);
}
}

7
game-web/src/main/java/awesome/group/game/web/rest/citrus/OpenController.java

@ -6,6 +6,7 @@ import awesome.group.game.service.SmsService;
import awesome.group.game.service.bo.citrus.AppBasicInfo;
import awesome.group.game.service.bo.citrus.InviteInfo;
import awesome.group.game.service.bo.citrus.LoginReq;
import awesome.group.game.service.bo.citrus.MarketBo;
import awesome.group.game.service.citrus.CitrusAppService;
import awesome.group.game.service.citrus.RegisterService;
import awesome.group.game.service.citrus.UserService;
@ -37,6 +38,12 @@ public class OpenController {
@Autowired
private CitrusAppService appService;
@GetMapping("/open/marketData")
@RestApi
public R<MarketBo> marketData(@RequestParam String appCode) {
return new R<>(appService.getMarketBo(appCode));
}
@PostMapping("/register/sendCode")
@RestApi
public R<Void> sendCode(@RequestParam String mobile, @RequestParam String scene) {

1
game-web/src/main/java/awesome/group/game/web/rest/matrix/MatrixUserController.java

@ -7,6 +7,7 @@ import awesome.group.game.service.common.response.R;
import awesome.group.game.service.matrix.MatrixUserService;
import awesome.group.game.web.RequestContext;
import awesome.group.game.web.aop.RestApi;
import io.swagger.v3.oas.annotations.Hidden;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

2
game-web/src/main/java/awesome/group/game/web/rest/matrix/SuperAdminController.java

@ -4,6 +4,7 @@ import awesome.group.game.dao.bean.MatrixEvilApp;
import awesome.group.game.service.common.response.R;
import awesome.group.game.service.matrix.SuperAdminService;
import awesome.group.game.web.aop.RestApi;
import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -13,6 +14,7 @@ import java.util.List;
@RestController
@RequestMapping("/api/superAdmin")
@Tag(name = "superAdmin")
//@Hidden
public class SuperAdminController {
@Autowired

Loading…
Cancel
Save