Browse Source

非法应用列表

master
nili 5 months ago
parent
commit
158a2d23a2
  1. 13
      game-dao/src/main/java/awesome/group/game/dao/bean/MatrixEvilApp.java
  2. 7
      game-dao/src/main/java/awesome/group/game/dao/mapper/MatrixEvilAppMapper.java
  3. 11
      game-service/src/main/java/awesome/group/game/service/citrus/CitrusAppService.java
  4. 31
      game-service/src/main/java/awesome/group/game/service/matrix/SuperAdminService.java
  5. 9
      game-web/src/main/java/awesome/group/game/web/rest/citrus/OpenController.java
  6. 34
      game-web/src/main/java/awesome/group/game/web/rest/matrix/SuperAdminController.java

13
game-dao/src/main/java/awesome/group/game/dao/bean/MatrixEvilApp.java

@ -0,0 +1,13 @@
package awesome.group.game.dao.bean;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
@Data
public class MatrixEvilApp {
@TableId(value = "id", type = IdType.AUTO)
private Integer id;
private String name;
private String packageName;
}

7
game-dao/src/main/java/awesome/group/game/dao/mapper/MatrixEvilAppMapper.java

@ -0,0 +1,7 @@
package awesome.group.game.dao.mapper;
import awesome.group.game.dao.bean.MatrixEvilApp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
public interface MatrixEvilAppMapper extends BaseMapper<MatrixEvilApp> {
}

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

@ -1,18 +1,29 @@
package awesome.group.game.service.citrus; package awesome.group.game.service.citrus;
import awesome.group.game.dao.bean.MatrixApp; import awesome.group.game.dao.bean.MatrixApp;
import awesome.group.game.dao.bean.MatrixEvilApp;
import awesome.group.game.dao.mapper.MatrixAppMapper; 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.AppBasicInfo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.List;
@Service @Service
public class CitrusAppService { public class CitrusAppService {
@Autowired @Autowired
private MatrixAppMapper appMapper; private MatrixAppMapper appMapper;
@Autowired
private MatrixEvilAppMapper evilAppMapper;
public AppBasicInfo getAppDetail(String appCode) { public AppBasicInfo getAppDetail(String appCode) {
MatrixApp app = appMapper.queryByCode(appCode); MatrixApp app = appMapper.queryByCode(appCode);
return AppBasicInfo.getBasic(app); return AppBasicInfo.getBasic(app);
} }
public List<MatrixEvilApp> getEvilApp() {
return evilAppMapper.selectList(null);
}
} }

31
game-service/src/main/java/awesome/group/game/service/matrix/SuperAdminService.java

@ -0,0 +1,31 @@
package awesome.group.game.service.matrix;
import awesome.group.game.dao.bean.MatrixEvilApp;
import awesome.group.game.dao.mapper.MatrixEvilAppMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Collections;
import java.util.List;
@Service
public class SuperAdminService {
@Autowired
private MatrixEvilAppMapper evilAppMapper;
public List<MatrixEvilApp> evilAppList() {
List<MatrixEvilApp> app = evilAppMapper.selectList(null);
Collections.reverse(app);
return app;
}
public void saveEvilApp(MatrixEvilApp app) {
if (app.getId() != null) {
evilAppMapper.updateById(app);
} else {
evilAppMapper.insert(app);
}
}
}

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

@ -1,5 +1,6 @@
package awesome.group.game.web.rest.citrus; package awesome.group.game.web.rest.citrus;
import awesome.group.game.dao.bean.MatrixEvilApp;
import awesome.group.game.dao.bean.MatrixUser; import awesome.group.game.dao.bean.MatrixUser;
import awesome.group.game.service.SmsService; import awesome.group.game.service.SmsService;
import awesome.group.game.service.bo.citrus.AppBasicInfo; import awesome.group.game.service.bo.citrus.AppBasicInfo;
@ -17,6 +18,8 @@ import jakarta.servlet.http.Cookie;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController @RestController
@RequestMapping("/api/citrus") @RequestMapping("/api/citrus")
@Hidden @Hidden
@ -81,4 +84,10 @@ public class OpenController {
public R<AppBasicInfo> getAppDetail(@RequestParam String appCode) { public R<AppBasicInfo> getAppDetail(@RequestParam String appCode) {
return new R<>(appService.getAppDetail(appCode)); return new R<>(appService.getAppDetail(appCode));
} }
@GetMapping("/open/evilApp")
@RestApi
public R<List<MatrixEvilApp>> getEvilApp() {
return new R<>(appService.getEvilApp());
}
} }

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

@ -0,0 +1,34 @@
package awesome.group.game.web.rest.matrix;
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.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@RestController
@RequestMapping("/api/superAdmin")
@Tag(name = "superAdmin")
public class SuperAdminController {
@Autowired
private SuperAdminService superAdminService;
@GetMapping("/evilAppList")
@RestApi
public R<List<MatrixEvilApp>> evilAppList() {
return new R<>(superAdminService.evilAppList());
}
@PostMapping("/saveEvilApp")
@RestApi
public R<Void> saveEvilApp(@RequestBody MatrixEvilApp evilApp) {
superAdminService.saveEvilApp(evilApp);
return new R<>(null);
}
}
Loading…
Cancel
Save