Browse Source

支持隐藏账号

master
nili 7 months ago
parent
commit
c1a5ce82d9
  1. 1
      game-dao/src/main/java/awesome/group/game/dao/bean/MatrixAdmin.java
  2. 3
      game-dao/src/main/java/awesome/group/game/dao/mapper/MatrixAdminMapper.java
  3. 15
      game-service/src/main/java/awesome/group/game/service/bo/MatrixAdminBo.java
  4. 8
      game-service/src/main/java/awesome/group/game/service/matrix/AdminService.java
  5. 7
      game-web/src/main/java/awesome/group/game/web/rest/matrix/AdminController.java

1
game-dao/src/main/java/awesome/group/game/dao/bean/MatrixAdmin.java

@ -16,4 +16,5 @@ public class MatrixAdmin {
private Integer parentAdminId;
private Integer deviceCnt;
private Integer incomeRate;
private Integer hide;
}

3
game-dao/src/main/java/awesome/group/game/dao/mapper/MatrixAdminMapper.java

@ -11,4 +11,7 @@ public interface MatrixAdminMapper extends BaseMapper<MatrixAdmin> {
@Update("update matrix_admin set app_ids = #{appIds} where id = #{id}")
int updateAppIds(String appIds, int id);
@Update("update matrix_admin set hide = #{hide} where id = #{id}")
int updateHide(Integer id, Integer hide);
}

15
game-service/src/main/java/awesome/group/game/service/bo/MatrixAdminBo.java

@ -10,13 +10,14 @@ import java.util.List;
@Data
public class MatrixAdminBo {
private Integer id;
private String name;
private String password;
private List<Integer> appIds;
private Integer role;//1超级管理员,2管理员,3普通账号
private Integer deviceCnt;
private Integer incomeRate;
public Integer id;
public String name;
public String password;
public List<Integer> appIds;
public Integer hide;
public Integer role;//1超级管理员,2管理员,3普通账号
public Integer deviceCnt;
public Integer incomeRate;
public OverviewBo overview;
public MatrixAdminBo() {

8
game-service/src/main/java/awesome/group/game/service/matrix/AdminService.java

@ -152,7 +152,7 @@ public class AdminService {
List<MatrixUser> uList = userMapper.selectBatchIds(uids);
uMap = uList.stream().collect(Collectors.toMap(MatrixUser::getId, x -> x));
}
for(MatrixAdvRecord x: records) {
for (MatrixAdvRecord x : records) {
MatrixAdvRecordBo bo = new MatrixAdvRecordBo(x, appMap.get(x.getAppId()));
BeanUtils.copyProperties(x, bo);
if (x.getAdminId() != null) {
@ -237,6 +237,10 @@ public class AdminService {
}
}
public void updateAdminHide(Integer id, Integer hide) {
adminMapper.updateHide(id, hide);
}
public void saveApp(MatrixApp app) {
if (app.getCode() != null) {
appMapper.updateNameOrUrl(app);
@ -319,7 +323,7 @@ public class AdminService {
Assert.isTrue(!CollectionUtils.isEmpty(bo.scheduleTime), "时间不能为空");
Assert.isTrue(!CollectionUtils.isEmpty(bo.appId), "应用不能为空");
List<MatrixMockSchedule> list = new ArrayList<>();
for(Integer appId: bo.appId) {
for (Integer appId : bo.appId) {
MatrixApp app = appMapper.selectById(appId);
if (app == null || !StringUtils.hasText(app.getChannel())) {
throw new PaganiException(PaganiExceptionCode.ILLEGAL_REQUEST, "应用不存在或渠道为空");

7
game-web/src/main/java/awesome/group/game/web/rest/matrix/AdminController.java

@ -87,6 +87,13 @@ public class AdminController {
return new R<>(R.CODE_SUCCESS, "ok", null);
}
@PostMapping("/changeAdminHide")
@RestApi
public R<Void> changeAdminHide(@RequestParam Integer adminId, @RequestParam Integer hide) {
adminService.updateAdminHide(adminId, hide);
return new R<>(R.CODE_SUCCESS, "ok", null);
}
@GetMapping("/incomeOverview")
@RestApi
public R<OverviewBo> incomeOverview(@RequestParam(required = false) String appCode) {

Loading…
Cancel
Save