B站下载姬添加直播用户名显示
新增/修改B站直播时自动获取直播用户名
This commit is contained in:
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.yutou.tools.mybatis.dao.BilibiliLiveDao;
|
||||
import com.yutou.tools.mybatis.model.BilibiliLive;
|
||||
import com.yutou.tools.mybatis.model.BilibiliLiveExample;
|
||||
import com.yutou.tools.utils.BiliBiliLiveTools;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -39,6 +40,7 @@ public class Live {
|
||||
}catch (Exception e){
|
||||
live.setCid(-1);
|
||||
}
|
||||
live.setTitle(BiliBiliLiveTools.getLiveUserName(live.getCid()+""));
|
||||
bilibiliLiveDao.insert(live);
|
||||
JSONObject json=new JSONObject();
|
||||
json.put("code",0);
|
||||
@@ -77,6 +79,7 @@ public class Live {
|
||||
if(!StringUtils.isEmpty(status)){
|
||||
live.setStatus(Integer.parseInt(status));
|
||||
}
|
||||
live.setTitle(BiliBiliLiveTools.getLiveUserName(live.getCid()+""));
|
||||
int code=bilibiliLiveDao.updateByPrimaryKey(live);
|
||||
json.put("code",code);
|
||||
json.put("msg","ok");
|
||||
|
||||
Reference in New Issue
Block a user