Ver Fonte

fix 修改车队排序

chenbiao há 1 ano atrás
pai
commit
ddc3f57563

+ 3 - 0
netflix-dao/src/main/java/com/cyksj/model/views/ChatgptCarInfoView.java

@@ -76,6 +76,9 @@ public class ChatgptCarInfoView {
     @DbField("cs.isPlus")
     private Integer isPlus;
 
+    @DbField("cs.sort")
+    private Integer sort;
+
 
     @Override
     public boolean equals(Object o) {

+ 1 - 1
netflix-service/src/main/java/com/cyksj/service/chatgpt/ChatGptAccountService.java

@@ -45,7 +45,7 @@ public interface ChatGptAccountService {
 
     ChatgptUser getCarChatGptUserWithToken(String userToken);
 
-    SearchResult<ChatgptCarInfoView> getCarInfoPage(String userToken, Integer limit, Boolean isPlus);
+    SearchResult<ChatgptCarInfoView> getCarInfoPage(String userToken, Integer limit);
 
     List<ChatgptCarInfoView> getCarInfoList(String userToken, Integer limit, Boolean isPlus);
 

+ 5 - 2
netflix-service/src/main/java/com/cyksj/service/chatgpt/impl/ChatGptAccountServiceImpl.java

@@ -465,9 +465,12 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
      * 获取车队分页信息
      */
     @Override
-    public SearchResult<ChatgptCarInfoView> getCarInfoPage(String userToken, Integer limit, Boolean isPlus) {
+    public SearchResult<ChatgptCarInfoView> getCarInfoPage(String userToken, Integer limit) {
+
         SearchResult<ChatgptCarInfoView> chatgptCarInfoViews = beanSearcher.search(ChatgptCarInfoView.class, MapUtils.flatBuilder(request.getParameterMap())
-                .field(ChatgptCarInfoView::getIsPlus, isPlus).orderBy(ChatgptCarInfoView::getTeamClearsIn).asc().orderBy(ChatgptCarInfoView::getClearsIn).asc().orderBy(ChatgptCarInfoView::getScore).asc().build());
+                .orderBy(ChatgptCarInfoView::getSort).asc()
+                .orderBy(ChatgptCarInfoView::getTeamClearsIn).asc()
+                .orderBy(ChatgptCarInfoView::getClearsIn).asc().orderBy(ChatgptCarInfoView::getScore).asc().build());
 
         chatgptCarInfoViews.getDataList().forEach(this::buildChatgptCarInfoView);
         return chatgptCarInfoViews;

+ 2 - 2
netflix-web/src/main/java/com/cyksj/web/controller/mirror/MirrorController.java

@@ -157,14 +157,14 @@ public class MirrorController {
      * @return
      */
     @GetMapping("/gpt/cars")
-    public Result<SearchResult<ChatgptCarInfoView>> getCarInfoList(Long relationId,@RequestParam(defaultValue = "20") Integer limit,@RequestParam(defaultValue = "true") Boolean isPlus) {
+    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("您还未购买车票");
         }
-        SearchResult<ChatgptCarInfoView> carInfoList = chatGptAccountService.getCarInfoPage(carChatGptUser.getUserToken(),limit, isPlus);
+        SearchResult<ChatgptCarInfoView> carInfoList = chatGptAccountService.getCarInfoPage(carChatGptUser.getUserToken(),limit);
         return GatewayResponse.SUCCESS.newBuilder().toResult(carInfoList);
     }