大屏票务服务返回值改为原来使用的返回类型

This commit is contained in:
XinWei 2024-08-16 10:53:25 +08:00
parent 4a1c2def16
commit ee27d54dde
4 changed files with 37 additions and 38 deletions

View File

@ -29,12 +29,12 @@ public class AssetApi {
private AssetService assetService;
@GetMapping("/type")
@Operation(summary = "获得所有设备名称和数量")
public CommonResult<List<Map<String, String>>> countAsset() {
return success(assetService.countAsset());
public List<Map<String, String>> countAsset() {
return assetService.countAsset();
}
@GetMapping("/name/{assettypename}")
@Operation(summary = "获取符合设备类型名的所有设备")
public CommonResult<List<AssetRespVO>> nameAsset(@PathVariable("assettypename") String assettypename) {
return success(assetService.nameAsset(assettypename));
public List<AssetRespVO> nameAsset(@PathVariable("assettypename") String assettypename) {
return assetService.nameAsset(assettypename);
}
}

View File

@ -25,13 +25,13 @@ public class CheckTicketApi {
private CheckTicketService checkTicketService;
@GetMapping("/{day}")
@Operation(summary = "获得日期当天的检票人数")
public CommonResult<Long> checkTicketTotal(@PathVariable("day") String day) {
return success(checkTicketService.checkTicketTotal(day));
public Long checkTicketTotal(@PathVariable("day") String day) {
return checkTicketService.checkTicketTotal(day);
}
@GetMapping("/qushi/{day}")
@Operation(summary = "获取日期当天各个时段的检票人数")
public CommonResult<List<Map<String, String>>> findbytimetemp(@PathVariable("day") String day) {
return success(checkTicketService.findbytimetemp(day));
public List<Map<String, String>> findbytimetemp(@PathVariable("day") String day) {
return checkTicketService.findbytimetemp(day);
}
}

View File

@ -27,87 +27,87 @@ public class SaleDataApi {
@GetMapping("/{day}")
@Operation(summary = "获得输入日期的当天总售票数")
public CommonResult<Long> checkTicketTotal(@PathVariable("day") String day) {
return success(saleDataService.countBySddate(day));
public Long checkTicketTotal(@PathVariable("day") String day) {
return saleDataService.countBySddate(day);
}
@GetMapping("/thisyear/{startTime}")
@Operation(summary = "获得今年日期往前十天内的数据")
public CommonResult<List<Map<String, String>>> thisyearNum(@PathVariable("startTime") String startTime) {
return success(saleDataService.findCheckticketcountBytime(startTime));
public List<Map<String, String>> thisyearNum(@PathVariable("startTime") String startTime) {
return saleDataService.findCheckticketcountBytime(startTime);
}
@GetMapping("/lastyear/{startTime}")
@Operation(summary = "获得去年日期往前推十天的数据")
public CommonResult<List<Map<String, String>>> lastyearNum(@PathVariable("startTime") String startTime) {
return success(saleDataService.findCheckticketcountBytime(startTime));
public List<Map<String, String>> lastyearNum(@PathVariable("startTime") String startTime) {
return saleDataService.findCheckticketcountBytime(startTime);
}
@GetMapping("/gender")
@Operation(summary = "获得所有数据的男女数量")
public CommonResult<List<Map<String, String>>> findByGender() {
return success(saleDataService.findByGender());
public List<Map<String, String>> findByGender() {
return saleDataService.findByGender();
}
@GetMapping("/age")
@Operation(summary = "获得所有数据的年龄分段和数量")
public CommonResult<List<Map<String, String>>> findByage() {
return success(saleDataService.findByAge());
public List<Map<String, String>> findByage() {
return saleDataService.findByAge();
}
@GetMapping("/lastyear/region")
@Operation(summary = "查询去年各个省份的人数")
public CommonResult<List<Map<String, String>>> lastyearfindByregion() {
return success(saleDataService.findByregion(saleDataService.findEventsLastYear()));
public List<Map<String, String>> lastyearfindByregion() {
return saleDataService.findByregion(saleDataService.findEventsLastYear());
}
@GetMapping("/thisyear/region")
@Operation(summary = "查询今年各个省份的人数")
public CommonResult<List<Map<String, String>>> thisyearfindByregion() {
return success(saleDataService.findByregion(saleDataService.findEventsThisYear()));
public List<Map<String, String>> thisyearfindByregion() {
return saleDataService.findByregion(saleDataService.findEventsThisYear());
}
@GetMapping("/salemethod")
@Operation(summary = "查询各个销售渠道的购票人数")
public CommonResult<List<Map<String, String>>> findBysaleMethod() {
return success(saleDataService.findBySaleMethod());
public List<Map<String, String>> findBysaleMethod() {
return saleDataService.findBySaleMethod();
}
@GetMapping("/wuyi/{x}")
@Operation(summary = "查询最近前几年当年的五一期间的数据")
public CommonResult<List<Map<String, String>>> findByWuyi(@PathVariable("x") int x) {
return success(saleDataService.findWuyi(x));
public List<Map<String, String>> findByWuyi(@PathVariable("x") int x) {
return saleDataService.findWuyi(x);
}
@GetMapping("/guoqing/{x}")
@Operation(summary = "查询最近前几年当年的国庆期间的数据")
public CommonResult<List<Map<String, String>>> findByGuoqing(@PathVariable("x") int x) {
return success(saleDataService.findGuoqing(x));
public List<Map<String, String>> findByGuoqing(@PathVariable("x") int x) {
return saleDataService.findGuoqing(x);
}
@GetMapping("/rijunthisyear/{startTime}")
@Operation(summary = "查询今年对应日期的近三十天日均售票数量")
public CommonResult<String> findThisyearRijun(@PathVariable("startTime") String startTime) {
return success(saleDataService.findrijun(startTime));
public String findThisyearRijun(@PathVariable("startTime") String startTime) {
return saleDataService.findrijun(startTime);
}
@GetMapping("/rijunlastyear/{startTime}")
@Operation(summary = "查询去年对应日期的近三十天日均售票数量")
public CommonResult<String> findLastyearRijun(@PathVariable("startTime") String startTime) {
return success(saleDataService.findrijun(startTime));
public String findLastyearRijun(@PathVariable("startTime") String startTime) {
return saleDataService.findrijun(startTime);
}
// TODO 年度平均什么并没有说清楚原代码是直接计算一年的总金额
@GetMapping("/thisyear/nianjun")
@Operation(summary = "查询今年年度售票平均金额")
public CommonResult<BigDecimal> findmoneythisyear() {
return success(saleDataService.findyearJun(saleDataService.findEventsThisYear()));
public BigDecimal findmoneythisyear() {
return saleDataService.findyearJun(saleDataService.findEventsThisYear());
}
@GetMapping("/lastyear/nianjun")
@Operation(summary = "查询去年年度售票平均金额")
public CommonResult<BigDecimal> findmoneylastyear() {
return success(saleDataService.findyearJun(saleDataService.findEventsLastYear()));
public BigDecimal findmoneylastyear() {
return saleDataService.findyearJun(saleDataService.findEventsLastYear());
}
}

View File

@ -19,8 +19,7 @@ public class SecurityConfiguration {
@Override
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
// Swagger 接口文档
registry.antMatchers("/v3/api-docs/**").permitAll() // 元数据
.antMatchers("/swagger-ui.html").permitAll(); // Swagger UI
registry.antMatchers("/**").permitAll(); // 放行所有接口
// Spring Boot Actuator 的安全配置
registry.antMatchers("/actuator").anonymous()
.antMatchers("/actuator/**").anonymous();