-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
730a8d8
commit 3fbab21
Showing
4 changed files
with
73 additions
and
10 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
src/main/java/cn/zxlee/znotifyapi/controller/StatisticsController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package cn.zxlee.znotifyapi.controller; | ||
|
||
import cn.zxlee.znotifyapi.pojo.bo.StatisticsPageBO; | ||
import cn.zxlee.znotifyapi.pojo.vo.VersionVO; | ||
import cn.zxlee.znotifyapi.pojo.vo.base.PageResultVO; | ||
import cn.zxlee.znotifyapi.response.Result; | ||
import cn.zxlee.znotifyapi.service.IStatisticsService; | ||
import io.swagger.annotations.Api; | ||
import io.swagger.annotations.ApiOperation; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.validation.annotation.Validated; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import javax.validation.constraints.NotEmpty; | ||
import java.util.HashMap; | ||
|
||
/** | ||
* @program: z-notify-api | ||
* @description: 统计管理控制器 | ||
* @author: zxlee | ||
* @create: 2022-12-07 20:03 | ||
**/ | ||
|
||
@Slf4j | ||
@RestController | ||
@RequestMapping("/v1/statistics") | ||
@Api(value = "统计管理", tags = {"统计管理"}) | ||
@Validated | ||
public class StatisticsController { | ||
@Autowired | ||
private IStatisticsService statisticsService; | ||
|
||
@GetMapping("/statistics/{project_id}") | ||
@ApiOperation("获取项目下的访问数据列表") | ||
public Result<PageResultVO<VersionVO>> getStatistics(@RequestHeader String token, @NotEmpty @PathVariable(value = "project_id") String projectId, @Validated StatisticsPageBO bo){ | ||
HashMap<String, String> params = new HashMap<String, String>() {{ | ||
put("token", token); | ||
put("projectId", projectId); | ||
put("keyword", bo.getKeyword()); | ||
}}; | ||
return Result.success(statisticsService.listByPage(params, bo)); | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
src/main/java/cn/zxlee/znotifyapi/pojo/bo/StatisticsPageBO.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package cn.zxlee.znotifyapi.pojo.bo; | ||
|
||
import cn.zxlee.znotifyapi.pojo.bo.base.PageBO; | ||
import io.swagger.annotations.ApiModel; | ||
import io.swagger.annotations.ApiModelProperty; | ||
import lombok.Data; | ||
|
||
/** | ||
* @program: z-notify-api | ||
* @description: 项目分页BO | ||
* @author: zxlee | ||
* @create: 2022-11-27 00:22 | ||
**/ | ||
|
||
@Data | ||
@ApiModel("版本分页BO") | ||
public class StatisticsPageBO extends PageBO { | ||
@ApiModelProperty("版本搜索关键字") | ||
private String keyword; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters