diff --git a/pom.xml b/pom.xml index 26cdf40..7c05d85 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ com.yutou tools - 1.0.3 + 1.0.4 tools Demo project for Spring Boot diff --git a/src/main/java/com/yutou/tools/BiliBili/Live.java b/src/main/java/com/yutou/tools/BiliBili/Live.java index 6e9c2fb..165f846 100644 --- a/src/main/java/com/yutou/tools/BiliBili/Live.java +++ b/src/main/java/com/yutou/tools/BiliBili/Live.java @@ -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(); + } } diff --git a/src/main/java/com/yutou/tools/Tools/PasswordManager.java b/src/main/java/com/yutou/tools/Tools/PasswordManager.java new file mode 100644 index 0000000..4b9f98d --- /dev/null +++ b/src/main/java/com/yutou/tools/Tools/PasswordManager.java @@ -0,0 +1,196 @@ +package com.yutou.tools.Tools; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.yutou.tools.mybatis.dao.ToolsPasswordDao; +import com.yutou.tools.mybatis.dao.ToolsPasswordTypeDao; +import com.yutou.tools.mybatis.model.ToolsPassword; +import com.yutou.tools.mybatis.model.ToolsPasswordExample; +import com.yutou.tools.mybatis.model.ToolsPasswordType; +import com.yutou.tools.mybatis.model.ToolsPasswordTypeExample; +import com.yutou.tools.utils.AESTools; +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("/tools/password/") +public class PasswordManager { + + @Resource + ToolsPasswordDao passwordDao; + @Resource + ToolsPasswordTypeDao passwordTypeDao; + + @ResponseBody + @RequestMapping(value = "get/list.do",method = RequestMethod.GET) + public String getPasswordList(String type){ + JSONObject json=new JSONObject(); + ToolsPasswordExample example=new ToolsPasswordExample(); + example.createCriteria().andTypeEqualTo(Integer.parseInt(type)); + List passwords=passwordDao.selectByExample(example); + for (ToolsPassword password : passwords) { + password.setPassword("*****"); + } + json.put("code",0); + json.put("msg","ok"); + json.put("data", JSONArray.toJSON(passwords)); + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "get/password.do",method = RequestMethod.GET) + public String getPassword(String id){ + JSONObject json=new JSONObject(); + ToolsPassword password=passwordDao.selectByPrimaryKey(Integer.parseInt(id)); + json.put("code",0); + json.put("data",AESTools.decrypt(password.getPassword())); + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "type/get/list.do",method = RequestMethod.GET) + public String getPasswordType(){ + JSONObject json=new JSONObject(); + List toolsPasswordTypes=passwordTypeDao.selectByExample(new ToolsPasswordTypeExample()); + json.put("code",0); + json.put("msg","ok"); + json.put("data", JSONArray.toJSON(toolsPasswordTypes)); + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "type/set/add.do",method = RequestMethod.POST) + public String addPasswordType(String type){ + JSONObject json=new JSONObject(); + try{ + ToolsPasswordType passwordType=new ToolsPasswordType(); + passwordType.setTitle(type); + int code=passwordTypeDao.insert(passwordType); + json.put("code",0); + json.put("msg","修改结果:"+code); + }catch (Exception e){ + e.printStackTrace(); + json.put("code",-1); + json.put("msg",e.getMessage()); + } + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "set/add.do",method = RequestMethod.POST) + public String addPassword(String title,String username,String password,String url,String info,String type){ + JSONObject json=new JSONObject(); + try{ + if(StringUtils.isEmpty(title)||StringUtils.isEmpty(username)||StringUtils.isEmpty(password)||StringUtils.isEmpty(type)){ + json.put("code",-1); + json.put("msg","有参数为空"); + return json.toJSONString(); + } + ToolsPassword toolsPassword=new ToolsPassword(); + toolsPassword.setTitle(title); + toolsPassword.setUsername(username); + toolsPassword.setPassword(AESTools.encrypt(password)); + toolsPassword.setType(Integer.parseInt(type)); + if(url!=null){ + toolsPassword.setUrl(url); + } + if(info!=null){ + toolsPassword.setInfo(info); + } + int code=passwordDao.insert(toolsPassword); + json.put("code",0); + json.put("msg","添加结果:"+code); + }catch (Exception e){ + e.printStackTrace(); + json.put("code",-1); + json.put("msg",e.getMessage()); + } + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "set/update.do",method = RequestMethod.POST) + public String updatePassword(String title,String username,String password,String url,String info,String id){ + JSONObject json=new JSONObject(); + try{ + ToolsPassword toolsPassword=passwordDao.selectByPrimaryKey(Integer.parseInt(id)); + if(!StringUtils.isEmpty(title)){ + toolsPassword.setTitle(title); + } + if(!StringUtils.isEmpty(username)){ + toolsPassword.setUsername(username); + } + if(!StringUtils.isEmpty(password)){ + toolsPassword.setPassword(AESTools.encrypt(password)); + } + if(!StringUtils.isEmpty(url)){ + toolsPassword.setUrl(url); + } + if(!StringUtils.isEmpty(info)){ + toolsPassword.setInfo(info); + } + int code=passwordDao.updateByPrimaryKey(toolsPassword); + json.put("code",0); + json.put("msg","修改结果:"+code); + }catch (Exception e){ + e.printStackTrace(); + json.put("code",-1); + json.put("msg",e.getMessage()); + } + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "type/set/update.do",method = RequestMethod.POST) + public String updatePasswordType(String type,String id){ + JSONObject json=new JSONObject(); + try { + ToolsPasswordType passwordType=passwordTypeDao.selectByPrimaryKey(Integer.parseInt(id)); + if(!StringUtils.isEmpty(type)){ + passwordType.setTitle(type); + } + int code=passwordTypeDao.updateByPrimaryKey(passwordType); + json.put("code",0); + json.put("msg","修改结果:"+code); + }catch (Exception e){ + e.printStackTrace(); + json.put("code",-1); + json.put("msg",e.getMessage()); + } + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "set/remove.do",method = RequestMethod.POST) + public String removePassword(String id){ + JSONObject json=new JSONObject(); + try { + int code=passwordDao.deleteByPrimaryKey(Integer.parseInt(id)); + json.put("code",0); + json.put("msg","删除结果:"+code); + }catch (Exception e){ + e.printStackTrace(); + json.put("code",-1); + json.put("msg",e.getMessage()); + } + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "type/set/remove.do",method = RequestMethod.POST) + public String removePasswordType(String id){ + JSONObject json=new JSONObject(); + try { + ToolsPasswordExample example=new ToolsPasswordExample(); + example.createCriteria().andTypeEqualTo(Integer.parseInt(id)); + int passwordCode=passwordDao.deleteByExample(example); + System.out.println("删除结果:"+passwordCode); + int code=passwordTypeDao.deleteByPrimaryKey(Integer.parseInt(id)); + json.put("code",0); + json.put("msg","删除结果:"+code); + }catch (Exception e){ + e.printStackTrace(); + json.put("code",-1); + json.put("msg",e.getMessage()); + } + return json.toJSONString(); + } +} diff --git a/src/main/java/com/yutou/tools/mybatis/dao/NasAdminAddressDao.java b/src/main/java/com/yutou/tools/mybatis/dao/NasAdminAddressDao.java new file mode 100644 index 0000000..e2832c5 --- /dev/null +++ b/src/main/java/com/yutou/tools/mybatis/dao/NasAdminAddressDao.java @@ -0,0 +1,33 @@ +package com.yutou.tools.mybatis.dao; + +import com.yutou.tools.mybatis.model.NasAdminAddress; +import com.yutou.tools.mybatis.model.NasAdminAddressExample; +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface NasAdminAddressDao { + long countByExample(NasAdminAddressExample example); + + int deleteByExample(NasAdminAddressExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(NasAdminAddress record); + + int insertSelective(NasAdminAddress record); + + List selectByExample(NasAdminAddressExample example); + + NasAdminAddress selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") NasAdminAddress record, @Param("example") NasAdminAddressExample example); + + int updateByExample(@Param("record") NasAdminAddress record, @Param("example") NasAdminAddressExample example); + + int updateByPrimaryKeySelective(NasAdminAddress record); + + int updateByPrimaryKey(NasAdminAddress record); +} \ No newline at end of file diff --git a/src/main/java/com/yutou/tools/mybatis/dao/ToolsPasswordDao.java b/src/main/java/com/yutou/tools/mybatis/dao/ToolsPasswordDao.java new file mode 100644 index 0000000..0d2b2bf --- /dev/null +++ b/src/main/java/com/yutou/tools/mybatis/dao/ToolsPasswordDao.java @@ -0,0 +1,33 @@ +package com.yutou.tools.mybatis.dao; + +import com.yutou.tools.mybatis.model.ToolsPassword; +import com.yutou.tools.mybatis.model.ToolsPasswordExample; +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface ToolsPasswordDao { + long countByExample(ToolsPasswordExample example); + + int deleteByExample(ToolsPasswordExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(ToolsPassword record); + + int insertSelective(ToolsPassword record); + + List selectByExample(ToolsPasswordExample example); + + ToolsPassword selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") ToolsPassword record, @Param("example") ToolsPasswordExample example); + + int updateByExample(@Param("record") ToolsPassword record, @Param("example") ToolsPasswordExample example); + + int updateByPrimaryKeySelective(ToolsPassword record); + + int updateByPrimaryKey(ToolsPassword record); +} \ No newline at end of file diff --git a/src/main/java/com/yutou/tools/mybatis/dao/ToolsPasswordTypeDao.java b/src/main/java/com/yutou/tools/mybatis/dao/ToolsPasswordTypeDao.java new file mode 100644 index 0000000..f40c32a --- /dev/null +++ b/src/main/java/com/yutou/tools/mybatis/dao/ToolsPasswordTypeDao.java @@ -0,0 +1,33 @@ +package com.yutou.tools.mybatis.dao; + +import com.yutou.tools.mybatis.model.ToolsPasswordType; +import com.yutou.tools.mybatis.model.ToolsPasswordTypeExample; +import java.util.List; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +@Mapper +public interface ToolsPasswordTypeDao { + long countByExample(ToolsPasswordTypeExample example); + + int deleteByExample(ToolsPasswordTypeExample example); + + int deleteByPrimaryKey(Integer id); + + int insert(ToolsPasswordType record); + + int insertSelective(ToolsPasswordType record); + + List selectByExample(ToolsPasswordTypeExample example); + + ToolsPasswordType selectByPrimaryKey(Integer id); + + int updateByExampleSelective(@Param("record") ToolsPasswordType record, @Param("example") ToolsPasswordTypeExample example); + + int updateByExample(@Param("record") ToolsPasswordType record, @Param("example") ToolsPasswordTypeExample example); + + int updateByPrimaryKeySelective(ToolsPasswordType record); + + int updateByPrimaryKey(ToolsPasswordType record); +} \ No newline at end of file diff --git a/src/main/java/com/yutou/tools/mybatis/model/NasAdminAddress.java b/src/main/java/com/yutou/tools/mybatis/model/NasAdminAddress.java new file mode 100644 index 0000000..7fdb190 --- /dev/null +++ b/src/main/java/com/yutou/tools/mybatis/model/NasAdminAddress.java @@ -0,0 +1,23 @@ +package com.yutou.tools.mybatis.model; + +import java.io.Serializable; +import lombok.Data; + +/** + * nas_admin_address + * @author + */ +@Data +public class NasAdminAddress implements Serializable { + private Integer id; + + private String title; + + private String url; + + private Integer port; + + private static final long serialVersionUID = 1L; + + +} \ No newline at end of file diff --git a/src/main/java/com/yutou/tools/mybatis/model/NasAdminAddressExample.java b/src/main/java/com/yutou/tools/mybatis/model/NasAdminAddressExample.java new file mode 100644 index 0000000..e560209 --- /dev/null +++ b/src/main/java/com/yutou/tools/mybatis/model/NasAdminAddressExample.java @@ -0,0 +1,461 @@ +package com.yutou.tools.mybatis.model; + +import java.util.ArrayList; +import java.util.List; + +public class NasAdminAddressExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public NasAdminAddressExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + 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 values) { + addCriterion("title in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotIn(List 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 andUrlIsNull() { + addCriterion("url is null"); + return (Criteria) this; + } + + public Criteria andUrlIsNotNull() { + addCriterion("url is not null"); + return (Criteria) this; + } + + public Criteria andUrlEqualTo(String value) { + addCriterion("url =", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotEqualTo(String value) { + addCriterion("url <>", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlGreaterThan(String value) { + addCriterion("url >", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlGreaterThanOrEqualTo(String value) { + addCriterion("url >=", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLessThan(String value) { + addCriterion("url <", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLessThanOrEqualTo(String value) { + addCriterion("url <=", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLike(String value) { + addCriterion("url like", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotLike(String value) { + addCriterion("url not like", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlIn(List values) { + addCriterion("url in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotIn(List values) { + addCriterion("url not in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlBetween(String value1, String value2) { + addCriterion("url between", value1, value2, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotBetween(String value1, String value2) { + addCriterion("url not between", value1, value2, "url"); + return (Criteria) this; + } + + public Criteria andPortIsNull() { + addCriterion("port is null"); + return (Criteria) this; + } + + public Criteria andPortIsNotNull() { + addCriterion("port is not null"); + return (Criteria) this; + } + + public Criteria andPortEqualTo(Integer value) { + addCriterion("port =", value, "port"); + return (Criteria) this; + } + + public Criteria andPortNotEqualTo(Integer value) { + addCriterion("port <>", value, "port"); + return (Criteria) this; + } + + public Criteria andPortGreaterThan(Integer value) { + addCriterion("port >", value, "port"); + return (Criteria) this; + } + + public Criteria andPortGreaterThanOrEqualTo(Integer value) { + addCriterion("port >=", value, "port"); + return (Criteria) this; + } + + public Criteria andPortLessThan(Integer value) { + addCriterion("port <", value, "port"); + return (Criteria) this; + } + + public Criteria andPortLessThanOrEqualTo(Integer value) { + addCriterion("port <=", value, "port"); + return (Criteria) this; + } + + public Criteria andPortIn(List values) { + addCriterion("port in", values, "port"); + return (Criteria) this; + } + + public Criteria andPortNotIn(List values) { + addCriterion("port not in", values, "port"); + return (Criteria) this; + } + + public Criteria andPortBetween(Integer value1, Integer value2) { + addCriterion("port between", value1, value2, "port"); + return (Criteria) this; + } + + public Criteria andPortNotBetween(Integer value1, Integer value2) { + addCriterion("port not between", value1, value2, "port"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/yutou/tools/mybatis/model/ToolsPassword.java b/src/main/java/com/yutou/tools/mybatis/model/ToolsPassword.java new file mode 100644 index 0000000..073d3a1 --- /dev/null +++ b/src/main/java/com/yutou/tools/mybatis/model/ToolsPassword.java @@ -0,0 +1,27 @@ +package com.yutou.tools.mybatis.model; + +import java.io.Serializable; +import lombok.Data; + +/** + * tools_password + * @author + */ +@Data +public class ToolsPassword implements Serializable { + private Integer id; + + private String title; + + private String username; + + private String password; + + private String url; + + private String info; + + private Integer type; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/yutou/tools/mybatis/model/ToolsPasswordExample.java b/src/main/java/com/yutou/tools/mybatis/model/ToolsPasswordExample.java new file mode 100644 index 0000000..721ba32 --- /dev/null +++ b/src/main/java/com/yutou/tools/mybatis/model/ToolsPasswordExample.java @@ -0,0 +1,671 @@ +package com.yutou.tools.mybatis.model; + +import java.util.ArrayList; +import java.util.List; + +public class ToolsPasswordExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public ToolsPasswordExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + 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 values) { + addCriterion("title in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotIn(List 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 andUsernameIsNull() { + addCriterion("username is null"); + return (Criteria) this; + } + + public Criteria andUsernameIsNotNull() { + addCriterion("username is not null"); + return (Criteria) this; + } + + public Criteria andUsernameEqualTo(String value) { + addCriterion("username =", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotEqualTo(String value) { + addCriterion("username <>", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThan(String value) { + addCriterion("username >", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameGreaterThanOrEqualTo(String value) { + addCriterion("username >=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThan(String value) { + addCriterion("username <", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLessThanOrEqualTo(String value) { + addCriterion("username <=", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameLike(String value) { + addCriterion("username like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotLike(String value) { + addCriterion("username not like", value, "username"); + return (Criteria) this; + } + + public Criteria andUsernameIn(List values) { + addCriterion("username in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotIn(List values) { + addCriterion("username not in", values, "username"); + return (Criteria) this; + } + + public Criteria andUsernameBetween(String value1, String value2) { + addCriterion("username between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andUsernameNotBetween(String value1, String value2) { + addCriterion("username not between", value1, value2, "username"); + return (Criteria) this; + } + + public Criteria andPasswordIsNull() { + addCriterion("`password` is null"); + return (Criteria) this; + } + + public Criteria andPasswordIsNotNull() { + addCriterion("`password` is not null"); + return (Criteria) this; + } + + public Criteria andPasswordEqualTo(String value) { + addCriterion("`password` =", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotEqualTo(String value) { + addCriterion("`password` <>", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordGreaterThan(String value) { + addCriterion("`password` >", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordGreaterThanOrEqualTo(String value) { + addCriterion("`password` >=", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLessThan(String value) { + addCriterion("`password` <", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLessThanOrEqualTo(String value) { + addCriterion("`password` <=", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordLike(String value) { + addCriterion("`password` like", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotLike(String value) { + addCriterion("`password` not like", value, "password"); + return (Criteria) this; + } + + public Criteria andPasswordIn(List values) { + addCriterion("`password` in", values, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotIn(List values) { + addCriterion("`password` not in", values, "password"); + return (Criteria) this; + } + + public Criteria andPasswordBetween(String value1, String value2) { + addCriterion("`password` between", value1, value2, "password"); + return (Criteria) this; + } + + public Criteria andPasswordNotBetween(String value1, String value2) { + addCriterion("`password` not between", value1, value2, "password"); + return (Criteria) this; + } + + public Criteria andUrlIsNull() { + addCriterion("url is null"); + return (Criteria) this; + } + + public Criteria andUrlIsNotNull() { + addCriterion("url is not null"); + return (Criteria) this; + } + + public Criteria andUrlEqualTo(String value) { + addCriterion("url =", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotEqualTo(String value) { + addCriterion("url <>", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlGreaterThan(String value) { + addCriterion("url >", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlGreaterThanOrEqualTo(String value) { + addCriterion("url >=", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLessThan(String value) { + addCriterion("url <", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLessThanOrEqualTo(String value) { + addCriterion("url <=", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlLike(String value) { + addCriterion("url like", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotLike(String value) { + addCriterion("url not like", value, "url"); + return (Criteria) this; + } + + public Criteria andUrlIn(List values) { + addCriterion("url in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotIn(List values) { + addCriterion("url not in", values, "url"); + return (Criteria) this; + } + + public Criteria andUrlBetween(String value1, String value2) { + addCriterion("url between", value1, value2, "url"); + return (Criteria) this; + } + + public Criteria andUrlNotBetween(String value1, String value2) { + addCriterion("url not between", value1, value2, "url"); + return (Criteria) this; + } + + public Criteria andInfoIsNull() { + addCriterion("info is null"); + return (Criteria) this; + } + + public Criteria andInfoIsNotNull() { + addCriterion("info is not null"); + return (Criteria) this; + } + + public Criteria andInfoEqualTo(String value) { + addCriterion("info =", value, "info"); + return (Criteria) this; + } + + public Criteria andInfoNotEqualTo(String value) { + addCriterion("info <>", value, "info"); + return (Criteria) this; + } + + public Criteria andInfoGreaterThan(String value) { + addCriterion("info >", value, "info"); + return (Criteria) this; + } + + public Criteria andInfoGreaterThanOrEqualTo(String value) { + addCriterion("info >=", value, "info"); + return (Criteria) this; + } + + public Criteria andInfoLessThan(String value) { + addCriterion("info <", value, "info"); + return (Criteria) this; + } + + public Criteria andInfoLessThanOrEqualTo(String value) { + addCriterion("info <=", value, "info"); + return (Criteria) this; + } + + public Criteria andInfoLike(String value) { + addCriterion("info like", value, "info"); + return (Criteria) this; + } + + public Criteria andInfoNotLike(String value) { + addCriterion("info not like", value, "info"); + return (Criteria) this; + } + + public Criteria andInfoIn(List values) { + addCriterion("info in", values, "info"); + return (Criteria) this; + } + + public Criteria andInfoNotIn(List values) { + addCriterion("info not in", values, "info"); + return (Criteria) this; + } + + public Criteria andInfoBetween(String value1, String value2) { + addCriterion("info between", value1, value2, "info"); + return (Criteria) this; + } + + public Criteria andInfoNotBetween(String value1, String value2) { + addCriterion("info not between", value1, value2, "info"); + return (Criteria) this; + } + + public Criteria andTypeIsNull() { + addCriterion("`type` is null"); + return (Criteria) this; + } + + public Criteria andTypeIsNotNull() { + addCriterion("`type` is not null"); + return (Criteria) this; + } + + public Criteria andTypeEqualTo(Integer value) { + addCriterion("`type` =", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotEqualTo(Integer value) { + addCriterion("`type` <>", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThan(Integer value) { + addCriterion("`type` >", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeGreaterThanOrEqualTo(Integer value) { + addCriterion("`type` >=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThan(Integer value) { + addCriterion("`type` <", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeLessThanOrEqualTo(Integer value) { + addCriterion("`type` <=", value, "type"); + return (Criteria) this; + } + + public Criteria andTypeIn(List values) { + addCriterion("`type` in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotIn(List values) { + addCriterion("`type` not in", values, "type"); + return (Criteria) this; + } + + public Criteria andTypeBetween(Integer value1, Integer value2) { + addCriterion("`type` between", value1, value2, "type"); + return (Criteria) this; + } + + public Criteria andTypeNotBetween(Integer value1, Integer value2) { + addCriterion("`type` not between", value1, value2, "type"); + return (Criteria) this; + } + } + + /** + */ + public static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/yutou/tools/mybatis/model/ToolsPasswordType.java b/src/main/java/com/yutou/tools/mybatis/model/ToolsPasswordType.java new file mode 100644 index 0000000..69a3dcd --- /dev/null +++ b/src/main/java/com/yutou/tools/mybatis/model/ToolsPasswordType.java @@ -0,0 +1,17 @@ +package com.yutou.tools.mybatis.model; + +import java.io.Serializable; +import lombok.Data; + +/** + * tools_password_type + * @author + */ +@Data +public class ToolsPasswordType implements Serializable { + private Integer id; + + private String title; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/yutou/tools/mybatis/model/ToolsPasswordTypeExample.java b/src/main/java/com/yutou/tools/mybatis/model/ToolsPasswordTypeExample.java new file mode 100644 index 0000000..776e05b --- /dev/null +++ b/src/main/java/com/yutou/tools/mybatis/model/ToolsPasswordTypeExample.java @@ -0,0 +1,331 @@ +package com.yutou.tools.mybatis.model; + +import java.util.ArrayList; +import java.util.List; + +public class ToolsPasswordTypeExample { + protected String orderByClause; + + protected boolean distinct; + + protected List oredCriteria; + + public ToolsPasswordTypeExample() { + oredCriteria = new ArrayList<>(); + } + + public void setOrderByClause(String orderByClause) { + this.orderByClause = orderByClause; + } + + public String getOrderByClause() { + return orderByClause; + } + + public void setDistinct(boolean distinct) { + this.distinct = distinct; + } + + public boolean isDistinct() { + return distinct; + } + + public List getOredCriteria() { + return oredCriteria; + } + + public void or(Criteria criteria) { + oredCriteria.add(criteria); + } + + public Criteria or() { + Criteria criteria = createCriteriaInternal(); + oredCriteria.add(criteria); + return criteria; + } + + public Criteria createCriteria() { + Criteria criteria = createCriteriaInternal(); + if (oredCriteria.size() == 0) { + oredCriteria.add(criteria); + } + return criteria; + } + + protected Criteria createCriteriaInternal() { + Criteria criteria = new Criteria(); + return criteria; + } + + public void clear() { + oredCriteria.clear(); + orderByClause = null; + distinct = false; + } + + protected abstract static class GeneratedCriteria { + protected List criteria; + + protected GeneratedCriteria() { + super(); + criteria = new ArrayList<>(); + } + + public boolean isValid() { + return criteria.size() > 0; + } + + public List getAllCriteria() { + return criteria; + } + + public List getCriteria() { + return criteria; + } + + protected void addCriterion(String condition) { + if (condition == null) { + throw new RuntimeException("Value for condition cannot be null"); + } + criteria.add(new Criterion(condition)); + } + + protected void addCriterion(String condition, Object value, String property) { + if (value == null) { + throw new RuntimeException("Value for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value)); + } + + protected void addCriterion(String condition, Object value1, Object value2, String property) { + if (value1 == null || value2 == null) { + throw new RuntimeException("Between values for " + property + " cannot be null"); + } + criteria.add(new Criterion(condition, value1, value2)); + } + + public Criteria andIdIsNull() { + addCriterion("id is null"); + return (Criteria) this; + } + + public Criteria andIdIsNotNull() { + addCriterion("id is not null"); + return (Criteria) this; + } + + public Criteria andIdEqualTo(Integer value) { + addCriterion("id =", value, "id"); + return (Criteria) this; + } + + public Criteria andIdNotEqualTo(Integer value) { + addCriterion("id <>", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThan(Integer value) { + addCriterion("id >", value, "id"); + return (Criteria) this; + } + + public Criteria andIdGreaterThanOrEqualTo(Integer value) { + addCriterion("id >=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThan(Integer value) { + addCriterion("id <", value, "id"); + return (Criteria) this; + } + + public Criteria andIdLessThanOrEqualTo(Integer value) { + addCriterion("id <=", value, "id"); + return (Criteria) this; + } + + public Criteria andIdIn(List values) { + addCriterion("id in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdNotIn(List values) { + addCriterion("id not in", values, "id"); + return (Criteria) this; + } + + public Criteria andIdBetween(Integer value1, Integer value2) { + addCriterion("id between", value1, value2, "id"); + return (Criteria) this; + } + + public Criteria andIdNotBetween(Integer value1, Integer value2) { + addCriterion("id not between", value1, value2, "id"); + 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 values) { + addCriterion("title in", values, "title"); + return (Criteria) this; + } + + public Criteria andTitleNotIn(List 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 static class Criteria extends GeneratedCriteria { + protected Criteria() { + super(); + } + } + + public static class Criterion { + private String condition; + + private Object value; + + private Object secondValue; + + private boolean noValue; + + private boolean singleValue; + + private boolean betweenValue; + + private boolean listValue; + + private String typeHandler; + + public String getCondition() { + return condition; + } + + public Object getValue() { + return value; + } + + public Object getSecondValue() { + return secondValue; + } + + public boolean isNoValue() { + return noValue; + } + + public boolean isSingleValue() { + return singleValue; + } + + public boolean isBetweenValue() { + return betweenValue; + } + + public boolean isListValue() { + return listValue; + } + + public String getTypeHandler() { + return typeHandler; + } + + protected Criterion(String condition) { + super(); + this.condition = condition; + this.typeHandler = null; + this.noValue = true; + } + + protected Criterion(String condition, Object value, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.typeHandler = typeHandler; + if (value instanceof List) { + this.listValue = true; + } else { + this.singleValue = true; + } + } + + protected Criterion(String condition, Object value) { + this(condition, value, null); + } + + protected Criterion(String condition, Object value, Object secondValue, String typeHandler) { + super(); + this.condition = condition; + this.value = value; + this.secondValue = secondValue; + this.typeHandler = typeHandler; + this.betweenValue = true; + } + + protected Criterion(String condition, Object value, Object secondValue) { + this(condition, value, secondValue, null); + } + } +} \ No newline at end of file diff --git a/src/main/java/com/yutou/tools/nas/AdminManager.java b/src/main/java/com/yutou/tools/nas/AdminManager.java deleted file mode 100644 index 7447d1a..0000000 --- a/src/main/java/com/yutou/tools/nas/AdminManager.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.yutou.tools.nas; - -import com.alibaba.fastjson.JSONObject; -import com.yutou.tools.utils.RedisTools; -import org.springframework.stereotype.Controller; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -@Controller -public class AdminManager { - @Resource - RedisTools redisTools; - - public String getAdminAddress(HttpServletRequest request){ - JSONObject json=new JSONObject(); - - String address=redisTools.get("adminAddress"); - if(address==null){ - json.put("code",-1); - json.put("msg","暂未设置管理后台"); - } - return json.toJSONString(); - } -} diff --git a/src/main/java/com/yutou/tools/nas/NasManager.java b/src/main/java/com/yutou/tools/nas/NasManager.java new file mode 100644 index 0000000..c2de222 --- /dev/null +++ b/src/main/java/com/yutou/tools/nas/NasManager.java @@ -0,0 +1,148 @@ +package com.yutou.tools.nas; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.yutou.tools.mybatis.dao.NasAdminAddressDao; +import com.yutou.tools.mybatis.model.NasAdminAddress; +import com.yutou.tools.mybatis.model.NasAdminAddressExample; +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.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.ArrayList; +import java.util.List; + +@Controller +public class NasManager { + @Resource + RedisTools redisTools; + @Resource + NasAdminAddressDao adminAddressDao; + @ResponseBody + @RequestMapping(value = "/auth/nas/address/get.do",method = RequestMethod.GET) + public String getAdminAddress(HttpServletRequest request){ + JSONObject json=new JSONObject(); + + String address=redisTools.get("adminAddress"); + if(address==null){ + json.put("code",-1); + json.put("msg","暂未设置管理后台"); + }else{ + JSONObject js=JSONObject.parseObject(address); + json.put("code",0); + json.put("msg","当前状态:"+js.getString("url")+":"+js.getString("port")); + } + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "/auth/nas/address/list.do",method = RequestMethod.GET) + public String addressList(HttpServletRequest request){ + JSONObject json =new JSONObject(); + try{ + List list=adminAddressDao.selectByExample(new NasAdminAddressExample()); + json.put("code",0); + json.put("msg","ok"); + json.put("count",list.size()); + if(list.size()==0){ + json.put("data",new JSONArray()); + }else { + json.put("data", JSONArray.toJSON(list)); + } + }catch (Exception e){ + e.printStackTrace(); + json.put("code",-1); + json.put("count",0); + json.put("msg",e.getMessage()); + json.put("data","[]"); + } + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "/auth/nas/address/add.do",method = RequestMethod.POST) + public String addAddress(HttpServletRequest request,String url,String port,String title) { + JSONObject json=new JSONObject(); + try { + NasAdminAddress address=new NasAdminAddress(); + address.setUrl(url); + address.setPort(Integer.parseInt(port)); + address.setTitle(title); + adminAddressDao.insert(address); + json.put("code",0); + json.put("msg","ok"); + }catch (Exception e){ + e.printStackTrace(); + json.put("code",-1); + json.put("msg",e.getMessage()); + } + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "/auth/nas/address/update.do",method = RequestMethod.POST) + public String updateAddress(HttpServletRequest request,String url,String port,String title,String id){ + JSONObject json=new JSONObject(); + try { + NasAdminAddress address=adminAddressDao.selectByPrimaryKey(Integer.parseInt(id)); + if(address!=null) { + if (!StringUtils.isEmpty(url)) { + address.setUrl(url); + } + if (!StringUtils.isEmpty(port)) { + address.setPort(Integer.parseInt(port)); + } + if (!StringUtils.isEmpty(title)) { + address.setTitle(title); + } + adminAddressDao.updateByPrimaryKey(address); + json.put("code",0); + json.put("msg","ok"); + }else { + json.put("code",1); + json.put("msg","无更新"); + } + + }catch (Exception e){ + e.printStackTrace(); + json.put("code",-1); + json.put("msg",e.getMessage()); + } + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "/auth/nas/address/remove.do",method = RequestMethod.POST) + public String removeAddress(HttpServletRequest request,String id){ + JSONObject json=new JSONObject(); + try{ + int code=adminAddressDao.deleteByPrimaryKey(Integer.parseInt(id)); + json.put("code",code); + json.put("msg","ok"); + }catch (Exception e){ + e.printStackTrace(); + json.put("code",-1); + json.put("msg",e.getMessage()); + } + return json.toJSONString(); + } + @ResponseBody + @RequestMapping(value = "/auth/nas/address/set.do",method = RequestMethod.POST) + public String setAddress(HttpServletRequest request,String id){ + JSONObject json=new JSONObject(); + try { + NasAdminAddress address=adminAddressDao.selectByPrimaryKey(Integer.parseInt(id)); + if(address!=null){ + redisTools.set("adminAddress",JSONObject.toJSONString(address)); + } + json.put("code",0); + json.put("msg","ok"); + }catch (Exception e){ + e.printStackTrace(); + json.put("code",-1); + json.put("msg",e.getMessage()); + } + return json.toJSONString(); + } +} diff --git a/src/main/java/com/yutou/tools/nas/UpdateIp.java b/src/main/java/com/yutou/tools/nas/UpdateIp.java index 487b1df..246208b 100644 --- a/src/main/java/com/yutou/tools/nas/UpdateIp.java +++ b/src/main/java/com/yutou/tools/nas/UpdateIp.java @@ -88,7 +88,7 @@ public class UpdateIp { } updateList(); File file = new File("/etc/nginx/nginx.conf"); - file = new File("D:\\nginx.conf"); + //file = new File("D:\\nginx.conf"); if (file.exists()) { String testIp = "0.0.0.0"; try { diff --git a/src/main/java/com/yutou/tools/utils/AESTools.java b/src/main/java/com/yutou/tools/utils/AESTools.java new file mode 100644 index 0000000..f9dd9a4 --- /dev/null +++ b/src/main/java/com/yutou/tools/utils/AESTools.java @@ -0,0 +1,52 @@ +package com.yutou.tools.utils; + +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; +import java.util.Base64; + +public class AESTools { + private static final String key="fJjSoOM7tDIQN0Ne"; + private static final String model="AES/ECB/PKCS5Padding"; + + /** + * 加密 + * @param value 原文 + * @return 密文 + */ + public static String encrypt(String value){ + try { + KeyGenerator generator=KeyGenerator.getInstance("AES"); + generator.init(128); + Cipher cipher=Cipher.getInstance(model); + cipher.init(Cipher.ENCRYPT_MODE,new SecretKeySpec(key.getBytes(),"AES")); + byte[] bytes=cipher.doFinal(value.getBytes(StandardCharsets.UTF_8)); + return new String(Base64.getEncoder().encode(bytes)); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + /** + * 解密 + * @param value 密文 + * @return 原文 + */ + public static String decrypt(String value){ + try { + KeyGenerator generator=KeyGenerator.getInstance("AES"); + generator.init(128); + Cipher cipher=Cipher.getInstance(model); + cipher.init(Cipher.DECRYPT_MODE,new SecretKeySpec(key.getBytes(),"AES")); + byte[] encodeBytes=Base64.getDecoder().decode(value); + byte[] bytes=cipher.doFinal(encodeBytes); + return new String(bytes); + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + +} diff --git a/src/main/java/com/yutou/tools/utils/APIFilter.java b/src/main/java/com/yutou/tools/utils/APIFilter.java index 094369c..adf18ec 100644 --- a/src/main/java/com/yutou/tools/utils/APIFilter.java +++ b/src/main/java/com/yutou/tools/utils/APIFilter.java @@ -1,11 +1,14 @@ package com.yutou.tools.utils; import com.yutou.tools.mybatis.dao.UKeyDao; +import com.yutou.tools.mybatis.model.UKeyExample; import org.springframework.stereotype.Component; +import org.springframework.util.StringUtils; import javax.annotation.Resource; import javax.servlet.*; import javax.servlet.annotation.WebFilter; +import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; @@ -18,19 +21,39 @@ public class APIFilter implements Filter { UKeyDao keyDao; @Resource RedisTools redisTools; + @Override public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException { - HttpServletRequest request= (HttpServletRequest) servletRequest; - String token=request.getParameter("token"); - System.out.println("接收到请求:"+request.getRequestURI()+" "+token); - if(token==null&&redisTools.get(request.getSession().getId())==null&&!request.getRequestURI().equals("/")){ - System.out.println("请求无令牌,拦截"); - //((HttpServletResponse)servletResponse).sendRedirect("/"); - //return; + HttpServletRequest request = (HttpServletRequest) servletRequest; + HttpServletResponse response= (HttpServletResponse) servletResponse; + String token = request.getParameter("token"); + Cookie cookie = Tools.getCookie(request, "user"); + System.out.println("接收到请求:" + request.getRequestURI() + " " + token); + boolean isToken = false; + boolean isCookie = false; + if (!StringUtils.isEmpty(token)) { + UKeyExample example = new UKeyExample(); + example.createCriteria().andKeyEqualTo(token); + if (keyDao.selectByExample(example).size() > 0) { + isToken = true; + } } - if (token==null||keyDao.selectByKey(token)==null) { + if (cookie != null) { + if ("ok".equals(redisTools.get(cookie.getValue()))) { + isCookie = true; + } + } + if (!isToken) { System.out.println("token验证不通过:" + token); - //return; + } else if (!isCookie) { + System.out.println("请求无令牌,拦截"); + } + if (!isCookie && !isToken) { + //response.sendRedirect("/"); + if(!request.getRequestURI().contains("/login/")){ + response.sendRedirect("/"); + return; + } } filterChain.doFilter(servletRequest, servletResponse); } diff --git a/src/main/java/com/yutou/tools/utils/RedisTools.java b/src/main/java/com/yutou/tools/utils/RedisTools.java index 579b195..e0d8ac6 100644 --- a/src/main/java/com/yutou/tools/utils/RedisTools.java +++ b/src/main/java/com/yutou/tools/utils/RedisTools.java @@ -6,18 +6,28 @@ import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Component; import javax.annotation.Resource; +import java.util.concurrent.TimeUnit; @Component public class RedisTools { @Resource - RedisTemplate redisTemplate; - public void set(String key,String value){ - redisTemplate.opsForValue().set(key,value); + RedisTemplate redisTemplate; + + public void set(String key, String value) { + redisTemplate.opsForValue().set(key, value); } - public void set(String key,String value,long time){ - redisTemplate.opsForValue().set(key, value, time); + + public void set(String key, String value, long time) { + System.out.println("key=" + key + " value=" + value + " time=" + time); + redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS); } - public String get(String key){ - return redisTemplate.opsForValue().get(key); + + public String get(String key) { + try { + return redisTemplate.opsForValue().get(key); + } catch (Exception e) { + return null; + } + } } diff --git a/src/main/java/com/yutou/tools/utils/Tools.java b/src/main/java/com/yutou/tools/utils/Tools.java index c570cfa..521fece 100644 --- a/src/main/java/com/yutou/tools/utils/Tools.java +++ b/src/main/java/com/yutou/tools/utils/Tools.java @@ -25,26 +25,9 @@ public class Tools { if(time!=-1) { cookie.setMaxAge(time); } + cookie.setPath("/"); response.addCookie(cookie); - } - /** - * 设置Cookie - * @param request - * @param response - * @param key - * @param time 生命周期,为0时即为删除 - * @return - */ - private static String setCookie(HttpServletRequest request, HttpServletResponse response, String key,int time) { - Cookie name = new Cookie("uname", key); - Cookie session = new Cookie("session", request.getSession().getId()); - if(time!=-1) { - name.setMaxAge(time); - session.setMaxAge(time); - } - response.addCookie(name); - response.addCookie(session); - return request.getSession().getId(); + } /** * 获取Cookie @@ -54,11 +37,16 @@ public class Tools { */ public static Cookie getCookie(HttpServletRequest request,String key) { Cookie[] cookies = request.getCookies(); - for (Cookie cookie : cookies) { - if (key!=null&&cookie.getName().equals(key)) { - return cookie; + try { + for (Cookie cookie : cookies) { + if (key!=null&&cookie.getName().equals(key)) { + return cookie; + } } + }catch (Exception ignored){ + } + return null; } /** @@ -69,18 +57,27 @@ public class Tools { * @return */ public static String deleteCookie(HttpServletRequest request, HttpServletResponse response, String key) { - return setCookie(request, response, key, 0); + for (Cookie cookie : request.getCookies()) { + if(cookie.getName().equals(key)) { + System.out.println("删除key="+key); + cookie.setMaxAge(0); + cookie.setPath("/"); + cookie.setValue(null); + response.addCookie(cookie); + } + } + return "ok"; } public static void sendServer(String title,String msg){ try{ System.out.println("title="+title+" msg="+msg); - /*HttpURLConnection connection= (HttpURLConnection) new URL("https://sc.ftqq.com/SCU64034T5adf5c5940dcecc016e0e9d0cf9b1e725da126ff47475.send?text=" + HttpURLConnection connection= (HttpURLConnection) new URL("https://sc.ftqq.com/SCU64034T5adf5c5940dcecc016e0e9d0cf9b1e725da126ff47475.send?text=" + URLEncoder.encode(title,"UTF-8")+"&desp="+URLEncoder.encode(msg,"UTF-8")).openConnection(); connection.connect(); InputStream inputStream=connection.getInputStream(); int i=inputStream.read(); inputStream.close(); - connection.disconnect();*/ + connection.disconnect(); }catch (Exception e){ e.printStackTrace(); } diff --git a/src/main/java/com/yutou/tools/web/userController.java b/src/main/java/com/yutou/tools/web/userController.java index c276580..6369374 100644 --- a/src/main/java/com/yutou/tools/web/userController.java +++ b/src/main/java/com/yutou/tools/web/userController.java @@ -7,6 +7,7 @@ import com.yutou.tools.utils.RedisTools; import com.yutou.tools.utils.Tools; import org.springframework.stereotype.Controller; 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; @@ -27,11 +28,13 @@ public class userController { JSONObject json = new JSONObject(); json.put("code", -1); json.put("msg", "未登录"); - JSONArray array=new JSONArray(); - if(redisTools.get("bean")!=null){ - array=JSONArray.parseArray(redisTools.get("bean")); + JSONArray array = new JSONArray(); + if (redisTools.get("ban") != null) { + array = JSONArray.parseArray(redisTools.get("ban")); } - if(array.contains(Tools.getRemoteAddress(request))){ + if (array.contains(Tools.getRemoteAddress(request))) { + json.put("code", -2); + json.put("msg", "未登录"); System.out.println("IP已被封禁"); return json.toJSONString(); } @@ -39,7 +42,7 @@ public class userController { if (cookie == null) { return json.toJSONString(); } - if (redisTools.get(cookie.getValue()).equals("ok")) { + if ("ok".equals(redisTools.get(cookie.getValue()))) { json.put("code", 0); json.put("msg", "登录成功"); return json.toJSONString(); @@ -52,31 +55,78 @@ public class userController { @RequestMapping("/login/sendCaptcha.do") @ResponseBody public String captcha(HttpServletRequest request) { - int[] captcha = Tools.randomCommon(0, 9, 5); + JSONArray array = new JSONArray(); + if (redisTools.get("ban") != null) { + array = JSONArray.parseArray(redisTools.get("ban")); + } + if (array.contains(Tools.getRemoteAddress(request))) { + + System.out.println("IP已被封禁"); + return "ERROR!"; + } + int[] captcha = Tools.randomCommon(0, 9, 6); String cc = ""; for (int value : captcha) { cc += value; } - redisTools.set("login",cc,5*60*1000); + redisTools.set("login", cc, 5 * 60 * 1000); + String token=UUID.randomUUID().toString().replace("-",""); + redisTools.set(token,Tools.getRemoteAddress(request),10 * 60 * 1000); + String url="http://tools.yutou233.cn/login/ban.do?token="+token; Tools.sendServer("管理后台登录验证码", "本次登录验证码为:" + cc + ",登录IP:" + Tools.getRemoteAddress(request) - + ",非正常登录,封禁IP:http://www.baidu.com"); + + ",非正常登录,封禁IP:"+url); return "ok"; } - @RequestMapping("/login/login.do") + @RequestMapping("/login/ban.do") @ResponseBody - public String login(HttpServletResponse response,String code){ - JSONObject json=new JSONObject(); - if(redisTools.get("login").equals(code.trim())){ - String uuid=UUID.randomUUID().toString(); - Tools.setCookie(response,"user",uuid.replace("-",""),30*24*60*60*1000); - redisTools.set(uuid.replace("-",""),"ok",30*24*60*60*1000); - json.put("code",0); - json.put("msg","登录成功"); + public String banIp(String token){ + String ip=redisTools.get(token); + if(ip!=null){ + JSONArray array = new JSONArray(); + if (redisTools.get("ban") != null) { + array = JSONArray.parseArray(redisTools.get("bean")); + } + array.add(ip); + redisTools.set("ban",array.toJSONString()); + return "已封禁"; + } + return "ERROR"; + } + + @RequestMapping(value = "/login/login.do", method = RequestMethod.POST) + @ResponseBody + public String login(HttpServletResponse response, String code) { + JSONObject json = new JSONObject(); + if (redisTools.get("login").equals(code.trim())) { + String uuid = UUID.randomUUID().toString(); + Tools.setCookie(response, "user", uuid.replace("-", ""), 30 * 24 * 60 * 60); + redisTools.set(uuid.replace("-", ""), "ok", 30 * 24 * 60 * 60); + json.put("code", 0); + json.put("msg", "登录成功"); return json.toJSONString(); } - json.put("code",-2); - json.put("msg","登录安全码错误"); - return json.toJSONString(); + json.put("code", -2); + json.put("msg", "登录安全码错误"); + return json.toJSONString(); + } + + @RequestMapping(value = "/login/logout.do", method = RequestMethod.POST) + @ResponseBody + public String logout(HttpServletRequest request, HttpServletResponse response) { + JSONObject json = new JSONObject(); + Cookie cookie = Tools.getCookie(request, "user"); + json.put("code", -1); + json.put("msg", "退出失败"); + if (cookie != null) { + if ("ok".equals(redisTools.get(cookie.getValue()))) { + redisTools.set(cookie.getValue(), "ok", 1); + Tools.deleteCookie(request, response, "user"); + json.put("code", 0); + json.put("msg", "退出成功"); + } + } + return json.toJSONString(); + } } diff --git a/src/main/resources/mapper/NasAdminAddressDao.xml b/src/main/resources/mapper/NasAdminAddressDao.xml new file mode 100644 index 0000000..6750480 --- /dev/null +++ b/src/main/resources/mapper/NasAdminAddressDao.xml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, title, url, port + + + + + delete from nas_admin_address + where id = #{id,jdbcType=INTEGER} + + + delete from nas_admin_address + + + + + + insert into nas_admin_address (title, url, port + ) + values (#{title,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{port,jdbcType=INTEGER} + ) + + + insert into nas_admin_address + + + title, + + + url, + + + port, + + + + + #{title,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{port,jdbcType=INTEGER}, + + + + + + update nas_admin_address + + + id = #{record.id,jdbcType=INTEGER}, + + + title = #{record.title,jdbcType=VARCHAR}, + + + url = #{record.url,jdbcType=VARCHAR}, + + + port = #{record.port,jdbcType=INTEGER}, + + + + + + + + update nas_admin_address + set id = #{record.id,jdbcType=INTEGER}, + title = #{record.title,jdbcType=VARCHAR}, + url = #{record.url,jdbcType=VARCHAR}, + port = #{record.port,jdbcType=INTEGER} + + + + + + update nas_admin_address + + + title = #{title,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + port = #{port,jdbcType=INTEGER}, + + + where id = #{id,jdbcType=INTEGER} + + + update nas_admin_address + set title = #{title,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + port = #{port,jdbcType=INTEGER} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/ToolsPasswordDao.xml b/src/main/resources/mapper/ToolsPasswordDao.xml new file mode 100644 index 0000000..09b6471 --- /dev/null +++ b/src/main/resources/mapper/ToolsPasswordDao.xml @@ -0,0 +1,235 @@ + + + + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, title, username, `password`, url, info, `type` + + + + + delete from tools_password + where id = #{id,jdbcType=INTEGER} + + + delete from tools_password + + + + + + insert into tools_password (title, username, `password`, + url, info, `type`) + values (#{title,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, + #{url,jdbcType=VARCHAR}, #{info,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}) + + + insert into tools_password + + + title, + + + username, + + + `password`, + + + url, + + + info, + + + `type`, + + + + + #{title,jdbcType=VARCHAR}, + + + #{username,jdbcType=VARCHAR}, + + + #{password,jdbcType=VARCHAR}, + + + #{url,jdbcType=VARCHAR}, + + + #{info,jdbcType=VARCHAR}, + + + #{type,jdbcType=INTEGER}, + + + + + + update tools_password + + + id = #{record.id,jdbcType=INTEGER}, + + + title = #{record.title,jdbcType=VARCHAR}, + + + username = #{record.username,jdbcType=VARCHAR}, + + + `password` = #{record.password,jdbcType=VARCHAR}, + + + url = #{record.url,jdbcType=VARCHAR}, + + + info = #{record.info,jdbcType=VARCHAR}, + + + `type` = #{record.type,jdbcType=INTEGER}, + + + + + + + + update tools_password + set id = #{record.id,jdbcType=INTEGER}, + title = #{record.title,jdbcType=VARCHAR}, + username = #{record.username,jdbcType=VARCHAR}, + `password` = #{record.password,jdbcType=VARCHAR}, + url = #{record.url,jdbcType=VARCHAR}, + info = #{record.info,jdbcType=VARCHAR}, + `type` = #{record.type,jdbcType=INTEGER} + + + + + + update tools_password + + + title = #{title,jdbcType=VARCHAR}, + + + username = #{username,jdbcType=VARCHAR}, + + + `password` = #{password,jdbcType=VARCHAR}, + + + url = #{url,jdbcType=VARCHAR}, + + + info = #{info,jdbcType=VARCHAR}, + + + `type` = #{type,jdbcType=INTEGER}, + + + where id = #{id,jdbcType=INTEGER} + + + update tools_password + set title = #{title,jdbcType=VARCHAR}, + username = #{username,jdbcType=VARCHAR}, + `password` = #{password,jdbcType=VARCHAR}, + url = #{url,jdbcType=VARCHAR}, + info = #{info,jdbcType=VARCHAR}, + `type` = #{type,jdbcType=INTEGER} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/src/main/resources/mapper/ToolsPasswordTypeDao.xml b/src/main/resources/mapper/ToolsPasswordTypeDao.xml new file mode 100644 index 0000000..94b2828 --- /dev/null +++ b/src/main/resources/mapper/ToolsPasswordTypeDao.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + + + + + + + + and ${criterion.condition} + + + and ${criterion.condition} #{criterion.value} + + + and ${criterion.condition} #{criterion.value} and #{criterion.secondValue} + + + and ${criterion.condition} + + #{listItem} + + + + + + + + + + + id, title + + + + + delete from tools_password_type + where id = #{id,jdbcType=INTEGER} + + + delete from tools_password_type + + + + + + insert into tools_password_type (title) + values (#{title,jdbcType=VARCHAR}) + + + insert into tools_password_type + + + title, + + + + + #{title,jdbcType=VARCHAR}, + + + + + + update tools_password_type + + + id = #{record.id,jdbcType=INTEGER}, + + + title = #{record.title,jdbcType=VARCHAR}, + + + + + + + + update tools_password_type + set id = #{record.id,jdbcType=INTEGER}, + title = #{record.title,jdbcType=VARCHAR} + + + + + + update tools_password_type + + + title = #{title,jdbcType=VARCHAR}, + + + where id = #{id,jdbcType=INTEGER} + + + update tools_password_type + set title = #{title,jdbcType=VARCHAR} + where id = #{id,jdbcType=INTEGER} + + \ No newline at end of file diff --git a/web/html/body/nas/bilidown.html b/web/html/body/nas/bilidown.html new file mode 100644 index 0000000..9883d39 --- /dev/null +++ b/web/html/body/nas/bilidown.html @@ -0,0 +1,123 @@ + + + + + + + NAS + + + + +
+ +
+
+
B站直播下载器
+
+ +
+ + + + + + + + + \ No newline at end of file diff --git a/web/html/body/nas/index.html b/web/html/body/nas/index.html index 1155ed9..9621342 100644 --- a/web/html/body/nas/index.html +++ b/web/html/body/nas/index.html @@ -30,12 +30,17 @@ $('#header').load("/html/header.html"); $('#footer').load("/html/footer.html"); $('#side').load("/html/body/nas/side.html"); + $.get("/login/check.do", function (data) { + let json = JSON.parse(data); + if (json.code != 0) { + window.location.href = "/" + } + }) + + + + + + \ No newline at end of file diff --git a/web/html/header.html b/web/html/header.html index c609841..d04e63c 100644 --- a/web/html/header.html +++ b/web/html/header.html @@ -12,13 +12,13 @@
  • 博客
  • NAS管理 - +
  • 工具集
    -
    密码管理器
    +
    密码管理器
  • @@ -29,27 +29,63 @@
  • - 登录 + 登录
    -
    退了
    +
    退了
  • - + \ No newline at end of file diff --git a/web/html/randompassword/css/font-awesome.min.css b/web/html/randompassword/css/font-awesome.min.css new file mode 100644 index 0000000..540440c --- /dev/null +++ b/web/html/randompassword/css/font-awesome.min.css @@ -0,0 +1,4 @@ +/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} diff --git a/web/html/randompassword/css/style.css b/web/html/randompassword/css/style.css new file mode 100644 index 0000000..b9d7856 --- /dev/null +++ b/web/html/randompassword/css/style.css @@ -0,0 +1,273 @@ +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body { + display: flex; + justify-content: center; + align-items: center; +} + +button { + border: 0; + outline: 0; +} + +.container { + margin: 40px 0; + width: 400px; + + padding: 10px 25px; + background: #0a0e31; + border-radius: 10px; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.45), 0 4px 8px rgba(0, 0, 0, 0.35), 0 8px 12px rgba(0, 0, 0, 0.15); + font-family: "Montserrat"; +} +.container h2.title { + font-size: 1.75rem; + margin: 10px -5px; + margin-bottom: 30px; + color: #fff; +} + +.result { + position: relative; + width: 100%; + height: 65px; + overflow: hidden; +} +.result__info { + position: absolute; + bottom: 4px; + color: #fff; + font-size: 0.8rem; + transition: all 150ms ease-in-out; + transform: translateY(200%); + opacity: 0; +} +.result__info.right { + right: 8px; +} +.result__info.left { + left: 8px; +} +.result__viewbox { + width: 100%; + height: 100%; + background: rgba(255, 255, 255, 0.08); + border-radius: 8px; + color: #fff; + text-align: center; + line-height: 65px; +} +.result #copy-btn { + position: absolute; + top: var(--y); + left: var(--x); + width: 38px; + height: 38px; + background: #fff; + border-radius: 50%; + opacity: 0; + transform: translate(-50%, -50%) scale(0); + transition: all 350ms cubic-bezier(0.175, 0.885, 0.32, 1.275); + cursor: pointer; + z-index: 2; +} +.result #copy-btn:active { + box-shadow: 0 0 0 200px rgba(255, 255, 255, 0.08); +} +.result:hover #copy-btn { + opacity: 1; + transform: translate(-50%, -50%) scale(1.35); +} + +.field-title { + position: absolute; + top: -10px; + left: 8px; + transform: translateY(-50%); + font-weight: 800; + color: rgba(255, 255, 255, 0.5); + text-transform: uppercase; + font-size: 0.65rem; + pointer-events: none; + user-select: none; +} + +.options { + width: 100%; + height: auto; + margin: 50px 0; +} + +.range__slider { + position: relative; + width: 100%; + height: calc(65px - 10px); + display: flex; + justify-content: center; + align-items: center; + background: rgba(255, 255, 255, 0.08); + border-radius: 8px; + margin: 30px 0; +} +.range__slider::before, .range__slider::after { + position: absolute; + color: #fff; + font-size: 0.9rem; + font-weight: bold; +} +.range__slider::before { + content: attr(data-min); + left: 10px; +} +.range__slider::after { + content: attr(data-max); + right: 10px; +} +.range__slider .length__title::after { + content: attr(data-length); + position: absolute; + right: -16px; + font-variant-numeric: tabular-nums; + color: #fff; +} + +#slider { + -webkit-appearance: none; + width: calc(100% - (70px)); + height: 2px; + border-radius: 5px; + background: rgba(255, 255, 255, 0.314); + outline: none; + padding: 0; + margin: 0; + cursor: pointer; +} +#slider::-webkit-slider-thumb { + -webkit-appearance: none; + width: 20px; + height: 20px; + border-radius: 50%; + background: white; + cursor: pointer; + transition: all 0.15s ease-in-out; +} +#slider::-webkit-slider-thumb:hover { + background: #d4d4d4; + transform: scale(1.2); +} +#slider::-moz-range-thumb { + width: 20px; + height: 20px; + border: 0; + border-radius: 50%; + background: white; + cursor: pointer; + transition: background 0.15s ease-in-out; +} +#slider::-moz-range-thumb:hover { + background: #d4d4d4; +} + +.settings { + position: relative; + height: auto; + widows: 100%; + display: flex; + flex-direction: column; +} +.settings .setting { + position: relative; + width: 100%; + height: calc(65px - 10px); + background: rgba(255, 255, 255, 0.08); + border-radius: 8px; + display: flex; + align-items: center; + padding: 10px 25px; + color: #fff; + margin-bottom: 8px; +} +.settings .setting input { + opacity: 0; + position: absolute; +} +.settings .setting input + label { + user-select: none; +} +.settings .setting input + label::before, .settings .setting input + label::after { + content: ""; + position: absolute; + transition: 150ms cubic-bezier(0.24, 0, 0.5, 1); + transform: translateY(-50%); + top: 50%; + right: 10px; + cursor: pointer; +} +.settings .setting input + label::before { + height: 30px; + width: 50px; + border-radius: 30px; + background: rgba(214, 214, 214, 0.434); +} +.settings .setting input + label::after { + height: 24px; + width: 24px; + border-radius: 60px; + right: 32px; + background: #fff; +} +.settings .setting input:checked + label:before { + background: #5d68e2; + transition: all 150ms cubic-bezier(0, 0, 0, 0.1); +} +.settings .setting input:checked + label:after { + right: 14px; +} +.settings .setting input:focus + label:before { + box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75); +} + +.btn.generate { + user-select: none; + position: relative; + width: 100%; + height: 50px; + margin: 10px 0; + border-radius: 8px; + color: #fff; + border: none; + background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%); + letter-spacing: 1px; + font-weight: bold; + text-transform: uppercase; + cursor: pointer; + transition: all 150ms ease; +} +.btn.generate:active { + transform: translateY(-3%); + box-shadow: 0 4px 8px rgba(255, 255, 255, 0.08); +} + +.support { + position: fixed; + right: 10px; + bottom: 10px; + padding: 10px; + display: flex; +} + +a { + margin: 0 20px; + color: #fff; + font-size: 2rem; + transition: all 400ms ease; +} + +a:hover { + color: #222; +} \ No newline at end of file diff --git a/web/html/randompassword/fonts/FontAwesome.otf b/web/html/randompassword/fonts/FontAwesome.otf new file mode 100644 index 0000000..401ec0f Binary files /dev/null and b/web/html/randompassword/fonts/FontAwesome.otf differ diff --git a/web/html/randompassword/fonts/fontawesome-webfont.eot b/web/html/randompassword/fonts/fontawesome-webfont.eot new file mode 100644 index 0000000..e9f60ca Binary files /dev/null and b/web/html/randompassword/fonts/fontawesome-webfont.eot differ diff --git a/web/html/randompassword/fonts/fontawesome-webfont.svg b/web/html/randompassword/fonts/fontawesome-webfont.svg new file mode 100644 index 0000000..855c845 --- /dev/null +++ b/web/html/randompassword/fonts/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/html/randompassword/fonts/fontawesome-webfont.ttf b/web/html/randompassword/fonts/fontawesome-webfont.ttf new file mode 100644 index 0000000..35acda2 Binary files /dev/null and b/web/html/randompassword/fonts/fontawesome-webfont.ttf differ diff --git a/web/html/randompassword/fonts/fontawesome-webfont.woff b/web/html/randompassword/fonts/fontawesome-webfont.woff new file mode 100644 index 0000000..400014a Binary files /dev/null and b/web/html/randompassword/fonts/fontawesome-webfont.woff differ diff --git a/web/html/randompassword/fonts/fontawesome-webfont.woff2 b/web/html/randompassword/fonts/fontawesome-webfont.woff2 new file mode 100644 index 0000000..4d13fc6 Binary files /dev/null and b/web/html/randompassword/fonts/fontawesome-webfont.woff2 differ diff --git a/web/html/randompassword/index.html b/web/html/randompassword/index.html new file mode 100644 index 0000000..048666a --- /dev/null +++ b/web/html/randompassword/index.html @@ -0,0 +1,60 @@ + + + + +js随机密码生成器插件 - 源码之家 + + + + + + + + + + + + + +
    +

    密码生成器

    +
    +
    生成的密码
    +
    点击复制
    +
    复制
    +
    点击生成
    + +
    +
    +
    长度:
    + +
    + +
    + settings +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    +
    + + +
    + + +
    +
    + + \ No newline at end of file diff --git a/web/html/randompassword/js/script.js b/web/html/randompassword/js/script.js new file mode 100644 index 0000000..bc1b1c0 --- /dev/null +++ b/web/html/randompassword/js/script.js @@ -0,0 +1,152 @@ +// This is a simple Password Generator App that will generate random password maybe you can you them to secure your account. +// I tried my best to make the code as simple as possible please dont mind the variable names. +// Also this idea came in my mind after checking Traversy Media's latest video. + +// Clear the concole on every refresh +console.clear(); + +// Range Slider Properties. +// Fill : The trailing color that you see when you drag the slider. +// background : Default Range Slider Background +const sliderProps = { + fill: "#0B1EDF", + background: "rgba(255, 255, 255, 0.214)", +}; + +// Selecting the Range Slider container which will effect the LENGTH property of the password. +const slider = document.querySelector(".range__slider"); + +// Text which will show the value of the range slider. +const sliderValue = document.querySelector(".length__title"); + +// Using Event Listener to apply the fill and also change the value of the text. +slider.querySelector("input").addEventListener("input", event => { + sliderValue.setAttribute("data-length", event.target.value); + applyFill(event.target); +}); +// Selecting the range input and passing it in the applyFill func. +applyFill(slider.querySelector("input")); +// This function is responsible to create the trailing color and setting the fill. +function applyFill(slider) { + const percentage = (100 * (slider.value - slider.min)) / (slider.max - slider.min); + const bg = `linear-gradient(90deg, ${sliderProps.fill} ${percentage}%, ${sliderProps.background} ${percentage + + 0.1}%)`; + slider.style.background = bg; + sliderValue.setAttribute("data-length", slider.value); +} + +// Object of all the function names that we will use to create random letters of password +const randomFunc = { + lower: getRandomLower, + upper: getRandomUpper, + number: getRandomNumber, + symbol: getRandomSymbol, +}; + +// Generator Functions +// All the functions that are responsible to return a random value taht we will use to create password. +function getRandomLower() { + return String.fromCharCode(Math.floor(Math.random() * 26) + 97); +} +function getRandomUpper() { + return String.fromCharCode(Math.floor(Math.random() * 26) + 65); +} +function getRandomNumber() { + return String.fromCharCode(Math.floor(Math.random() * 10) + 48); +} +function getRandomSymbol() { + const symbols = '~!@#$%^&*()_+{}":?><;.,'; + return symbols[Math.floor(Math.random() * symbols.length)]; +} + +// Selecting all the DOM Elements that are necessary --> + +// The Viewbox where the result will be shown +const resultEl = document.getElementById("result"); +// The input slider, will use to change the length of the password +const lengthEl = document.getElementById("slider"); + +// Checkboxes representing the options that is responsible to create differnt type of password based on user +const uppercaseEl = document.getElementById("uppercase"); +const lowercaseEl = document.getElementById("lowercase"); +const numberEl = document.getElementById("number"); +const symbolEl = document.getElementById("symbol"); + +// Button to generate the password +const generateBtn = document.getElementById("generate"); +// Button to copy the text +const copyBtn = document.getElementById("copy-btn"); +// Result viewbox container +const resultContainer = document.querySelector(".result"); +// Text info showed after generate button is clicked +const copyInfo = document.querySelector(".result__info.right"); +// Text appear after copy button is clicked +const copiedInfo = document.querySelector(".result__info.left"); + +// Update Css Props of the COPY button +// Getting the bounds of the result viewbox container +let resultContainerBound = { + left: resultContainer.getBoundingClientRect().left, + top: resultContainer.getBoundingClientRect().top, +}; +// This will update the position of the copy button based on mouse Position +resultContainer.addEventListener("mousemove", e => { + copyBtn.style.setProperty("--x", `${e.x - resultContainerBound.left}px`); + copyBtn.style.setProperty("--y", `${e.y - resultContainerBound.top}px`); +}); +window.addEventListener("resize", e => { + resultContainerBound = { + left: resultContainer.getBoundingClientRect().left, + top: resultContainer.getBoundingClientRect().top, + }; +}); + +// Copy Password in clipboard +copyBtn.addEventListener("click", () => { + const textarea = document.createElement("textarea"); + const password = resultEl.innerText; + if (!password || password == "CLICK GENERATE") { + return; + } + textarea.value = password; + document.body.appendChild(textarea); + textarea.select(); + document.execCommand("copy"); + textarea.remove(); + + copyInfo.style.transform = "translateY(200%)"; + copyInfo.style.opacity = "0"; + copiedInfo.style.transform = "translateY(0%)"; + copiedInfo.style.opacity = "0.75"; +}); + +// When Generate is clicked Password id generated. +generateBtn.addEventListener("click", () => { + const length = +lengthEl.value; + const hasLower = lowercaseEl.checked; + const hasUpper = uppercaseEl.checked; + const hasNumber = numberEl.checked; + const hasSymbol = symbolEl.checked; + resultEl.innerText = generatePassword(length, hasLower, hasUpper, hasNumber, hasSymbol); + copyInfo.style.transform = "translateY(0%)"; + copyInfo.style.opacity = "0.75"; + copiedInfo.style.transform = "translateY(200%)"; + copiedInfo.style.opacity = "0"; +}); + +// Function responsible to generate password and then returning it. +function generatePassword(length, lower, upper, number, symbol) { + let generatedPassword = ""; + const typesCount = lower + upper + number + symbol; + const typesArr = [{ lower }, { upper }, { number }, { symbol }].filter(item => Object.values(item)[0]); + if (typesCount === 0) { + return ""; + } + for (let i = 0; i < length; i++) { + typesArr.forEach(type => { + const funcName = Object.keys(type)[0]; + generatedPassword += randomFunc[funcName](); + }); + } + return generatedPassword.slice(0, length); +} \ No newline at end of file diff --git a/web/index.html b/web/index.html index 63cf50d..0ba3975 100644 --- a/web/index.html +++ b/web/index.html @@ -12,7 +12,7 @@
    - + 主页暂时还没想好~~~~咕!