清理与ztcloud中重复的代码,改为 jar 包方式引用 ztcloud

This commit is contained in:
ranke
2026-02-03 15:23:43 +08:00
parent 47e2529b2b
commit 4d997d9b86
3397 changed files with 158 additions and 260291 deletions

View File

@@ -4,16 +4,14 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.zt.plat</groupId>
<artifactId>zt</artifactId>
<artifactId>zt-dsc</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<modules>
<module>zt-module-report-api</module>
<module>zt-module-report-server</module>
<module>zt-module-report-server-app</module>
</modules>
<artifactId>zt-module-report</artifactId>
<artifactId>zt-module-report-dsc</artifactId>
<packaging>pom</packaging>
<name>${project.artifactId}</name>

View File

@@ -1,26 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.zt.plat</groupId>
<artifactId>zt-module-report</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>zt-module-report-api</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>
report 模块 API暴露给其它模块调用
</description>
<dependencies>
<dependency>
<groupId>com.zt.plat</groupId>
<artifactId>zt-common</artifactId>
</dependency>
</dependencies>
</project>

View File

@@ -1,4 +0,0 @@
/**
* 占位,避免 api 目录无文件时git 无法提交
*/
package com.zt.plat.module.report.api;

View File

@@ -1,15 +0,0 @@
package com.zt.plat.module.report.enums;
import com.zt.plat.framework.common.exception.ErrorCode;
/**
* Report 错误码枚举类
*
* report 系统,使用 1-003-000-000 段
*/
public interface ErrorCodeConstants {
// ========== GoView 模块 1-003-000-000 ==========
ErrorCode GO_VIEW_PROJECT_NOT_EXISTS = new ErrorCode(1_003_000_000, "GoView 项目不存在");
}

View File

@@ -4,7 +4,7 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>zt-module-report</artifactId>
<artifactId>zt-module-report-dsc</artifactId>
<groupId>com.zt.plat</groupId>
<version>${revision}</version>
</parent>
@@ -24,6 +24,12 @@
<version>${revision}</version>
</dependency>
<!-- Test 测试相关 -->
<dependency>
<groupId>com.zt.plat</groupId>
<artifactId>zt-spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
package com.zt.plat.module.report.controller.admin.ajreport;

View File

@@ -1,63 +0,0 @@
package com.zt.plat.module.report.controller.admin.goview;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.RandomUtil;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.module.report.controller.admin.goview.vo.data.GoViewDataGetBySqlReqVO;
import com.zt.plat.module.report.controller.admin.goview.vo.data.GoViewDataRespVO;
import com.zt.plat.module.report.service.goview.GoViewDataService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import java.util.*;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - GoView 数据", description = "提供 SQL、HTTP 等数据查询的能力")
@RestController
@RequestMapping("/report/go-view/data")
@Validated
public class GoViewDataController {
@Resource
private GoViewDataService goViewDataService;
@RequestMapping("/get-by-sql")
@Operation(summary = "使用 SQL 查询数据")
@PreAuthorize("@ss.hasPermission('report:go-view-data:get-by-sql')")
public CommonResult<GoViewDataRespVO> getDataBySQL(@Valid @RequestBody GoViewDataGetBySqlReqVO reqVO) {
return success(goViewDataService.getDataBySQL(reqVO.getSql()));
}
@RequestMapping("/get-by-http")
@Operation(summary = "使用 HTTP 查询数据", description = "这个只是示例接口,实际应该每个查询,都要写一个接口")
@PreAuthorize("@ss.hasPermission('report:go-view-data:get-by-http')")
public CommonResult<GoViewDataRespVO> getDataByHttp(
@RequestParam(required = false) Map<String, String> params,
@RequestBody(required = false) String body) { // params、body 按照需要去接收,这里仅仅是示例
GoViewDataRespVO respVO = new GoViewDataRespVO();
// 1. 数据维度
respVO.setDimensions(Arrays.asList("日期", "PV", "UV")); // PV 是每天访问次数UV 是每天访问人数
// 2. 明细数据列表
// 目前通过随机的方式生成。一般来说,这里你可以写逻辑来实现数据的返回
respVO.setSource(new LinkedList<>());
for (int i = 1; i <= 12; i++) {
String date = "2021-" + (i < 10 ? "0" + i : i);
Integer pv = RandomUtil.randomInt(1000, 10000);
Integer uv = RandomUtil.randomInt(100, 1000);
respVO.getSource().add(MapUtil.<String, Object>builder().put("日期", date)
.put("PV", pv).put("UV", uv).build());
}
return success(respVO);
}
}

View File

@@ -1,76 +0,0 @@
package com.zt.plat.module.report.controller.admin.goview;
import com.zt.plat.framework.common.pojo.CommonResult;
import com.zt.plat.framework.common.pojo.PageParam;
import com.zt.plat.framework.common.pojo.PageResult;
import com.zt.plat.module.report.controller.admin.goview.vo.project.GoViewProjectCreateReqVO;
import com.zt.plat.module.report.controller.admin.goview.vo.project.GoViewProjectRespVO;
import com.zt.plat.module.report.controller.admin.goview.vo.project.GoViewProjectUpdateReqVO;
import com.zt.plat.module.report.convert.goview.GoViewProjectConvert;
import com.zt.plat.module.report.dal.dataobject.goview.GoViewProjectDO;
import com.zt.plat.module.report.service.goview.GoViewProjectService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import jakarta.validation.Valid;
import static com.zt.plat.framework.common.pojo.CommonResult.success;
import static com.zt.plat.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
@Tag(name = "管理后台 - GoView 项目")
@RestController
@RequestMapping("/report/go-view/project")
@Validated
public class GoViewProjectController {
@Resource
private GoViewProjectService goViewProjectService;
@PostMapping("/create")
@Operation(summary = "创建项目")
@PreAuthorize("@ss.hasPermission('report:go-view-project:create')")
public CommonResult<Long> createProject(@Valid @RequestBody GoViewProjectCreateReqVO createReqVO) {
return success(goViewProjectService.createProject(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新项目")
@PreAuthorize("@ss.hasPermission('report:go-view-project:update')")
public CommonResult<Boolean> updateProject(@Valid @RequestBody GoViewProjectUpdateReqVO updateReqVO) {
goViewProjectService.updateProject(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除 GoView 项目")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('report:go-view-project:delete')")
public CommonResult<Boolean> deleteProject(@RequestParam("id") Long id) {
goViewProjectService.deleteProject(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得项目")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('report:go-view-project:query')")
public CommonResult<GoViewProjectRespVO> getProject(@RequestParam("id") Long id) {
GoViewProjectDO project = goViewProjectService.getProject(id);
return success(GoViewProjectConvert.INSTANCE.convert(project));
}
@GetMapping("/my-page")
@Operation(summary = "获得我的项目分页")
@PreAuthorize("@ss.hasPermission('report:go-view-project:query')")
public CommonResult<PageResult<GoViewProjectRespVO>> getMyProjectPage(@Valid PageParam pageVO) {
PageResult<GoViewProjectDO> pageResult = goViewProjectService.getMyProjectPage(
pageVO, getLoginUserId());
return success(GoViewProjectConvert.INSTANCE.convertPage(pageResult));
}
}

View File

@@ -1,15 +0,0 @@
package com.zt.plat.module.report.controller.admin.goview.vo.data;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;
@Schema(description = "管理后台 - GoView 使用 SQL 查询数据 Request VO")
@Data
public class GoViewDataGetBySqlReqVO {
@Schema(description = "SQL 语句", requiredMode = Schema.RequiredMode.REQUIRED, example = "SELECT * FROM user")
@NotEmpty(message = "SQL 语句不能为空")
private String sql;
}

Some files were not shown because too many files have changed in this diff Show More