nili
5 months ago
6 changed files with 105 additions and 0 deletions
@ -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; |
||||
|
} |
@ -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> { |
||||
|
} |
@ -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); |
||||
|
} |
||||
} |
} |
||||
|
@ -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); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
@ -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…
Reference in new issue