|
@@ -1,12 +1,17 @@
|
|
|
package com.cyksj.web.controller.group;
|
|
package com.cyksj.web.controller.group;
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.extra.servlet.ServletUtil;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
|
|
+import com.cyksj.common.util.StringUtil;
|
|
|
import com.cyksj.dto.Result;
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
|
|
+import com.cyksj.mapper.ChatGptPwdViewRecordMapper;
|
|
|
import com.cyksj.mapper.GroupsRelationMapper;
|
|
import com.cyksj.mapper.GroupsRelationMapper;
|
|
|
|
|
+import com.cyksj.model.entity.ChatGptPwdViewRecord;
|
|
|
import com.cyksj.model.entity.GroupsRelation;
|
|
import com.cyksj.model.entity.GroupsRelation;
|
|
|
import com.cyksj.model.entity.OrderDon;
|
|
import com.cyksj.model.entity.OrderDon;
|
|
|
|
|
+import com.cyksj.model.manage.views.GroupsRelationView;
|
|
|
import com.cyksj.model.request.OrderPayRequest;
|
|
import com.cyksj.model.request.OrderPayRequest;
|
|
|
import com.cyksj.model.views.RenewalView;
|
|
import com.cyksj.model.views.RenewalView;
|
|
|
import com.cyksj.model.views.UserTicketView;
|
|
import com.cyksj.model.views.UserTicketView;
|
|
@@ -21,6 +26,7 @@ import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -43,6 +49,10 @@ public class GroupRelationController {
|
|
|
|
|
|
|
|
private final UserService userService;
|
|
private final UserService userService;
|
|
|
|
|
|
|
|
|
|
+ private final ChatGptPwdViewRecordMapper chatGptPwdViewRecordMapper;
|
|
|
|
|
+
|
|
|
|
|
+ private final HttpServletRequest request;
|
|
|
|
|
+
|
|
|
@RequestMapping("/get/renewal")
|
|
@RequestMapping("/get/renewal")
|
|
|
public Result<List<RenewalView>> get(Boolean isLoginPopularize) {
|
|
public Result<List<RenewalView>> get(Boolean isLoginPopularize) {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
@@ -93,4 +103,22 @@ public class GroupRelationController {
|
|
|
.build());
|
|
.build());
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(ticketViews);
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(ticketViews);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 记录查看ChatGPT车票密码
|
|
|
|
|
+ */
|
|
|
|
|
+ @GetMapping("/recordView/{relationId}")
|
|
|
|
|
+ public Result<String> recordGPTPwdView(@PathVariable Long relationId) {
|
|
|
|
|
+ long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
|
|
+ GroupsRelationView groupsRelationView = beanSearcher.searchFirst(GroupsRelationView.class, MapUtils.builder().field(GroupsRelationView::getUserId, userId)
|
|
|
|
|
+ .field(GroupsRelationView::getId, relationId).build());
|
|
|
|
|
+ if (groupRelationFrontService == null) throw BusinessRuntimeException.getInstance("车票已不存在");
|
|
|
|
|
+ ChatGptPwdViewRecord viewRecord = new ChatGptPwdViewRecord();
|
|
|
|
|
+ viewRecord.setUserId(userId);
|
|
|
|
|
+ viewRecord.setRelationId(relationId);
|
|
|
|
|
+ viewRecord.setSkuId(groupsRelationView.getSkuId());
|
|
|
|
|
+ viewRecord.setOperateLocation(StringUtil.getRealAddressByIP(ServletUtil.getClientIP(request)));
|
|
|
|
|
+ chatGptPwdViewRecordMapper.insert(viewRecord);
|
|
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|