diff --git a/src/main/java/com/yutou/tools/Gams/RandomRpgGame/MainGame.java b/src/main/java/com/yutou/tools/Gams/RandomRpgGame/MainGame.java new file mode 100644 index 0000000..0c54fae --- /dev/null +++ b/src/main/java/com/yutou/tools/Gams/RandomRpgGame/MainGame.java @@ -0,0 +1,10 @@ +package com.yutou.tools.Gams.RandomRpgGame; + +public class MainGame { + public static void main(String[] args) { + new MainGame(); + } + private MainGame(){ + + } +} diff --git a/src/main/java/com/yutou/tools/Gams/RandomRpgGame/Users/BaseUser.java b/src/main/java/com/yutou/tools/Gams/RandomRpgGame/Users/BaseUser.java new file mode 100644 index 0000000..cf6c34f --- /dev/null +++ b/src/main/java/com/yutou/tools/Gams/RandomRpgGame/Users/BaseUser.java @@ -0,0 +1,6 @@ +package com.yutou.tools.Gams.RandomRpgGame.Users; + +public abstract class BaseUser { + private String userName; + +} diff --git a/src/main/java/com/yutou/tools/Tools/GoogleAccount.java b/src/main/java/com/yutou/tools/Tools/GoogleAccount.java index 0036af6..4afe1e5 100644 --- a/src/main/java/com/yutou/tools/Tools/GoogleAccount.java +++ b/src/main/java/com/yutou/tools/Tools/GoogleAccount.java @@ -10,7 +10,7 @@ import org.apache.commons.codec.binary.Base32; import org.apache.commons.codec.binary.Base64; public class GoogleAccount { - public static final boolean isDev=false; + public static final boolean isDev=true; // 生成的key长度( Generate secret key length) private static final int SECRET_SIZE = 10; diff --git a/src/main/java/com/yutou/tools/bangumi/AnimationController.java b/src/main/java/com/yutou/tools/bangumi/AnimationController.java index 595c1d6..74a08fc 100644 --- a/src/main/java/com/yutou/tools/bangumi/AnimationController.java +++ b/src/main/java/com/yutou/tools/bangumi/AnimationController.java @@ -29,14 +29,17 @@ public class AnimationController { @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) + 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) + if (!isNull) { items = new AnimationData().bangumiList(page,type,team, keys); + } JSONObject json = new JSONObject(); if (items != null) { json.put("data", items); @@ -93,6 +96,7 @@ public class AnimationController { item.setCategories(categories); item.setTitlekey(titleKey); item.setBid(bid); + item.setEnable(1); int i = itemDao.insert(item); JSONObject json = new JSONObject(); json.put("code", 0); @@ -121,6 +125,29 @@ public class AnimationController { return json.toJSONString(); } @ResponseBody + @RequestMapping(value = "rss/edit.do",method = RequestMethod.POST) + public JSONObject editAnimation(int id,String title, String author, String categories, String titleKey,String enable){ + JSONObject json=new JSONObject(); + BangumiItem item =itemDao.selectByPrimaryKey(id); + if(!StringUtils.isEmpty(title)){ + item.setTitle(title); + } + if(!StringUtils.isEmpty(author)){ + item.setAuthor(author); + } + if(!StringUtils.isEmpty(categories)){ + item.setCategories(categories); + } + if(!StringUtils.isEmpty(titleKey)){ + item.setTitlekey(titleKey); + } + if(!StringUtils.isEmpty(enable)){ + item.setEnable(Integer.parseInt(enable)); + } + itemDao.updateByPrimaryKey(item); + return json; + } + @ResponseBody @RequestMapping(value = "client/get.do", method = RequestMethod.GET) public String clientApi(){ AnimationData animationData=new AnimationData(); diff --git a/src/main/java/com/yutou/tools/mybatis/model/BangumiItem.java b/src/main/java/com/yutou/tools/mybatis/model/BangumiItem.java index 79e27ac..c3d1137 100644 --- a/src/main/java/com/yutou/tools/mybatis/model/BangumiItem.java +++ b/src/main/java/com/yutou/tools/mybatis/model/BangumiItem.java @@ -24,5 +24,7 @@ public class BangumiItem implements Serializable { */ private String titlekey; + private Integer enable; + private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/src/main/java/com/yutou/tools/mybatis/model/BangumiItemExample.java b/src/main/java/com/yutou/tools/mybatis/model/BangumiItemExample.java index 1d84d3a..c2b4d3f 100644 --- a/src/main/java/com/yutou/tools/mybatis/model/BangumiItemExample.java +++ b/src/main/java/com/yutou/tools/mybatis/model/BangumiItemExample.java @@ -513,6 +513,66 @@ public class BangumiItemExample { addCriterion("titleKey not between", value1, value2, "titlekey"); return (Criteria) this; } + + public Criteria andEnableIsNull() { + addCriterion("`enable` is null"); + return (Criteria) this; + } + + public Criteria andEnableIsNotNull() { + addCriterion("`enable` is not null"); + return (Criteria) this; + } + + public Criteria andEnableEqualTo(Integer value) { + addCriterion("`enable` =", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotEqualTo(Integer value) { + addCriterion("`enable` <>", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThan(Integer value) { + addCriterion("`enable` >", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableGreaterThanOrEqualTo(Integer value) { + addCriterion("`enable` >=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThan(Integer value) { + addCriterion("`enable` <", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableLessThanOrEqualTo(Integer value) { + addCriterion("`enable` <=", value, "enable"); + return (Criteria) this; + } + + public Criteria andEnableIn(List values) { + addCriterion("`enable` in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotIn(List values) { + addCriterion("`enable` not in", values, "enable"); + return (Criteria) this; + } + + public Criteria andEnableBetween(Integer value1, Integer value2) { + addCriterion("`enable` between", value1, value2, "enable"); + return (Criteria) this; + } + + public Criteria andEnableNotBetween(Integer value1, Integer value2) { + addCriterion("`enable` not between", value1, value2, "enable"); + return (Criteria) this; + } } /** diff --git a/src/main/resources/mapper/BangumiItemDao.xml b/src/main/resources/mapper/BangumiItemDao.xml index 326906d..9fd4cda 100644 --- a/src/main/resources/mapper/BangumiItemDao.xml +++ b/src/main/resources/mapper/BangumiItemDao.xml @@ -8,6 +8,7 @@ + @@ -68,7 +69,7 @@ - id, bid, categories, author, title, titleKey + id, bid, categories, author, title, titleKey, `enable` @@ -170,6 +179,9 @@ titleKey = #{record.titlekey,jdbcType=VARCHAR}, + + `enable` = #{record.enable,jdbcType=INTEGER}, + @@ -182,7 +194,8 @@ categories = #{record.categories,jdbcType=VARCHAR}, author = #{record.author,jdbcType=VARCHAR}, title = #{record.title,jdbcType=VARCHAR}, - titleKey = #{record.titlekey,jdbcType=VARCHAR} + titleKey = #{record.titlekey,jdbcType=VARCHAR}, + `enable` = #{record.enable,jdbcType=INTEGER} @@ -205,6 +218,9 @@ titleKey = #{titlekey,jdbcType=VARCHAR}, + + `enable` = #{enable,jdbcType=INTEGER}, + where id = #{id,jdbcType=INTEGER} @@ -214,7 +230,8 @@ categories = #{categories,jdbcType=VARCHAR}, author = #{author,jdbcType=VARCHAR}, title = #{title,jdbcType=VARCHAR}, - titleKey = #{titlekey,jdbcType=VARCHAR} + titleKey = #{titlekey,jdbcType=VARCHAR}, + `enable` = #{enable,jdbcType=INTEGER} where id = #{id,jdbcType=INTEGER} \ No newline at end of file diff --git a/web/html/body/nas/animrss.html b/web/html/body/nas/animrss.html index bfa047f..7c1441c 100644 --- a/web/html/body/nas/animrss.html +++ b/web/html/body/nas/animrss.html @@ -168,10 +168,17 @@ 订阅 - +