新增页面
有登陆过滤器 正式上线1.0
This commit is contained in:
@@ -7,6 +7,7 @@ import com.yutou.tools.mybatis.model.BilibiliLive;
|
||||
import com.yutou.tools.mybatis.model.BilibiliLiveExample;
|
||||
import com.yutou.tools.utils.RedisTools;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@@ -56,4 +57,45 @@ public class Live {
|
||||
json.put("data",JSONArray.toJSON(list));
|
||||
return json.toJSONString();
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping("set/update.do")
|
||||
public String configDown(String id,String url,String cid,String status){
|
||||
JSONObject json=new JSONObject();
|
||||
BilibiliLive live=bilibiliLiveDao.selectByPrimaryKey(Integer.parseInt(id));
|
||||
if(!StringUtils.isEmpty(url)){
|
||||
if(url.startsWith("https://")){
|
||||
cid=url.replace("https://live.bilibili.com/","").split("\\?")[0];
|
||||
}else{
|
||||
cid=url;
|
||||
url="https://live.bilibili.com/"+cid;
|
||||
}
|
||||
live.setUrl(url);
|
||||
live.setCid(Integer.parseInt(cid));
|
||||
}
|
||||
if(!StringUtils.isEmpty(cid)){
|
||||
live.setCid(Integer.parseInt(cid));
|
||||
}
|
||||
if(!StringUtils.isEmpty(status)){
|
||||
live.setStatus(Integer.parseInt(status));
|
||||
}
|
||||
int code=bilibiliLiveDao.updateByPrimaryKey(live);
|
||||
json.put("code",code);
|
||||
json.put("msg","ok");
|
||||
return json.toJSONString();
|
||||
}
|
||||
@ResponseBody
|
||||
@RequestMapping("set/delete.do")
|
||||
public String delUrl(String id){
|
||||
JSONObject json=new JSONObject();
|
||||
try{
|
||||
int code=bilibiliLiveDao.deleteByPrimaryKey(Integer.parseInt(id));
|
||||
json.put("code",code);
|
||||
json.put("msg","ret "+code);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
json.put("code",-1);
|
||||
json.put("msg",e.getMessage());
|
||||
}
|
||||
return json.toJSONString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user