|
@@ -90,6 +90,8 @@ public class GroupRelationController {
|
|
|
|
|
|
|
|
private final GroupsRelationMapper relationMapper;
|
|
private final GroupsRelationMapper relationMapper;
|
|
|
|
|
|
|
|
|
|
+ private final TicketRedemptionCodeRecordMapper ticketRedemptionCodeRecordMapper;
|
|
|
|
|
+
|
|
|
private final GroupRelationFrontService groupRelationFrontService;
|
|
private final GroupRelationFrontService groupRelationFrontService;
|
|
|
|
|
|
|
|
private final UserService userService;
|
|
private final UserService userService;
|
|
@@ -245,6 +247,24 @@ public class GroupRelationController {
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(tickets);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(tickets);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 获取车票api额度兑换码
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/get/redemption/code/{relationId}")
|
|
|
|
|
+ public Result<String> getRedemptionCode(@PathVariable Long relationId) {
|
|
|
|
|
+ long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
|
|
+ List<Long> userIds = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
|
|
+ TicketRedemptionCodeRecord record = ticketRedemptionCodeRecordMapper.selectOne(Wrappers.lambdaQuery(TicketRedemptionCodeRecord.class)
|
|
|
|
|
+ .eq(TicketRedemptionCodeRecord::getRelationId, relationId)
|
|
|
|
|
+ .in(TicketRedemptionCodeRecord::getUserId, userIds)
|
|
|
|
|
+ .eq(TicketRedemptionCodeRecord::getStatus, "success")
|
|
|
|
|
+ .last("limit 1"));
|
|
|
|
|
+ if (record == null || StrUtil.isBlank(record.getRedeemCode())) {
|
|
|
|
|
+ throw BusinessRuntimeException.getInstance("兑换码不存在");
|
|
|
|
|
+ }
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(record.getRedeemCode());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 记录查看ChatGPT车票密码
|
|
* 记录查看ChatGPT车票密码
|
|
|
*/
|
|
*/
|