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

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

View File

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

View File

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

View File

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