票务新增区间抽数方法(测试接口)

This commit is contained in:
XinWei 2024-08-28 17:04:05 +08:00
parent 7b9932797a
commit fe20745099
2 changed files with 34 additions and 0 deletions

View File

@ -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<String> 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));
}
}

View File

@ -36,6 +36,7 @@ public class SecurityConfiguration {
.antMatchers(adminSeverContextPath + "/**").anonymous();
// 文件读取
registry.antMatchers(buildAdminApi("/infra/file/*/get/**")).permitAll();
registry.antMatchers("/**/infra/ticketing/**").permitAll();
// TODO 芋艿这个每个项目都需要重复配置得捉摸有没通用的方案
// RPC 服务的安全配置