|
|
@@ -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;
|
|
|
@@ -157,14 +155,18 @@ public class MirrorController {
|
|
|
* @return
|
|
|
*/
|
|
|
@GetMapping("/gpt/cars")
|
|
|
- public Result<SearchResult<ChatgptCarInfoView>> getCarInfoList(Long relationId,@RequestParam(defaultValue = "20") Integer limit) {
|
|
|
+ public Result<SearchResult<ChatgptCarInfoView>> getCarInfoList(Long relationId, @RequestParam(defaultValue = "20") Integer limit) {
|
|
|
long userId = StpUserUtil.getUserIdAfterLogin();
|
|
|
- //查看用户是否存在车票
|
|
|
- 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);
|
|
|
}
|
|
|
|