请问后端 的这种代码,里面的Type 为什么不用直接传的 int 或 Integer 类型呢?一定要Byte类型才好?
//控制层判断代码
if (new Byte(type) == 0) {
Collect.setSongId(Integer.parseInt(songId));//放入歌曲id字段
} else if (new Byte(type) == 1) {
Collect.setSongListId(Integer.parseInt(songListId));//放入歌单id字段
} else if (new Byte(type) == 2) {
Collect.setAlbumId(Integer.parseInt(albumId));//放入专辑id字段
}
//数据库字段
private Byte type;