Ejemplo n.º 1
0
 /**
  * 根据条件查询歌曲,返回歌曲列表
  *
  * @param param
  * @return
  * @throws Exception
  */
 @RequestMapping(value = "/list", method = RequestMethod.GET)
 @ResponseBody
 public Map<String, Object> list(SearchMusicParam param) throws Exception {
   Map<String, Object> result = new HashMap<>();
   result.put("code", 0);
   result.put("data", musicService.list(param));
   return result;
 }
Ejemplo n.º 2
0
 /**
  * 编辑歌曲
  *
  * @param param
  * @return
  * @throws Exception
  */
 @RequestMapping(value = "/edit", method = RequestMethod.POST)
 @ResponseBody
 public Map<String, Object> edit(EditMusicParam param) throws Exception {
   Map<String, Object> result = new HashMap<>();
   musicService.edit(param);
   result.put("code", 0);
   result.put("data", null);
   return result;
 }
Ejemplo n.º 3
0
 /**
  * 歌曲上下线
  *
  * @param flag 1为上线,0为下线
  * @return
  */
 @RequestMapping(value = "/online", method = RequestMethod.POST)
 @ResponseBody
 public Map<String, Object> online(Integer id, Byte flag) throws Exception {
   Map<String, Object> result = new HashMap<>();
   Map<String, Object> param = new HashMap<>();
   param.put("id", id);
   param.put("flag", flag);
   musicService.online(param);
   result.put("code", 0);
   result.put("data", null);
   return result;
 }
Ejemplo n.º 4
0
 /**
  * 添加歌曲
  *
  * @param param
  * @return
  * @throws Exception
  */
 @RequestMapping(value = "/add", method = RequestMethod.POST)
 @ResponseBody
 public Map<String, Object> add(EditMusicParam param, HttpServletRequest request)
     throws Exception {
   Map<String, Object> result = new HashMap<>();
   Integer sysUserId = ((SysUser) request.getSession().getAttribute("sysUser")).getId();
   param.setCreatorId(sysUserId);
   param.setCreateTime(new Date());
   musicService.add(param);
   result.put("code", 0);
   result.put("data", null);
   return result;
 }