Переглянути джерело

Merge remote-tracking branch 'origin/Payment-Configuration' into Payment-Configuration

xgb 2 тижнів тому
батько
коміт
1c9f246dac

+ 46 - 13
fs-service/src/main/java/com/fs/course/mapper/FsUserVideoMapper.java

@@ -131,19 +131,52 @@ public interface FsUserVideoMapper
     @Update("update fs_user_video set favorite_num=favorite_num-1 where video_id=#{videoId}")
     int minusFavorite(Long videoId);
 
-    @Select({"<script> " +
-            "select v.video_id as id,v.title,v.description as msg,t.nick_name as username,t.avatar as headImg, " +
-            "v.thumbnail as cover,v.url as src,v.likes as likeNum,v.comments as smsNum,v.favorite_num," +
-            "v.create_time,v.views as playNumber,v.product_id,p.img_url,p.package_name,v.upload_type,v.shares,v.add_num from fs_user_video v " +
-            "left join fs_user_talent t on t.talent_id = v.talent_id " +
-            " left join fs_package p on p.package_id = v.product_id " +
-            "where v.is_del = 0 and v.status = 1  " +
-            " and v.is_audit = 1 " +
-            "<if test = ' maps.keyword!=null and maps.keyword != \"\" '> " +
-            "and v.title like CONCAT('%',#{maps.keyword},'%') " +
-            "</if>" +
-            " order by RAND() "+
-            "</script>"})
+    @Select({
+            "<script>",
+            "SELECT",
+            "    v.video_id AS id,",
+            "    v.title,",
+            "    v.description AS msg,",
+            "    t.nick_name AS username,",
+            "    t.avatar AS headImg,",
+            "    v.thumbnail AS cover,",
+            "    v.url AS src,",
+            "    v.likes AS likeNum,",
+            "    v.comments AS smsNum,",
+            "    v.favorite_num,",
+            "    v.create_time,",
+            "    v.views AS playNumber,",
+            "    v.product_id,",
+            "    p.img_url,",
+            "    p.package_name,",
+            "    v.upload_type,",
+            "    v.shares,",
+            "    v.add_num",
+            "FROM fs_user_video v",
+            "LEFT JOIN fs_user_talent t ON t.talent_id = v.talent_id",
+            "LEFT JOIN fs_package p ON p.package_id = v.product_id",
+            "WHERE v.is_del = 0",
+            "    AND v.status = 1",
+            "    AND v.is_audit = 1",
+            "<if test='maps.keyword != null and maps.keyword != \"\"'>",
+            "    AND v.title LIKE CONCAT('%', #{maps.keyword}, '%')",
+            "</if>",
+            "<choose>",
+            "    <when test='maps.sortType == \"hot\"'>",
+            "        ORDER BY v.likes DESC, v.create_time DESC",
+            "    </when>",
+            "    <when test='maps.sortType == \"new\"'>",
+            "        ORDER BY v.create_time DESC",
+            "    </when>",
+            "    <when test='maps.sortType == \"play\"'>",
+            "        ORDER BY v.views DESC",
+            "    </when>",
+            "    <otherwise>",
+            "        ORDER BY RAND()",
+            "    </otherwise>",
+            "</choose>",
+            "</script>"
+    })
     List<FsUserVideoListUVO> selectFsUserVideoListUVO(@Param("maps") FsUserVideoListUParam param);
 
     @Update("UPDATE fs_user_video SET comments = comments+#{commentCount} WHERE video_id = #{videoId}")

+ 5 - 0
fs-service/src/main/java/com/fs/course/param/FsUserVideoListUParam.java

@@ -12,4 +12,9 @@ public class FsUserVideoListUParam extends BaseParam implements Serializable {
 
     Long videoId;
 
+    /**
+     * 类型
+     */
+    String sortType;
+
 }

+ 1 - 1
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -2012,7 +2012,7 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
                 //查询是否绑定小程序
                 FsUserWx fsUserWx = fsUserWxService.selectByAppIdAndUserId(param.getAppId(), user.getUserId(), 1);
                 if (fsUserWx == null) {
-                    return R.error("openId参数错误,请清理缓存重新授权");
+                    return R.error(401,"openId参数错误,请清理缓存重新授权");
                 } else {
                     packetParam.setOpenId(fsUserWx.getOpenId());
                 }

+ 2 - 1
fs-user-app/src/main/java/com/fs/app/controller/AppLoginController.java

@@ -90,6 +90,7 @@ public class AppLoginController extends AppBaseController{
     private ISmsService smsService;
     @Autowired
     private IFsCoursePlaySourceConfigService fsCoursePlaySourceConfigService;
+    @Autowired
     private OpenIMService openIMService;
 
     @ApiOperation("注册app用户")
@@ -1041,6 +1042,6 @@ public class AppLoginController extends AppBaseController{
     @PostMapping("/getFriendList")
     public R getFriendList(@RequestBody UserRequestParam userRequestParam)
     {
-        return R.ok().put("date",openIMService.getFriendList(userRequestParam.getUserID(),userRequestParam.getPagination().getPageNumber(),userRequestParam.getPagination().getShowNumber(),userRequestParam.getApplyType()));
+        return R.ok().put("data",openIMService.getFriendList(userRequestParam.getUserID(),userRequestParam.getPagination().getPageNumber(),userRequestParam.getPagination().getShowNumber(),userRequestParam.getApplyType()));
     }
 }

+ 1 - 1
fs-user-app/src/main/java/com/fs/app/controller/UserController.java

@@ -378,7 +378,7 @@ public class UserController extends  AppBaseController {
         String userId = getUserId();
         FsUser fsUser = new FsUser();
         fsUser.setUserId(Long.parseLong(userId));
-//        fsUser.setHistoryApp(historyApp);
+        fsUser.setHistoryApp(historyApp);
         if (userService.updateFsUser(fsUser)>0) {
             return R.ok();
         } else {