parent
5ba7cc1e8d
commit
a50ecd2d81
@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jre1.8.0">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="java"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0">
|
||||
<attributes>
|
||||
<attribute name="owner.project.facets" value="jst.web"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||
<classpathentry kind="output" path="build/classes"/>
|
||||
</classpath>
|
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>GLGLServer</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.validation.validationbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="WebContent"/>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
|
||||
<attributes>
|
||||
<attribute name="hide" value="true"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
|
||||
<classpathentry kind="output" path=""/>
|
||||
</classpath>
|
@ -0,0 +1,7 @@
|
||||
eclipse.preferences.version=1
|
||||
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
|
||||
<wb-module deploy-name="GLGLServer">
|
||||
<wb-resource deploy-path="/" source-path="/WebContent" tag="defaultRootSource"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src"/>
|
||||
<wb-resource deploy-path="/WEB-INF/classes" source-path="/WebContent/video"/>
|
||||
<property name="context-root" value="GLGLServer"/>
|
||||
<property name="java-output-path" value="/GLGLServer/build/classes"/>
|
||||
</wb-module>
|
||||
</project-modules>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<faceted-project>
|
||||
<runtime name="Apache Tomcat v7.0"/>
|
||||
<fixed facet="java"/>
|
||||
<fixed facet="wst.jsdt.web"/>
|
||||
<fixed facet="jst.web"/>
|
||||
<installed facet="java" version="1.8"/>
|
||||
<installed facet="jst.web" version="2.5"/>
|
||||
<installed facet="wst.jsdt.web" version="1.0"/>
|
||||
</faceted-project>
|
@ -0,0 +1 @@
|
||||
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
|
@ -0,0 +1 @@
|
||||
Window
|
@ -0,0 +1,3 @@
|
||||
Manifest-Version: 1.0
|
||||
Class-Path:
|
||||
|
@ -0,0 +1,42 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>视频教程列表</title>
|
||||
<meta charSet="utf-8" />
|
||||
<meta httpEquiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta httpEquiv="Cache-Control" content="no-siteapp" />
|
||||
<meta name="renderer" content="webkit" />
|
||||
<meta name="keywords" content="demo" />
|
||||
<meta name="description" content="demo" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<OBJECT id=WMP height=320 standby=Loading... width=332
|
||||
classid=clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6>
|
||||
< PARAM NAME="URL" VALUE="D:/fly/GuiLinGL/GLGLServer/WebContent/shipin.mp4">
|
||||
<PARAM NAME="rate" VALUE="1">
|
||||
< PARAM NAME="balance" VALUE="0">
|
||||
< PARAM NAME="currentPosition" VALUE="0">
|
||||
<PARAM NAME="playCount" VALUE="1">
|
||||
< PARAM NAME="autoStart" VALUE="1">
|
||||
< PARAM NAME="currentMarker" VALUE="0">
|
||||
< PARAM NAME="invokeURLs" VALUE="-1">
|
||||
< PARAM NAME="baseURL" VALUE="">
|
||||
< PARAM NAME="volume" VALUE="50">
|
||||
< PARAM NAME="defaultFrame" VALUE="">
|
||||
< PARAM NAME="mute" VALUE="0">
|
||||
< PARAM NAME="uiMode" VALUE="full">
|
||||
< PARAM NAME="stretchToFit" VALUE="0">
|
||||
< PARAM NAME="windowlessVideo" VALUE="0">
|
||||
< PARAM NAME="enabled" VALUE="-1">
|
||||
< PARAM NAME="enableContextMenu" VALUE="-1">
|
||||
< PARAM NAME="fullScreen" VALUE="0">
|
||||
< PARAM NAME="SAMIStyle" VALUE="">
|
||||
< PARAM NAME="SAMILang" VALUE="">
|
||||
< PARAM NAME="SAMIFilename" VALUE="">
|
||||
< PARAM NAME="captioningID" VALUE="">
|
||||
< /OBJECT>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,12 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8"
|
||||
pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>zwh</title>
|
||||
</head>
|
||||
<body>
|
||||
<embed src="video/shipin.mp4" width="500" height="600">
|
||||
</body>
|
||||
</html>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
|
||||
<display-name>WXFJavaBeanStarBook</display-name>
|
||||
<welcome-file-list>
|
||||
<welcome-file>index.html</welcome-file>
|
||||
<welcome-file>index.htm</welcome-file>
|
||||
<welcome-file>index.jsp</welcome-file>
|
||||
<welcome-file>default.html</welcome-file>
|
||||
<welcome-file>default.htm</welcome-file>
|
||||
<welcome-file>default.jsp</welcome-file>
|
||||
</welcome-file-list>
|
||||
<servlet>
|
||||
<description></description>
|
||||
<display-name>RegisterServlet</display-name>
|
||||
<servlet-name>RegisterServlet</servlet-name>
|
||||
<servlet-class>com.fly.web.servlet.RegisterServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>RegisterServlet</servlet-name>
|
||||
<url-pattern>/register</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet>
|
||||
<description></description>
|
||||
<display-name>LoginServlet</display-name>
|
||||
<servlet-name>LoginServlet</servlet-name>
|
||||
<servlet-class>com.fly.web.servlet.LoginServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>LoginServlet</servlet-name>
|
||||
<url-pattern>/login</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet>
|
||||
<description></description>
|
||||
<display-name>QueryOrderFormServlet</display-name>
|
||||
<servlet-name>QueryOrderFormServlet</servlet-name>
|
||||
<servlet-class>com.fly.web.servlet.QueryOrderFormServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>QueryOrderFormServlet</servlet-name>
|
||||
<url-pattern>/queryOrderForm</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet>
|
||||
<description></description>
|
||||
<display-name>GetShouYeData</display-name>
|
||||
<servlet-name>GetShouYeData</servlet-name>
|
||||
<servlet-class>com.fly.web.servlet.GetShouYeData</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>GetShouYeData</servlet-name>
|
||||
<url-pattern>/getShouYeData</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet>
|
||||
<description></description>
|
||||
<display-name>HistoryServlet</display-name>
|
||||
<servlet-name>HistoryServlet</servlet-name>
|
||||
<servlet-class>com.fly.web.servlet.HistoryServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>HistoryServlet</servlet-name>
|
||||
<url-pattern>/history</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet>
|
||||
<description></description>
|
||||
<display-name>DeleteHistoryServlet</display-name>
|
||||
<servlet-name>DeleteHistoryServlet</servlet-name>
|
||||
<servlet-class>com.fly.web.servlet.DeleteHistoryServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>DeleteHistoryServlet</servlet-name>
|
||||
<url-pattern>/deleteHistory</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet>
|
||||
<description></description>
|
||||
<display-name>GetHistoryServlet</display-name>
|
||||
<servlet-name>GetHistoryServlet</servlet-name>
|
||||
<servlet-class>com.fly.web.servlet.GetHistoryServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>GetHistoryServlet</servlet-name>
|
||||
<url-pattern>/getHistory</url-pattern>
|
||||
</servlet-mapping>
|
||||
<servlet>
|
||||
<description></description>
|
||||
<display-name>UpdatePwdServlet</display-name>
|
||||
<servlet-name>UpdatePwdServlet</servlet-name>
|
||||
<servlet-class>com.fly.web.servlet.UpdatePwdServlet</servlet-class>
|
||||
</servlet>
|
||||
<servlet-mapping>
|
||||
<servlet-name>UpdatePwdServlet</servlet-name>
|
||||
<url-pattern>/updatePwd</url-pattern>
|
||||
</servlet-mapping>
|
||||
</web-app>
|
Binary file not shown.
@ -0,0 +1,4 @@
|
||||
c3p0.driverClass=com.mysql.jdbc.Driver
|
||||
c3p0.jdbcUrl=jdbc:mysql:///glgl
|
||||
c3p0.user=root
|
||||
c3p0.password=root
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,44 @@
|
||||
sql语句
|
||||
|
||||
create database glgl;
|
||||
|
||||
use glgl;
|
||||
|
||||
create database glgl;
|
||||
|
||||
create table user(
|
||||
logname char(20) not null,
|
||||
password char(20),
|
||||
primary key (logname)
|
||||
);
|
||||
|
||||
create table history(
|
||||
uniquekey char(30) not null,
|
||||
url char(50),
|
||||
title char(20),
|
||||
leibie char(20),
|
||||
imageurl char(100),
|
||||
time char(20),
|
||||
account char(20),
|
||||
primary key (uniquekey)
|
||||
);
|
||||
|
||||
create table shouye(
|
||||
uniquekey char(30) not null,
|
||||
url char(50),
|
||||
title char(20),
|
||||
leibie char(20),
|
||||
imageurl char(100),
|
||||
primary key (uniquekey)
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,69 @@
|
||||
/*
|
||||
SQLyog Enterprise - MySQL GUI v6.14
|
||||
MySQL - 5.5.49 : Database - glgl
|
||||
*********************************************************************
|
||||
*/
|
||||
|
||||
/*!40101 SET NAMES utf8 */;
|
||||
|
||||
/*!40101 SET SQL_MODE=''*/;
|
||||
|
||||
create database if not exists `glgl`;
|
||||
|
||||
USE `glgl`;
|
||||
|
||||
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||
|
||||
/*Table structure for table `history` */
|
||||
|
||||
DROP TABLE IF EXISTS `history`;
|
||||
|
||||
CREATE TABLE `history` (
|
||||
`uniquekey` char(50) NOT NULL,
|
||||
`url` char(100) DEFAULT NULL,
|
||||
`title` char(100) DEFAULT NULL,
|
||||
`leibie` char(20) DEFAULT NULL,
|
||||
`imageurl` char(150) DEFAULT NULL,
|
||||
`time` char(20) DEFAULT NULL,
|
||||
`account` char(20) DEFAULT NULL,
|
||||
PRIMARY KEY (`uniquekey`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
/*Data for the table `history` */
|
||||
|
||||
insert into `history`(`uniquekey`,`url`,`title`,`leibie`,`imageurl`,`time`,`account`) values ('jiaotong02','https://m.mafengwo.cn/gl/catalog/index?id=289&catalog_id=957','出租车','交通住宿','https://img1.qunarzz.com/travel/d8/1703/30/42823b7086545bb5.jpg_r_326x190x70_3a66727c.jpg','2019-05-08 22:28:43','fly'),('xingcheng02','https://touch.go.qunar.com/feature/14257','让时光漫步,醉心山水五日游','行程推荐','https://img1.qunarzz.com/travel/d8/1703/30/42823b7086545bb5.jpg_r_326x190x70_3a66727c.jpg','2019-05-08 22:28:51','fly');
|
||||
|
||||
/*Table structure for table `shouye` */
|
||||
|
||||
DROP TABLE IF EXISTS `shouye`;
|
||||
|
||||
CREATE TABLE `shouye` (
|
||||
`uniquekey` char(30) NOT NULL,
|
||||
`url` char(50) DEFAULT NULL,
|
||||
`title` char(20) DEFAULT NULL,
|
||||
`leibie` char(20) DEFAULT NULL,
|
||||
`imageurl` char(100) DEFAULT NULL,
|
||||
PRIMARY KEY (`uniquekey`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
/*Data for the table `shouye` */
|
||||
|
||||
insert into `shouye`(`uniquekey`,`url`,`title`,`leibie`,`imageurl`) values ('001','www',NULL,'www','www'),('002','www','www','www','www'),('003','www','www','www','www'),('004','www','www','www','www'),('005','www','www','www','www');
|
||||
|
||||
/*Table structure for table `user` */
|
||||
|
||||
DROP TABLE IF EXISTS `user`;
|
||||
|
||||
CREATE TABLE `user` (
|
||||
`logname` char(20) NOT NULL,
|
||||
`password` char(100) DEFAULT NULL,
|
||||
PRIMARY KEY (`logname`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
||||
|
||||
/*Data for the table `user` */
|
||||
|
||||
insert into `user`(`logname`,`password`) values ('fly','d0970714757783e6cf17b26fb8e2298f');
|
||||
|
||||
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
@ -0,0 +1,4 @@
|
||||
c3p0.driverClass=com.mysql.jdbc.Driver
|
||||
c3p0.jdbcUrl=jdbc:mysql:///glgl
|
||||
c3p0.user=root
|
||||
c3p0.password=root
|
@ -0,0 +1,18 @@
|
||||
package com.fly.dao;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.commons.dbutils.QueryRunner;
|
||||
import com.fly.utils.DataSourceUtils;
|
||||
|
||||
public class DeleteDao {
|
||||
|
||||
public static void deleteOrderForm(int number) throws SQLException {
|
||||
// 创建queryrunner
|
||||
QueryRunner qr = new QueryRunner();
|
||||
// 编写sql
|
||||
String sql = "delete from orderform where orderNumber = ?";
|
||||
// 执行sql
|
||||
qr.update(DataSourceUtils.getConnection(), sql, number);
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.fly.dao;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.dbutils.QueryRunner;
|
||||
import org.apache.commons.dbutils.handlers.BeanListHandler;
|
||||
|
||||
import com.fly.domain.History;
|
||||
import com.fly.domain.ShouYe;
|
||||
import com.fly.utils.DataSourceUtils;
|
||||
|
||||
public class HistoryDao {
|
||||
|
||||
public void historyAdd(String account, String uniquekey, String url, String title, String leibie, String imageurl,
|
||||
String time) throws SQLException {
|
||||
|
||||
System.out.println("HistoryDao:" + account + "--" + uniquekey + "--" + url + "--" + title + "--" + leibie
|
||||
+ "---" + imageurl + "---" + time);
|
||||
// 创建queryrunner
|
||||
QueryRunner qr = new QueryRunner();
|
||||
// 编写sql
|
||||
String sql = "insert into history values(?,?,?,?,?,?,?);";
|
||||
// 执行sql
|
||||
int update = qr.update(DataSourceUtils.getConnection(), sql, uniquekey, url, title, leibie, imageurl, time,
|
||||
account);
|
||||
}
|
||||
|
||||
public void historyDeleteByAccount(String account) throws SQLException {
|
||||
// 创建queryrunner
|
||||
QueryRunner qr = new QueryRunner();
|
||||
// 编写sql
|
||||
String sql = "delete from history where account = ?;";
|
||||
qr.update(DataSourceUtils.getConnection(), sql, account);
|
||||
}
|
||||
|
||||
public List<History> historyQueryAllByAccount(String account) throws SQLException {
|
||||
// 创建queryrunner
|
||||
QueryRunner qr = new QueryRunner(DataSourceUtils.getDataSource());
|
||||
String sql = "select * from history where account = ?;";
|
||||
// String sql = "select * from history;";
|
||||
List<History> list = qr.query(sql, account, new BeanListHandler<>(History.class));
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.fly.dao;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.commons.dbutils.QueryRunner;
|
||||
import org.apache.commons.dbutils.handlers.BeanHandler;
|
||||
|
||||
import com.fly.domain.User;
|
||||
import com.fly.utils.DataSourceUtils;
|
||||
|
||||
public class LoginDao {
|
||||
|
||||
public User registerLogin(String logname, String password) throws SQLException {
|
||||
// 创建queryrunner
|
||||
QueryRunner qr = new QueryRunner();
|
||||
// 编写sql
|
||||
String sql = "select * from user where logname = ? and password = ?";
|
||||
// 执行sql
|
||||
return qr.query(DataSourceUtils.getConnection(), sql, new BeanHandler<>(User.class), logname, password);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
package com.fly.dao;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.dbutils.QueryRunner;
|
||||
import org.apache.commons.dbutils.handlers.BeanHandler;
|
||||
import org.apache.commons.dbutils.handlers.BeanListHandler;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.fly.domain.OrderForm;
|
||||
import com.fly.utils.DataSourceUtils;
|
||||
import com.sun.org.apache.xpath.internal.operations.Or;
|
||||
|
||||
public class QueryOrderFormDao {
|
||||
|
||||
@Test
|
||||
public List<OrderForm> queryOrder(String logname) throws SQLException {
|
||||
QueryRunner qr = new QueryRunner(DataSourceUtils.getDataSource());
|
||||
// 编写sql
|
||||
String sql = "select * from orderform where logname = ?";
|
||||
// 执行sql
|
||||
List<OrderForm> list = qr.query(sql, new BeanListHandler<>(OrderForm.class), logname);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.fly.dao;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import org.apache.commons.dbutils.QueryRunner;
|
||||
import org.junit.Test;
|
||||
|
||||
import com.fly.utils.DataSourceUtils;
|
||||
|
||||
public class RegisterDao {
|
||||
|
||||
// 添加注册
|
||||
public void registerAdd(String logname, String password) throws SQLException {
|
||||
// 创建queryrunner
|
||||
QueryRunner qr = new QueryRunner();
|
||||
// 编写sql
|
||||
String sql = "insert into user values(?,?);";
|
||||
// 执行sql
|
||||
int update = qr.update(DataSourceUtils.getConnection(), sql, logname, password);
|
||||
|
||||
}
|
||||
|
||||
//更改密码
|
||||
public void updatePwd(String logname, String newPwd) throws SQLException {
|
||||
// 创建queryrunner
|
||||
QueryRunner qr = new QueryRunner();
|
||||
// 编写sql
|
||||
String sql = "update user set password = ? where logname = ?;";
|
||||
// 执行sql
|
||||
int update = qr.update(DataSourceUtils.getConnection(), sql, newPwd, logname);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
package com.fly.dao;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.dbutils.QueryRunner;
|
||||
import org.apache.commons.dbutils.handlers.BeanListHandler;
|
||||
|
||||
import com.fly.domain.ShouYe;
|
||||
import com.fly.utils.DataSourceUtils;
|
||||
|
||||
public class ShouYeDao {
|
||||
|
||||
|
||||
/**
|
||||
* 查询所有数据
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static List<ShouYe> allShou() throws Exception {
|
||||
|
||||
QueryRunner qr = new QueryRunner(DataSourceUtils.getDataSource());
|
||||
String sql = "select * from shouye";
|
||||
List<ShouYe> list = qr.query(sql, new BeanListHandler<>(ShouYe.class));
|
||||
// for (ShouYe bean : list) {
|
||||
// System.out.println("----allStu----" + bean);
|
||||
// }
|
||||
return list;
|
||||
}
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.fly.domain;
|
||||
|
||||
public class History {
|
||||
|
||||
private String account;
|
||||
private String uniquekey;
|
||||
private String url;
|
||||
private String title;
|
||||
private String leibie;
|
||||
private String imageurl;
|
||||
private String time;
|
||||
|
||||
public String getImageurl() {
|
||||
return imageurl;
|
||||
}
|
||||
|
||||
public String getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public void setImageurl(String imageurl) {
|
||||
this.imageurl = imageurl;
|
||||
}
|
||||
|
||||
public void setTime(String time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public String getAccount() {
|
||||
return account;
|
||||
}
|
||||
|
||||
public void setAccount(String account) {
|
||||
this.account = account;
|
||||
}
|
||||
|
||||
public String getUniquekey() {
|
||||
return uniquekey;
|
||||
}
|
||||
|
||||
public void setUniquekey(String uniquekey) {
|
||||
this.uniquekey = uniquekey;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getLeibie() {
|
||||
return leibie;
|
||||
}
|
||||
|
||||
public void setLeibie(String leibie) {
|
||||
this.leibie = leibie;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
// TODO Auto-generated method stub
|
||||
return title + "--" + leibie + "--" + account;
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.fly.domain;
|
||||
|
||||
public class OrderForm {
|
||||
|
||||
private int orderNumber;
|
||||
private String logname;
|
||||
private String ordermess;
|
||||
private float sum;
|
||||
|
||||
public void setSum(float sum) {
|
||||
this.sum = sum;
|
||||
}
|
||||
|
||||
public float getSum() {
|
||||
return sum;
|
||||
}
|
||||
|
||||
public void setLogname(String logname) {
|
||||
this.logname = logname;
|
||||
}
|
||||
|
||||
public void setOrdermess(String ordermess) {
|
||||
this.ordermess = ordermess;
|
||||
}
|
||||
|
||||
public void setOrderNumber(int orderNumber) {
|
||||
this.orderNumber = orderNumber;
|
||||
}
|
||||
|
||||
public String getLogname() {
|
||||
return logname;
|
||||
}
|
||||
|
||||
public String getOrdermess() {
|
||||
return ordermess;
|
||||
}
|
||||
|
||||
public int getOrderNumber() {
|
||||
return orderNumber;
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.fly.domain;
|
||||
|
||||
public class ShouYe {
|
||||
|
||||
private String imageurl;
|
||||
private String leibie;
|
||||
private String title;
|
||||
private String uniquekey;
|
||||
private String url;
|
||||
|
||||
public String getImageurl() {
|
||||
return imageurl;
|
||||
}
|
||||
public void setImageurl(String imageurl) {
|
||||
this.imageurl = imageurl;
|
||||
}
|
||||
public String getLeibie() {
|
||||
return leibie;
|
||||
}
|
||||
public void setLeibie(String leibie) {
|
||||
this.leibie = leibie;
|
||||
}
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
public String getUniquekey() {
|
||||
return uniquekey;
|
||||
}
|
||||
public void setUniquekey(String uniquekey) {
|
||||
this.uniquekey = uniquekey;
|
||||
}
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
public void setUrl(String url) {
|
||||
this.url = url;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
// TODO Auto-generated method stub
|
||||
return imageurl+"--"+title+"--"+url+"--"+leibie+"--"+uniquekey;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
package com.fly.domain;
|
||||
|
||||
public class User {
|
||||
|
||||
private String logname;
|
||||
private String password;
|
||||
|
||||
public void setLogname(String logname) {
|
||||
this.logname = logname;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getLogname() {
|
||||
return logname;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.fly.service;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import com.fly.dao.HistoryDao;
|
||||
import com.fly.domain.History;
|
||||
|
||||
public class HistoryService {
|
||||
|
||||
HistoryDao dao = new HistoryDao();
|
||||
|
||||
public void add(String account, String uniquekey, String url, String title, String leibie, String imageurl,
|
||||
String time) throws SQLException {
|
||||
dao.historyAdd(account, uniquekey, url, title, leibie, imageurl, time);
|
||||
System.out.println("HistoryService:" + account + "--" + uniquekey + "--" + url + "--" + title + "--" + leibie);
|
||||
}
|
||||
|
||||
public void deleteByAccount(String account) throws SQLException {
|
||||
dao.historyDeleteByAccount(account);
|
||||
}
|
||||
|
||||
public List<History> queryAllByAccount(String account) throws SQLException {
|
||||
// TODO Auto-generated method stub
|
||||
return dao.historyQueryAllByAccount(account);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.fly.service;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import com.fly.dao.LoginDao;
|
||||
import com.fly.domain.User;
|
||||
|
||||
public class LoginService {
|
||||
|
||||
LoginDao dao = new LoginDao();
|
||||
|
||||
public User login(String logname, String password) throws SQLException {
|
||||
return dao.registerLogin(logname, password);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.fly.service;
|
||||
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import com.fly.dao.QueryOrderFormDao;
|
||||
import com.fly.domain.OrderForm;
|
||||
|
||||
public class QueryOrderFormService {
|
||||
|
||||
QueryOrderFormDao dao = new QueryOrderFormDao();
|
||||
|
||||
public List<OrderForm> queryOrder(String logname) throws SQLException {
|
||||
List<OrderForm> queryOrder = dao.queryOrder(logname);
|
||||
return queryOrder;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.fly.service;
|
||||
|
||||
import java.sql.SQLException;
|
||||
|
||||
import com.fly.dao.RegisterDao;
|
||||
|
||||
public class RegisterService {
|
||||
|
||||
RegisterDao dao = new RegisterDao();
|
||||
|
||||
public void register(String logname, String password)
|
||||
throws SQLException {
|
||||
dao.registerAdd(logname, password);
|
||||
}
|
||||
|
||||
public void updatePwd(String account, String pwd) throws SQLException {
|
||||
dao.updatePwd(account,pwd);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.fly.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fly.dao.ShouYeDao;
|
||||
import com.fly.domain.ShouYe;
|
||||
|
||||
public class ShouYeService {
|
||||
|
||||
ShouYeDao dao = new ShouYeDao();
|
||||
|
||||
public List<ShouYe> shouYe() throws Exception {
|
||||
return dao.allShou();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
package com.fly.utils;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
import com.mchange.v2.c3p0.ComboPooledDataSource;
|
||||
|
||||
public class DataSourceUtils {
|
||||
private static ComboPooledDataSource ds = new ComboPooledDataSource();
|
||||
private static ThreadLocal<Connection> tl = new ThreadLocal<>();
|
||||
|
||||
/**
|
||||
* 获取数据源
|
||||
* @return
|
||||
*/
|
||||
public static DataSource getDataSource(){
|
||||
return ds;
|
||||
}
|
||||
|
||||
/**
|
||||
* 从当前线程上获取连接
|
||||
* @return
|
||||
* @throws SQLException
|
||||
*/
|
||||
public static Connection getConnection() throws SQLException{
|
||||
Connection conn = null;
|
||||
if (conn == null) {
|
||||
//第一次获取 创建一个连接 和当前的线程绑定
|
||||
conn = ds.getConnection();
|
||||
//绑定
|
||||
tl.set(conn);
|
||||
}
|
||||
return conn;
|
||||
}
|
||||
|
||||
/**
|
||||
* 释放资源
|
||||
* @param conn
|
||||
* @param st
|
||||
* @param rs
|
||||
*/
|
||||
public static void closeResource(Connection conn,Statement st,ResultSet rs){
|
||||
closeResource(st, rs);
|
||||
closeConn(conn);
|
||||
}
|
||||
|
||||
public static void closeResource(Statement st, ResultSet rs) {
|
||||
closeResultSet(rs);
|
||||
closeStatement(st);
|
||||
}
|
||||
|
||||
/**
|
||||
* 释放连接
|
||||
* @param conn
|
||||
*/
|
||||
public static void closeConn(Connection conn) {
|
||||
if(conn != null){
|
||||
try {
|
||||
conn.close();
|
||||
//和当前的线程解绑
|
||||
tl.remove();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
conn =null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 释放语句执行者
|
||||
* @param st
|
||||
*/
|
||||
public static void closeStatement(Statement st) {
|
||||
if (st != null) {
|
||||
try {
|
||||
st.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
st = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 释放结果集
|
||||
* @param rs
|
||||
*/
|
||||
public static void closeResultSet(ResultSet rs) {
|
||||
if (rs != null) {
|
||||
try {
|
||||
rs.close();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
rs = null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 开启事物
|
||||
* @throws SQLException
|
||||
*/
|
||||
public static void startTransaction() throws SQLException{
|
||||
//获取连接 开启事物
|
||||
getConnection().setAutoCommit(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* 事务提交
|
||||
*/
|
||||
public static void commitAndClose(){
|
||||
try {
|
||||
//获取连接
|
||||
Connection conn = getConnection();
|
||||
//提交事物
|
||||
conn.commit();
|
||||
//释放资源
|
||||
conn.close();
|
||||
//接触绑定
|
||||
tl.remove();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 事务回滚
|
||||
*/
|
||||
public static void rollbackAndClose(){
|
||||
try {
|
||||
//获取连接
|
||||
Connection conn = getConnection();
|
||||
//事务回滚
|
||||
conn.rollback();
|
||||
//释放资源
|
||||
conn.close();
|
||||
//解除绑定
|
||||
tl.remove();
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package com.fly.web.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fly.service.HistoryService;
|
||||
|
||||
/**
|
||||
* 根据用户清空History
|
||||
*/
|
||||
public class DeleteHistoryServlet extends HttpServlet {
|
||||
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
// 设置编码
|
||||
request.setCharacterEncoding("utf-8");
|
||||
response.setContentType("text/html;charset=utf-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
String account = request.getParameter("account");
|
||||
|
||||
String mess;
|
||||
try {
|
||||
new HistoryService().deleteByAccount(account);
|
||||
mess = account + "服务器删除成功";
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
mess = account + "服务器删除失败";
|
||||
}
|
||||
|
||||
// 输出数据
|
||||
out.println(mess);
|
||||
}
|
||||
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
doGet(request, response);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,72 @@
|
||||
package com.fly.web.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fly.domain.History;
|
||||
import com.fly.domain.ShouYe;
|
||||
import com.fly.service.HistoryService;
|
||||
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
/**
|
||||
* 获取数据库中的历史记录转换成json
|
||||
*/
|
||||
public class GetHistoryServlet extends HttpServlet {
|
||||
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
// 设置编码
|
||||
request.setCharacterEncoding("utf-8");
|
||||
response.setContentType("text/json;charset=utf-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
String account = request.getParameter("account");
|
||||
// String account = "fly";
|
||||
try {
|
||||
List<History> list = new HistoryService().queryAllByAccount(account);
|
||||
|
||||
JSONObject jsonobj1 = new JSONObject();
|
||||
jsonobj1.put("error_code", 0);
|
||||
jsonobj1.put("reason", "成功的返回");
|
||||
|
||||
JSONObject jsonobj2 = new JSONObject();
|
||||
JSONArray jsonarray1 = new JSONArray();
|
||||
|
||||
JSONObject jsonobj3 = new JSONObject();
|
||||
for (History s : list) {
|
||||
jsonobj3.put("account", s.getAccount());
|
||||
jsonobj3.put("leibie", s.getLeibie());
|
||||
jsonobj3.put("title", s.getTitle());
|
||||
jsonobj3.put("uniquekey", s.getUniquekey());
|
||||
jsonobj3.put("url", s.getUrl());
|
||||
jsonobj3.put("imageurl", s.getImageurl());
|
||||
jsonobj3.put("time", s.getTime());
|
||||
jsonarray1.add(jsonobj3);
|
||||
}
|
||||
|
||||
jsonobj2.put("data", jsonarray1);
|
||||
|
||||
jsonobj1.put("result", jsonobj2);
|
||||
|
||||
out.println(jsonobj1);
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
out.println("服务器获取历史失败");
|
||||
}
|
||||
}
|
||||
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
doGet(request, response);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,79 @@
|
||||
package com.fly.web.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.List;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fly.dao.ShouYeDao;
|
||||
import com.fly.domain.ShouYe;
|
||||
import com.fly.service.ShouYeService;
|
||||
|
||||
import net.sf.json.JSONArray;
|
||||
import net.sf.json.JSONObject;
|
||||
|
||||
/**
|
||||
* 生成首页滑动数据
|
||||
*/
|
||||
public class GetShouYeData extends HttpServlet {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
// 设置响应内容类型
|
||||
// 设置响应内容类型
|
||||
response.setContentType("text/json; charset=utf-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
try {
|
||||
List<ShouYe> list = new ShouYeService().shouYe();
|
||||
// for (ShouYe bean : list) {
|
||||
// System.out.println("----allStu----" + bean);
|
||||
// }
|
||||
// JSONArray jsonarray = new JSONArray();
|
||||
// JSONObject jsonobj = new JSONObject();
|
||||
// for (ShouYe s : list) {
|
||||
// jsonobj.put("imageurl", s.getImageurl());
|
||||
// jsonobj.put("leibie", s.getLeibie());
|
||||
// jsonobj.put("title", s.getTitle());
|
||||
// jsonobj.put("uniquekey", s.getUniquekey());
|
||||
// jsonobj.put("url", s.getUrl());
|
||||
// jsonarray.add(jsonobj);
|
||||
// }
|
||||
|
||||
JSONObject jsonobj1 = new JSONObject();
|
||||
jsonobj1.put("error_code", 0);
|
||||
jsonobj1.put("reason", "成功的返回");
|
||||
|
||||
JSONObject jsonobj2 = new JSONObject();
|
||||
JSONArray jsonarray1 = new JSONArray();
|
||||
|
||||
JSONObject jsonobj3 = new JSONObject();
|
||||
for (ShouYe s : list) {
|
||||
jsonobj3.put("imageurl", s.getImageurl());
|
||||
jsonobj3.put("leibie", s.getLeibie());
|
||||
jsonobj3.put("title", s.getTitle());
|
||||
jsonobj3.put("uniquekey", s.getUniquekey());
|
||||
jsonobj3.put("url", s.getUrl());
|
||||
jsonarray1.add(jsonobj3);
|
||||
}
|
||||
|
||||
jsonobj2.put("data", jsonarray1);
|
||||
|
||||
jsonobj1.put("result", jsonobj2);
|
||||
|
||||
out.println(jsonobj1);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
doGet(request, response);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.fly.web.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fly.service.HistoryService;
|
||||
import com.fly.service.RegisterService;
|
||||
|
||||
/**
|
||||
* 保存浏览历史
|
||||
*/
|
||||
public class HistoryServlet extends HttpServlet {
|
||||
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
// 设置编码
|
||||
request.setCharacterEncoding("utf-8");
|
||||
response.setContentType("text/html;charset=utf-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
//// mAccount,mUniquekey, mUrl, mTitle,mLeiBie
|
||||
String account = request.getParameter("account");
|
||||
String uniquekey = request.getParameter("uniquekey");
|
||||
String url = request.getParameter("url");
|
||||
String title = request.getParameter("title");
|
||||
String leibie = request.getParameter("leibie");
|
||||
String imageurl = request.getParameter("imageurl");
|
||||
String time = request.getParameter("time");
|
||||
String mess;
|
||||
|
||||
// String account = "account";
|
||||
// String uniquekey = "uniquekey";
|
||||
// String url = "url";
|
||||
// String title = "title";
|
||||
// String leibie = "leibie";
|
||||
|
||||
try {
|
||||
new HistoryService().add(account, uniquekey, url, title, leibie, imageurl, time);
|
||||
mess = account + "服务器历史成功";
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
mess = "服务器历史失败";
|
||||
}
|
||||
|
||||
// 输出数据
|
||||
out.println(mess);
|
||||
|
||||
}
|
||||
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
doGet(request, response);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package com.fly.web.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.Cookie;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import com.fly.domain.User;
|
||||
import com.fly.service.LoginService;
|
||||
import com.fly.service.RegisterService;
|
||||
|
||||
/**
|
||||
* 登陆
|
||||
*/
|
||||
public class LoginServlet extends HttpServlet {
|
||||
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
// 设置编码
|
||||
request.setCharacterEncoding("utf-8");
|
||||
response.setContentType("text/html;charset=utf-8");
|
||||
PrintWriter out = response.getWriter();
|
||||
String account = request.getParameter("account");
|
||||
String pwd = request.getParameter("pwd");
|
||||
System.out.println("账户:" + account);
|
||||
System.out.println("密码:" + pwd);
|
||||
User user = null;
|
||||
String mess;
|
||||
try {
|
||||
user = new LoginService().login(account, pwd);
|
||||
if (user == null) {
|
||||
mess = "登陆失败";
|
||||
} else {
|
||||
mess = account + "登陆成功";
|
||||
}
|
||||
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
mess = "登陆失败";
|
||||
}
|
||||
// 输出数据
|
||||
out.println(mess);
|
||||
|
||||
}
|
||||
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
doGet(request, response);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.fly.web.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fly.service.RegisterService;
|
||||
|
||||
/**
|
||||
* 注册页面
|
||||
*/
|
||||
public class RegisterServlet extends HttpServlet {
|
||||
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
// 设置编码
|
||||
request.setCharacterEncoding("utf-8");
|
||||
response.setContentType("text/html;charset=utf-8");
|
||||
|
||||
// 设置响应内容类型
|
||||
// 设置响应内容类型
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
// 接收参数
|
||||
String account = request.getParameter("account");
|
||||
String pwd = request.getParameter("pwd");
|
||||
|
||||
System.out.println("Register---" + account);
|
||||
System.out.println("Register---" + pwd);
|
||||
String mess;
|
||||
try {
|
||||
new RegisterService().register(account, pwd);
|
||||
mess = account + "注册成功";
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
mess = "用户名已经被注册";
|
||||
}
|
||||
|
||||
// 输出数据
|
||||
out.println(mess);
|
||||
}
|
||||
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
doGet(request, response);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
package com.fly.web.servlet;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.sql.SQLException;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import javax.servlet.http.HttpServlet;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fly.service.RegisterService;
|
||||
|
||||
/**
|
||||
* 更新密码
|
||||
*/
|
||||
public class UpdatePwdServlet extends HttpServlet {
|
||||
|
||||
protected void doGet(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
// 设置编码
|
||||
request.setCharacterEncoding("utf-8");
|
||||
response.setContentType("text/html;charset=utf-8");
|
||||
// 设置响应内容类型
|
||||
// 设置响应内容类型
|
||||
PrintWriter out = response.getWriter();
|
||||
|
||||
// 接收参数
|
||||
String account = request.getParameter("account");
|
||||
String pwd = request.getParameter("pwd");
|
||||
|
||||
System.out.println("需要修改密码的账户---" + account);
|
||||
System.out.println("新的密码---" + pwd);
|
||||
String mess;
|
||||
try {
|
||||
new RegisterService().updatePwd(account, pwd);
|
||||
mess = "successful";
|
||||
} catch (SQLException e) {
|
||||
e.printStackTrace();
|
||||
mess = "error";
|
||||
}
|
||||
|
||||
// 输出数据
|
||||
out.println(mess);
|
||||
}
|
||||
|
||||
protected void doPost(HttpServletRequest request, HttpServletResponse response)
|
||||
throws ServletException, IOException {
|
||||
// TODO Auto-generated method stub
|
||||
doGet(request, response);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
sql语句
|
||||
|
||||
create database glgl;
|
||||
|
||||
use glgl;
|
||||
|
||||
create database glgl;
|
||||
|
||||
create table user(
|
||||
logname char(20) not null,
|
||||
password char(20),
|
||||
primary key (logname)
|
||||
);
|
||||
|
||||
create table history(
|
||||
uniquekey char(30) not null,
|
||||
url char(50),
|
||||
title char(20),
|
||||
leibie char(20),
|
||||
imageurl char(100),
|
||||
time char(20),
|
||||
account char(20),
|
||||
primary key (uniquekey)
|
||||
);
|
||||
|
||||
create table shouye(
|
||||
uniquekey char(30) not null,
|
||||
url char(50),
|
||||
title char(20),
|
||||
leibie char(20),
|
||||
imageurl char(100),
|
||||
primary key (uniquekey)
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -0,0 +1,9 @@
|
||||
*.iml
|
||||
.gradle
|
||||
/local.properties
|
||||
/.idea/workspace.xml
|
||||
/.idea/libraries
|
||||
.DS_Store
|
||||
/build
|
||||
/captures
|
||||
.externalNativeBuild
|
Binary file not shown.
Binary file not shown.
@ -0,0 +1,116 @@
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<code_scheme name="Project" version="173">
|
||||
<codeStyleSettings language="XML">
|
||||
<indentOptions>
|
||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
||||
</indentOptions>
|
||||
<arrangement>
|
||||
<rules>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:android</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>xmlns:.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:id</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*:name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>name</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>style</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>^$</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>ANDROID_ATTRIBUTE_ORDER</order>
|
||||
</rule>
|
||||
</section>
|
||||
<section>
|
||||
<rule>
|
||||
<match>
|
||||
<AND>
|
||||
<NAME>.*</NAME>
|
||||
<XML_ATTRIBUTE />
|
||||
<XML_NAMESPACE>.*</XML_NAMESPACE>
|
||||
</AND>
|
||||
</match>
|
||||
<order>BY_NAME</order>
|
||||
</rule>
|
||||
</section>
|
||||
</rules>
|
||||
</arrangement>
|
||||
</codeStyleSettings>
|
||||
</code_scheme>
|
||||
</component>
|
@ -0,0 +1,25 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="GradleSettings">
|
||||
<option name="linkedExternalProjectsSettings">
|
||||
<GradleProjectSettings>
|
||||
<option name="distributionType" value="DEFAULT_WRAPPED" />
|
||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||
<option name="modules">
|
||||
<set>
|
||||
<option value="$PROJECT_DIR$" />
|
||||
<option value="$PROJECT_DIR$/adapter" />
|
||||
<option value="$PROJECT_DIR$/app" />
|
||||
<option value="$PROJECT_DIR$/color" />
|
||||
<option value="$PROJECT_DIR$/gl" />
|
||||
<option value="$PROJECT_DIR$/rv" />
|
||||
<option value="$PROJECT_DIR$/tb" />
|
||||
<option value="$PROJECT_DIR$/v" />
|
||||
</set>
|
||||
</option>
|
||||
<option name="resolveModulePerSourceSet" value="false" />
|
||||
<option name="testRunner" value="PLATFORM" />
|
||||
</GradleProjectSettings>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="NullableNotNullManager">
|
||||
<option name="myDefaultNullable" value="android.support.annotation.Nullable" />
|
||||
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
|
||||
<option name="myNullables">
|
||||
<value>
|
||||
<list size="4">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
|
||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
|
||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
|
||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
<option name="myNotNulls">
|
||||
<value>
|
||||
<list size="4">
|
||||
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.NotNull" />
|
||||
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nonnull" />
|
||||
<item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.NonNull" />
|
||||
<item index="3" class="java.lang.String" itemvalue="android.support.annotation.NonNull" />
|
||||
</list>
|
||||
</value>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_7" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="ProjectType">
|
||||
<option name="id" value="Android" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/GuiLinGL.iml" filepath="$PROJECT_DIR$/GuiLinGL.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/adapter/GuiLinGL-adapter.iml" filepath="$PROJECT_DIR$/adapter/GuiLinGL-adapter.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/color/GuiLinGL-color.iml" filepath="$PROJECT_DIR$/color/GuiLinGL-color.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/gl/GuiLinGL-gl.iml" filepath="$PROJECT_DIR$/gl/GuiLinGL-gl.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/rv/GuiLinGL-rv.iml" filepath="$PROJECT_DIR$/rv/GuiLinGL-rv.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/tb/GuiLinGL-tb.iml" filepath="$PROJECT_DIR$/tb/GuiLinGL-tb.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/v/GuiLinGL-v.iml" filepath="$PROJECT_DIR$/v/GuiLinGL-v.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/adapter/adapter.iml" filepath="$PROJECT_DIR$/adapter/adapter.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/app/app.iml" filepath="$PROJECT_DIR$/app/app.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/color/color.iml" filepath="$PROJECT_DIR$/color/color.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/gl/gl.iml" filepath="$PROJECT_DIR$/gl/gl.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/rv/rv.iml" filepath="$PROJECT_DIR$/rv/rv.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/tb/tb.iml" filepath="$PROJECT_DIR$/tb/tb.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/v/v.iml" filepath="$PROJECT_DIR$/v/v.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RunConfigurationProducerService">
|
||||
<option name="ignoredProducers">
|
||||
<set>
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
|
||||
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
|
||||
</set>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1 @@
|
||||
/build
|
@ -0,0 +1,38 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 26
|
||||
defaultConfig {
|
||||
applicationId "com.fly.guilingl"
|
||||
minSdkVersion 16
|
||||
targetSdkVersion 26
|
||||
versionCode 1
|
||||
versionName "1.0"
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
release {
|
||||
minifyEnabled false
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
||||
implementation 'com.android.support:appcompat-v7:26.1.0'
|
||||
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
|
||||
testImplementation 'junit:junit:4.12'
|
||||
androidTestImplementation 'com.android.support.test:runner:1.0.2'
|
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
|
||||
androidTestCompile('com.android.support:support-annotations:26.1.0') { force = true }
|
||||
compile 'com.lzy.net:okgo:2.0.0'
|
||||
compile 'com.android.support:design:26.1.0'
|
||||
compile 'com.android.support:recyclerview-v7:26.1.0'
|
||||
compile 'com.android.support:cardview-v7:26.1.0'
|
||||
implementation files('libs/systembartint-1.0.4.jar')
|
||||
compile 'com.lzy.net:okgo:2.0.0'
|
||||
compile 'com.github.bumptech.glide:glide:3.6.1'
|
||||
compile 'de.hdodenhof:circleimageview:2.1.0'
|
||||
implementation 'cn.jzvd:jiaozivideoplayer:6.3.1'
|
||||
}
|
Binary file not shown.
@ -0,0 +1,21 @@
|
||||
# Add project specific ProGuard rules here.
|
||||
# You can control the set of applied configuration files using the
|
||||
# proguardFiles setting in build.gradle.
|
||||
#
|
||||
# For more details, see
|
||||
# http://developer.android.com/guide/developing/tools/proguard.html
|
||||
|
||||
# If your project uses WebView with JS, uncomment the following
|
||||
# and specify the fully qualified class name to the JavaScript interface
|
||||
# class:
|
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
|
||||
# public *;
|
||||
#}
|
||||
|
||||
# Uncomment this to preserve the line number information for
|
||||
# debugging stack traces.
|
||||
#-keepattributes SourceFile,LineNumberTable
|
||||
|
||||
# If you keep the line number information, uncomment this to
|
||||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
@ -0,0 +1,26 @@
|
||||
package com.fly.guilingl;
|
||||
|
||||
import android.content.Context;
|
||||
import android.support.test.InstrumentationRegistry;
|
||||
import android.support.test.runner.AndroidJUnit4;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Instrumented test, which will execute on an Android device.
|
||||
*
|
||||
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
||||
*/
|
||||
@RunWith(AndroidJUnit4.class)
|
||||
public class ExampleInstrumentedTest {
|
||||
@Test
|
||||
public void useAppContext() throws Exception {
|
||||
// Context of the app under test.
|
||||
Context appContext = InstrumentationRegistry.getTargetContext();
|
||||
|
||||
assertEquals("com.fly.guilingl", appContext.getPackageName());
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
package="com.fly.guilingl">
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
|
||||
<application
|
||||
android:name=".gloabal.MyApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_logo1"
|
||||
android:label="@string/app_name"
|
||||
android:roundIcon="@mipmap/ic_logo1"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/AppTheme">
|
||||
<activity android:name=".ui.activity.WenDaDetailActivity"></activity>
|
||||
<activity android:name=".ui.activity.SplashActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".ui.activity.CollectionActivity" />
|
||||
<activity android:name=".ui.activity.LoginActivity" />
|
||||
<activity android:name=".ui.activity.DetailActivity" />
|
||||
<activity android:name=".ui.activity.SearchGLActivity" />
|
||||
<activity
|
||||
android:name=".ui.activity.JinNangActivity"
|
||||
android:screenOrientation="portrait" />
|
||||
<activity android:name=".ui.activity.MyVideoActivity" />
|
||||
<activity android:name=".ui.activity.WenDaActivity" />
|
||||
<activity android:name=".ui.activity.GuideActivity" />
|
||||
<activity android:name=".ui.activity.MainActivity" />
|
||||
<activity android:name=".ui.activity.RegisterActivity" />
|
||||
<activity android:name=".ui.activity.CateLogActivity" />
|
||||
<activity android:name=".ui.activity.ShopDetailActivity3" />
|
||||
<activity android:name=".ui.activity.ConfirmActivity" />
|
||||
<activity android:name=".ui.activity.DingDanActivity" />
|
||||
<activity android:name=".ui.activity.ComentActivity" />
|
||||
<activity android:name=".ui.activity.TongZhiActivity" />
|
||||
<activity android:name=".ui.activity.SettingActivity" />
|
||||
<activity android:name=".ui.activity.HistoryActivity" />
|
||||
<activity android:name=".ui.activity.WeatherDetailActivity" />
|
||||
<activity android:name=".ui.activity.YouJiActivity" />
|
||||
<activity android:name=".ui.activity.WenDaEditorActivity" />
|
||||
<activity android:name=".ui.activity.YouJiEditorActivity" />
|
||||
<activity android:name=".ui.activity.TiWenActivity" />
|
||||
<activity android:name=".ui.activity.YouJiDetailActivity" />
|
||||
<activity android:name=".ui.activity.SetAccountPdActivity" />
|
||||
|
||||
<provider
|
||||
android:name=".provider.CollectProvider"
|
||||
android:authorities="com.fly.guilingl"
|
||||
android:exported="true"></provider>
|
||||
<provider
|
||||
android:name=".provider.HistoryProvider"
|
||||
android:authorities="com.fly.guilinglhistory"
|
||||
android:exported="true" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
@ -0,0 +1,30 @@
|
||||
package com.fly.guilingl.bean;
|
||||
|
||||
import android.database.Cursor;
|
||||
|
||||
/**
|
||||
* Created by Fly on 2017/3/3.
|
||||
*/
|
||||
|
||||
public class Collection {
|
||||
public static Collection createFromCursor(Cursor cursor) {
|
||||
Collection collection = new Collection();
|
||||
collection.url = cursor.getString(cursor.getColumnIndex("url"));
|
||||
collection.title = (cursor.getString(cursor.getColumnIndex("title")));
|
||||
collection.uniquekey = (cursor.getString(cursor.getColumnIndex("uniquekey")));
|
||||
collection.leibie = (cursor.getString(cursor.getColumnIndex("leibie")));
|
||||
collection.account = (cursor.getString(cursor.getColumnIndex("account")));
|
||||
collection.imageUrl = (cursor.getString(cursor.getColumnIndex("imageurl")));
|
||||
collection.time = (cursor.getString(cursor.getColumnIndex("time")));
|
||||
System.out.println("CollectionNews---->" + collection.title);
|
||||
return collection;
|
||||
}
|
||||
|
||||
public String url;
|
||||
public String title;
|
||||
public String uniquekey;
|
||||
public String leibie;
|
||||
public String account;
|
||||
public String imageUrl;
|
||||
public String time;
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.fly.guilingl.bean;
|
||||
|
||||
/**
|
||||
* Created by Fly on 2019/1/13/013.
|
||||
*/
|
||||
|
||||
public class DingDanBean {
|
||||
public String title;//商品的名字
|
||||
public String url;//商品的链接
|
||||
public String imageUrl;//商品的图片链接
|
||||
public String uniquekey;//商品的key
|
||||
public String leibie;//商品的类别
|
||||
public int amount;//商品的个数
|
||||
public String price;//商品的单价
|
||||
public String time;//购买商品的时间
|
||||
|
||||
|
||||
public String name;//商品所在的店铺
|
||||
public String place;//从哪出发
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.fly.guilingl.bean;
|
||||
|
||||
/**
|
||||
* Created by Administrator on 2019/1/4/004.
|
||||
*/
|
||||
|
||||
public class GrideData {
|
||||
|
||||
public static final int TYPE_LINEAR = 1;
|
||||
public static final int TYPE_GRIDE = 2;
|
||||
public int viewType = 1,spanCount=1;
|
||||
public String data;
|
||||
public String url;
|
||||
public String uniquekey;
|
||||
public GrideData(int viewType, String data,String url,String uniquekey) {
|
||||
this.viewType = viewType;
|
||||
this.data = data;
|
||||
this.url = url;
|
||||
this.uniquekey = uniquekey;
|
||||
if (viewType == TYPE_GRIDE) {
|
||||
spanCount = 1;
|
||||
} else {
|
||||
spanCount = 2;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.fly.guilingl.bean;
|
||||
|
||||
public class History {
|
||||
|
||||
public String account;
|
||||
public String uniquekey;
|
||||
public String url;
|
||||
public String title;
|
||||
public String leibie;
|
||||
public String imageUrl;
|
||||
public String time;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title + "--" + leibie + "--" + account;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.fly.guilingl.bean;
|
||||
|
||||
/**
|
||||
* Created by Fly on 2019/1/8/008.
|
||||
*/
|
||||
|
||||
public class HomeNextBean {
|
||||
private String title;
|
||||
|
||||
public HomeNextBean(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.fly.guilingl.bean;
|
||||
|
||||
/**
|
||||
* Created by Fly on 2017/12/13.
|
||||
*/
|
||||
|
||||
public class NewsData {
|
||||
public String author_name;//新闻
|
||||
public String category;//新闻类别
|
||||
public String date;//时间
|
||||
public String thumbnail_pic_s;//第一张图
|
||||
public String thumbnail_pic_s02;//第二张图
|
||||
public String thumbnail_pic_s03;//第三张图
|
||||
public String title;//名称
|
||||
public String uniquekey;//key
|
||||
public String url;//url
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.fly.guilingl.bean;
|
||||
|
||||
/**
|
||||
* Created by Fly on 2019/1/12/012.
|
||||
*/
|
||||
|
||||
public class ShopBean {
|
||||
public String imageurl;
|
||||
public String leibie;
|
||||
public String title;
|
||||
public String uniquekey;
|
||||
public String url;
|
||||
public String name;
|
||||
public String place;
|
||||
public String price;
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.fly.guilingl.bean;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
/**
|
||||
* Created by Fly on 2019/3/28/028.
|
||||
*/
|
||||
|
||||
public class WeatherBean {
|
||||
|
||||
public String current_pubTime;
|
||||
public String current_temperature;
|
||||
public String current_weather;
|
||||
public String current_feelsLike;//体感温度
|
||||
public String current_humidity;//相对空气湿度
|
||||
public String current_pressure;//气压
|
||||
|
||||
public String weather_from;
|
||||
public String weather_to;
|
||||
|
||||
public String temperature_from;
|
||||
public String temperature_to;
|
||||
|
||||
public String time;
|
||||
|
||||
public String weekDay;
|
||||
|
||||
public String str_pre;
|
||||
public String sunRiseSet_from;
|
||||
public String sunRiseSet_to;
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package com.fly.guilingl.bean;
|
||||
|
||||
public class WenDaBean {
|
||||
public String title;//名称
|
||||
public String url;//链接
|
||||
public String imageUrl;//图片链接
|
||||
public String uniquekey;//key
|
||||
public String leibie;//类别
|
||||
public String leibie2;//第二类别
|
||||
public String time;
|
||||
public String author;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title + "--" + url + "--" + imageUrl + "--" + uniquekey;
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
package com.fly.guilingl.bean;
|
||||
|
||||
/**
|
||||
* Created by Fly on 2019/1/10/010.
|
||||
*/
|
||||
|
||||
public class YouJiBean {
|
||||
|
||||
public String title;//名称
|
||||
public String url;//链接
|
||||
public String imageUrl;//图片链接
|
||||
public String uniquekey;//key
|
||||
public String leibie;//类别
|
||||
public String leibie2;//第二类别
|
||||
public String time;
|
||||
public String author;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return title + "--" + url + "--" + imageUrl + "--" + uniquekey;
|
||||
}
|
||||
}
|
@ -0,0 +1,49 @@
|
||||
package com.fly.guilingl.constant;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.fly.guilingl.R;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
/**
|
||||
* Created by Fly on 2019/1/10/010.
|
||||
*/
|
||||
|
||||
public class Data {
|
||||
/**
|
||||
* 从raw中读取txt
|
||||
*/
|
||||
public static String readFromRaw(Context context,int id) {
|
||||
try {
|
||||
//InputStream is = context.getResources().openRawResource(R.raw.videodata);
|
||||
InputStream is = context.getResources().openRawResource(id);
|
||||
String text = readTextFromSDcard(is);
|
||||
return text;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "没有读取到";
|
||||
}
|
||||
|
||||
/**
|
||||
* 按行读取txt
|
||||
*
|
||||
* @param is
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private static String readTextFromSDcard(InputStream is) throws Exception {
|
||||
InputStreamReader reader = new InputStreamReader(is);
|
||||
BufferedReader bufferedReader = new BufferedReader(reader);
|
||||
StringBuffer buffer = new StringBuffer("");
|
||||
String str;
|
||||
while ((str = bufferedReader.readLine()) != null) {
|
||||
buffer.append(str);
|
||||
buffer.append("\n");
|
||||
}
|
||||
return buffer.toString();
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue