diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/ticketing/TicketingController.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/ticketing/TicketingController.java new file mode 100644 index 000000000..4a6c7a521 --- /dev/null +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/ticketing/TicketingController.java @@ -0,0 +1,33 @@ +package cn.iocoder.yudao.module.infra.controller.admin.ticketing; + +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.util.date.TickingDateUtils; +import cn.iocoder.yudao.module.infra.job.ticketing.TicketDataMigration; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.Calendar; +import java.util.Date; + +/** + * @Description 测试抽数接口 + */ +@Tag(name = "管理后台 - 抽数接口") +@RestController +@RequestMapping("/infra/ticketing") +@Validated +public class TicketingController { + @Resource + TicketDataMigration ticketDataMigration; + + @GetMapping + public CommonResult testTicketing(@RequestParam("startDate") String startDate, @RequestParam("endDate")String endDate, @RequestParam("method") String method) throws Exception { + Calendar startCalendar = Calendar.getInstance(); + Calendar endCalendar = Calendar.getInstance(); + startCalendar.setTime(TickingDateUtils.parse(startDate)); + endCalendar.setTime(TickingDateUtils.parse(endDate)); + return CommonResult.success(ticketDataMigration.getTicketDataByTimeZonesToMongo(startCalendar, endCalendar, method)); + } +} diff --git a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java index c5b947e11..8a45a0953 100644 --- a/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java +++ b/yudao-module-infra/yudao-module-infra-biz/src/main/java/cn/iocoder/yudao/module/infra/framework/security/config/SecurityConfiguration.java @@ -36,6 +36,7 @@ public class SecurityConfiguration { .antMatchers(adminSeverContextPath + "/**").anonymous(); // 文件读取 registry.antMatchers(buildAdminApi("/infra/file/*/get/**")).permitAll(); + registry.antMatchers("/**/infra/ticketing/**").permitAll(); // TODO 芋艿:这个每个项目都需要重复配置,得捉摸有没通用的方案 // RPC 服务的安全配置