From ee27d54dde89ad9aeca06d49829e47f1818ffdc1 Mon Sep 17 00:00:00 2001 From: XinWei <2718030729@qq.com> Date: Fri, 16 Aug 2024 10:53:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E7=A5=A8=E5=8A=A1=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E8=BF=94=E5=9B=9E=E5=80=BC=E6=94=B9=E4=B8=BA=E5=8E=9F?= =?UTF-8?q?=E6=9D=A5=E4=BD=BF=E7=94=A8=E7=9A=84=E8=BF=94=E5=9B=9E=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/asset/AssetApi.java | 8 +-- .../admin/checkticket/CheckTicketApi.java | 8 +-- .../admin/saledata/SaleDataApi.java | 56 +++++++++---------- .../config/SecurityConfiguration.java | 3 +- 4 files changed, 37 insertions(+), 38 deletions(-) diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/AssetApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/AssetApi.java index 97ffd9a26..fc4ca56cd 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/AssetApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/asset/AssetApi.java @@ -29,12 +29,12 @@ public class AssetApi { private AssetService assetService; @GetMapping("/type") @Operation(summary = "获得所有设备名称和数量") - public CommonResult>> countAsset() { - return success(assetService.countAsset()); + public List> countAsset() { + return assetService.countAsset(); } @GetMapping("/name/{assettypename}") @Operation(summary = "获取符合设备类型名的所有设备") - public CommonResult> nameAsset(@PathVariable("assettypename") String assettypename) { - return success(assetService.nameAsset(assettypename)); + public List nameAsset(@PathVariable("assettypename") String assettypename) { + return assetService.nameAsset(assettypename); } } diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/CheckTicketApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/CheckTicketApi.java index a0b848309..5b83dc24c 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/CheckTicketApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/checkticket/CheckTicketApi.java @@ -25,13 +25,13 @@ public class CheckTicketApi { private CheckTicketService checkTicketService; @GetMapping("/{day}") @Operation(summary = "获得日期当天的检票人数") - public CommonResult 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>> findbytimetemp(@PathVariable("day") String day) { - return success(checkTicketService.findbytimetemp(day)); + public List> findbytimetemp(@PathVariable("day") String day) { + return checkTicketService.findbytimetemp(day); } } diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/SaleDataApi.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/SaleDataApi.java index 36d20cb93..d7cbe87e4 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/SaleDataApi.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/controller/admin/saledata/SaleDataApi.java @@ -27,87 +27,87 @@ public class SaleDataApi { @GetMapping("/{day}") @Operation(summary = "获得输入日期的当天总售票数") - public CommonResult 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>> thisyearNum(@PathVariable("startTime") String startTime) { - return success(saleDataService.findCheckticketcountBytime(startTime)); + public List> thisyearNum(@PathVariable("startTime") String startTime) { + return saleDataService.findCheckticketcountBytime(startTime); } @GetMapping("/lastyear/{startTime}") @Operation(summary = "获得去年日期往前推十天的数据") - public CommonResult>> lastyearNum(@PathVariable("startTime") String startTime) { - return success(saleDataService.findCheckticketcountBytime(startTime)); + public List> lastyearNum(@PathVariable("startTime") String startTime) { + return saleDataService.findCheckticketcountBytime(startTime); } @GetMapping("/gender") @Operation(summary = "获得所有数据的男女数量") - public CommonResult>> findByGender() { - return success(saleDataService.findByGender()); + public List> findByGender() { + return saleDataService.findByGender(); } @GetMapping("/age") @Operation(summary = "获得所有数据的年龄分段和数量") - public CommonResult>> findByage() { - return success(saleDataService.findByAge()); + public List> findByage() { + return saleDataService.findByAge(); } @GetMapping("/lastyear/region") @Operation(summary = "查询去年各个省份的人数") - public CommonResult>> lastyearfindByregion() { - return success(saleDataService.findByregion(saleDataService.findEventsLastYear())); + public List> lastyearfindByregion() { + return saleDataService.findByregion(saleDataService.findEventsLastYear()); } @GetMapping("/thisyear/region") @Operation(summary = "查询今年各个省份的人数") - public CommonResult>> thisyearfindByregion() { - return success(saleDataService.findByregion(saleDataService.findEventsThisYear())); + public List> thisyearfindByregion() { + return saleDataService.findByregion(saleDataService.findEventsThisYear()); } @GetMapping("/salemethod") @Operation(summary = "查询各个销售渠道的购票人数") - public CommonResult>> findBysaleMethod() { - return success(saleDataService.findBySaleMethod()); + public List> findBysaleMethod() { + return saleDataService.findBySaleMethod(); } @GetMapping("/wuyi/{x}") @Operation(summary = "查询最近前几年当年的五一期间的数据") - public CommonResult>> findByWuyi(@PathVariable("x") int x) { - return success(saleDataService.findWuyi(x)); + public List> findByWuyi(@PathVariable("x") int x) { + return saleDataService.findWuyi(x); } @GetMapping("/guoqing/{x}") @Operation(summary = "查询最近前几年当年的国庆期间的数据") - public CommonResult>> findByGuoqing(@PathVariable("x") int x) { - return success(saleDataService.findGuoqing(x)); + public List> findByGuoqing(@PathVariable("x") int x) { + return saleDataService.findGuoqing(x); } @GetMapping("/rijunthisyear/{startTime}") @Operation(summary = "查询今年对应日期的近三十天日均售票数量") - public CommonResult 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 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 findmoneythisyear() { - return success(saleDataService.findyearJun(saleDataService.findEventsThisYear())); + public BigDecimal findmoneythisyear() { + return saleDataService.findyearJun(saleDataService.findEventsThisYear()); } @GetMapping("/lastyear/nianjun") @Operation(summary = "查询去年年度售票平均金额") - public CommonResult findmoneylastyear() { - return success(saleDataService.findyearJun(saleDataService.findEventsLastYear())); + public BigDecimal findmoneylastyear() { + return saleDataService.findyearJun(saleDataService.findEventsLastYear()); } } diff --git a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/security/config/SecurityConfiguration.java b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/security/config/SecurityConfiguration.java index 725273fb6..0b8e6376a 100644 --- a/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/security/config/SecurityConfiguration.java +++ b/ludu-module-datacenter/ludu-module-datacenter-biz/src/main/java/cn/iocoder/yudao/module/datacenter/framework/security/config/SecurityConfiguration.java @@ -19,8 +19,7 @@ public class SecurityConfiguration { @Override public void customize(ExpressionUrlAuthorizationConfigurer.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();