喜欢等bug
This commit is contained in:
@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.UserLikeMusic;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.system.service.IUserLikeMusicService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -95,4 +96,6 @@ public class UserLikeMusicController extends BaseController
|
||||
{
|
||||
return toAjax(userLikeMusicService.deleteUserLikeMusicByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.core.domain.entity.MusicInfo;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.system.service.IBannerInfoService;
|
||||
import com.ruoyi.system.service.ICategoryInfoService;
|
||||
import com.ruoyi.system.service.IMusicInfoService;
|
||||
@@ -29,7 +30,8 @@ public class IndexController extends BaseController {
|
||||
private IMusicInfoService musicInfoService;
|
||||
@Autowired
|
||||
private IRecommendInfoService recommendInfoService;
|
||||
|
||||
@Autowired
|
||||
private IMusicInfoService musicService;
|
||||
/**
|
||||
* @return com.ruoyi.common.core.domain.AjaxResult
|
||||
* 获取banner
|
||||
@@ -58,6 +60,14 @@ public class IndexController extends BaseController {
|
||||
public TableDataInfo getRecommendMusic(){
|
||||
startPage();
|
||||
List<MusicInfo> list = recommendInfoService.findRecommendMusic();
|
||||
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
for (MusicInfo musicInfo : list) {
|
||||
Long musicId = musicInfo.getMusicId();
|
||||
MusicInfo selectUserLikeMusic = musicService.selectUserLikeMusic(String.valueOf(musicId), userId);
|
||||
musicInfo.setLike(selectUserLikeMusic.isLike());
|
||||
}
|
||||
|
||||
return getDataTableData(list);
|
||||
}
|
||||
|
||||
|
||||
@@ -211,4 +211,11 @@ public class MusicController extends BaseController {
|
||||
// return AjaxResult.success(musicInfos);
|
||||
}
|
||||
|
||||
// 查找该音乐是否是我喜欢的音乐
|
||||
@GetMapping("/selectUserLikeMusic/{musicId}")
|
||||
public AjaxResult selectUserLikeMusic(@PathVariable("musicId") String musicId) {
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
return AjaxResult.success(musicService.selectUserLikeMusic(musicId,userId));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -42,22 +42,22 @@ public class UmengConfig {
|
||||
private final PushClient client = new PushClient();
|
||||
|
||||
public UmResp send(String token,String deviceTypeUp){
|
||||
String umAppkey = null;
|
||||
if (deviceTypeUp.equals(DeviceTypeEnum.ANDROID.name())){
|
||||
umAppkey = AliKeyConfig.UMApp_Android_Key;
|
||||
}else if (deviceTypeUp.equals(DeviceTypeEnum.IOS.name())){
|
||||
umAppkey = AliKeyConfig.UMApp_IOS_Key;
|
||||
}
|
||||
// String umAppkey = null;
|
||||
// if (deviceTypeUp.equals(DeviceTypeEnum.ANDROID.name())){
|
||||
// umAppkey = AliKeyConfig.UMApp_Android_Key;
|
||||
// }else if (deviceTypeUp.equals(DeviceTypeEnum.IOS.name())){
|
||||
// umAppkey = AliKeyConfig.UMApp_IOS_Key;
|
||||
// }
|
||||
//687b2df479267e0210b79b6f
|
||||
String appKey = AliKeyConfig.UMApp_AliKey;
|
||||
String appSecret = AliKeyConfig.UMApp_AliSecret;
|
||||
// String appKey = AliKeyConfig.UMApp_AliKey;
|
||||
// String appSecret = AliKeyConfig.UMApp_AliSecret;
|
||||
// if (deviceTypeUp.equals(DeviceTypeEnum.ANDROID.name())){
|
||||
//
|
||||
// }
|
||||
// //687b2df479267e0210b79b6f
|
||||
// String umAppkey = "68a99a66ec2b5b6f8825b8b1";
|
||||
// String appKey = "204918113";
|
||||
// String appSecret = "v4UrIhhLZlo0adpmevyCfvThGFbrRer0";
|
||||
String umAppkey = "68a99a66ec2b5b6f8825b8b1";
|
||||
String appKey = "204918113";
|
||||
String appSecret = "v4UrIhhLZlo0adpmevyCfvThGFbrRer0";
|
||||
// 下面的url要和阿里云云市场购买的商品对应
|
||||
String url = "https://verify5.market.alicloudapi.com/api/v1/mobile/info?appkey=" + umAppkey;
|
||||
HttpPost httpPost = new HttpPost(url);
|
||||
@@ -161,11 +161,12 @@ public class UmengConfig {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
UmengConfig umengConfig = new UmengConfig();
|
||||
// System.out.println(DeviceTypeEnum.ANDROID.name());
|
||||
// UmResp sss1 = umengConfig.send("eyJvIjoiaU9TIiwiayI6ImJNSGJwMktVdjhVaE5zOW1wQWhwYlwvWCtVRTlqcnZKeXhjb091N3BDdVlqcHNEc2RKM3A2M0pJZ056U0JrdlY5UlFPSHo3U25ZMmNcL3ZpbUI3ZHN2THFwQXlkbmRJeDB4NHhLSytFR2pvVEF4eU1oUnpUVHlrNHYzZThCSjNIajJOamJoK0VPdUtRTXV3N2pnS0dIdHJoT3FJRFF4QXJ0NisrUTI1ODhhQWdEVnp5TUVZdmxpTFhKeDUwS1wvZWI5VjdSb1VoNkMzc2E5Mm1xcHI1S3FxMm9KZHk3THoyYkVPQUVnM1hvWHJWVlwvcmtOMFluV1AyMVBZb0xrVFgxXC84TWZhVXZJRkY2aWJldDVaYkNzMVNhZU9LVU1rcnlicVpINHBMNlF5TzBFRjkrUHljT01hOGlVTjZabVZ6dm1HOFJHK3BjQjF1amVpSVpRN2N5bDRPOGxnPT0iLCJjIjoiSW02VTJVV3IxYTlDTkpmN29WR2FpRGxCZ3RSamQ5djUwaENCajJMWXd5N2Y3dzV2SndnWHFSXC8zeTlWYzFpSDFITnFHN1wvcUZpN2cxXC94cGQ5RGNsVjE0SXFKYmsxSHppZkNcL0JSU0NaeGpFTm5qWndTR3l1K1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XdRSmMzSzY0QkxNcCJ9", "ios");
|
||||
// String sss;
|
||||
//
|
||||
// sss = "{\"success\":true,\"data\":{\"mobile\":\"18518753918\",\"score\":null,\"activeScore\":null,\"aesEncryptKey\":null},\"code\":2001,\"message\":\"gain mobile's result success\",\"requestId\":\"0E87E249-42A0-42C0-94D3-7424D45E571E\"}\n";
|
||||
System.out.println(DeviceTypeEnum.ANDROID.name());
|
||||
UmResp sss1 = umengConfig.send(
|
||||
"eyJvIjoiaU9TIiwiayI6ImJNSGJwMktVdjhVaE5zOW1wQWhwYlwvWCtVRTlqcnZKeXhjb091N3BDdVlqcHNEc2RKM3A2M0pJZ056U0JrdlY5UlFPSHo3U25ZMmNcL3ZpbUI3ZHN2THFwQXlkbmRJeDB4NHhLSytFR2pvVEF4eU1oUnpUVHlrNHYzZThCSjNIajJOamJoK0VPdUtRTXV3N2pnS0dIdHJoT3FJRFF4QXJ0NisrUTI1ODhhQWdEVnp5TUVZdmxpTFhKeDUwS1wvZWI5VjdSb1VoNkMzc2E5Mm1xcHI1S3FxMm9KZHk3THoyYkVPQUVnM1hvWHJWVlwvcmtOMFluV1AyMVBZb0xrVFgxXC84TWZhVXZJRkY2aWJldDVaYkNzMVNhZU9LVU1rcnlicVpINHBMNlF5TzBFRjkrUHljT01hOGlVTjZabVZ6dm1HOFJHK3BjQjF1amVpSVpRN2N5bDRPOGxnPT0iLCJjIjoiSW02VTJVV3IxYTlDTkpmN29WR2FpRGxCZ3RSamQ5djUwaENCajJMWXd5N2Y3dzV2SndnWHFSXC8zeTlWYzFpSDFITnFHN1wvcUZpN2cxXC94cGQ5RGNsVjE0SXFKYmsxSHppZkNcL0JSU0NaeGpFTm5qWndTR3l1K1VnR3luajhnMWlHbkFhOHRmVWRUN0lGNWdrOGpVSVlteTZBNllkXC92Z2RXXC9wa1krcE9pczVWZEUrTjhXMjhEXC9idXhjQm1Wbm5obHpMWmdzRHUrdWcwQ0FMY2M0V3JybWdGdFcyOWN4Mkh5SGNNZ3AwY2xuOW5GQnNaS20zbDV3QWZIeUd2WkRpU1R3Q0lpSjFHUzNXUm1oZFVVdXo4NHRqMnBhWHZ1Y01Sa0tnNGt6Mk9cLyt4QmMrRzJ1VGpETXNtcW1nVUdBSWFoMlNyaGs5MEJMZWlKSFRLY0diTjlZbmN2cjZlMTBlZE1nSDR3QTB5K0lnTzlXd2t5OVAwb1FUbEZpUHd1Tm9PMm1OUEFpTDVwb3ZkZEp0QmY4TDZmb3B1NWl4a0FnVzBUdFM2OHN3Y3BaeWhuT25zRks0dXI2OHc3YWIySWJPNWpZMnhLTHZvb1NjMmRcLzhcL2JSTmxFM0txUUFLcDRGQUpxdWJ2bjhQRzdPcGN2bXhuSkF4bTJYNTFkQUZtaTdsSjZuZlc0MlJSNDRZWDBtMlhkczAwY3hZa2s5Q29zeVdWVUdGUkVDMjdjUUFURU9PMWp2TzdlMHEwOTRLZjdnaEx2UFJadlo2bFIxSUxmTTJxeWlQc0V5dmRiSUJyaG1yVEtJOWdqRW5Qc3U2dEZPc1RiZ0oxaVwvNGZBRFBKWDhOczF1Ym9taVl2KzZnVGsyNzlZTmQ3WU9OT21mMzlTOG05RktrNEN3Uk1QT1wvcVVSMGRJN25HbER4U1wvWEFFbWNHU0wxcDllczN0U0lsVUIrbHNcL3luWWZFNWNicDIwRE9NV3ZcL0xLa0I2cXA5RkVtaXV6eDY2MWYzZE9hZnk2WUJ2V2dsQnljU05TSkdDNkpYeTZnWHEwR1wvNE9XTkRPdjFhakIxMnhGRk9PK1dhbUVKcG9Takxic0FFV0V5eEtDb3pXaU9meG0ydEJ0bHdoM2hwXC9Vb3RyRCtIbkY2Z1NOOGtCblVtYnJRU3FzYUdsM2g3WDZSZUREbXdRSmMzSzY0QkxNcCJ9", "IOS");
|
||||
// String sss;
|
||||
|
||||
// sss = "{\"success\":true,\"data\":{\"mobile\":\"18518753918\",\"score\":null,\"activeScore\":null,\"aesEncryptKey\":null},\"code\":2001,\"message\":\"gain mobile's result success\",\"requestId\":\"0E87E249-42A0-42C0-94D3-7424D45E571E\"}\n";
|
||||
//
|
||||
// UmResp ss = JSONUtil.toBean(sss, UmResp.class);
|
||||
// System.out.println(ss);
|
||||
|
||||
@@ -64,4 +64,6 @@ public interface MusicCollectMapper
|
||||
int delBindMusic(MusicCollect musicCollect);
|
||||
|
||||
MusicCollect selectCollectIdAndMusicId(MusicCollect musicCollect);
|
||||
|
||||
int deleteMusicCollectByCollectIds(Long[] ids);
|
||||
}
|
||||
|
||||
@@ -112,4 +112,6 @@ public interface MusicInfoMapper
|
||||
String selectListRandomMusic(String currentMusicId);
|
||||
|
||||
UserLikeMusic selectMusicAndUserLike(@Param("userId") Long userId,@Param("musicId") String musicId);
|
||||
|
||||
MusicInfo selectUserLikeMusic(@Param("musicId") String musicId,@Param("userId") Long userId);
|
||||
}
|
||||
|
||||
@@ -138,4 +138,6 @@ public interface IMusicInfoService
|
||||
* @return 音乐信息列表,包含是否是当前用户喜欢的标识
|
||||
*/
|
||||
List<MusicInfo> findLikeSearch(String search);
|
||||
|
||||
MusicInfo selectUserLikeMusic(String musicId, Long userId);
|
||||
}
|
||||
|
||||
@@ -532,4 +532,13 @@ public class MusicInfoServiceImpl implements IMusicInfoService
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MusicInfo selectUserLikeMusic(String musicId, Long userId) {
|
||||
MusicInfo musicInfo = musicInfoMapper.selectUserLikeMusic(musicId, userId);
|
||||
if (musicInfo != null){
|
||||
musicInfo.setLike(true);
|
||||
return musicInfo;
|
||||
}
|
||||
return new MusicInfo();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,6 +109,8 @@ public class UserCollectServiceImpl implements IUserCollectService
|
||||
@Override
|
||||
public int deleteUserCollectByIds(Long[] ids)
|
||||
{
|
||||
// 删除关联
|
||||
musicCollectMapper.deleteMusicCollectByCollectIds(ids);
|
||||
return userCollectMapper.deleteUserCollectByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
@@ -69,4 +69,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<select id="selectCollectIdAndMusicId" resultMap="MusicCollectResult">
|
||||
SELECT * FROM music_collect where music_id=#{musicId} and collect_id=#{collectId}
|
||||
</select>
|
||||
|
||||
<delete id="deleteMusicCollectByCollectIds">
|
||||
delete from music_collect where collect_id in
|
||||
<foreach item="collectId" collection="array" open="(" separator="," close=")">
|
||||
#{collectId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -140,7 +140,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectRecommendMusic" resultMap="MusicInfoResult">
|
||||
SELECT mi.*,mr.recommend_id FROM music_recommend mr LEFT JOIN music_info mi on mr.music_id = mi.music_id and mi.is_del=0
|
||||
SELECT mi.*,mr.recommend_id FROM music_recommend mr
|
||||
LEFT JOIN music_info mi on mr.music_id = mi.music_id and mi.is_del=0
|
||||
</select>
|
||||
|
||||
<select id="selectMusicByCollectId" resultMap="MusicInfoResult">
|
||||
@@ -207,10 +208,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</select>
|
||||
|
||||
<select id="selectListRandomMusic" resultType="java.lang.String">
|
||||
SELECT music_info.music_id from music_info where music_id != #{currentMusicId} ORDER BY RAND() LIMIT 1
|
||||
SELECT music_info.music_id from music_info where music_id != #{currentMusicId} and music_type != 'mixing' ORDER BY RAND() LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectMusicAndUserLike" resultType="com.ruoyi.common.core.domain.entity.UserLikeMusic">
|
||||
SELECT user_id as userId , music_id as musicId FROm user_like_music where user_id=#{userId} and music_id=#{musicId} limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectUserLikeMusic" resultMap="MusicInfoResult">
|
||||
SELECT * FROM user_like_music where user_id= #{userId} and music_id= #{musicId}
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -53,7 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMusicRecommendByIds" parameterType="String">
|
||||
delete from music_recommend where id in
|
||||
delete from music_recommend where recommend_id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
|
||||
Reference in New Issue
Block a user