开发工具:eclipse,数据库mysql5.7 jdk1.8
技术:springboot+mybatis
/**
*
*
*
*/
package com.bjpowernode.music.ss.service.impl;
import java.util.List;
import javax.annotation.Resource;
import com.bjpowernode.music.common.AbstractService;
import com.bjpowernode.music.ss.domain.MusicLink;
import com.bjpowernode.music.ss.mapper.IMusicLinkMapper;
import org.springframework.stereotype.Service;
import com.bjpowernode.music.common.IOperations;
import com.bjpowernode.music.ss.service.IMusicLinkService;
@Service("musicLinkService")
public class MusicLinkService extends AbstractService<MusicLink, MusicLink> implements IMusicLinkService {
public MusicLinkService() {
this.setTableName("musiclink");
}
@Resource
private IMusicLinkMapper musicLinkMapper;
@Override
protected IOperations<MusicLink, MusicLink> getMapper() {
return musicLinkMapper;
}
@Override
public void setTableName(String tableName) {
this.tableName = tableName;
}
public List<MusicLink> songRearch(String songName) {
return musicLinkMapper.songRearch(songName);
}
public String getUserId(String user_name, String user_password) {
return musicLinkMapper.getUserId(user_name, user_password);
}
@Override
public void insertSongRearch(int song_id, int userId) {
musicLinkMapper.insertSongRearch(song_id, userId);
}
@Override
public String judgeSong(String songName, int userId) {
return musicLinkMapper.judgeSong(songName, userId);
}
}
/**
*
*
*
*/
package com.bjpowernode.music.ss.service.impl;
import java.util.List;
import javax.annotation.Resource;
import com.bjpowernode.music.common.AbstractService;
import com.bjpowernode.music.common.IOperations;
import com.bjpowernode.music.ss.domain.MyMusic;
import com.bjpowernode.music.ss.mapper.IMyMusicMapper;
import com.bjpowernode.music.ss.service.IMyMusicService;
import org.springframework.stereotype.Service;
@Service("myMusicService")
public class MyMusicService extends AbstractService<MyMusic, MyMusic> implements IMyMusicService {
public MyMusicService() {
this.setTableName("myMusic");
}
@Resource
private IMyMusicMapper myMusicMapper;
@Override
protected IOperations<MyMusic, MyMusic> getMapper() {
return myMusicMapper;
}
@Override
public void setTableName(String tableName) {
this.tableName = tableName;
;
}
@Override
public String getUserById(String user_name, String user_password) {
return myMusicMapper.getUserById(user_name, user_password);
}
@Override
public List<MyMusic> getMyMusicList(int userId) {
return myMusicMapper.getMyMusicList(userId);
}
// 删除音乐
@Override
public int deleteMyMusic(int song_id, int user_id) {
return myMusicMapper.deleteMyMusic(song_id, user_id);
}
}
免费领取下载链接-关注底部gongzhonghao:029