更新动漫家园订阅页面和对应API

This commit is contained in:
Yutousama 2020-05-12 17:42:24 +08:00
parent 47a15aa8d7
commit 61b1636c54
14 changed files with 657 additions and 114 deletions

View File

@ -0,0 +1,135 @@
package com.yutou.tools.bangumi;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yutou.tools.mybatis.dao.BangumiItemDao;
import com.yutou.tools.mybatis.dao.BangumiListDao;
import com.yutou.tools.mybatis.model.BangumiItem;
import com.yutou.tools.mybatis.model.BangumiItemExample;
import com.yutou.tools.mybatis.model.BangumiList;
import com.yutou.tools.mybatis.model.BangumiListExample;
import org.springframework.stereotype.Controller;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.annotation.Resource;
import java.util.List;
@Controller
@RequestMapping("anim/")
public class AnimationController {
@Resource
BangumiListDao listDao;
@Resource
BangumiItemDao itemDao;
@ResponseBody
@RequestMapping(value = "rss/data.do", method = RequestMethod.GET)
public String getAnimList(String key,String type,String team, int page) {
boolean isNull = key.length() == 0;
if(!StringUtils.isEmpty(type)&&type.length()>2)
type=type.substring(2);
if(!StringUtils.isEmpty(team)&&team.length()>2)
team=team.substring(2);
String[] keys = key.split(" ");
JSONArray items = null;
if (!isNull)
items = new AnimationData().bangumiList(page,type,team, keys);
JSONObject json = new JSONObject();
if (items != null) {
json.put("data", items);
} else {
json.put("data", new JSONArray());
}
json.put("count", 999);
json.put("code", 0);
json.put("msg", "ok");
return json.toJSONString();
}
@ResponseBody
@RequestMapping(value = "type/add.do", method = RequestMethod.POST)
public String addRssType(String title) {
BangumiList bangumiList = new BangumiList();
bangumiList.setTitle(title);
bangumiList.setStatus(1);
int i = listDao.insert(bangumiList);
JSONObject json = new JSONObject();
json.put("code", 0);
json.put("msg", i == 0 ? "添加失败" : "添加成功");
return json.toJSONString();
}
@ResponseBody
@RequestMapping(value = "type/list.do", method = RequestMethod.GET)
public String getRssTypeList() {
JSONObject json = new JSONObject();
json.put("code", 0);
json.put("msg", "ok");
json.put("data", JSONArray.toJSON(listDao.selectByExample(new BangumiListExample())));
return json.toJSONString();
}
@ResponseBody
@RequestMapping(value = "type/del.do", method = RequestMethod.POST)
public String delType(int id){
BangumiItemExample example=new BangumiItemExample();
example.createCriteria().andBidEqualTo(id+"");
itemDao.deleteByExample(example);
int i=listDao.deleteByPrimaryKey(id);
JSONObject json=new JSONObject();
json.put("code", 0);
json.put("msg", i == 0 ? "删除失败" : "删除成功");
return json.toJSONString();
}
@ResponseBody
@RequestMapping(value = "rss/add.do", method = RequestMethod.POST)
public String addAnimationRss(String title, String author, String categories, String titleKey, String bid) {
BangumiItem item = new BangumiItem();
item.setTitle(title);
item.setAuthor(author);
item.setCategories(categories);
item.setTitlekey(titleKey);
item.setBid(bid);
int i = itemDao.insert(item);
JSONObject json = new JSONObject();
json.put("code", 0);
json.put("msg", i == 0 ? "添加失败" : "添加成功");
return json.toJSONString();
}
@ResponseBody
@RequestMapping(value = "rss/list.do", method = RequestMethod.GET)
public String getAnimationRssList(String type) {
JSONObject json = new JSONObject();
BangumiItemExample example=new BangumiItemExample();
example.createCriteria().andBidEqualTo(type);
json.put("code", 0);
json.put("msg", "ok");
json.put("data", JSONArray.toJSON(itemDao.selectByExample(example)));
return json.toJSONString();
}
@ResponseBody
@RequestMapping(value = "rss/del.do", method = RequestMethod.POST)
public String delAnimation(int id){
int i=itemDao.deleteByPrimaryKey(id);
JSONObject json=new JSONObject();
json.put("code", 0);
json.put("msg", i == 0 ? "删除失败" : "删除成功");
return json.toJSONString();
}
@ResponseBody
@RequestMapping(value = "client/get.do", method = RequestMethod.GET)
public String clientApi(){
AnimationData animationData=new AnimationData();
List<BangumiItem> list=itemDao.selectByExample(new BangumiItemExample());
for (BangumiItem item : list) {
item.setCategories(animationData.nameToValue(item.getCategories(),false)+"");
item.setAuthor(animationData.nameToValue(item.getAuthor(),true)+"");
}
JSONArray array= (JSONArray) JSONArray.toJSON(list);
return array.toJSONString();
}
}

View File

@ -4,31 +4,55 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.yutou.tools.utils.Tools; import com.yutou.tools.utils.Tools;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder; import java.net.URLEncoder;
public class AnimationData { public class AnimationData {
private String rss2jsonUrl = "https://api.rss2json.com/v1/api.json?rss_url="; private String rss2jsonUrl = "https://api.rss2json.com/v1/api.json?rss_url=";
private String animUrl="http://share.dmhy.org/topics/rss/page/%s/rss.xml?keyword=%s"; private String animUrl = "http://share.dmhy.org/topics/rss/page/%s/rss.xml?keyword=%s&sort_id=%s&team_id=%s&order=date-desc";
public void getData(){ private String team="[{\"0\":\"全部\"},{\"117\":\"動漫花園\"},{\"669\":\"喵萌奶茶屋\"},{\"648\":\"魔星字幕团\"},{\"185\":\"极影字幕社\"},{\"619\":\"桜都字幕组\"},{\"604\":\"c.c动漫\"},{\"241\":\"幻樱字幕组\"},{\"151\":\"悠哈C9字幕社\"},{\"657\":\"LoliHouse\"},{\"283\":\"千夏字幕组\"},{\"755\":\"GMTeam\"},{\"390\":\"天使动漫\"},{\"731\":\"星空字幕组\"},{\"303\":\"动漫国字幕组\"},{\"563\":\"花園壓制組\"},{\"37\":\"雪飄工作室(FLsnow)\"},{\"47\":\"爱恋字幕社\"},{\"710\":\"咪梦动漫组\"},{\"88\":\"动音漫影\"},{\"574\":\"梦蓝字幕组\"},{\"504\":\"LoveEcho!\"},{\"765\":\"爱咕字幕组\"},{\"520\":\"豌豆字幕组\"},{\"650\":\"SweetSub\"},{\"430\":\"幻之字幕组\"},{\"407\":\"DHR動研字幕組\"},{\"321\":\"轻之国度\"},{\"581\":\"VCB-Studio\"},{\"703\":\"届恋字幕组\"},{\"576\":\"银色子弹字幕组\"},{\"454\":\"风车字幕组\"},{\"485\":\"天空树双语字幕组\"},{\"134\":\"漫游字幕组\"},{\"434\":\"风之圣殿\"},{\"630\":\"枫叶字幕组\"},{\"228\":\"KRL字幕组\"},{\"526\":\"东京不够热\"},{\"592\":\"未央阁联盟\"},{\"288\":\"诸神kamigami字幕组\"},{\"767\":\"天月動漫&發佈組\"},{\"768\":\"千歲字幕組\"},{\"423\":\"漫貓字幕組\"},{\"562\":\"129.3字幕組\"},{\"447\":\"夢幻戀櫻\"},{\"680\":\"Little字幕组\"},{\"641\":\"冷番补完字幕组\"},{\"31\":\"卡通空間\"},{\"649\":\"云光字幕组\"},{\"701\":\"狐狸小宮\"},{\"459\":\"紫音動漫&發佈組\"},{\"699\":\"小花花同盟戰線\"},{\"626\":\"驯兽师联盟\"},{\"58\":\"澄空学园\"},{\"769\":\"动漫萌\"},{\"734\":\"TD-RAWS\"},{\"225\":\"鈴風字幕組\"},{\"673\":\"VRAINSTORM\"},{\"741\":\"銀月字幕組\"},{\"675\":\"AikatsuFans\"},{\"759\":\"红鸟窝字幕组\"},{\"764\":\"MCE汉化组\"},{\"391\":\"ZERO字幕组\"},{\"561\":\"钉铛字幕组\"},{\"727\":\"2B4B\"},{\"104\":\"动漫先锋\"},{\"567\":\"雪梦字幕组\"},{\"573\":\"Centaurea-Raws\"},{\"652\":\"SFEO-Raws\"},{\"666\":\"中肯字幕組\"},{\"754\":\"BYYM发布组\"},{\"613\":\"AI-Raws\"},{\"706\":\"K&W-RAWS\"},{\"732\":\"肥猫压制\"},{\"424\":\"TSDM字幕組\"},{\"739\":\"Clarita 压制组\"},{\"432\":\"自由字幕组\"},{\"217\":\"AQUA工作室\"},{\"753\":\"柠檬水字幕组\"},{\"763\":\"光之家族字幕组\"},{\"332\":\"CureSub\"},{\"537\":\"NEO·QSW\"},{\"632\":\"歐克勒亞\"},{\"548\":\"Cornflower Studio\"},{\"638\":\"LittleBakas!\"}]";
private String type="[{\"0\":\"全部\"},{\"2\":\"動畫\"},{\"31\":\"季度全集\"},{\"3\":\"漫畫\"},{\"41\":\"港台原版\"},{\"42\":\"日文原版\"},{\"4\":\"音樂\"},{\"43\":\"動漫音樂\"},{\"44\":\"同人音樂\"},{\"15\":\"流行音樂\"},{\"6\":\"日劇\"},{\"7\":\"\"},{\"9\":\"遊戲\"},{\"17\":\"電腦遊戲\"},{\"18\":\"電視遊戲\"},{\"19\":\"掌機遊戲\"},{\"20\":\"網絡遊戲\"},{\"21\":\"遊戲周邊\"},{\"12\":\"特攝\"},{\"1\":\"其他\"}]";
public JSONArray bangumiList(int index,String type, String team,String... keys) {
try { try {
String js=Tools.get(rss2jsonUrl+ URLEncoder.encode(String.format(animUrl,"1","辉夜大小姐想让我告白"),"UTF-8")); String title = "";
for (String key : keys) {
System.out.println(key);
title += key + "+";
}
title = title.substring(1, title.length() - 1);
System.out.println(String.format(animUrl, "" + index, title,type,team));
System.out.println(rss2jsonUrl + URLEncoder.encode(String.format(animUrl, "" + index, title,type,team), "UTF-8") + "&api_key=wtfm5pebya13pnl8rtu51wfgfpte0mb9sap1foll&count=500");
String js=Tools.get(rss2jsonUrl+ URLEncoder.encode(String.format(animUrl,""+index,title,type,team),"UTF-8")+"&api_key=wtfm5pebya13pnl8rtu51wfgfpte0mb9sap1foll&count=500");
JSONObject json=JSONObject.parseObject(js); JSONObject json=JSONObject.parseObject(js);
if(json.getString("status").equals("ok")){ if(json.getString("status").equals("ok")){
JSONArray items=json.getJSONArray("items"); return json.getJSONArray("items");
for (Object obj : items) {
JSONObject item= (JSONObject) obj;
System.out.println(item.getString("title"));
}
} }
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return null;
}
public int nameToValue(String name,boolean isTeam){
JSONArray array;
if(isTeam){
array=JSONArray.parseArray(team);
}else{
array=JSONArray.parseArray(type);
}
for (Object o : array) {
JSONObject json= (JSONObject) o;
for (String s : json.keySet()) {
if(json.get(s).equals(name)){
return Integer.parseInt(s);
}
}
}
return -1;
} }
public static void main(String[] args) { public static void main(String[] args) {
AnimationData data=new AnimationData(); AnimationData data=new AnimationData();
data.getData(); int i=data.nameToValue("极影字幕社",true);
System.out.println(i);
} }
} }

View File

@ -3,8 +3,11 @@ package com.yutou.tools.mybatis.dao;
import com.yutou.tools.mybatis.model.BangumiItem; import com.yutou.tools.mybatis.model.BangumiItem;
import com.yutou.tools.mybatis.model.BangumiItemExample; import com.yutou.tools.mybatis.model.BangumiItemExample;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper
public interface BangumiItemDao { public interface BangumiItemDao {
long countByExample(BangumiItemExample example); long countByExample(BangumiItemExample example);

View File

@ -3,8 +3,11 @@ package com.yutou.tools.mybatis.dao;
import com.yutou.tools.mybatis.model.BangumiList; import com.yutou.tools.mybatis.model.BangumiList;
import com.yutou.tools.mybatis.model.BangumiListExample; import com.yutou.tools.mybatis.model.BangumiListExample;
import java.util.List; import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@Mapper
public interface BangumiListDao { public interface BangumiListDao {
long countByExample(BangumiListExample example); long countByExample(BangumiListExample example);

View File

@ -17,6 +17,8 @@ public class BangumiItem implements Serializable {
private String author; private String author;
private String title;
/** /**
* 标题过滤词 * 标题过滤词
*/ */

View File

@ -374,6 +374,76 @@ public class BangumiItemExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andTitleIsNull() {
addCriterion("title is null");
return (Criteria) this;
}
public Criteria andTitleIsNotNull() {
addCriterion("title is not null");
return (Criteria) this;
}
public Criteria andTitleEqualTo(String value) {
addCriterion("title =", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotEqualTo(String value) {
addCriterion("title <>", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThan(String value) {
addCriterion("title >", value, "title");
return (Criteria) this;
}
public Criteria andTitleGreaterThanOrEqualTo(String value) {
addCriterion("title >=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThan(String value) {
addCriterion("title <", value, "title");
return (Criteria) this;
}
public Criteria andTitleLessThanOrEqualTo(String value) {
addCriterion("title <=", value, "title");
return (Criteria) this;
}
public Criteria andTitleLike(String value) {
addCriterion("title like", value, "title");
return (Criteria) this;
}
public Criteria andTitleNotLike(String value) {
addCriterion("title not like", value, "title");
return (Criteria) this;
}
public Criteria andTitleIn(List<String> values) {
addCriterion("title in", values, "title");
return (Criteria) this;
}
public Criteria andTitleNotIn(List<String> values) {
addCriterion("title not in", values, "title");
return (Criteria) this;
}
public Criteria andTitleBetween(String value1, String value2) {
addCriterion("title between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andTitleNotBetween(String value1, String value2) {
addCriterion("title not between", value1, value2, "title");
return (Criteria) this;
}
public Criteria andTitlekeyIsNull() { public Criteria andTitlekeyIsNull() {
addCriterion("titleKey is null"); addCriterion("titleKey is null");
return (Criteria) this; return (Criteria) this;

View File

@ -13,8 +13,6 @@ public class BangumiList implements Serializable {
private String title; private String title;
private String rsskey;
private Integer status; private Integer status;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View File

@ -234,76 +234,6 @@ public class BangumiListExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andRsskeyIsNull() {
addCriterion("rssKey is null");
return (Criteria) this;
}
public Criteria andRsskeyIsNotNull() {
addCriterion("rssKey is not null");
return (Criteria) this;
}
public Criteria andRsskeyEqualTo(String value) {
addCriterion("rssKey =", value, "rsskey");
return (Criteria) this;
}
public Criteria andRsskeyNotEqualTo(String value) {
addCriterion("rssKey <>", value, "rsskey");
return (Criteria) this;
}
public Criteria andRsskeyGreaterThan(String value) {
addCriterion("rssKey >", value, "rsskey");
return (Criteria) this;
}
public Criteria andRsskeyGreaterThanOrEqualTo(String value) {
addCriterion("rssKey >=", value, "rsskey");
return (Criteria) this;
}
public Criteria andRsskeyLessThan(String value) {
addCriterion("rssKey <", value, "rsskey");
return (Criteria) this;
}
public Criteria andRsskeyLessThanOrEqualTo(String value) {
addCriterion("rssKey <=", value, "rsskey");
return (Criteria) this;
}
public Criteria andRsskeyLike(String value) {
addCriterion("rssKey like", value, "rsskey");
return (Criteria) this;
}
public Criteria andRsskeyNotLike(String value) {
addCriterion("rssKey not like", value, "rsskey");
return (Criteria) this;
}
public Criteria andRsskeyIn(List<String> values) {
addCriterion("rssKey in", values, "rsskey");
return (Criteria) this;
}
public Criteria andRsskeyNotIn(List<String> values) {
addCriterion("rssKey not in", values, "rsskey");
return (Criteria) this;
}
public Criteria andRsskeyBetween(String value1, String value2) {
addCriterion("rssKey between", value1, value2, "rsskey");
return (Criteria) this;
}
public Criteria andRsskeyNotBetween(String value1, String value2) {
addCriterion("rssKey not between", value1, value2, "rsskey");
return (Criteria) this;
}
public Criteria andStatusIsNull() { public Criteria andStatusIsNull() {
addCriterion("`status` is null"); addCriterion("`status` is null");
return (Criteria) this; return (Criteria) this;

View File

@ -9,6 +9,9 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.Cookie; import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.*;
import java.util.Enumeration;
@Controller @Controller
public class tools { public class tools {
@ -32,4 +35,30 @@ public class tools {
json.put("data",array); json.put("data",array);
return json.toJSONString(); return json.toJSONString();
} }
@ResponseBody
@RequestMapping(value = "tools/get.do")
public String getJs(HttpServletRequest request, HttpServletResponse response) throws Exception {
Enumeration<String> name=request.getHeaderNames();
while (name.hasMoreElements()){
String na=name.nextElement();
System.out.println(na+" "+request.getHeader(na));
}
File file=new File("D:\\IDEA\\web_toolset\\web\\js\\my.js");
BufferedReader reader=new BufferedReader(new FileReader(file));
String tmp,str="";
while ((tmp=reader.readLine())!=null){
if(tmp.contains("\"")){
// tmp=tmp.replace("\"","\\\"");
}
str+=tmp;
}
reader.close();
/* response.setHeader("Content-Type","application/javascript; charset=utf-8");
PrintWriter writer=response.getWriter();
writer.write(str);
writer.flush();
writer.close();*/
return str;
//return "function test(){ return \"https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1588139022200&di=8cc8405f7514dd54bd82fcd070349603&imgtype=0&src=http%3A%2F%2Fa2.att.hudong.com%2F36%2F48%2F19300001357258133412489354717.jpg\" }";
}
} }

View File

@ -6,6 +6,7 @@
<result column="bid" jdbcType="VARCHAR" property="bid" /> <result column="bid" jdbcType="VARCHAR" property="bid" />
<result column="categories" jdbcType="VARCHAR" property="categories" /> <result column="categories" jdbcType="VARCHAR" property="categories" />
<result column="author" jdbcType="VARCHAR" property="author" /> <result column="author" jdbcType="VARCHAR" property="author" />
<result column="title" jdbcType="VARCHAR" property="title" />
<result column="titleKey" jdbcType="VARCHAR" property="titlekey" /> <result column="titleKey" jdbcType="VARCHAR" property="titlekey" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
@ -67,7 +68,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, bid, categories, author, titleKey id, bid, categories, author, title, titleKey
</sql> </sql>
<select id="selectByExample" parameterType="com.yutou.tools.mybatis.model.BangumiItemExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.yutou.tools.mybatis.model.BangumiItemExample" resultMap="BaseResultMap">
select select
@ -101,9 +102,9 @@
</delete> </delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.tools.mybatis.model.BangumiItem" useGeneratedKeys="true"> <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.tools.mybatis.model.BangumiItem" useGeneratedKeys="true">
insert into bangumi_item (bid, categories, author, insert into bangumi_item (bid, categories, author,
titleKey) title, titleKey)
values (#{bid,jdbcType=VARCHAR}, #{categories,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR}, values (#{bid,jdbcType=VARCHAR}, #{categories,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR},
#{titlekey,jdbcType=VARCHAR}) #{title,jdbcType=VARCHAR}, #{titlekey,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.tools.mybatis.model.BangumiItem" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.tools.mybatis.model.BangumiItem" useGeneratedKeys="true">
insert into bangumi_item insert into bangumi_item
@ -117,6 +118,9 @@
<if test="author != null"> <if test="author != null">
author, author,
</if> </if>
<if test="title != null">
title,
</if>
<if test="titlekey != null"> <if test="titlekey != null">
titleKey, titleKey,
</if> </if>
@ -131,6 +135,9 @@
<if test="author != null"> <if test="author != null">
#{author,jdbcType=VARCHAR}, #{author,jdbcType=VARCHAR},
</if> </if>
<if test="title != null">
#{title,jdbcType=VARCHAR},
</if>
<if test="titlekey != null"> <if test="titlekey != null">
#{titlekey,jdbcType=VARCHAR}, #{titlekey,jdbcType=VARCHAR},
</if> </if>
@ -157,6 +164,9 @@
<if test="record.author != null"> <if test="record.author != null">
author = #{record.author,jdbcType=VARCHAR}, author = #{record.author,jdbcType=VARCHAR},
</if> </if>
<if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR},
</if>
<if test="record.titlekey != null"> <if test="record.titlekey != null">
titleKey = #{record.titlekey,jdbcType=VARCHAR}, titleKey = #{record.titlekey,jdbcType=VARCHAR},
</if> </if>
@ -171,6 +181,7 @@
bid = #{record.bid,jdbcType=VARCHAR}, bid = #{record.bid,jdbcType=VARCHAR},
categories = #{record.categories,jdbcType=VARCHAR}, categories = #{record.categories,jdbcType=VARCHAR},
author = #{record.author,jdbcType=VARCHAR}, author = #{record.author,jdbcType=VARCHAR},
title = #{record.title,jdbcType=VARCHAR},
titleKey = #{record.titlekey,jdbcType=VARCHAR} titleKey = #{record.titlekey,jdbcType=VARCHAR}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -188,6 +199,9 @@
<if test="author != null"> <if test="author != null">
author = #{author,jdbcType=VARCHAR}, author = #{author,jdbcType=VARCHAR},
</if> </if>
<if test="title != null">
title = #{title,jdbcType=VARCHAR},
</if>
<if test="titlekey != null"> <if test="titlekey != null">
titleKey = #{titlekey,jdbcType=VARCHAR}, titleKey = #{titlekey,jdbcType=VARCHAR},
</if> </if>
@ -199,6 +213,7 @@
set bid = #{bid,jdbcType=VARCHAR}, set bid = #{bid,jdbcType=VARCHAR},
categories = #{categories,jdbcType=VARCHAR}, categories = #{categories,jdbcType=VARCHAR},
author = #{author,jdbcType=VARCHAR}, author = #{author,jdbcType=VARCHAR},
title = #{title,jdbcType=VARCHAR},
titleKey = #{titlekey,jdbcType=VARCHAR} titleKey = #{titlekey,jdbcType=VARCHAR}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>

View File

@ -4,7 +4,6 @@
<resultMap id="BaseResultMap" type="com.yutou.tools.mybatis.model.BangumiList"> <resultMap id="BaseResultMap" type="com.yutou.tools.mybatis.model.BangumiList">
<id column="id" jdbcType="INTEGER" property="id" /> <id column="id" jdbcType="INTEGER" property="id" />
<result column="title" jdbcType="VARCHAR" property="title" /> <result column="title" jdbcType="VARCHAR" property="title" />
<result column="rssKey" jdbcType="VARCHAR" property="rsskey" />
<result column="status" jdbcType="INTEGER" property="status" /> <result column="status" jdbcType="INTEGER" property="status" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
@ -66,7 +65,7 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, title, rssKey, `status` id, title, `status`
</sql> </sql>
<select id="selectByExample" parameterType="com.yutou.tools.mybatis.model.BangumiListExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.yutou.tools.mybatis.model.BangumiListExample" resultMap="BaseResultMap">
select select
@ -99,10 +98,8 @@
</if> </if>
</delete> </delete>
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.tools.mybatis.model.BangumiList" useGeneratedKeys="true"> <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.yutou.tools.mybatis.model.BangumiList" useGeneratedKeys="true">
insert into bangumi_list (title, rssKey, `status` insert into bangumi_list (title, `status`)
) values (#{title,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER})
values (#{title,jdbcType=VARCHAR}, #{rsskey,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}
)
</insert> </insert>
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.tools.mybatis.model.BangumiList" useGeneratedKeys="true"> <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.yutou.tools.mybatis.model.BangumiList" useGeneratedKeys="true">
insert into bangumi_list insert into bangumi_list
@ -110,9 +107,6 @@
<if test="title != null"> <if test="title != null">
title, title,
</if> </if>
<if test="rsskey != null">
rssKey,
</if>
<if test="status != null"> <if test="status != null">
`status`, `status`,
</if> </if>
@ -121,9 +115,6 @@
<if test="title != null"> <if test="title != null">
#{title,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR},
</if> </if>
<if test="rsskey != null">
#{rsskey,jdbcType=VARCHAR},
</if>
<if test="status != null"> <if test="status != null">
#{status,jdbcType=INTEGER}, #{status,jdbcType=INTEGER},
</if> </if>
@ -144,9 +135,6 @@
<if test="record.title != null"> <if test="record.title != null">
title = #{record.title,jdbcType=VARCHAR}, title = #{record.title,jdbcType=VARCHAR},
</if> </if>
<if test="record.rsskey != null">
rssKey = #{record.rsskey,jdbcType=VARCHAR},
</if>
<if test="record.status != null"> <if test="record.status != null">
`status` = #{record.status,jdbcType=INTEGER}, `status` = #{record.status,jdbcType=INTEGER},
</if> </if>
@ -159,7 +147,6 @@
update bangumi_list update bangumi_list
set id = #{record.id,jdbcType=INTEGER}, set id = #{record.id,jdbcType=INTEGER},
title = #{record.title,jdbcType=VARCHAR}, title = #{record.title,jdbcType=VARCHAR},
rssKey = #{record.rsskey,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=INTEGER} `status` = #{record.status,jdbcType=INTEGER}
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -171,9 +158,6 @@
<if test="title != null"> <if test="title != null">
title = #{title,jdbcType=VARCHAR}, title = #{title,jdbcType=VARCHAR},
</if> </if>
<if test="rsskey != null">
rssKey = #{rsskey,jdbcType=VARCHAR},
</if>
<if test="status != null"> <if test="status != null">
`status` = #{status,jdbcType=INTEGER}, `status` = #{status,jdbcType=INTEGER},
</if> </if>
@ -183,7 +167,6 @@
<update id="updateByPrimaryKey" parameterType="com.yutou.tools.mybatis.model.BangumiList"> <update id="updateByPrimaryKey" parameterType="com.yutou.tools.mybatis.model.BangumiList">
update bangumi_list update bangumi_list
set title = #{title,jdbcType=VARCHAR}, set title = #{title,jdbcType=VARCHAR},
rssKey = #{rsskey,jdbcType=VARCHAR},
`status` = #{status,jdbcType=INTEGER} `status` = #{status,jdbcType=INTEGER}
where id = #{id,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER}
</update> </update>

View File

@ -0,0 +1,351 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>NAS</title>
<link rel="stylesheet" href="/layui/css/layui.css">
</head>
<body>
<div class="layui-layout layui-layout-admin">
<div id="header"></div>
<div class="layui-body" style="top: 100px; ">
<div id="side"></div>
<blockquote class="layui-elem-quote"><span id="ip">番剧订阅器</span></blockquote>
<button type="button" id="addType" class="layui-btn layui-btn-normal">新增分类</button>
<div class="layui-tab" lay-filter="type" lay-allowclose="true">
<ul class="layui-tab-title">
</ul>
<div class="layui-tab-content">
</div>
</div>
<blockquote class="layui-elem-quote"><span id="ip">动漫花园RSS</span></blockquote>
<form class="layui-form" action="" lay-filter="formTest">
<div class="layui-form-item">
<label class="layui-form-label"><a type="text" id="search"
class="layui-btn layui-btn-normal">搜索</a></label>
<div class="layui-input-block" style="padding-top: 8px; width: 200px;">
<input type="text" name="title" id="title" required lay-verify="required" placeholder="请输入标题"
autocomplete="off" class="layui-input" style="width: 200px;">
</div>
<div class="layui-form-item">
<label class="layui-form-label">类型</label>
<div class="layui-input-block" style="width: 200px;">
<select name="type" lay-verify="type" id="type">
<option value="0">全部</option>
<option value="2">動畫</option>
<option value="31">季度全集</option>
<option value="3">漫畫</option>
<option value="41">港台原版</option>
<option value="42">日文原版</option>
<option value="4">音樂</option>
<option value="43">動漫音樂</option>
<option value="44">同人音樂</option>
<option value="15">流行音樂</option>
<option value="6">日劇</option>
<option value="7"></option>
<option value="9">遊戲</option>
<option value="17">電腦遊戲</option>
<option value="18">電視遊戲</option>
<option value="19">掌機遊戲</option>
<option value="20">網絡遊戲</option>
<option value="21">遊戲周邊</option>
<option value="12">特攝</option>
<option value="1">其他</option>
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">字幕组</label>
<div class="layui-input-block" style="width: 200px;">
<select name="team" lay-verify="team" id='team'>
<option value="0">全部</option>
<option value="117">動漫花園</option>
<option value="669">喵萌奶茶屋</option>
<option value="648">魔星字幕团</option>
<option value="185">极影字幕社</option>
<option value="619">桜都字幕组</option>
<option value="604">c.c动漫</option>
<option value="241">幻樱字幕组</option>
<option value="151">悠哈C9字幕社</option>
<option value="657">LoliHouse</option>
<option value="283">千夏字幕组</option>
<option value="755">GMTeam</option>
<option value="390">天使动漫</option>
<option value="731">星空字幕组</option>
<option value="303">动漫国字幕组</option>
<option value="563">花園壓制組</option>
<option value="37">雪飄工作室(FLsnow)</option>
<option value="47">爱恋字幕社</option>
<option value="710">咪梦动漫组</option>
<option value="88">动音漫影</option>
<option value="574">梦蓝字幕组</option>
<option value="504">LoveEcho!</option>
<option value="765">爱咕字幕组</option>
<option value="520">豌豆字幕组</option>
<option value="650">SweetSub</option>
<option value="430">幻之字幕组</option>
<option value="407">DHR動研字幕組</option>
<option value="321">轻之国度</option>
<option value="581">VCB-Studio</option>
<option value="703">届恋字幕组</option>
<option value="576">银色子弹字幕组</option>
<option value="454">风车字幕组</option>
<option value="485">天空树双语字幕组</option>
<option value="134">漫游字幕组</option>
<option value="434">风之圣殿</option>
<option value="630">枫叶字幕组</option>
<option value="228">KRL字幕组</option>
<option value="526">东京不够热</option>
<option value="592">未央阁联盟</option>
<option value="288">诸神kamigami字幕组</option>
<option value="767">天月動漫&amp;發佈組</option>
<option value="768">千歲字幕組</option>
<option value="423">漫貓字幕組</option>
<option value="562">129.3字幕組</option>
<option value="447">夢幻戀櫻</option>
<option value="680">Little字幕组</option>
<option value="641">冷番补完字幕组</option>
<option value="31">卡通空間</option>
<option value="649">云光字幕组</option>
<option value="701">狐狸小宮</option>
<option value="459">紫音動漫&amp;發佈組</option>
<option value="699">小花花同盟戰線</option>
<option value="626">驯兽师联盟</option>
<option value="58">澄空学园</option>
<option value="769">动漫萌</option>
<option value="734">TD-RAWS</option>
<option value="225">鈴風字幕組</option>
<option value="673">VRAINSTORM</option>
<option value="741">銀月字幕組</option>
<option value="675">AikatsuFans</option>
<option value="759">红鸟窝字幕组</option>
<option value="764">MCE汉化组</option>
<option value="391">ZERO字幕组</option>
<option value="561">钉铛字幕组</option>
<option value="727">2B4B</option>
<option value="104">动漫先锋</option>
<option value="567">雪梦字幕组</option>
<option value="573">Centaurea-Raws</option>
<option value="652">SFEO-Raws</option>
<option value="666">中肯字幕組</option>
<option value="754">BYYM发布组</option>
<option value="613">AI-Raws</option>
<option value="706">K&amp;W-RAWS</option>
<option value="732">肥猫压制</option>
<option value="424">TSDM字幕組</option>
<option value="739">Clarita 压制组</option>
<option value="432">自由字幕组</option>
<option value="217">AQUA工作室</option>
<option value="753">柠檬水字幕组</option>
<option value="763">光之家族字幕组</option>
<option value="332">CureSub</option>
<option value="537">NEO·QSW</option>
<option value="632">歐克勒亞</option>
<option value="548">Cornflower Studio</option>
<option value="638">LittleBakas!</option>
</select>
</div>
</div>
</div>
</form>
<table id="rss" lay-filter="rssTools"></table>
<div id="footer"></div>
</div>
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>
<script type="text/html" id="rssTopTools">
<a class="layui-btn layui-btn-xs" lay-event="addRss">订阅</a>
</script>
<script type="text/html" id="listTools">
<a class="layui-btn layui-btn-xs" lay-event="edit">查看</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script>
let tabid = -1;
$.get("/login/check.do", function (data) {
let json = JSON.parse(data);
if (json.code != 0) {
window.location.href = "/"
}
})
layui.use(['layer', 'form', 'element', 'table'], function () {
var layer = layui.layer
, form = layui.form
, table = layui.table
, element = layui.element;
$.get("/anim/type/list.do", function (data) {
let json = JSON.parse(data);
if (json.code == 0) {
for (let index = 0; index < json.data.length; index++) {
const ret = json.data[index];
element.tabAdd('type', {
title: ret.title
, content: '<table id="passwordlist' + ret.id + '" lay-filter="listTools"></table>'
, id: ret.id
})
}
element.tabChange('type', '1');
}
});
let rssList = table.render({
elem: "#rss",
url: "/anim/rss/data.do?key=&type=" + form.val("formTest").type + "&team=" + form.val("formTest").team,
toolbar: true,
page: true,
cols: [[
{ field: "title", title: "标题", sort: true, fixed: 'left' }
, { field: 'author', title: '字幕组', }
, { field: 'categories', title: '类型', templet: '<div><label>{{d.categories[0]}}</label><div>' }
, { field: 'pubDate', title: '发布时间', }
, { field: 'thumbnail', title: '封面', templet: '<div><img src="{{d.thumbnail}}"/><div>' }
, { field: 'title', title: 'magnet', templet: '<div><label >{{d.enclosure.link}}</label ></div>' }
, { field: "right", toolbar: '#rssTopTools' }
]]
})
form.render()
element.on('tab(type)', function (data) {
tabid = $(this).attr('lay-id')
table.render({
elem: "#passwordlist" + tabid
, url: '/anim/rss/list.do?type=' + tabid
, page: true
, cols: [[
{ field: "id", title: "id", width: 80, sort: true, fixed: 'left' }
, { field: 'title', title: '标题' }
, { field: 'categories', title: '类型' }
, { field: 'author', title: '字幕组' }
, { field: 'titlekey', title: '搜索关键词' }
, { field: "right", toolbar: '#listTools' }
]]
});
})
element.on('tabDelete(type)', function (data) {
let name = $(data.elem.prevObject.prevObject[0]).text().replace("ဆ", "")
let id = $(data.elem.prevObject.prevObject[0]).attr('lay-id')
layer.open({
title: "警告"
, content: "确认删除 " + name
, btn: ['确认', '取消']
, yes: function (index) {
$.post('/tools/password/type/set/remove.do', { id: id }, function (data) {
let json = JSON.parse(data);
layer.msg(json.msg);
})
layer.close(index)
}
, btn2: function (index) {
layer.close(index)
}
})
});
table.on('rowDouble(listTools)', function (data) {
$.get('/tools/password/get/password.do?id=' + data.data.id, function (udata) {
let json = JSON.parse(udata);
data.data.password = json.data;
data.update(data.data)
})
})
table.on('tool(listTools)', function (obj) {
if (obj.event === 'edit') {
$("#type").find("option:contains('" + obj.data.categories + "')").attr("selected", null);
$("#team").find("option:contains('" + obj.data.author + "')").attr("selected", null);
$("#type").find("option:contains('" + obj.data.categories + "')").attr("selected", true);
$("#team").find("option:contains('" + obj.data.author + "')").attr("selected", true);
$('#title').val(obj.data.titlekey);
form.render("select", 'team');
form.render("select", 'type');
searchClick();
} else if (obj.event === 'del') {
layer.open({
title: "警告!"
, content: "删除操作无法回滚,是否确认删除:" + obj.data.title
, btn: ['确认', '取消']
, yes: function (index) {
},
btn2: function (index) {
layer.close(index);
}
})
}
})
table.on('tool(rssTools)', function (obj) {
let data = obj.data;
if (obj.event === 'addRss') {
layer.prompt({
formType: 2,
title: '订阅这个RSS结果,并加入到第' + tabid + '个分类中',
value: data.title
}, function (value, index, elem) {
$.post("/anim/rss/add.do", {
title: value
, author: data.author
, categories: data.categories[0]
, titleKey: $('#title').val()
, bid: tabid
}, function (data) {
let json = JSON.parse(data);
layer.msg(json.msg)
layer.close(index)
})
})
}
})
$('#addType').click(function () {
layer.prompt({
title: '新增分类'
}, function (value, index, elem) {
$.post('/anim/type/add.do', { title: value }, function (data) {
window.location.reload()
})
layer.close(index)
})
})
$('#search').click(function () {
searchClick()
})
function searchClick() {
rssList.reload({
where: {
key: $('#title').val(),
type: form.val("formTest").type,
team:form.val("formTest").team
}
})
}
});
$.ajax({ cache: false })
$('#header').load("/html/header.html");
$('#footer').load("/html/footer.html");
$('#side').load("/html/body/nas/side.html");
//let js="" ; $('#team option').each(function() { let value=$(this).val(); let text=$(this).text(); js+='{"'+value+'":"'+text+'"},'})
</script>
</body>
<style>
#icon {
float: right;
}
#rss+.layui-table-view tbody>tr>td>.layui-table-cell {
height: 100px;
line-height: 100px;
}
</style>
</html>

View File

@ -16,6 +16,9 @@
<dl class="layui-nav-child"> <dl class="layui-nav-child">
<dd><a href="/html/body/nas/bilidown.html">B站直播下载器</a></dd> <dd><a href="/html/body/nas/bilidown.html">B站直播下载器</a></dd>
</dl> </dl>
<dl class="layui-nav-child">
<dd><a href="/html/body/nas/animrss.html">番剧订阅器</a></dd>
</dl>
</li> </li>
</ul> </ul>
</div> </div>

View File

@ -69,7 +69,6 @@
}); });
form.render() form.render()
element.on('tab(type)', function (data) { element.on('tab(type)', function (data) {
console.log(this)
tabid = $(this).attr('lay-id') tabid = $(this).attr('lay-id')
table.render({ table.render({
elem: "#passwordlist" + tabid elem: "#passwordlist" + tabid
@ -78,7 +77,7 @@
, page: true , page: true
, cols: [[ , cols: [[
{ field: "id", title: "id", width: 80, sort: true, fixed: 'left' } { field: "id", title: "id", width: 80, sort: true, fixed: 'left' }
, { field: 'title', title: '标题', width: 80 } , { field: 'title', title: '标题', width: 200 }
, { field: 'username', title: '账号', width: 200 } , { field: 'username', title: '账号', width: 200 }
, { field: 'password', title: '密码', width: 200 } , { field: 'password', title: '密码', width: 200 }
, { field: 'url', title: '网址', width: 400, templet: '<div><a href="{{d.url}}" target="_blank">{{d.url}}</a></div>' } , { field: 'url', title: '网址', width: 400, templet: '<div><a href="{{d.url}}" target="_blank">{{d.url}}</a></div>' }
@ -228,9 +227,6 @@
$('#side').load("/html/body/nas/side.html"); $('#side').load("/html/body/nas/side.html");
</script> </script>
<style>
</style>
<div style="display: none; margin: 20px;" id="adduser"> <div style="display: none; margin: 20px;" id="adduser">
<form class="layui-form" action=""> <form class="layui-form" action="">
@ -271,6 +267,7 @@
</div> </div>
</form> </form>
</div> </div>
</div>
</body> </body>
<style> <style>
#icon { #icon {