小程序点歌 新增获取正在演唱歌曲接口
This commit is contained in:
parent
41c264d325
commit
a25e86fcc0
|
|
@ -60,7 +60,9 @@ public class LoginFilter implements Filter {
|
||||||
// 点歌部分不需要登录
|
// 点歌部分不需要登录
|
||||||
"/cashierService/song/detail",
|
"/cashierService/song/detail",
|
||||||
"/cashierService/song/record",
|
"/cashierService/song/record",
|
||||||
"/cashierService/song"
|
"/cashierService/song",
|
||||||
|
"/cashierService/song/singing",
|
||||||
|
"/cashierService/login/test"
|
||||||
);
|
);
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,11 @@ public class ShopSongController {
|
||||||
return Result.successWithData(shopSongService.getRecord(openId, page, size, state, isDesc));
|
return Result.successWithData(shopSongService.getRecord(openId, page, size, state, isDesc));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取正在播放的歌曲
|
||||||
|
* @param openId 用户id
|
||||||
|
* @return 歌曲信息
|
||||||
|
*/
|
||||||
@GetMapping("/singing")
|
@GetMapping("/singing")
|
||||||
public Result getSinging(
|
public Result getSinging(
|
||||||
@RequestHeader("openId") String openId
|
@RequestHeader("openId") String openId
|
||||||
|
|
@ -68,6 +73,12 @@ public class ShopSongController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建订单
|
||||||
|
* @param openId 用户信息
|
||||||
|
* @param songOrderDTO 订单信息
|
||||||
|
* @return result
|
||||||
|
*/
|
||||||
@PostMapping
|
@PostMapping
|
||||||
public Result createOrder(
|
public Result createOrder(
|
||||||
@RequestHeader("openId") String openId,
|
@RequestHeader("openId") String openId,
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,6 @@ public interface TbShopSongOrderMapper {
|
||||||
" a.open_id = #{openId} and a.state in (1, 2, 3)")
|
" a.open_id = #{openId} and a.state in (1, 2, 3)")
|
||||||
List<Map<String, Object>> selectActiveOrderByUserId(@Param("openId") String openId);
|
List<Map<String, Object>> selectActiveOrderByUserId(@Param("openId") String openId);
|
||||||
|
|
||||||
@Select("SELECT song_name, id FROM `tb_shop_song_order` where open_id=#{openId} and state=2 limit 1")
|
@Select("SELECT a.song_name songName, a.id, b.img FROM `tb_shop_song_order` as a left join tb_shop_song as b on a.song_id=b.id where open_id=#{openId} and state=2 limit 1")
|
||||||
Map<String, Object> selectSinging(@Param("openId") String openId);
|
Map<String, Object> selectSinging(@Param("openId") String openId);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import org.springframework.web.context.request.RequestContextHolder;
|
||||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
|
@ -136,7 +137,16 @@ public class TbShopSongServiceImpl implements TbShopSongService{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Object getSinging(String openId) {
|
public Object getSinging(String openId) {
|
||||||
return shopSongOrderMapper.selectSinging(openId);
|
Map<String, Object> map = shopSongOrderMapper.selectSinging(openId);
|
||||||
|
if (map == null) {
|
||||||
|
return new HashMap<String, Object>(){{
|
||||||
|
put("songName", "");
|
||||||
|
put("id", "");
|
||||||
|
put("img", "");
|
||||||
|
}};
|
||||||
|
}else {
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue