|
|
@@ -39,8 +39,6 @@ import javax.servlet.http.Cookie;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
import java.io.IOException;
|
|
|
-import java.math.BigDecimal;
|
|
|
-import java.math.RoundingMode;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
@@ -159,12 +157,16 @@ public class MirrorController {
|
|
|
@GetMapping("/gpt/cars")
|
|
|
public Result<SearchResult<ChatgptCarInfoView>> getCarInfoList(Long relationId,@RequestParam(defaultValue = "20") Integer limit) {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
- //查看用户是否存在车票
|
|
|
- ChatgptUser carChatGptUser = chatGptAccountService.getCarChatGptUser(userId, relationId);
|
|
|
- if (carChatGptUser == null) {
|
|
|
- throw BusinessRuntimeException.getInstance("您还未购买车票");
|
|
|
+ String userToken = null;
|
|
|
+ if (relationId != null) {
|
|
|
+ //查看用户是否存在车票
|
|
|
+ ChatgptUser carChatGptUser = chatGptAccountService.getCarChatGptUser(userId, relationId);
|
|
|
+ if (carChatGptUser == null) {
|
|
|
+ throw BusinessRuntimeException.getInstance("您还未购买车票");
|
|
|
+ }
|
|
|
+ userToken = carChatGptUser.getUserToken();
|
|
|
}
|
|
|
- SearchResult<ChatgptCarInfoView> carInfoList = chatGptAccountService.getCarInfoPage(carChatGptUser.getUserToken(),limit);
|
|
|
+ SearchResult<ChatgptCarInfoView> carInfoList = chatGptAccountService.getCarInfoPage(userToken,limit);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(carInfoList);
|
|
|
}
|
|
|
|
|
|
@@ -442,10 +444,12 @@ public class MirrorController {
|
|
|
@GetMapping("/claude/cars")
|
|
|
public Result<SearchResult<ClaudeCarInfoView>> claudeCarInfoList(Long relationId) {
|
|
|
long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
- //查看用户是否存在车票
|
|
|
- ClaudeUser claudeUser = claudeService.getClaudeUser(userId, relationId);
|
|
|
- if (claudeUser == null) {
|
|
|
- throw BusinessRuntimeException.getInstance("您还未购买车票");
|
|
|
+ if (relationId != null) {
|
|
|
+ //查看用户是否存在车票
|
|
|
+ ClaudeUser claudeUser = claudeService.getClaudeUser(userId, relationId);
|
|
|
+ if (claudeUser == null) {
|
|
|
+ throw BusinessRuntimeException.getInstance("您还未购买车票");
|
|
|
+ }
|
|
|
}
|
|
|
SearchResult<ClaudeCarInfoView> carInfoList = beanSearcher.search(ClaudeCarInfoView.class, MapUtils.flatBuilder(request.getParameterMap()).field(ClaudeCarInfoView::getCsStatus, true).orderBy(ClaudeCarInfoView::getSort).desc().orderBy(ClaudeCarInfoView::getScore).asc().build());
|
|
|
carInfoList.getDataList().forEach((claudeCarInfoView)->{
|