├── .settings ├── org.eclipse.wst.jsdt.ui.superType.name ├── org.eclipse.wst.jsdt.ui.superType.container ├── org.eclipse.jdt.core.prefs ├── org.eclipse.wst.common.project.facet.core.xml ├── org.eclipse.wst.common.component └── .jsdtscope ├── image ├── 1.jpg ├── 2.jpg ├── 3.jpg ├── 4.jpg ├── 5.jpg ├── 6.jpg ├── 7.jpg ├── 8.jpg ├── 9.jpg └── 10.jpg ├── src ├── merchantInfo.properties ├── com │ └── gdp │ │ └── mooc │ │ ├── biz │ │ ├── IpsetBiz.java │ │ ├── MessageBiz.java │ │ ├── LogBiz.java │ │ ├── ReviewBiz.java │ │ ├── UserBiz.java │ │ ├── CourseBiz.java │ │ └── impl │ │ │ ├── IpsetBizImpl.java │ │ │ ├── MessageBizImpl.java │ │ │ ├── LogBizImpl.java │ │ │ ├── UserBizImpl.java │ │ │ ├── ReviewBizImpl.java │ │ │ └── CourseBizImpl.java │ │ ├── mapper │ │ ├── IpsetMapper.java │ │ ├── MessageMapper.java │ │ ├── ReviewMapper.java │ │ ├── LogMapper.java │ │ ├── UserMapper.java │ │ ├── CourseMapper.java │ │ ├── MessageMapper.xml │ │ ├── IpsetMapper.xml │ │ ├── LogMapper.xml │ │ ├── ReviewMapper.xml │ │ ├── CourseMapper.xml │ │ └── UserMapper.xml │ │ ├── entity │ │ ├── Message.java │ │ ├── Ipset.java │ │ ├── Log.java │ │ ├── Review.java │ │ ├── Course.java │ │ └── User.java │ │ ├── test │ │ └── Test.java │ │ └── controller │ │ ├── MainController.java │ │ ├── UserController.java │ │ └── AdminController.java ├── jdbc.properties ├── applicationContext.xml ├── spring_mvc.xml ├── MyBatisGeneratorConfig.xml └── UploadFile.java ├── .gitignore ├── .classpath ├── .project ├── README.md └── mooc.sql /.settings/org.eclipse.wst.jsdt.ui.superType.name: -------------------------------------------------------------------------------- 1 | Window -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.jsdt.ui.superType.container: -------------------------------------------------------------------------------- 1 | org.eclipse.wst.jsdt.launching.baseBrowserLibrary -------------------------------------------------------------------------------- /image/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No221Online-video-education-website/HEAD/image/1.jpg -------------------------------------------------------------------------------- /image/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No221Online-video-education-website/HEAD/image/2.jpg -------------------------------------------------------------------------------- /image/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No221Online-video-education-website/HEAD/image/3.jpg -------------------------------------------------------------------------------- /image/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No221Online-video-education-website/HEAD/image/4.jpg -------------------------------------------------------------------------------- /image/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No221Online-video-education-website/HEAD/image/5.jpg -------------------------------------------------------------------------------- /image/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No221Online-video-education-website/HEAD/image/6.jpg -------------------------------------------------------------------------------- /image/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No221Online-video-education-website/HEAD/image/7.jpg -------------------------------------------------------------------------------- /image/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No221Online-video-education-website/HEAD/image/8.jpg -------------------------------------------------------------------------------- /image/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No221Online-video-education-website/HEAD/image/9.jpg -------------------------------------------------------------------------------- /image/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nature924/No221Online-video-education-website/HEAD/image/10.jpg -------------------------------------------------------------------------------- /src/merchantInfo.properties: -------------------------------------------------------------------------------- 1 | p1_MerId=10001126856 2 | keyValue=69cl522AV6q613Ii4W6u8K6XuW8vM1N6bFgyv769220IuYe9u37N4y7rI4Pl -------------------------------------------------------------------------------- /src/com/gdp/mooc/biz/IpsetBiz.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.biz; 2 | 3 | import java.util.List; 4 | 5 | import com.gdp.mooc.entity.Ipset; 6 | 7 | public interface IpsetBiz { 8 | List select(); 9 | Ipset selectip(String ip); 10 | int insert(Ipset ipset); 11 | int updateByPrimaryKeySelective(Ipset ipset); 12 | } 13 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/mapper/IpsetMapper.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.gdp.mooc.entity.Ipset; 6 | 7 | public interface IpsetMapper { 8 | List select(); 9 | Ipset selectip(String ip); 10 | int insert(Ipset ipset); 11 | int updateByPrimaryKeySelective(Ipset ipset); 12 | } 13 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/biz/MessageBiz.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.biz; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import com.gdp.mooc.entity.Message; 7 | 8 | public interface MessageBiz { 9 | int delete(Message record); 10 | Message select(Message record); 11 | int insert(Message record); 12 | List selectmy(String userid); 13 | } 14 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/mapper/MessageMapper.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.mapper; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import com.gdp.mooc.entity.Message; 7 | 8 | public interface MessageMapper { 9 | int delete(Message record); 10 | Message select(Message record); 11 | int insert(Message record); 12 | List selectMy(String userid); 13 | } 14 | -------------------------------------------------------------------------------- /src/jdbc.properties: -------------------------------------------------------------------------------- 1 | jdbc_driver=com.mysql.jdbc.Driver 2 | jdbc_url=jdbc:mysql://localhost:3306/mooc 3 | jdbc_user=root 4 | jdbc_password=123456 5 | 6 | #generator config 7 | 8 | project=C:/Users/Administrator/Desktop/mooc/src 9 | entity=com.gdp.mooc.entity 10 | dao=com.gdp.mooc.mapper 11 | driverPath=C:/Users/Administrator/Desktop/mooc/WebContent/WEB-INF/lib/mysql-connector-java-5.0.4-bin.jar 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | /build/ 25 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 | org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 4 | org.eclipse.jdt.core.compiler.compliance=1.7 5 | org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 6 | org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 7 | org.eclipse.jdt.core.compiler.source=1.7 8 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/mapper/ReviewMapper.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.mapper; 2 | 3 | 4 | 5 | import java.util.List; 6 | 7 | import com.gdp.mooc.entity.Review; 8 | 9 | public interface ReviewMapper { 10 | List select(int courseid); 11 | int delete(Review review); 12 | int insert(Review review); 13 | List selectbyuserid(String username); 14 | int updateByPrimaryKeySelective(Review review); 15 | } 16 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/biz/LogBiz.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.biz; 2 | 3 | import java.util.List; 4 | 5 | import com.gdp.mooc.entity.Log; 6 | 7 | public interface LogBiz { 8 | List select(); 9 | List selectadminlog(); 10 | List selectbyusername(String username); 11 | List selectadminlogbyusername(String username); 12 | int insert(Log log); 13 | int updateByPrimaryKeySelective(Log log); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.project.facet.core.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/mapper/LogMapper.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.gdp.mooc.entity.Log; 6 | 7 | public interface LogMapper { 8 | List select(); 9 | List selectadminlog(); 10 | List selectbyusername(String username); 11 | List selectadminlogbyusername(String username); 12 | int insert(Log log); 13 | int updateByPrimaryKeySelective(Log log); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/biz/ReviewBiz.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.biz; 2 | 3 | import java.util.List; 4 | 5 | import com.gdp.mooc.entity.Review; 6 | 7 | public interface ReviewBiz { 8 | List select(int courseid); 9 | int delete(Review review); 10 | int insert(Review review); 11 | String avglable(int courseid); 12 | List selectbyuserid(String username); 13 | int updateByPrimaryKeySelective(List reviews); 14 | } 15 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/entity/Message.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.entity; 2 | 3 | public class Message { 4 | private int courseid; 5 | private String userid; 6 | public int getCourseid() { 7 | return courseid; 8 | } 9 | public void setCourseid(int courseid) { 10 | this.courseid = courseid; 11 | } 12 | public String getUserid() { 13 | return userid; 14 | } 15 | public void setUserid(String userid) { 16 | this.userid = userid; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /.settings/org.eclipse.wst.common.component: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/biz/UserBiz.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.biz; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import com.gdp.mooc.entity.User; 7 | 8 | public interface UserBiz { 9 | int deleteByPrimaryKey(String id); 10 | User selectByPrimaryKey(String id); 11 | List selectAllUser(); 12 | public User selectLoginUser(Map map); 13 | public int selectUser(Map map); 14 | public int selectUser(String username); 15 | int insertSelective(User record); 16 | int updateByPrimaryKeySelective(User record); 17 | } 18 | -------------------------------------------------------------------------------- /.settings/.jsdtscope: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/biz/CourseBiz.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.biz; 2 | 3 | import java.util.List; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | import com.gdp.mooc.entity.Course; 8 | 9 | public interface CourseBiz { 10 | public List selectAllCourse(); 11 | Course selectByPrimaryKey(int id); 12 | int updateByPrimaryKeySelective(Course record); 13 | List coursesearch(String search); 14 | List freeCourse(); 15 | List vipCourse(); 16 | int deleteByPrimaryKey(String id); 17 | int savecourse(HttpServletRequest req); 18 | } 19 | -------------------------------------------------------------------------------- /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/mapper/UserMapper.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.mapper; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import com.gdp.mooc.entity.User; 7 | 8 | public interface UserMapper { 9 | List selectAllUser(); 10 | User selectLoginUser(Map map); 11 | int deleteByPrimaryKey(String id); 12 | 13 | int insert(User record); 14 | 15 | int insertSelective(User record); 16 | int selectByUserName(String username); 17 | User selectByPrimaryKey(String id); 18 | 19 | int updateByPrimaryKeySelective(User record); 20 | 21 | int updateByPrimaryKey(User record); 22 | } -------------------------------------------------------------------------------- /src/com/gdp/mooc/test/Test.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.test; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.context.support.ClassPathXmlApplicationContext; 8 | 9 | import com.gdp.mooc.biz.CourseBiz; 10 | import com.gdp.mooc.entity.User; 11 | import com.gdp.mooc.mapper.UserMapper; 12 | 13 | 14 | public class Test { 15 | @Autowired 16 | static CourseBiz cs; 17 | 18 | 19 | public static void ttt() { 20 | System.out.println(cs); 21 | } 22 | 23 | public static void main(String[] args) { 24 | ttt(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/mapper/CourseMapper.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.mapper; 2 | 3 | import java.util.List; 4 | 5 | import com.gdp.mooc.entity.Course; 6 | /** 7 | * 8 | * @author ccnoobs-杨祺晖 9 | * 10 | */ 11 | public interface CourseMapper { 12 | public List coursesearch(String scarch); 13 | public List selectAllCourse(); 14 | public List freecourse(); 15 | public List vipcourse(); 16 | Course selectlastcourse(); 17 | int deleteByPrimaryKey(String id); 18 | 19 | int insert(Course record); 20 | 21 | int insertSelective(Course record); 22 | 23 | Course selectByPrimaryKey(int id); 24 | 25 | int updateByPrimaryKeySelective(Course record); 26 | 27 | int updateByPrimaryKey(Course record); 28 | } -------------------------------------------------------------------------------- /src/com/gdp/mooc/entity/Ipset.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class Ipset { 6 | private String ip; 7 | private String type; 8 | private String mark; 9 | private Date firsttime; 10 | private Date bantime; 11 | private Date totime; 12 | public String getIp() { 13 | return ip; 14 | } 15 | public void setIp(String ip) { 16 | this.ip = ip; 17 | } 18 | public String getType() { 19 | return type; 20 | } 21 | public void setType(String type) { 22 | this.type = type; 23 | } 24 | public String getMark() { 25 | return mark; 26 | } 27 | public void setMark(String mark) { 28 | this.mark = mark; 29 | } 30 | public Date getFirsttime() { 31 | return firsttime; 32 | } 33 | public void setFirsttime(Date firsttime) { 34 | this.firsttime = firsttime; 35 | } 36 | public Date getBantime() { 37 | return bantime; 38 | } 39 | public void setBantime(Date bantime) { 40 | this.bantime = bantime; 41 | } 42 | public Date getTotime() { 43 | return totime; 44 | } 45 | public void setTotime(Date totime) { 46 | this.totime = totime; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/biz/impl/IpsetBizImpl.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.biz.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.gdp.mooc.biz.IpsetBiz; 9 | import com.gdp.mooc.entity.Ipset; 10 | import com.gdp.mooc.mapper.IpsetMapper; 11 | @Service(value="IpsetBiz") 12 | public class IpsetBizImpl implements IpsetBiz{ 13 | @Autowired 14 | IpsetMapper ipsetMapper; 15 | 16 | @Override 17 | public List select() { 18 | // TODO Auto-generated method stub 19 | return ipsetMapper.select(); 20 | } 21 | 22 | @Override 23 | public Ipset selectip(String ip) { 24 | // TODO Auto-generated method stub 25 | return ipsetMapper.selectip(ip); 26 | } 27 | 28 | @Override 29 | public int insert(Ipset ipset) { 30 | // TODO Auto-generated method stub 31 | return ipsetMapper.insert(ipset); 32 | } 33 | 34 | @Override 35 | public int updateByPrimaryKeySelective(Ipset ipset) { 36 | // TODO Auto-generated method stub 37 | return ipsetMapper.updateByPrimaryKeySelective(ipset); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/biz/impl/MessageBizImpl.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.biz.impl; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.gdp.mooc.biz.MessageBiz; 10 | import com.gdp.mooc.entity.Message; 11 | import com.gdp.mooc.mapper.MessageMapper; 12 | @Service(value="MessageBiz") 13 | public class MessageBizImpl implements MessageBiz { 14 | @Autowired 15 | MessageMapper messageMapper; 16 | 17 | @Override 18 | public int delete(Message record) { 19 | // TODO Auto-generated method stub 20 | return messageMapper.delete(record); 21 | } 22 | 23 | @Override 24 | public Message select(Message record) { 25 | // TODO Auto-generated method stub 26 | return messageMapper.select(record); 27 | } 28 | 29 | @Override 30 | public int insert(Message record) { 31 | // TODO Auto-generated method stub 32 | return messageMapper.insert(record); 33 | } 34 | 35 | @Override 36 | public List selectmy(String userid) { 37 | // TODO Auto-generated method stub 38 | return messageMapper.selectMy(userid); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/entity/Log.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.entity; 2 | 3 | import java.util.Date; 4 | 5 | 6 | 7 | public class Log { 8 | private int id; 9 | private String userid; 10 | private String username; 11 | private String type; 12 | private Date time; 13 | private String ip; 14 | private String executor; 15 | public int getId() { 16 | return id; 17 | } 18 | public void setId(int id) { 19 | this.id = id; 20 | } 21 | public String getUserid() { 22 | return userid; 23 | } 24 | public void setUserid(String userid) { 25 | this.userid = userid; 26 | } 27 | public String getUsername() { 28 | return username; 29 | } 30 | public void setUsername(String username) { 31 | this.username = username; 32 | } 33 | public String getType() { 34 | return type; 35 | } 36 | public void setType(String type) { 37 | this.type = type; 38 | } 39 | public Date getTime() { 40 | return time; 41 | } 42 | public void setTime(Date time) { 43 | this.time = time; 44 | } 45 | public String getIp() { 46 | return ip; 47 | } 48 | public void setIp(String ip) { 49 | this.ip = ip; 50 | } 51 | public String getExecutor() { 52 | return executor; 53 | } 54 | public void setExecutor(String executor) { 55 | this.executor = executor; 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/mapper/MessageMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | courseid, userid 10 | 11 | 16 | 21 | 22 | delete from message 23 | where courseid = #{courseid,jdbcType=INTEGER} and userid = #{userid} 24 | 25 | 26 | insert into message (courseid, userid) 27 | values (#{courseid,jdbcType=INTEGER}, #{userid,jdbcType=VARCHAR}) 28 | 29 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | mooc 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.wst.jsdt.core.javascriptValidator 10 | 11 | 12 | 13 | 14 | org.eclipse.jdt.core.javabuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.common.project.facet.core.builder 20 | 21 | 22 | 23 | 24 | org.eclipse.wst.validation.validationbuilder 25 | 26 | 27 | 28 | 29 | com.genuitec.eclipse.ast.deploy.core.DeploymentBuilder 30 | 31 | 32 | 33 | 34 | 35 | com.genuitec.eclipse.ast.deploy.core.deploymentnature 36 | org.eclipse.jem.workbench.JavaEMFNature 37 | org.eclipse.wst.common.modulecore.ModuleCoreNature 38 | org.eclipse.wst.common.project.facet.core.nature 39 | org.eclipse.jdt.core.javanature 40 | org.eclipse.wst.jsdt.core.jsNature 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/entity/Review.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class Review { 6 | private String reviewid; 7 | private String context; 8 | private String username; 9 | private int courseid; 10 | private Date time; 11 | private int lable; 12 | private String sex; 13 | private int vip; 14 | 15 | public String getSex() { 16 | return sex; 17 | } 18 | public void setSex(String sex) { 19 | this.sex = sex; 20 | } 21 | public int getVip() { 22 | return vip; 23 | } 24 | public void setVip(int vip) { 25 | this.vip = vip; 26 | } 27 | public String getReviewid() { 28 | return reviewid; 29 | } 30 | public void setReviewid(String reviewid) { 31 | this.reviewid = reviewid; 32 | } 33 | public String getContext() { 34 | return context; 35 | } 36 | public void setContext(String context) { 37 | this.context = context; 38 | } 39 | public String getUsername() { 40 | return username; 41 | } 42 | public void setUsername(String username) { 43 | this.username = username; 44 | } 45 | public int getCourseid() { 46 | return courseid; 47 | } 48 | public void setCourseid(int courseid) { 49 | this.courseid = courseid; 50 | } 51 | public Date getTime() { 52 | return time; 53 | } 54 | public void setTime(Date time) { 55 | this.time = time; 56 | } 57 | public int getLable() { 58 | return lable; 59 | } 60 | public void setLable(int lable) { 61 | this.lable = lable; 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/biz/impl/LogBizImpl.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.biz.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.gdp.mooc.biz.LogBiz; 9 | import com.gdp.mooc.entity.Log; 10 | import com.gdp.mooc.mapper.LogMapper; 11 | @Service(value="LogBiz") 12 | public class LogBizImpl implements LogBiz { 13 | @Autowired 14 | LogMapper logmapper; 15 | @Override 16 | public List select() { 17 | // TODO Auto-generated method stub 18 | return logmapper.select(); 19 | } 20 | 21 | @Override 22 | public List selectadminlog() { 23 | // TODO Auto-generated method stub 24 | return logmapper.selectadminlog(); 25 | } 26 | 27 | @Override 28 | public List selectbyusername(String username) { 29 | // TODO Auto-generated method stub 30 | return logmapper.selectbyusername(username); 31 | } 32 | 33 | @Override 34 | public int insert(Log log) { 35 | // TODO Auto-generated method stub 36 | return logmapper.insert(log); 37 | } 38 | 39 | @Override 40 | public int updateByPrimaryKeySelective(Log log) { 41 | // TODO Auto-generated method stub 42 | return logmapper.updateByPrimaryKeySelective(log); 43 | } 44 | 45 | @Override 46 | public List selectadminlogbyusername(String username) { 47 | // TODO Auto-generated method stub 48 | return logmapper.selectadminlogbyusername(username); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/spring_mvc.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 20 | 21 | 22 | 23 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 基于Springboot的在线视频教育网站系统 2 | = 3 | ### 完整代码获取地址:从戎源码网 ([https://armycodes.com/](https://armycodes.com/)) 4 | ### 作者微信:19941326836 QQ:952045282 5 | ### 承接计算机毕业设计、Java毕业设计、Python毕业设计、深度学习、机器学习 6 | ### 选题+开题报告+任务书+程序定制+安装调试+论文+答辩ppt 一条龙服务 7 | ### 所有选题地址https://github.com/nature924/allProject 8 | 9 | 一、项目介绍 10 | --- 11 | 基于SpringBoot框架的实现的在线视频教育网站系统,本系统共分为2个角色:系统管理员、用户,主要功能如下 12 | 13 | ### 【用户】: 14 | 1. 首页:用户可以浏览课程的推荐内容、热门内容、最新内容等,并可以进行课程搜索。 15 | 2. 会员中心:用户可以查看自己的会员信息,包括会员等级、到期时间等,并可以进行会员续费等操作。 16 | 3. 课程查找:用户可以根据关键词、课程分类等条件进行课程查找,并可以查看课程的详细信息。 17 | 4. 学习课程:用户可以选择并学习感兴趣的课程,包括观看视频、下载学习资料、查看课程讨论等。 18 | 5. 个人信息:用户可以查看和编辑自己的个人信息,包括头像、昵称、联系方式等。 19 | 6. 我的课程:用户可以查看自己已购买或正在学习的课程,包括课程名称、讲师、学习进度等。 20 | 21 | ### 【管理员】: 22 | 1. 用户管理:管理员可以管理网站的用户信息,包括查看用户列表、编辑用户信息和删除用户等操作。 23 | 2. 课程管理:管理员可以管理网站的课程信息,包括添加新的课程、编辑课程信息和删除课程等操作。 24 | 3. 日志管理:管理员可以查看网站的操作日志,包括用户的登录日志、课程的访问日志等,并可以进行导出和删除操作。 25 | 4. IP管理:管理员可以管理用户的IP地址,包括查看IP列表、封禁IP和解封IP等操作。 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 二、项目技术 35 | --- 36 | - 编程语言:Java 37 | - 数据库:MySQL 38 | - 项目管理工具:Maven 39 | - 前端技术:VUE、HTML、Jquery、Bootstrap 40 | - 后端技术:Spring、SpringMVC、MyBatis 41 | 42 | 三、运行环境 43 | --- 44 | - 操作系统:Windows、macOS都可以 45 | - JDK版本:JDK1.8以上都可以 46 | - 开发工具:IDEA、Ecplise、Myecplise都可以 47 | - 数据库: MySQL5.7以上都可以 48 | - Tomcat:任意版本都可以 49 | - Maven:任意版本都可以 50 | 51 | 四、运行截图 52 | --- 53 | 54 | ### 程序截图: 55 | ![image/1.png](image/1.jpg) 56 | ![image/1.png](image/2.jpg) 57 | ![image/1.png](image/3.jpg) 58 | ![image/1.png](image/4.jpg) 59 | ![image/1.png](image/5.jpg) 60 | ![image/1.png](image/6.jpg) 61 | ![image/1.png](image/7.jpg) 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/entity/Course.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.entity; 2 | 3 | public class Course { 4 | private int id; 5 | 6 | private String name; 7 | 8 | private String context; 9 | 10 | private String type; 11 | 12 | private String price; 13 | 14 | private String label; 15 | 16 | private String hour; 17 | 18 | public int getId() { 19 | return id; 20 | } 21 | 22 | public void setId(int id) { 23 | this.id = id ; 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public void setName(String name) { 31 | this.name = name == null ? null : name.trim(); 32 | } 33 | 34 | public String getContext() { 35 | return context; 36 | } 37 | 38 | public void setContext(String context) { 39 | this.context = context == null ? null : context.trim(); 40 | } 41 | 42 | public String getType() { 43 | return type; 44 | } 45 | 46 | public void setType(String type) { 47 | this.type = type == null ? null : type.trim(); 48 | } 49 | 50 | public String getPrice() { 51 | return price; 52 | } 53 | 54 | public void setPrice(String price) { 55 | this.price = price == null ? null : price.trim(); 56 | } 57 | 58 | public String getLabel() { 59 | return label; 60 | } 61 | 62 | public void setLabel(String label) { 63 | this.label = label == null ? null : label.trim(); 64 | } 65 | 66 | public String getHour() { 67 | return hour; 68 | } 69 | 70 | public void setHour(String hour) { 71 | this.hour = hour == null ? null : hour.trim(); 72 | } 73 | } -------------------------------------------------------------------------------- /src/com/gdp/mooc/biz/impl/UserBizImpl.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.biz.impl; 2 | 3 | import java.util.List; 4 | import java.util.Map; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Service; 8 | 9 | import com.gdp.mooc.biz.UserBiz; 10 | import com.gdp.mooc.entity.User; 11 | import com.gdp.mooc.mapper.UserMapper; 12 | @Service(value="UserBiz") 13 | public class UserBizImpl implements UserBiz{ 14 | @Autowired 15 | UserMapper userMapper; 16 | @Override 17 | public User selectLoginUser(Map map) { 18 | // TODO Auto-generated method stub 19 | return userMapper.selectLoginUser(map); 20 | } 21 | @Override 22 | public int selectUser(Map map) { 23 | // TODO Auto-generated method stub 24 | User user = userMapper.selectLoginUser(map); 25 | if(user==null) 26 | return 0; 27 | else 28 | return 1; 29 | } 30 | @Override 31 | public int selectUser(String username) { 32 | 33 | return userMapper.selectByUserName(username); 34 | } 35 | @Override 36 | public int insertSelective(User record) { 37 | // TODO Auto-generated method stub 38 | return userMapper.insertSelective(record); 39 | } 40 | @Override 41 | public int updateByPrimaryKeySelective(User record) { 42 | // TODO Auto-generated method stub 43 | return userMapper.updateByPrimaryKeySelective(record); 44 | } 45 | @Override 46 | public List selectAllUser() { 47 | // TODO Auto-generated method stub 48 | return userMapper.selectAllUser(); 49 | } 50 | @Override 51 | public User selectByPrimaryKey(String id) { 52 | // TODO Auto-generated method stub 53 | return userMapper.selectByPrimaryKey(id); 54 | } 55 | @Override 56 | public int deleteByPrimaryKey(String id) { 57 | // TODO Auto-generated method stub 58 | return userMapper.deleteByPrimaryKey(id); 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/biz/impl/ReviewBizImpl.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.biz.impl; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.gdp.mooc.biz.ReviewBiz; 9 | import com.gdp.mooc.entity.Review; 10 | import com.gdp.mooc.mapper.ReviewMapper; 11 | @Service(value="ReviewBiz") 12 | public class ReviewBizImpl implements ReviewBiz{ 13 | @Autowired 14 | ReviewMapper ReviewMapper; 15 | @Override 16 | public List select(int courseid) { 17 | // TODO Auto-generated method stub 18 | return ReviewMapper.select(courseid); 19 | } 20 | 21 | @Override 22 | public int delete(Review review) { 23 | // TODO Auto-generated method stub 24 | return ReviewMapper.delete(review); 25 | } 26 | 27 | @Override 28 | public int insert(Review review) { 29 | // TODO Auto-generated method stub 30 | return ReviewMapper.insert(review); 31 | } 32 | 33 | @Override 34 | public String avglable(int courseid) {//返回平均评价 35 | // TODO Auto-generated method stub 36 | int a=0; 37 | List reviews = ReviewMapper.select(courseid); 38 | for(Review review:reviews){ 39 | a+=review.getLable(); 40 | } 41 | a/=reviews.size()+1; 42 | if(a<1.5){ 43 | return "一般"; 44 | }else 45 | if(a<2.5){ 46 | return "还行"; 47 | }else 48 | if(a<3.5){ 49 | return "不错"; 50 | }else 51 | return "非常好"; 52 | } 53 | 54 | @Override 55 | public List selectbyuserid(String username) { 56 | // TODO Auto-generated method stub 57 | return ReviewMapper.selectbyuserid(username); 58 | } 59 | 60 | @Override 61 | public int updateByPrimaryKeySelective(List reviews) { 62 | // TODO Auto-generated method stub 63 | for(Review review:reviews){ 64 | ReviewMapper.updateByPrimaryKeySelective(review); 65 | } 66 | return 0; 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/biz/impl/CourseBizImpl.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.biz.impl; 2 | 3 | import java.util.List; 4 | 5 | import javax.servlet.http.HttpServletRequest; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.gdp.mooc.biz.CourseBiz; 11 | import com.gdp.mooc.entity.Course; 12 | import com.gdp.mooc.mapper.CourseMapper; 13 | import com.gdp.mooc.util.UploadFile; 14 | @Service(value="CourseBiz") 15 | public class CourseBizImpl implements CourseBiz{ 16 | @Autowired 17 | CourseMapper courseMapper; 18 | @Override 19 | public List selectAllCourse() { 20 | // TODO Auto-generated method stub 21 | return courseMapper.selectAllCourse(); 22 | } 23 | @Override 24 | public Course selectByPrimaryKey(int id) { 25 | // TODO Auto-generated method stub 26 | return courseMapper.selectByPrimaryKey(id); 27 | } 28 | @Override 29 | public int updateByPrimaryKeySelective(Course record) { 30 | // TODO Auto-generated method stub 31 | return courseMapper.updateByPrimaryKeySelective(record); 32 | } 33 | @Override 34 | public List coursesearch(String search) { 35 | // TODO Auto-generated method stub 36 | return courseMapper.coursesearch(search); 37 | } 38 | @Override 39 | public List freeCourse() { 40 | // TODO Auto-generated method stub 41 | return courseMapper.freecourse(); 42 | } 43 | @Override 44 | public List vipCourse() { 45 | // TODO Auto-generated method stub 46 | return courseMapper.vipcourse(); 47 | } 48 | @Override 49 | public int deleteByPrimaryKey(String id) { 50 | // TODO Auto-generated method stub 51 | return courseMapper.deleteByPrimaryKey(id); 52 | } 53 | @Override 54 | public int savecourse(HttpServletRequest req) { 55 | // TODO Auto-generated method stub 56 | int maxid = courseMapper.selectlastcourse().getId(); 57 | Course course = (Course) UploadFile.uploadFile(String.valueOf(maxid), req); 58 | if(course.getId()==0) { 59 | course.setId(maxid+1); 60 | courseMapper.insertSelective(course); 61 | /*System.out.println(course.getId());*/ 62 | }else { 63 | courseMapper.updateByPrimaryKeySelective(course); 64 | } 65 | return 0; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /src/MyBatisGeneratorConfig.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 55 | 60 | 61 |
62 | 67 |
68 |
69 |
-------------------------------------------------------------------------------- /src/com/gdp/mooc/mapper/IpsetMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | ip,type, mark,firsttime,bantime,totime 14 | 15 | 16 | 21 | 22 | 26 | 27 | insert into Ipset 28 | 29 | ip, 30 | 31 | type, 32 | 33 | 34 | mark, 35 | 36 | firsttime, 37 | 38 | bantime, 39 | 40 | 41 | totime, 42 | 43 | 44 | 45 | #{ip,jdbcType=VARCHAR}, 46 | 47 | #{type,jdbcType=VARCHAR}, 48 | 49 | 50 | #{mark,jdbcType=VARCHAR}, 51 | 52 | now(), 53 | 54 | #{bantime,jdbcType=TIMESTAMP}, 55 | 56 | 57 | #{totime,jdbcType=TIMESTAMP}, 58 | 59 | 60 | 61 | 62 | update Ipset 63 | 64 | 65 | mark = #{mark,jdbcType=VARCHAR}, 66 | 67 | 68 | type = #{type,jdbcType=VARCHAR}, 69 | 70 | 71 | firsttime = #{firsttime,jdbcType=TIMESTAMP}, 72 | 73 | 74 | bantime = #{bantime,jdbcType=TIMESTAMP}, 75 | 76 | 77 | totime = #{totime,jdbcType=TIMESTAMP}, 78 | 79 | 80 | where ip = #{ip,jdbcType=INTEGER} 81 | 82 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/mapper/LogMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | id,userid, username,type,ip,time,executor 15 | 16 | 17 | 22 | 27 | 32 | 37 | 38 | delete from log 39 | where id = #{id,jdbcType=INTEGER} 40 | 41 | 42 | insert into log 43 | 44 | 45 | userid, 46 | 47 | 48 | username, 49 | 50 | 51 | type, 52 | 53 | 54 | ip, 55 | 56 | time, 57 | 58 | executor, 59 | 60 | 61 | 62 | 63 | #{userid,jdbcType=VARCHAR}, 64 | 65 | 66 | #{username,jdbcType=VARCHAR}, 67 | 68 | 69 | #{type,jdbcType=VARCHAR}, 70 | 71 | 72 | #{ip,jdbcType=VARCHAR}, 73 | 74 | now(), 75 | 76 | #{executor,jdbcType=VARCHAR}, 77 | 78 | 79 | 80 | 81 | update log 82 | 83 | 84 | username = #{username,jdbcType=VARCHAR}, 85 | 86 | 87 | type = #{type,jdbcType=VARCHAR}, 88 | 89 | 90 | ip = #{ip,jdbcType=VARCHAR}, 91 | 92 | 93 | time = #{time,jdbcType=TIMESTAMP}, 94 | 95 | 96 | executor = #{executor,jdbcType=VARCHAR}, 97 | 98 | 99 | where id = #{id,jdbcType=INTEGER} 100 | 101 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/entity/User.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.entity; 2 | 3 | import java.util.Date; 4 | 5 | public class User { 6 | private String id; 7 | 8 | private String sex; 9 | 10 | private String phone; 11 | 12 | private String mail; 13 | 14 | private String vx; 15 | 16 | private String nickname; 17 | 18 | private String username; 19 | 20 | private String password; 21 | 22 | private String mission; 23 | 24 | private String buycase; 25 | 26 | private String mycase; 27 | 28 | private int collect; 29 | 30 | private String education; 31 | 32 | public String getSex() { 33 | return sex; 34 | } 35 | 36 | public void setSex(String sex) { 37 | this.sex = sex == null ? null : sex.trim(); 38 | } 39 | 40 | public Date getFristtime() { 41 | return fristtime; 42 | } 43 | 44 | public void setFristtime(Date fristtime) { 45 | this.fristtime = fristtime; 46 | } 47 | 48 | private Date vip; 49 | 50 | private Date fristtime; 51 | 52 | public String getId() { 53 | return id; 54 | } 55 | 56 | public void setId(String id) { 57 | this.id = id == null ? null : id.trim(); 58 | } 59 | 60 | public String getPhone() { 61 | return phone; 62 | } 63 | 64 | public void setPhone(String phone) { 65 | this.phone = phone == null ? null : phone.trim(); 66 | } 67 | 68 | public String getMail() { 69 | return mail; 70 | } 71 | 72 | public void setMail(String mail) { 73 | this.mail = mail == null ? null : mail.trim(); 74 | } 75 | 76 | public String getVx() { 77 | return vx; 78 | } 79 | 80 | public void setVx(String vx) { 81 | this.vx = vx == null ? null : vx.trim(); 82 | } 83 | 84 | public String getNickname() { 85 | return nickname; 86 | } 87 | 88 | public void setNickname(String nickname) { 89 | this.nickname = nickname == null ? null : nickname.trim(); 90 | } 91 | 92 | public String getUsername() { 93 | return username; 94 | } 95 | 96 | public void setUsername(String username) { 97 | this.username = username == null ? null : username.trim(); 98 | } 99 | 100 | public String getPassword() { 101 | return password; 102 | } 103 | 104 | public void setPassword(String password) { 105 | this.password = password == null ? null : password.trim(); 106 | } 107 | 108 | public String getMission() { 109 | return mission; 110 | } 111 | 112 | public void setMission(String mission) { 113 | this.mission = mission == null ? null : mission.trim(); 114 | } 115 | 116 | public String getBuycase() { 117 | return buycase; 118 | } 119 | 120 | public void setBuycase(String buycase) { 121 | this.buycase = buycase == null ? null : buycase.trim(); 122 | } 123 | 124 | public String getMycase() { 125 | return mycase; 126 | } 127 | 128 | public void setMycase(String mycase) { 129 | this.mycase = mycase == null ? null : mycase.trim(); 130 | } 131 | 132 | public int getCollect() { 133 | return collect; 134 | } 135 | 136 | public void setCollect(int collect) { 137 | this.collect = collect; 138 | } 139 | 140 | public String getEducation() { 141 | return education; 142 | } 143 | 144 | public void setEducation(String education) { 145 | this.education = education == null ? null : education.trim(); 146 | } 147 | 148 | public Date getVip() { 149 | return vip; 150 | } 151 | 152 | public void setVip(Date vip) { 153 | this.vip = vip; 154 | } 155 | } -------------------------------------------------------------------------------- /src/com/gdp/mooc/mapper/ReviewMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | reviewid,courseid, username,context,lable,time,sex,vip 16 | 17 | 18 | 23 | 28 | 29 | delete from review 30 | where courseid = #{courseid,jdbcType=INTEGER} 31 | 32 | 33 | insert into review 34 | 35 | 36 | reviewid, 37 | 38 | 39 | courseid, 40 | 41 | 42 | username, 43 | 44 | 45 | context, 46 | 47 | 48 | lable, 49 | 50 | time, 51 | 52 | sex, 53 | 54 | 55 | vip, 56 | 57 | 58 | 59 | 60 | #{reviewid,jdbcType=VARCHAR}, 61 | 62 | 63 | #{courseid,jdbcType=INTEGER}, 64 | 65 | 66 | #{username,jdbcType=VARCHAR}, 67 | 68 | 69 | #{context,jdbcType=VARCHAR}, 70 | 71 | 72 | #{lable,jdbcType=VARCHAR}, 73 | 74 | now(), 75 | 76 | #{sex,jdbcType=VARCHAR}, 77 | 78 | 79 | #{vip,jdbcType=INTEGER}, 80 | 81 | 82 | 83 | 84 | update review 85 | 86 | 87 | 88 | courseid = #{courseid,jdbcType=INTEGER}, 89 | 90 | 91 | username = #{username,jdbcType=VARCHAR}, 92 | 93 | 94 | context = #{context,jdbcType=VARCHAR}, 95 | 96 | 97 | lable = #{lable,jdbcType=VARCHAR}, 98 | 99 | 100 | time = #{time,jdbcType=VARCHAR}, 101 | 102 | 103 | sex = #{sex,jdbcType=VARCHAR}, 104 | 105 | 106 | vip = #{vip,jdbcType=INTEGER}, 107 | 108 | 109 | where reviewid = #{reviewid,jdbcType=TIMESTAMP} 110 | 111 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/mapper/CourseMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | id, name, context, type, price, label, hour 15 | 16 | 19 | 24 | 29 | 36 | 40 | 46 | 47 | delete from course 48 | where id = #{id,jdbcType=INTEGER} 49 | 50 | 51 | insert into course (id, name, context, 52 | type, price, label, 53 | hour) 54 | values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{context,jdbcType=VARCHAR}, 55 | #{type,jdbcType=VARCHAR}, #{price,jdbcType=VARCHAR}, #{label,jdbcType=VARCHAR}, 56 | #{hour,jdbcType=CHAR}) 57 | 58 | 59 | insert into course 60 | 61 | 62 | id, 63 | 64 | 65 | name, 66 | 67 | 68 | context, 69 | 70 | 71 | type, 72 | 73 | 74 | price, 75 | 76 | 77 | label, 78 | 79 | 80 | hour, 81 | 82 | 83 | 84 | 85 | #{id,jdbcType=VARCHAR}, 86 | 87 | 88 | #{name,jdbcType=VARCHAR}, 89 | 90 | 91 | #{context,jdbcType=VARCHAR}, 92 | 93 | 94 | #{type,jdbcType=VARCHAR}, 95 | 96 | 97 | #{price,jdbcType=VARCHAR}, 98 | 99 | 100 | #{label,jdbcType=VARCHAR}, 101 | 102 | 103 | #{hour,jdbcType=CHAR}, 104 | 105 | 106 | 107 | 108 | update course 109 | 110 | 111 | name = #{name,jdbcType=VARCHAR}, 112 | 113 | 114 | context = #{context,jdbcType=VARCHAR}, 115 | 116 | 117 | type = #{type,jdbcType=VARCHAR}, 118 | 119 | 120 | price = #{price,jdbcType=VARCHAR}, 121 | 122 | 123 | label = #{label,jdbcType=VARCHAR}, 124 | 125 | 126 | hour = #{hour,jdbcType=CHAR}, 127 | 128 | 129 | where id = #{id,jdbcType=INTEGER} 130 | 131 | 132 | update course 133 | set name = #{name,jdbcType=VARCHAR}, 134 | context = #{context,jdbcType=VARCHAR}, 135 | type = #{type,jdbcType=VARCHAR}, 136 | price = #{price,jdbcType=VARCHAR}, 137 | label = #{label,jdbcType=VARCHAR}, 138 | hour = #{hour,jdbcType=CHAR} 139 | where id = #{id,jdbcType=INTEGER} 140 | 141 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/controller/MainController.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.controller; 2 | 3 | import java.awt.Image; 4 | import java.io.File; 5 | import java.io.IOException; 6 | import java.io.PrintWriter; 7 | import java.text.SimpleDateFormat; 8 | import java.util.Date; 9 | import java.util.List; 10 | import java.util.HashMap; 11 | import java.util.Map; 12 | import java.util.Random; 13 | 14 | import javax.servlet.ServletException; 15 | import javax.servlet.http.HttpServletRequest; 16 | import javax.servlet.http.HttpServletResponse; 17 | import javax.servlet.http.HttpSession; 18 | import javax.xml.crypto.Data; 19 | 20 | import org.springframework.beans.factory.annotation.Autowired; 21 | import org.springframework.stereotype.Controller; 22 | import org.springframework.web.bind.annotation.RequestMapping; 23 | 24 | import com.gdp.mooc.biz.*; 25 | import com.gdp.mooc.entity.Course; 26 | import com.gdp.mooc.entity.Log; 27 | import com.gdp.mooc.entity.Review; 28 | import com.gdp.mooc.entity.User; 29 | import com.gdp.mooc.util.DateUtil; 30 | import com.gdp.mooc.util.NubmerToJpgUtil; 31 | import com.gdp.mooc.util.UploadFile; 32 | @Controller 33 | public class MainController { 34 | @Autowired 35 | UserBiz userBiz; 36 | @Autowired 37 | CourseBiz courseBiz; 38 | @Autowired 39 | ReviewBiz reviewBiz; 40 | @Autowired 41 | MessageBiz messageBiz; 42 | @Autowired 43 | LogBiz logBiz; 44 | public void setlog(User loginUser, String ip, String type) { 45 | Log log = new Log(); 46 | log.setUserid(loginUser.getId()); 47 | log.setUsername(loginUser.getUsername()); 48 | log.setIp(ip); 49 | log.setType(type); 50 | logBiz.insert(log); 51 | } 52 | @RequestMapping(value = "varcodecheck")//验证码验证 53 | public void varcodecheck(String varcode,HttpSession session,HttpServletResponse res) throws IOException { 54 | res.setCharacterEncoding("utf-8"); 55 | PrintWriter pw = res.getWriter(); 56 | String var = (String) session.getAttribute("varcodenumber"); 57 | if(!var.equals(varcode)){ 58 | pw.write("0"); 59 | } 60 | } 61 | 62 | @RequestMapping(value = "changevarcode")//更换验证码,验证码显示 63 | public void changevarcode(HttpSession session,HttpServletResponse res) throws IOException { 64 | 65 | /*String url=req.getServletContext().getRealPath("/varcodeimg")+"\\"+varcodeurl+".jpg";*/ 66 | 67 | //验证码生成 varcodenumber为验证码的值 68 | /* url=req.getServletContext().getRealPath("/varcodeimg")+"\\"+varcodeurl+".jpg";*/ 69 | //写出到response的输出流中 70 | String varcodenumber = NubmerToJpgUtil.NumberToJpgUtil(res.getOutputStream()); 71 | session.setAttribute("varcodenumber",varcodenumber); 72 | 73 | } 74 | 75 | @RequestMapping(value = "admin")//管理员登录入口 76 | public String admin(HttpSession session) { 77 | return "loginadmin"; 78 | } 79 | 80 | @RequestMapping(value = "index") 81 | public String index(HttpSession session,HttpServletRequest req) { 82 | User loginUser = (User) session.getAttribute("loginUser"); 83 | List freecourses = courseBiz.freeCourse(); 84 | List vipcourses = courseBiz.vipCourse(); 85 | session.setAttribute("freecourses", freecourses); 86 | session.setAttribute("vipcourses", vipcourses); 87 | return "index"; 88 | } 89 | 90 | @RequestMapping(value = "subreview") 91 | // 提交评论 92 | public String subreview(HttpSession session, Review review,HttpServletRequest req) { 93 | User loginUser = (User) session.getAttribute("loginUser"); 94 | if (loginUser == null) { 95 | return "login"; 96 | } 97 | int vip ; 98 | if(loginUser.getVip()!=null){ 99 | vip=1; 100 | }else{ 101 | vip=0; 102 | } 103 | Course course = new Course(); 104 | course.setId(review.getCourseid()); 105 | course.setLabel(reviewBiz.avglable(review.getCourseid())); 106 | courseBiz.updateByPrimaryKeySelective(course); 107 | review.setVip(vip); 108 | review.setSex(loginUser.getSex()); 109 | review.setReviewid(DateUtil.getId()); 110 | review.setUsername(loginUser.getUsername()); 111 | reviewBiz.insert(review); 112 | setlog(loginUser, req.getRemoteAddr(), "发表评论,在'"+courseBiz.selectByPrimaryKey(review.getCourseid()).getName() +"'"); 113 | return "redirect:coursevideo.do?courseid=" + review.getCourseid(); 114 | 115 | } 116 | 117 | @RequestMapping(value = "review") 118 | // 查看评论 119 | public String review(HttpSession session, int courseid) { 120 | List reviews = reviewBiz.select(courseid); 121 | session.setAttribute("reviews", reviews); 122 | return "redirect:coursevideo.do"; 123 | } 124 | 125 | @RequestMapping(value = "coursesearch") 126 | // 查找课程 127 | public String coursesearch(HttpSession session, String search, Map map) { 128 | System.out.println(search); 129 | List courses = courseBiz.coursesearch(search); 130 | map.remove(courses); 131 | map.put("courses", courses); 132 | map.put("search", search); 133 | return "courseindex"; 134 | } 135 | 136 | 137 | 138 | /*@RequestMapping(value="testfile") 139 | public String testfile(HttpSession session,HttpServletRequest request,HttpServletResponse response) { 140 | if(!UploadFile.uploadFile("20",request)) { 141 | session.setAttribute("message", "上传失败!"); 142 | } 143 | session.setAttribute("message", "上传成功!"); 144 | return "message"; 145 | }*/ 146 | 147 | 148 | } 149 | -------------------------------------------------------------------------------- /src/UploadFile.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.io.PrintWriter; 6 | import java.util.HashMap; 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | import javax.servlet.http.HttpServletRequest; 11 | import javax.servlet.http.HttpServletResponse; 12 | 13 | import org.apache.commons.fileupload.FileItem; 14 | import org.apache.commons.fileupload.disk.DiskFileItemFactory; 15 | import org.apache.commons.fileupload.servlet.ServletFileUpload; 16 | 17 | import com.gdp.mooc.entity.Course; 18 | /** 19 | * 文件上传包装类 20 | * jpg文件与其他文件分开存放 21 | * @author ccnoobs-杨祺晖 22 | * 23 | */ 24 | public class UploadFile { 25 | // 上传文件存储目录 26 | private static final String UPLOAD_DIRECTORY = "style\\video"; 27 | //上传图片存放位置 28 | private static final String UPLOADImage_DIRECTORY = "style\\image\\courses"; 29 | 30 | // 上传配置 31 | private static final int MEMORY_THRESHOLD = 1024 * 1024 * 3; // 3MB 32 | private static final int MAX_FILE_SIZE = 1024 * 1024 * 500; // 500MB 33 | private static final int MAX_REQUEST_SIZE = 1024 * 1024 * 500; // 500MB 34 | /** 35 | * 方法uploadFile("保存的文件名",HttpServletRequest,HttpServletResponse) 36 | * @param refilename 37 | * @param request 38 | * @param response 39 | * @return 40 | * @return 41 | */ 42 | public static Object uploadFile(String refilename,HttpServletRequest request){ 43 | /*//程序状态 44 | boolean isok = true;*/ 45 | // 检测是否为多媒体上传 46 | if (!ServletFileUpload.isMultipartContent(request)) { 47 | // 如果不是则停止 48 | System.err.println("Error: 表单必须包含 enctype=multipart/form-data"); 49 | /* PrintWriter writer = response.getWriter(); 50 | writer.println("Error: 表单必须包含 enctype=multipart/form-data"); 51 | writer.flush();*/ 52 | return null; 53 | } 54 | 55 | // 配置上传参数 56 | DiskFileItemFactory factory = new DiskFileItemFactory(); 57 | // 设置内存临界值 - 超过后将产生临时文件并存储于临时目录中 58 | factory.setSizeThreshold(MEMORY_THRESHOLD); 59 | // 设置临时存储目录 60 | factory.setRepository(new File(System.getProperty("java.io.tmpdir"))); 61 | 62 | ServletFileUpload upload = new ServletFileUpload(factory); 63 | 64 | // 设置最大文件上传值 65 | upload.setFileSizeMax(MAX_FILE_SIZE); 66 | 67 | // 设置最大请求值 (包含文件和表单数据) 68 | upload.setSizeMax(MAX_REQUEST_SIZE); 69 | 70 | // 中文处理 71 | upload.setHeaderEncoding("UTF-8"); 72 | 73 | // 构造临时路径来存储上传的文件 74 | // 这个路径相对当前应用的目录 75 | String uploadPath = request.getServletContext().getRealPath("./") + File.separator + UPLOAD_DIRECTORY; 76 | String uploadImagePath = request.getServletContext().getRealPath("./") + File.separator + UPLOADImage_DIRECTORY; 77 | 78 | 79 | // 如果目录不存在则创建 80 | File uploadDir = new File(uploadPath); 81 | File uploadImageDir = new File(uploadImagePath); 82 | if (!uploadDir.exists()) { 83 | uploadDir.mkdir(); 84 | } 85 | if (!uploadImageDir.exists()) { 86 | uploadImageDir.mkdir(); 87 | } 88 | Map pmap = new HashMap<>(); 89 | Course course = new Course(); 90 | 91 | try { 92 | // 解析请求的内容提取文件数据 93 | @SuppressWarnings("unchecked") 94 | List formItems = upload.parseRequest(request); 95 | 96 | if (formItems != null && formItems.size() > 0) { 97 | // 迭代表单数据 98 | for (FileItem item : formItems) { 99 | // 处理在表单中的字段 100 | if(item.isFormField()) { 101 | pmap.put(item.getFieldName(), item.getString("utf-8")); 102 | } 103 | 104 | } 105 | if(pmap.get("id")==null||pmap.get("id").equals("")) { 106 | refilename = String.valueOf(Integer.parseInt(refilename)+1); 107 | 108 | }else { 109 | refilename = pmap.get("id"); 110 | /*System.out.println(pmap.get("id"));*/ 111 | } 112 | for (FileItem item : formItems) { 113 | // 处理不在表单中的字段 114 | if (!item.isFormField()) { 115 | String fileName = new File(item.getName()).getName(); 116 | String fileExtName = fileName.substring(fileName.lastIndexOf(".")+1); 117 | String filePath = uploadPath + File.separator + refilename+"."+fileExtName; 118 | if(fileExtName.equals("jpg")) { 119 | filePath = uploadImagePath + File.separator + refilename+"."+fileExtName; 120 | } 121 | File storeFile = new File(filePath); 122 | // 在控制台输出文件的上传路径 123 | System.out.println(filePath); 124 | // 保存文件到硬盘 125 | item.write(storeFile); 126 | System.out.println("文件上传成功!"); 127 | /*request.setAttribute("message", 128 | "文件上传成功!");*/ 129 | } 130 | } 131 | } 132 | } catch (Exception ex) { 133 | System.err.println( "错误信息: " + ex.getMessage()); 134 | /* request.setAttribute("message", 135 | "错误信息: " + ex.getMessage());*/ 136 | } 137 | if(pmap.get("id")!=null&&!pmap.get("id").equals("")) { 138 | course.setId(Integer.parseInt(pmap.get("id"))); 139 | } 140 | course.setName(pmap.get("name")); 141 | course.setContext(pmap.get("context")); 142 | course.setType(pmap.get("type")); 143 | course.setPrice("1"); 144 | return course; 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/mapper/UserMapper.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | id, phone, mail, vx, sex, nickname, username, password, mission, buycase, mycase, collect, 23 | education, vip,fristtime 24 | 25 | 26 | 31 | 32 | 38 | 43 | 49 | 50 | delete from user 51 | where id = #{id,jdbcType=VARCHAR} 52 | 53 | 54 | insert into user (id, phone, mail, 55 | vx, nickname, username, 56 | password, mission, buycase, 57 | mycase, collect, education, 58 | vip) 59 | values (#{id,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{mail,jdbcType=VARCHAR}, 60 | #{vx,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, #{username,jdbcType=VARCHAR}, 61 | #{password,jdbcType=VARCHAR}, #{mission,jdbcType=VARCHAR}, #{buycase,jdbcType=VARCHAR}, 62 | #{mycase,jdbcType=VARCHAR}, #{collect,jdbcType=VARCHAR}, #{education,jdbcType=VARCHAR}, 63 | #{vip,jdbcType=TIMESTAMP}) 64 | 65 | 66 | insert into user 67 | 68 | 69 | id, 70 | 71 | 72 | sex, 73 | 74 | 75 | phone, 76 | 77 | 78 | mail, 79 | 80 | 81 | vx, 82 | 83 | 84 | nickname, 85 | 86 | 87 | username, 88 | 89 | 90 | password, 91 | 92 | 93 | mission, 94 | 95 | 96 | buycase, 97 | 98 | 99 | mycase, 100 | 101 | 102 | collect, 103 | 104 | 105 | education, 106 | 107 | 108 | vip, 109 | 110 | 111 | fristtime, 112 | 113 | 114 | 115 | 116 | #{id,jdbcType=VARCHAR}, 117 | 118 | 119 | #{sex,jdbcType=VARCHAR}, 120 | 121 | 122 | #{phone,jdbcType=VARCHAR}, 123 | 124 | 125 | #{mail,jdbcType=VARCHAR}, 126 | 127 | 128 | #{vx,jdbcType=VARCHAR}, 129 | 130 | 131 | #{nickname,jdbcType=VARCHAR}, 132 | 133 | 134 | #{username,jdbcType=VARCHAR}, 135 | 136 | 137 | #{password,jdbcType=VARCHAR}, 138 | 139 | 140 | #{mission,jdbcType=VARCHAR}, 141 | 142 | 143 | #{buycase,jdbcType=VARCHAR}, 144 | 145 | 146 | #{mycase,jdbcType=VARCHAR}, 147 | 148 | 149 | 500, 150 | 151 | 152 | #{education,jdbcType=VARCHAR}, 153 | 154 | 155 | #{vip,jdbcType=TIMESTAMP}, 156 | 157 | 158 | now(), 159 | 160 | 161 | 162 | 163 | update user 164 | 165 | 166 | phone = #{phone,jdbcType=VARCHAR}, 167 | 168 | 169 | mail = #{mail,jdbcType=VARCHAR}, 170 | 171 | 172 | vx = #{vx,jdbcType=VARCHAR}, 173 | 174 | 175 | sex = #{sex,jdbcType=VARCHAR}, 176 | 177 | 178 | nickname = #{nickname,jdbcType=VARCHAR}, 179 | 180 | 181 | 182 | password = #{password,jdbcType=VARCHAR}, 183 | 184 | 185 | mission = #{mission,jdbcType=VARCHAR}, 186 | 187 | 188 | buycase = #{buycase,jdbcType=VARCHAR}, 189 | 190 | 191 | mycase = #{mycase,jdbcType=VARCHAR}, 192 | 193 | 194 | collect = #{collect,jdbcType=VARCHAR}, 195 | 196 | 197 | education = #{education,jdbcType=VARCHAR}, 198 | 199 | 200 | vip = #{vip,jdbcType=TIMESTAMP}, 201 | 202 | 203 | where id = #{id,jdbcType=INTEGER} 204 | 205 | 206 | update user 207 | set phone = #{phone,jdbcType=VARCHAR}, 208 | mail = #{mail,jdbcType=VARCHAR}, 209 | vx = #{vx,jdbcType=VARCHAR}, 210 | sex = #{sex,jdbcType=VARCHAR}, 211 | nickname = #{nickname,jdbcType=VARCHAR}, 212 | username = #{username,jdbcType=VARCHAR}, 213 | password = #{password,jdbcType=VARCHAR}, 214 | mission = #{mission,jdbcType=VARCHAR}, 215 | buycase = #{buycase,jdbcType=VARCHAR}, 216 | mycase = #{mycase,jdbcType=VARCHAR}, 217 | collect = #{collect,jdbcType=VARCHAR}, 218 | education = #{education,jdbcType=VARCHAR}, 219 | vip = #{vip,jdbcType=TIMESTAMP} 220 | where id = #{id,jdbcType=INTEGER} 221 | 222 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.controller; 2 | 3 | /** 4 | * 杨祺晖 5 | * 2018.9.14 6 | * 591284209@qq.com 7 | */ 8 | import java.io.IOException; 9 | import java.io.PrintWriter; 10 | import java.util.ArrayList; 11 | import java.util.Date; 12 | import java.util.HashMap; 13 | import java.util.List; 14 | import java.util.Map; 15 | 16 | import javax.servlet.http.HttpServletRequest; 17 | import javax.servlet.http.HttpServletResponse; 18 | import javax.servlet.http.HttpSession; 19 | 20 | import org.springframework.beans.factory.annotation.Autowired; 21 | import org.springframework.stereotype.Controller; 22 | import org.springframework.web.bind.annotation.RequestMapping; 23 | 24 | import com.gdp.mooc.biz.CourseBiz; 25 | import com.gdp.mooc.biz.LogBiz; 26 | import com.gdp.mooc.biz.MessageBiz; 27 | import com.gdp.mooc.biz.ReviewBiz; 28 | import com.gdp.mooc.biz.UserBiz; 29 | import com.gdp.mooc.entity.*; 30 | import com.gdp.mooc.util.DateUtil; 31 | 32 | @Controller 33 | public class UserController { 34 | @Autowired 35 | UserBiz userBiz; 36 | @Autowired 37 | CourseBiz courseBiz; 38 | @Autowired 39 | MessageBiz messageBiz; 40 | @Autowired 41 | ReviewBiz reviewBiz; 42 | @Autowired 43 | LogBiz logBiz; 44 | 45 | /** 46 | * 普通日志写入 47 | * 48 | * @param loginUser 49 | * @param ip 50 | * @param type 51 | */ 52 | public void setlog(User loginUser, String ip, String type) { 53 | Log log = new Log(); 54 | log.setUserid(loginUser.getId()); 55 | log.setUsername(loginUser.getUsername()); 56 | log.setIp(ip); 57 | log.setType(type); 58 | logBiz.insert(log); 59 | } 60 | 61 | @RequestMapping(value = "login") 62 | public String login(User user, HttpSession session, HttpServletRequest req) { 63 | Map paramMap = new HashMap(); 64 | paramMap.put("username", user.getUsername()); 65 | paramMap.put("password", user.getPassword()); 66 | User loginUser = userBiz.selectLoginUser(paramMap); 67 | if (loginUser == null) { 68 | return "login"; 69 | } 70 | setlog(loginUser, req.getRemoteAddr(), "登录"); 71 | session.setAttribute("loginUser", loginUser); 72 | return "redirect:course.do"; 73 | } 74 | 75 | @RequestMapping(value = "logout") // 注销登出 76 | public String logout(String type, User user, HttpSession session, HttpServletRequest req) { 77 | User loginUser = (User) session.getAttribute("loginUser"); 78 | if (loginUser == null) { 79 | return "login"; 80 | } else { 81 | session.invalidate(); 82 | if (type == "admin") { 83 | setlog(loginUser, req.getRemoteAddr(), "管理员注销"); 84 | return "loginadmin"; 85 | } else 86 | setlog(loginUser, req.getRemoteAddr(), "注销"); 87 | return "redirect:index.do"; 88 | } 89 | } 90 | 91 | /* 92 | * ajax密码检查 93 | */ 94 | @RequestMapping(value = "passwordcheck") 95 | public void selectUser(User user, HttpSession session, HttpServletResponse response, HttpServletRequest req) 96 | throws IOException { 97 | Map paramMap = new HashMap(); 98 | paramMap.put("username", user.getUsername()); 99 | paramMap.put("password", user.getPassword()); 100 | response.setCharacterEncoding("utf-8"); 101 | PrintWriter out = response.getWriter(); 102 | if (userBiz.selectUser(paramMap) == 1) { 103 | if (!"admin".equals(userBiz.selectLoginUser(paramMap).getMission())) { 104 | if (userBiz.selectLoginUser(paramMap).getBuycase() != null) { 105 | if ("1".equals(userBiz.selectLoginUser(paramMap).getBuycase())) { 106 | out.println("3");// 屏蔽登录 107 | } else 108 | out.println("1");// 正常登录密码正确 109 | } else { 110 | out.println("1"); 111 | } 112 | } else { 113 | out.println("2");// 管理员返回 114 | } 115 | } else { 116 | Log log = new Log(); 117 | log.setIp(req.getRemoteAddr()); 118 | log.setType("尝试登录账号:" + user.getUsername() + ",密码错误"); 119 | logBiz.insert(log); 120 | out.println("0");//密码错误返回值 121 | } 122 | } 123 | 124 | @RequestMapping(value = "usercheck") 125 | // 注册检查 126 | public void Usercheck(String username, HttpSession session, HttpServletResponse response) throws IOException { 127 | response.setCharacterEncoding("utf-8"); 128 | PrintWriter out = response.getWriter(); 129 | int i = userBiz.selectUser(username); 130 | out.println(i); 131 | } 132 | 133 | @RequestMapping(value = "quickregist") 134 | // 快速注册 135 | public String insertUser(String varcode, User user, HttpSession session, HttpServletRequest req) { 136 | String id = DateUtil.getId(); 137 | String username = user.getUsername(); 138 | String revarcode = (String) session.getAttribute("varcodenumber"); 139 | if (varcode == null) { 140 | return "redirect:course.do"; 141 | } 142 | if (userBiz.selectUser(username) == 1 || !varcode.equals(revarcode)) { 143 | return "redirect:course.do"; 144 | } 145 | user.setId(id); 146 | user.setMission(null); 147 | user.setBuycase(null); 148 | user.setMycase(null); 149 | user.setVip(null); 150 | userBiz.insertSelective(user); 151 | session.setAttribute("loginUser", user); 152 | setlog(user, req.getRemoteAddr(), "快速注册"); 153 | return "redirect:course.do"; 154 | } 155 | 156 | @RequestMapping(value = "regist") 157 | // 注册 158 | public String regist(String varcode, User user, HttpSession session, HttpServletRequest req) { 159 | String id = DateUtil.getId(); 160 | String username = user.getUsername(); 161 | String revarcode = (String) session.getAttribute("varcodenumber"); 162 | if (varcode == null) { 163 | return "redirect:course.do"; 164 | } 165 | if (userBiz.selectUser(username) == 1 || !varcode.equals(revarcode)) { 166 | return "redirect:course.do"; 167 | } 168 | user.setId(id); 169 | user.setMission(null); 170 | user.setBuycase(null); 171 | user.setMycase(null); 172 | user.setVip(null); 173 | userBiz.insertSelective(user); 174 | setlog(user, req.getRemoteAddr(), "普通注册"); 175 | return "redirect:course.do"; 176 | } 177 | 178 | @RequestMapping(value = "showvip") 179 | // 会员中心 180 | public String showvip(HttpSession session) { 181 | User loginUser = (User) session.getAttribute("loginUser"); 182 | if (loginUser != null) { 183 | loginUser = userBiz.selectByPrimaryKey(loginUser.getId()); 184 | session.setAttribute("loginUser", loginUser); 185 | } 186 | return "vip"; 187 | } 188 | 189 | @RequestMapping(value = "mylearn") 190 | // 我的课程查询 191 | public String myCourse(HttpSession session, Map map) { 192 | User loginUser = (User) session.getAttribute("loginUser"); 193 | if (loginUser == null) { 194 | return "login"; 195 | } 196 | List courses = new ArrayList(); 197 | List messages = messageBiz.selectmy(loginUser.getId()); 198 | for (int i = 0; i < messages.size(); i++) { 199 | int a = messages.get(i).getCourseid(); 200 | Course course = courseBiz.selectByPrimaryKey(a); 201 | courses.add(course); 202 | } 203 | map.put("mycourses", courses); 204 | return "mylearn"; 205 | 206 | } 207 | 208 | @RequestMapping(value = "course") 209 | // 主页课程查询 210 | public String Course(HttpSession session, Map map) { 211 | List courses = courseBiz.selectAllCourse(); 212 | map.put("courses", courses); 213 | return "courseindex"; 214 | 215 | } 216 | 217 | @RequestMapping(value = "coursedetail") 218 | // 单课程主页 219 | public String Courseindex(int id, HttpSession session, Map map) { 220 | User loginUser = (User) session.getAttribute("loginUser"); 221 | if (loginUser == null) { 222 | return "login"; 223 | } 224 | Message message = new Message(); 225 | message.setCourseid(id); 226 | message.setUserid(loginUser.getId()); 227 | Message me = messageBiz.select(message); 228 | if (me == null) { 229 | map.put("isSelect", false); 230 | } else { 231 | map.put("isSelect", true); 232 | } 233 | Course course = courseBiz.selectByPrimaryKey(id); 234 | map.put("course", course); 235 | return "coursedetail"; 236 | 237 | } 238 | 239 | @RequestMapping(value = "coursevideo") 240 | // 单课程视屏 241 | public String Coursevideo(int courseid, HttpSession session, Map map) { 242 | User loginUser = (User) session.getAttribute("loginUser"); 243 | if (loginUser == null) { 244 | return "login"; 245 | } 246 | Course course = courseBiz.selectByPrimaryKey(courseid); 247 | if ("1".equals(course.getType())) { 248 | if (loginUser.getVip() == null) { 249 | return "vip"; 250 | } 251 | } 252 | map.put("course", course); 253 | List reviews = reviewBiz.select(courseid); 254 | map.put("reviews", reviews); 255 | return "coursevideo"; 256 | 257 | } 258 | 259 | @RequestMapping(value = "insertCourse") 260 | // 加入课程 261 | public void insertCourse(int courseid, String userid, HttpSession session, HttpServletRequest req, 262 | HttpServletResponse response) throws IOException { 263 | String result = "订阅成功!"; 264 | User user = (User) session.getAttribute("loginUser"); 265 | Course c = courseBiz.selectByPrimaryKey(courseid); 266 | if (user.getVip() == null && "1".equals(c.getType())) { 267 | result = "此课程是会员课程,请购买会员!"; 268 | } else { 269 | Message message = new Message(); 270 | message.setCourseid(courseid); 271 | message.setUserid(userid); 272 | int i = messageBiz.insert(message); 273 | setlog(user, req.getRemoteAddr(), "订阅课程:" + c.getName()); 274 | } 275 | response.setCharacterEncoding("utf-8"); 276 | PrintWriter out = response.getWriter(); 277 | out.print(result); 278 | } 279 | 280 | @RequestMapping(value = "deleteCourse") 281 | // 删除课程 282 | public String deleteCourse(int courseid, String userid, HttpServletResponse response, HttpServletRequest req) 283 | throws IOException { 284 | Message message = new Message(); 285 | message.setCourseid(courseid); 286 | message.setUserid(userid); 287 | PrintWriter out = response.getWriter(); 288 | int i = messageBiz.delete(message); 289 | User loginUser = userBiz.selectByPrimaryKey(userid); 290 | Course c = courseBiz.selectByPrimaryKey(courseid); 291 | setlog(loginUser, req.getRemoteAddr(), "取消课程:" + c.getName()); 292 | String result = i > 0 ? "true" : "false"; 293 | return result; 294 | } 295 | 296 | @RequestMapping(value = "infoset") 297 | // 个人信息设置 298 | public String Infoset(User user, HttpSession session, HttpServletRequest req) { 299 | User loginUser = (User) session.getAttribute("loginUser"); 300 | if (loginUser == null) { 301 | return "login"; 302 | } 303 | user.setCollect(loginUser.getCollect()); 304 | List reviews = reviewBiz.selectbyuserid(loginUser.getUsername()); 305 | for (int a = 0; a < reviews.size(); a++) { 306 | reviews.get(a).setSex(user.getSex()); 307 | } 308 | reviewBiz.updateByPrimaryKeySelective(reviews); 309 | 310 | userBiz.updateByPrimaryKeySelective(user); 311 | Map map = new HashMap(); 312 | map.put("username", loginUser.getUsername()); 313 | map.put("password", loginUser.getPassword()); 314 | session.setAttribute("loginUser", userBiz.selectLoginUser(map)); 315 | setlog(loginUser, req.getRemoteAddr(), "个人信息更改"); 316 | return "redirect:course.do"; 317 | 318 | } 319 | 320 | @RequestMapping(value = "vip") 321 | // vip购买 0为1个月,1为半年,2为一年 322 | public void Vip(HttpSession session, int viptype, HttpServletResponse response, HttpServletRequest req) 323 | throws IOException { 324 | String data = "已经成功充值"; 325 | User loginUser = (User) session.getAttribute("loginUser"); 326 | if (loginUser == null) { 327 | // return "login"; 328 | } 329 | List reviews = reviewBiz.selectbyuserid(loginUser.getUsername()); 330 | int collect = loginUser.getCollect(); 331 | boolean isvip = false; 332 | boolean is = true; 333 | Date date = new Date(); 334 | Date vipdate = loginUser.getVip(); 335 | if (vipdate == null) { 336 | is = false; 337 | } else if (vipdate.getTime() > date.getTime()) { 338 | is = false; 339 | } 340 | if (vipdate == null || is) { 341 | if (viptype == 0) { 342 | if (collect < 500) { 343 | data = "余额不足,请联系管理员充值!"; 344 | } else { 345 | loginUser.setCollect(collect - 500); 346 | vipdate = new Date(); 347 | vipdate.setMonth(vipdate.getMonth() + 1); 348 | loginUser.setVip(vipdate); 349 | isvip = true; 350 | setlog(loginUser, req.getRemoteAddr(), "购买会员:一个月"); 351 | } 352 | } else if (viptype == 1) { 353 | if (Integer.valueOf(loginUser.getCollect()) < 2000) { 354 | data = "余额不足,请联系管理员充值!"; 355 | } else { 356 | loginUser.setCollect(collect - 2000); 357 | vipdate = new Date(); 358 | vipdate.setMonth(vipdate.getMonth() + 6); 359 | loginUser.setVip(vipdate); 360 | isvip = true; 361 | setlog(loginUser, req.getRemoteAddr(), "购买会员:半年"); 362 | } 363 | } else if (viptype == 2) { 364 | if (collect < 3000) { 365 | data = "余额不足,请联系管理员充值!"; 366 | } else { 367 | loginUser.setCollect(collect - 3000); 368 | vipdate = new Date(); 369 | vipdate.setYear(vipdate.getYear() + 1); 370 | loginUser.setVip(vipdate); 371 | isvip = true; 372 | setlog(loginUser, req.getRemoteAddr(), "购买会员:一年"); 373 | } 374 | } 375 | } else { 376 | if (viptype == 0) { 377 | if (collect < 500) { 378 | data = "余额不足,请联系管理员充值!"; 379 | } else { 380 | loginUser.setCollect(collect - 500); 381 | vipdate.setMonth(vipdate.getMonth() + 1); 382 | loginUser.setVip(vipdate); 383 | isvip = true; 384 | setlog(loginUser, req.getRemoteAddr(), "购买会员:一个月"); 385 | } 386 | } else if (viptype == 1) { 387 | if (collect < 2000) { 388 | data = "余额不足,请联系管理员充值!"; 389 | } else { 390 | loginUser.setCollect(collect - 2000); 391 | vipdate.setMonth(vipdate.getMonth() + 6); 392 | loginUser.setVip(vipdate); 393 | isvip = true; 394 | setlog(loginUser, req.getRemoteAddr(), "购买会员:半年"); 395 | } 396 | } else if (viptype == 2) { 397 | if (collect < 3000) { 398 | data = "余额不足,请联系管理员充值!"; 399 | } else { 400 | loginUser.setCollect(collect - 3000); 401 | vipdate.setYear(vipdate.getYear() + 1); 402 | loginUser.setVip(vipdate); 403 | isvip = true; 404 | setlog(loginUser, req.getRemoteAddr(), "购买会员:一年"); 405 | } 406 | } 407 | 408 | } 409 | if (isvip = true) { 410 | for (int a = 0; a < reviews.size(); a++) { 411 | reviews.get(a).setVip(1); 412 | } 413 | } 414 | reviewBiz.updateByPrimaryKeySelective(reviews); 415 | userBiz.updateByPrimaryKeySelective(loginUser); 416 | Map map = new HashMap(); 417 | map.put("username", loginUser.getUsername()); 418 | map.put("password", loginUser.getPassword()); 419 | session.setAttribute("loginUser", userBiz.selectLoginUser(map)); 420 | 421 | response.setCharacterEncoding("utf-8"); 422 | PrintWriter out = response.getWriter(); 423 | 424 | out.println(data); 425 | 426 | } 427 | } 428 | -------------------------------------------------------------------------------- /src/com/gdp/mooc/controller/AdminController.java: -------------------------------------------------------------------------------- 1 | package com.gdp.mooc.controller; 2 | 3 | import java.io.IOException; 4 | import java.io.PrintWriter; 5 | import java.util.ArrayList; 6 | import java.util.Date; 7 | import java.util.HashMap; 8 | import java.util.List; 9 | import java.util.Map; 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | import javax.servlet.http.HttpServletRequest; 19 | import javax.servlet.http.HttpServletResponse; 20 | import javax.servlet.http.HttpSession; 21 | 22 | import org.springframework.beans.factory.annotation.Autowired; 23 | import org.springframework.http.HttpRequest; 24 | import org.springframework.stereotype.Controller; 25 | import org.springframework.web.bind.annotation.RequestMapping; 26 | import org.springframework.web.bind.annotation.SessionAttributes; 27 | 28 | import com.gdp.mooc.biz.CourseBiz; 29 | import com.gdp.mooc.biz.IpsetBiz; 30 | import com.gdp.mooc.biz.LogBiz; 31 | import com.gdp.mooc.biz.UserBiz; 32 | import com.gdp.mooc.entity.Course; 33 | import com.gdp.mooc.entity.Ipset; 34 | import com.gdp.mooc.entity.Log; 35 | import com.gdp.mooc.entity.User; 36 | import com.gdp.mooc.util.DateUtil; 37 | 38 | @Controller 39 | public class AdminController { 40 | @Autowired 41 | UserBiz userBiz; 42 | @Autowired 43 | LogBiz logBiz; 44 | @Autowired 45 | CourseBiz courseBiz; 46 | @Autowired 47 | IpsetBiz ipsetBiz; 48 | public void setlog(User loginUser,String ip,String type,String adminname){ 49 | Log log = new Log(); 50 | log.setUserid(loginUser.getId()); 51 | log.setUsername(loginUser.getUsername()); 52 | log.setIp(ip); 53 | log.setType(type); 54 | log.setExecutor(adminname); 55 | logBiz.insert(log); 56 | } 57 | @RequestMapping(value = "adminlogin")//管理员登录 58 | public String adminlogin(User user, HttpSession session,HttpServletRequest req) { 59 | Map paramMap = new HashMap(); 60 | paramMap.put("username", user.getUsername()); 61 | paramMap.put("password", user.getPassword()); 62 | User loginUser = userBiz.selectLoginUser(paramMap); 63 | if (loginUser == null) { 64 | return "login"; 65 | }else if(!"admin".equals(loginUser.getMission())){ 66 | //添加管理员登录的再次验证,防止直接跳过前端验证进行强制登录 67 | session.setAttribute("loginUser", loginUser); 68 | Log log = new Log(); 69 | log.setUserid(loginUser.getId()); 70 | log.setUsername(loginUser.getUsername()); 71 | log.setIp(req.getRemoteAddr()); 72 | log.setType("用户尝试强制登录管理员页面"); 73 | logBiz.insert(log); 74 | return "redirect:course.do"; 75 | }else{ 76 | session.setAttribute("loginUser", loginUser); 77 | setlog(loginUser, req.getRemoteAddr(),"登录", loginUser.getUsername()); 78 | return "admin/leftmeun"; 79 | 80 | } 81 | } 82 | @RequestMapping(value = "alluser")//展示所有用户 83 | public String alluser(int page, HttpSession session) { 84 | User loginUser = (User) session.getAttribute("loginUser"); 85 | if (loginUser == null) { 86 | return "login"; 87 | }else if(!"admin".equals(loginUser.getMission())){ 88 | //添加管理员的再次验证 89 | session.setAttribute("loginUser", loginUser); 90 | return "redirect:course.do"; 91 | }else{ 92 | List userss = userBiz.selectAllUser(); 93 | int totalpage = 14;//一页的数量 94 | List users = new ArrayList(); 95 | session.setAttribute("maxpage", (userss.size()-1)/totalpage); 96 | for(int i = page*totalpage;i users = userBiz.selectAllUser(); 215 | session.setAttribute("users", users); 216 | } 217 | } 218 | @RequestMapping(value = "showlog")//日志查看 219 | public String showlog(String seachusername,String type, HttpSession session) { 220 | User loginUser = (User) session.getAttribute("loginUser"); 221 | if (loginUser == null) { 222 | return "login"; 223 | }else if(!"admin".equals(loginUser.getMission())){ 224 | //添加管理员的再次验证 225 | return "redirect:course.do"; 226 | } 227 | if(seachusername!=null&&type==null){ 228 | List logs = logBiz.selectbyusername(seachusername); 229 | session.setAttribute("logss", logs); 230 | session.removeAttribute("type"); 231 | session.setAttribute("logs", initlogpage(logs)); 232 | session.setAttribute("maxpage", (logs.size()-1)/15);//10为每页个数 233 | session.setAttribute("page", 0); 234 | return "admin/log"; 235 | } 236 | if(type!=null&&seachusername==null){ 237 | List logs = logBiz.selectadminlog(); 238 | session.setAttribute("type", "admin"); 239 | session.setAttribute("logss", logs); 240 | session.setAttribute("logs", initlogpage(logs)); 241 | session.setAttribute("maxpage", (logs.size()-1)/15); 242 | session.setAttribute("page", 0); 243 | return "admin/log"; 244 | } 245 | if(type==null&&seachusername==null){ 246 | List logs = logBiz.select(); 247 | session.removeAttribute("type"); 248 | session.setAttribute("logss", logs); 249 | session.setAttribute("logs", initlogpage(logs)); 250 | session.setAttribute("maxpage", (logs.size()-1)/15); 251 | session.setAttribute("page", 0); 252 | return "admin/log"; 253 | } 254 | if(type!=null&&seachusername!=null){ 255 | List logs = logBiz.selectadminlogbyusername(seachusername); 256 | session.removeAttribute("type"); 257 | session.setAttribute("logss", logs); 258 | session.setAttribute("logs", initlogpage(logs)); 259 | session.setAttribute("maxpage", (logs.size()-1)/15); 260 | session.setAttribute("page", 0); 261 | return "admin/log"; 262 | } 263 | List logs = logBiz.select(); 264 | session.removeAttribute("type"); 265 | session.setAttribute("logss", logs); 266 | session.setAttribute("logs", initlogpage(logs)); 267 | session.setAttribute("maxpage", (logs.size()-1)/15); 268 | session.setAttribute("page", 0); 269 | return "admin/log"; 270 | } 271 | 272 | public List initlogpage(List logss){//第一次传输日志 273 | int totalpage = 15;//一页的数量 274 | List logs = new ArrayList(); 275 | for(int i = 0;i logss = (List) session.getAttribute("logss"); 286 | int rpage = (int) session.getAttribute("page"); 287 | int totalpage = 15;//一页的数量 288 | List logs = new ArrayList(); 289 | for(int i = page*totalpage;i coursess = courseBiz.selectAllCourse(); 312 | int totalpage = 14;//一页的数量 313 | List courses = new ArrayList(); 314 | session.setAttribute("maxpage", (coursess.size()-1)/totalpage); 315 | for(int i = page*totalpage;i ipss = ipsetBiz.select(); 394 | int totalpage = 14;//一页的数量 395 | List ips = new ArrayList(); 396 | session.setAttribute("maxpage", (ipss.size()-1)/totalpage); 397 | for(int i = page*totalpage;i55) { 438 | date.setMinutes(date.getMinutes()-55); 439 | date.setHours(date.getHours()+1); 440 | }else { 441 | date.setMinutes(date.getMinutes()+5); 442 | } 443 | ip1.setBantime(date); 444 | }else if(time.equals("2h")) { 445 | date.setHours(date.getHours()+2); 446 | ip1.setBantime(date); 447 | }else if(time.equals("1d")) { 448 | date.setDate(date.getDate()+1); 449 | ip1.setBantime(date); 450 | }else if(time.equals("1m")) { 451 | date.setMonth(date.getMonth()+1); 452 | ip1.setBantime(date); 453 | }else if(time.equals("1y")) { 454 | date.setYear(date.getYear()+1); 455 | ip1.setBantime(date); 456 | }else if(time.equals("ever")) { 457 | date.setYear(date.getYear()+99); 458 | ip1.setBantime(date); 459 | } 460 | if(isnull) { 461 | ipsetBiz.insert(ip1); 462 | }else { 463 | ipsetBiz.updateByPrimaryKeySelective(ip1); 464 | } 465 | resp.setCharacterEncoding("utf-8"); 466 | resp.getWriter().write("封禁成功!封禁至:"+date); 467 | } 468 | 469 | @RequestMapping(value="logoutadmin")//管理员注销 470 | public String logoutadmin(HttpSession session,HttpServletRequest req){ 471 | User loginUser = (User) session.getAttribute("loginUser"); 472 | session.invalidate(); 473 | setlog(loginUser, req.getRemoteAddr(),"注销", loginUser.getUsername()); 474 | return "loginadmin"; 475 | } 476 | @RequestMapping(value = "coursede")//课程详情界面 477 | public String coursede(String courseid, HttpSession session) { 478 | session.removeAttribute("msg"); 479 | User loginUser = (User) session.getAttribute("loginUser"); 480 | if (loginUser == null) { 481 | return "login"; 482 | }else if(!"admin".equals(loginUser.getMission())){ 483 | //添加管理员的再次验证 484 | return "redirect:course.do"; 485 | } 486 | if(courseid!=null) { 487 | Course course = courseBiz.selectByPrimaryKey(Integer.parseInt(courseid)); 488 | session.setAttribute("course", course); 489 | return "admin/course"; 490 | } 491 | session.removeAttribute("course"); 492 | return "admin/course"; 493 | 494 | } 495 | @RequestMapping(value = "coursesave")//课程上传/修改 496 | public String coursesave(HttpServletRequest req, HttpSession session) { 497 | session.removeAttribute("msg"); 498 | User loginUser = (User) session.getAttribute("loginUser"); 499 | if (loginUser == null) { 500 | return "login"; 501 | }else if(!"admin".equals(loginUser.getMission())){ 502 | //添加管理员的再次验证 503 | return "redirect:course.do"; 504 | } 505 | courseBiz.savecourse(req); 506 | session.setAttribute("msg", "操作成功"); 507 | return "admin/course"; 508 | 509 | } 510 | 511 | } 512 | -------------------------------------------------------------------------------- /mooc.sql: -------------------------------------------------------------------------------- 1 | /* 2 | Navicat MySQL Data Transfer 3 | 4 | Source Server : localhost 5 | Source Server Version : 50045 6 | Source Host : localhost:3306 7 | Source Database : mooc 8 | 9 | Target Server Type : MYSQL 10 | Target Server Version : 50045 11 | File Encoding : 65001 12 | 13 | Date: 2018-10-29 17:51:27 14 | */ 15 | 16 | SET FOREIGN_KEY_CHECKS=0; 17 | 18 | -- ---------------------------- 19 | -- Table structure for `course` 20 | -- ---------------------------- 21 | DROP TABLE IF EXISTS `course`; 22 | CREATE TABLE `course` ( 23 | `id` int(100) NOT NULL auto_increment, 24 | `name` varchar(200) default NULL, 25 | `context` varchar(500) default NULL, 26 | `type` varchar(50) default NULL, 27 | `price` varchar(50) default NULL, 28 | `label` varchar(100) default NULL, 29 | `hour` char(50) default NULL, 30 | PRIMARY KEY (`id`) 31 | ) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8; 32 | 33 | -- ---------------------------- 34 | -- Records of course 35 | -- ---------------------------- 36 | INSERT INTO `course` VALUES ('1', 'Python', 'Python', '1', '1', '一般', '20'); 37 | INSERT INTO `course` VALUES ('2', 'Python入门', 'Python入门', '0', '0', '还行', '10'); 38 | INSERT INTO `course` VALUES ('3', '1024设计', '1024设计', '1', '0', '还行', '5'); 39 | INSERT INTO `course` VALUES ('4', 'Python爬虫', 'Python爬虫技巧', '0', '0', '还行', '12'); 40 | INSERT INTO `course` VALUES ('5', 'java', 'java基础入门', '1', '0', '一般', '14'); 41 | INSERT INTO `course` VALUES ('6', 'Python爬虫2', 'Python爬虫2', '0', '0', '一般', '15'); 42 | INSERT INTO `course` VALUES ('7', '123', '123123', '1', '1', null, null); 43 | INSERT INTO `course` VALUES ('8', '12123', '123123', '1', '1', null, null); 44 | 45 | -- ---------------------------- 46 | -- Table structure for `ipset` 47 | -- ---------------------------- 48 | DROP TABLE IF EXISTS `ipset`; 49 | CREATE TABLE `ipset` ( 50 | `ip` varchar(255) NOT NULL default '', 51 | `type` varchar(255) default NULL, 52 | `mark` varchar(255) default NULL, 53 | `firsttime` datetime default NULL, 54 | `bantime` datetime default NULL, 55 | `totime` datetime default NULL, 56 | PRIMARY KEY (`ip`) 57 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 58 | 59 | -- ---------------------------- 60 | -- Records of ipset 61 | -- ---------------------------- 62 | INSERT INTO `ipset` VALUES ('0:0:0:0:0:0:0:1', null, null, '2018-10-27 20:00:34', null, '2018-10-27 20:02:33'); 63 | INSERT INTO `ipset` VALUES ('127.0.0.1', '0', '恶意登陆管理员账号!', '2018-10-16 11:57:36', '2117-10-16 19:16:14', '2018-10-29 16:09:50'); 64 | INSERT INTO `ipset` VALUES ('172.162.1.125', '0', '多次测试未知账户!', '2018-10-16 18:34:05', '2018-10-16 18:39:14', '2018-10-16 18:34:05'); 65 | INSERT INTO `ipset` VALUES ('172.162.1.40', '0', '恶意登陆管理员账号!', '2018-10-16 14:11:35', '2117-10-16 19:00:29', '2018-10-16 19:05:29'); 66 | INSERT INTO `ipset` VALUES ('172.162.1.41', '1', '多次测试未知账户!', '2018-10-16 12:00:48', '2018-10-17 19:21:21', '2018-10-16 19:20:43'); 67 | INSERT INTO `ipset` VALUES ('172.162.1.42', '0', '多次测试未知账户!', '2018-10-16 14:09:01', '2018-10-17 18:57:18', '2018-10-17 19:22:21'); 68 | INSERT INTO `ipset` VALUES ('172.162.1.43', '0', '多次测试未知账户!', '2018-10-16 12:00:30', '2018-10-16 19:24:00', '2018-10-16 14:04:47'); 69 | INSERT INTO `ipset` VALUES ('172.162.1.44', '1', '多次测试未知账户!', '2018-10-16 15:09:06', '2018-10-16 19:26:04', '2018-10-16 19:19:24'); 70 | INSERT INTO `ipset` VALUES ('172.162.1.87', '1', '多次测试未知账户!', '2018-10-16 19:08:26', '2018-10-16 19:25:58', '2018-10-16 19:09:36'); 71 | 72 | -- ---------------------------- 73 | -- Table structure for `log` 74 | -- ---------------------------- 75 | DROP TABLE IF EXISTS `log`; 76 | CREATE TABLE `log` ( 77 | `id` int(255) NOT NULL auto_increment, 78 | `userid` varchar(255) default NULL, 79 | `username` varchar(255) default NULL, 80 | `type` varchar(255) default NULL, 81 | `ip` varchar(255) default NULL, 82 | `time` datetime default NULL, 83 | `executor` varchar(255) default NULL, 84 | PRIMARY KEY (`id`) 85 | ) ENGINE=InnoDB AUTO_INCREMENT=127 DEFAULT CHARSET=utf8; 86 | 87 | -- ---------------------------- 88 | -- Records of log 89 | -- ---------------------------- 90 | INSERT INTO `log` VALUES ('1', '20151612204', 'admin', '登录', '0:0:0:0:0:0:0:1', '2018-10-15 15:13:46', null); 91 | INSERT INTO `log` VALUES ('2', '20151612204', 'admin', '登录', '0:0:0:0:0:0:0:1', '2018-10-15 15:15:57', 'admin'); 92 | INSERT INTO `log` VALUES ('3', '20151612204', 'admin', '充值500元', '0:0:0:0:0:0:0:1', '2018-10-15 15:16:53', 'admin'); 93 | INSERT INTO `log` VALUES ('4', '201808231058301205', '1823544517', '充值10000元', '0:0:0:0:0:0:0:1', '2018-10-15 15:18:02', 'admin'); 94 | INSERT INTO `log` VALUES ('5', '201808231058301205', '1823544517', '屏蔽用户登录', '0:0:0:0:0:0:0:1', '2018-10-15 15:18:12', 'admin'); 95 | INSERT INTO `log` VALUES ('6', '201808231058301205', '1823544517', '恢复用户登录', '0:0:0:0:0:0:0:1', '2018-10-15 15:19:10', 'admin'); 96 | INSERT INTO `log` VALUES ('7', '201808231058301205', '1823544517', '登录', '127.0.0.1', '2018-10-15 15:19:15', null); 97 | INSERT INTO `log` VALUES ('8', '201808231058301205', '1823544517', '订阅课程:1024设计', '127.0.0.1', '2018-10-15 15:19:20', null); 98 | INSERT INTO `log` VALUES ('9', '201808231058301205', '1823544517', '购买会员:一年', '127.0.0.1', '2018-10-15 15:31:58', null); 99 | INSERT INTO `log` VALUES ('10', '201808231058301205', '1823544517', '登录', '127.0.0.1', '2018-10-15 16:12:09', null); 100 | INSERT INTO `log` VALUES ('11', '20151612204', 'admin', '登录', '0:0:0:0:0:0:0:1', '2018-10-15 21:45:02', 'admin'); 101 | INSERT INTO `log` VALUES ('12', '201808231058301205', '1823544517', '登录', '127.0.0.1', '2018-10-15 21:49:02', null); 102 | INSERT INTO `log` VALUES ('13', null, null, '下架课程:Python', '0:0:0:0:0:0:0:1', '2018-10-15 21:49:27', 'admin'); 103 | INSERT INTO `log` VALUES ('14', null, null, '上架课程:Python', '0:0:0:0:0:0:0:1', '2018-10-15 21:49:37', 'admin'); 104 | INSERT INTO `log` VALUES ('15', null, null, '下架课程:Python', '0:0:0:0:0:0:0:1', '2018-10-15 21:49:44', 'admin'); 105 | INSERT INTO `log` VALUES ('16', null, null, '尝试登录账号:asdawdasdwqweqwrqwe,密码错误', '127.0.0.1', '2018-10-16 10:08:03', null); 106 | INSERT INTO `log` VALUES ('17', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 10:08:48', 'admin'); 107 | INSERT INTO `log` VALUES ('18', '201808231058301205', '1823544517', '登录', '127.0.0.1', '2018-10-16 10:10:17', null); 108 | INSERT INTO `log` VALUES ('19', '201810161045371069', 'abc', '普通注册', '172.162.1.44', '2018-10-16 10:37:45', null); 109 | INSERT INTO `log` VALUES ('20', '201810161045371069', 'abc', '登录', '172.162.1.44', '2018-10-16 10:38:12', null); 110 | INSERT INTO `log` VALUES ('21', '201810161045371069', 'abc', '购买会员:一个月', '172.162.1.44', '2018-10-16 10:38:27', null); 111 | INSERT INTO `log` VALUES ('22', '201810161045371069', 'abc', '订阅课程:1024设计', '172.162.1.44', '2018-10-16 10:39:07', null); 112 | INSERT INTO `log` VALUES ('23', '201810161045371069', 'abc', '个人信息更改', '172.162.1.44', '2018-10-16 10:40:49', null); 113 | INSERT INTO `log` VALUES ('24', '201810161045371069', 'abc', '个人信息更改', '172.162.1.44', '2018-10-16 10:40:57', null); 114 | INSERT INTO `log` VALUES ('25', '201808231058301205', '1823544517', '登录', '127.0.0.1', '2018-10-16 10:41:17', null); 115 | INSERT INTO `log` VALUES ('26', '201810161045371069', 'abc', '取消课程:1024设计', '172.162.1.44', '2018-10-16 10:41:32', null); 116 | INSERT INTO `log` VALUES ('27', '201810161045371069', 'abc', '个人信息更改', '172.162.1.44', '2018-10-16 10:43:15', null); 117 | INSERT INTO `log` VALUES ('28', '201810161045371069', 'abc', '充值10000元', '127.0.0.1', '2018-10-16 10:44:50', 'admin'); 118 | INSERT INTO `log` VALUES ('29', '201810161045371069', 'abc', '购买会员:一年', '172.162.1.44', '2018-10-16 10:45:04', null); 119 | INSERT INTO `log` VALUES ('30', '201810161045371069', 'abc', '购买会员:半年', '172.162.1.44', '2018-10-16 10:45:07', null); 120 | INSERT INTO `log` VALUES ('31', '201810161045371069', 'abc', '购买会员:一个月', '172.162.1.44', '2018-10-16 10:45:11', null); 121 | INSERT INTO `log` VALUES ('32', '201810161045371069', 'abc', '购买会员:一个月', '172.162.1.44', '2018-10-16 10:45:13', null); 122 | INSERT INTO `log` VALUES ('33', '201810161045371069', 'abc', '购买会员:一个月', '172.162.1.44', '2018-10-16 10:45:15', null); 123 | INSERT INTO `log` VALUES ('34', '201810161045371069', 'abc', '购买会员:一个月', '172.162.1.44', '2018-10-16 10:45:16', null); 124 | INSERT INTO `log` VALUES ('35', '201810161045371069', 'abc', '购买会员:半年', '172.162.1.44', '2018-10-16 10:46:02', null); 125 | INSERT INTO `log` VALUES ('36', '201810161045371069', 'abc', '购买会员:一个月', '172.162.1.44', '2018-10-16 10:46:05', null); 126 | INSERT INTO `log` VALUES ('37', '201810161045371069', 'abc', '购买会员:一个月', '172.162.1.44', '2018-10-16 10:46:07', null); 127 | INSERT INTO `log` VALUES ('38', '201810161045371069', 'abc', '注销', '172.162.1.44', '2018-10-16 10:46:24', null); 128 | INSERT INTO `log` VALUES ('39', null, null, '尝试登录账号:admin,密码错误', '172.162.1.44', '2018-10-16 10:46:52', null); 129 | INSERT INTO `log` VALUES ('40', '20151612204', 'admin', '注销', '127.0.0.1', '2018-10-16 10:47:40', 'admin'); 130 | INSERT INTO `log` VALUES ('41', null, null, '尝试登录账号:admin,密码错误', '127.0.0.1', '2018-10-16 10:47:50', null); 131 | INSERT INTO `log` VALUES ('42', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 10:48:09', 'admin'); 132 | INSERT INTO `log` VALUES ('43', '201808231058301205', '1823544517', '登录', '172.162.1.42', '2018-10-16 14:09:19', null); 133 | INSERT INTO `log` VALUES ('44', '201808231058301205', '1823544517', '订阅课程:Python爬虫', '172.162.1.42', '2018-10-16 14:09:32', null); 134 | INSERT INTO `log` VALUES ('45', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 14:34:55', 'admin'); 135 | INSERT INTO `log` VALUES ('46', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 14:47:31', 'admin'); 136 | INSERT INTO `log` VALUES ('47', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 15:02:14', 'admin'); 137 | INSERT INTO `log` VALUES ('48', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 15:06:45', 'admin'); 138 | INSERT INTO `log` VALUES ('49', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 15:07:24', 'admin'); 139 | INSERT INTO `log` VALUES ('50', '201808231058301205', '1823544517', '登录', '127.0.0.1', '2018-10-16 15:22:23', null); 140 | INSERT INTO `log` VALUES ('51', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 15:27:01', 'admin'); 141 | INSERT INTO `log` VALUES ('52', '201808231058301205', '1823544517', '登录', '127.0.0.1', '2018-10-16 15:27:30', null); 142 | INSERT INTO `log` VALUES ('53', '201808231058301205', '1823544517', '发表评论,在\'null\'', '127.0.0.1', '2018-10-16 15:27:45', null); 143 | INSERT INTO `log` VALUES ('54', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 15:29:20', 'admin'); 144 | INSERT INTO `log` VALUES ('55', '201808231058301205', '1823544517', '登录', '127.0.0.1', '2018-10-16 15:30:13', null); 145 | INSERT INTO `log` VALUES ('56', '201808231058301205', '1823544517', '发表评论,在\'Python爬虫\'', '127.0.0.1', '2018-10-16 15:30:22', null); 146 | INSERT INTO `log` VALUES ('57', '201810161045371069', 'abc', '登录', '172.162.1.44', '2018-10-16 15:34:59', null); 147 | INSERT INTO `log` VALUES ('58', '201810161045371069', 'abc', '订阅课程:1024设计', '172.162.1.44', '2018-10-16 15:35:05', null); 148 | INSERT INTO `log` VALUES ('59', '201810161045371069', 'abc', '发表评论,在\'1024设计\'', '172.162.1.44', '2018-10-16 15:35:30', null); 149 | INSERT INTO `log` VALUES ('60', '201810161045371069', 'abc', '取消课程:1024设计', '172.162.1.44', '2018-10-16 15:36:28', null); 150 | INSERT INTO `log` VALUES ('61', '201810161045371069', 'abc', '屏蔽用户登录', '127.0.0.1', '2018-10-16 15:36:47', 'admin'); 151 | INSERT INTO `log` VALUES ('62', '201810161045371069', 'abc', '订阅课程:Python入门', '172.162.1.44', '2018-10-16 15:37:03', null); 152 | INSERT INTO `log` VALUES ('63', '201810161045371069', 'abc', '注销', '172.162.1.44', '2018-10-16 15:37:11', null); 153 | INSERT INTO `log` VALUES ('64', '201810161045371069', 'abc', '恢复用户登录', '127.0.0.1', '2018-10-16 15:37:22', 'admin'); 154 | INSERT INTO `log` VALUES ('65', '201810161045371069', 'abc', '登录', '172.162.1.44', '2018-10-16 15:37:27', null); 155 | INSERT INTO `log` VALUES ('66', '201808231058301205', '1823544517', '注销', '127.0.0.1', '2018-10-16 15:42:47', null); 156 | INSERT INTO `log` VALUES ('67', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 17:11:30', 'admin'); 157 | INSERT INTO `log` VALUES ('68', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 17:12:28', 'admin'); 158 | INSERT INTO `log` VALUES ('69', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 17:27:45', 'admin'); 159 | INSERT INTO `log` VALUES ('70', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 17:28:48', 'admin'); 160 | INSERT INTO `log` VALUES ('71', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 17:29:32', 'admin'); 161 | INSERT INTO `log` VALUES ('72', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 17:31:06', 'admin'); 162 | INSERT INTO `log` VALUES ('73', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 17:40:19', 'admin'); 163 | INSERT INTO `log` VALUES ('74', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 17:44:57', 'admin'); 164 | INSERT INTO `log` VALUES ('75', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 17:47:35', 'admin'); 165 | INSERT INTO `log` VALUES ('76', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 17:48:23', 'admin'); 166 | INSERT INTO `log` VALUES ('77', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 18:18:24', 'admin'); 167 | INSERT INTO `log` VALUES ('78', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 18:21:29', 'admin'); 168 | INSERT INTO `log` VALUES ('79', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 18:27:53', 'admin'); 169 | INSERT INTO `log` VALUES ('80', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 18:53:35', 'admin'); 170 | INSERT INTO `log` VALUES ('81', null, null, '尝试登录账号:96321,密码错误', '172.162.1.40', '2018-10-16 19:01:02', null); 171 | INSERT INTO `log` VALUES ('82', null, null, '尝试登录账号:96321,密码错误', '172.162.1.40', '2018-10-16 19:01:24', null); 172 | INSERT INTO `log` VALUES ('83', '201810161901381601', '96321', '普通注册', '172.162.1.40', '2018-10-16 19:01:38', null); 173 | INSERT INTO `log` VALUES ('84', '201810161901381601', '96321', '屏蔽用户登录', '127.0.0.1', '2018-10-16 19:01:50', 'admin'); 174 | INSERT INTO `log` VALUES ('85', '201810161901381601', '96321', '恢复用户登录', '127.0.0.1', '2018-10-16 19:01:55', 'admin'); 175 | INSERT INTO `log` VALUES ('86', '201810161901381601', '96321', '登录', '172.162.1.40', '2018-10-16 19:02:03', null); 176 | INSERT INTO `log` VALUES ('87', '201810161901381601', '96321', '个人信息更改', '172.162.1.40', '2018-10-16 19:02:33', null); 177 | INSERT INTO `log` VALUES ('88', '201810161901381601', '96321', '订阅课程:Python入门', '172.162.1.40', '2018-10-16 19:02:41', null); 178 | INSERT INTO `log` VALUES ('89', '201810161901381601', '96321', '发表评论,在\'Python入门\'', '172.162.1.40', '2018-10-16 19:02:56', null); 179 | INSERT INTO `log` VALUES ('90', '201810161901381601', '96321', '取消课程:Python入门', '172.162.1.40', '2018-10-16 19:03:08', null); 180 | INSERT INTO `log` VALUES ('91', '201810161901381601', '96321', '购买会员:一个月', '172.162.1.40', '2018-10-16 19:03:40', null); 181 | INSERT INTO `log` VALUES ('92', '201810161901381601', '96321', '订阅课程:Python爬虫2', '172.162.1.40', '2018-10-16 19:03:46', null); 182 | INSERT INTO `log` VALUES ('93', '201810161901381601', '96321', '发表评论,在\'Python爬虫2\'', '172.162.1.40', '2018-10-16 19:03:55', null); 183 | INSERT INTO `log` VALUES ('94', '201810161901381601', '96321', '个人信息更改', '172.162.1.40', '2018-10-16 19:04:36', null); 184 | INSERT INTO `log` VALUES ('95', '201810161901381601', '96321', '注销', '172.162.1.40', '2018-10-16 19:05:29', null); 185 | INSERT INTO `log` VALUES ('96', '20151612204', 'admin', '登录', '172.162.1.44', '2018-10-16 19:15:49', 'admin'); 186 | INSERT INTO `log` VALUES ('97', '20151612204', 'admin', '登录', '172.162.1.44', '2018-10-16 19:18:37', 'admin'); 187 | INSERT INTO `log` VALUES ('98', '20151612204', 'admin', '登录', '172.162.1.44', '2018-10-16 19:19:04', 'admin'); 188 | INSERT INTO `log` VALUES ('99', '20151612204', 'admin', '登录', '172.162.1.41', '2018-10-16 19:20:27', 'admin'); 189 | INSERT INTO `log` VALUES ('100', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-16 19:20:55', 'admin'); 190 | INSERT INTO `log` VALUES ('101', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-17 15:50:41', null); 191 | INSERT INTO `log` VALUES ('102', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-17 15:51:46', 'admin'); 192 | INSERT INTO `log` VALUES ('103', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-17 15:52:31', null); 193 | INSERT INTO `log` VALUES ('104', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-17 18:55:21', 'admin'); 194 | INSERT INTO `log` VALUES ('105', null, null, '尝试登录账号:admin,密码错误', '0:0:0:0:0:0:0:1', '2018-10-27 20:01:49', null); 195 | INSERT INTO `log` VALUES ('106', '20151612204', 'admin', '登录', '0:0:0:0:0:0:0:1', '2018-10-27 20:01:57', 'admin'); 196 | INSERT INTO `log` VALUES ('107', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-29 10:30:06', 'admin'); 197 | INSERT INTO `log` VALUES ('108', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-29 10:46:37', 'admin'); 198 | INSERT INTO `log` VALUES ('109', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-29 14:30:47', 'admin'); 199 | INSERT INTO `log` VALUES ('110', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-29 14:35:21', 'admin'); 200 | INSERT INTO `log` VALUES ('111', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-29 14:48:57', 'admin'); 201 | INSERT INTO `log` VALUES ('112', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-29 14:51:52', 'admin'); 202 | INSERT INTO `log` VALUES ('113', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-29 14:52:54', 'admin'); 203 | INSERT INTO `log` VALUES ('114', null, null, '删除课程:张三', '127.0.0.1', '2018-10-29 14:53:07', 'admin'); 204 | INSERT INTO `log` VALUES ('115', null, null, '删除课程:张三', '127.0.0.1', '2018-10-29 14:53:16', 'admin'); 205 | INSERT INTO `log` VALUES ('116', null, null, '删除课程:张三', '127.0.0.1', '2018-10-29 14:53:22', 'admin'); 206 | INSERT INTO `log` VALUES ('117', null, null, '删除课程:张三', '127.0.0.1', '2018-10-29 14:53:29', 'admin'); 207 | INSERT INTO `log` VALUES ('118', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-29 15:22:11', 'admin'); 208 | INSERT INTO `log` VALUES ('119', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-29 15:23:42', 'admin'); 209 | INSERT INTO `log` VALUES ('120', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-29 15:24:57', 'admin'); 210 | INSERT INTO `log` VALUES ('121', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-29 15:51:24', 'admin'); 211 | INSERT INTO `log` VALUES ('122', '20151612204', 'admin', '登录', '127.0.0.1', '2018-10-29 15:53:23', 'admin'); 212 | INSERT INTO `log` VALUES ('123', null, null, '上架课程:123123', '127.0.0.1', '2018-10-29 15:54:04', 'admin'); 213 | INSERT INTO `log` VALUES ('124', null, null, '下架课程:123123', '127.0.0.1', '2018-10-29 15:54:17', 'admin'); 214 | INSERT INTO `log` VALUES ('125', null, null, '删除课程:123123', '127.0.0.1', '2018-10-29 15:54:34', 'admin'); 215 | INSERT INTO `log` VALUES ('126', '20151612204', 'admin', '发表评论,在\'Python入门\'', '127.0.0.1', '2018-10-29 16:09:50', null); 216 | 217 | -- ---------------------------- 218 | -- Table structure for `message` 219 | -- ---------------------------- 220 | DROP TABLE IF EXISTS `message`; 221 | CREATE TABLE `message` ( 222 | `courseid` int(100) NOT NULL default '0', 223 | `userid` varchar(100) NOT NULL default '' 224 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 225 | 226 | -- ---------------------------- 227 | -- Records of message 228 | -- ---------------------------- 229 | INSERT INTO `message` VALUES ('1', '20151612204'); 230 | INSERT INTO `message` VALUES ('3', '201808240857431128'); 231 | INSERT INTO `message` VALUES ('6', '201808231058301205'); 232 | INSERT INTO `message` VALUES ('4', '20151612204'); 233 | INSERT INTO `message` VALUES ('5', '20151612204'); 234 | INSERT INTO `message` VALUES ('2', '201809030750151429'); 235 | INSERT INTO `message` VALUES ('2', '20151612204'); 236 | INSERT INTO `message` VALUES ('2', '201809061049051592'); 237 | INSERT INTO `message` VALUES ('2', '201808240857431128'); 238 | INSERT INTO `message` VALUES ('6', '201808240857431128'); 239 | INSERT INTO `message` VALUES ('4', '201809030750151429'); 240 | INSERT INTO `message` VALUES ('5', '201808240857431128'); 241 | INSERT INTO `message` VALUES ('1', '201809061049051592'); 242 | INSERT INTO `message` VALUES ('3', '201808231058301205'); 243 | INSERT INTO `message` VALUES ('4', '201808231058301205'); 244 | INSERT INTO `message` VALUES ('2', '201810161045371069'); 245 | INSERT INTO `message` VALUES ('6', '201810161901381601'); 246 | 247 | -- ---------------------------- 248 | -- Table structure for `review` 249 | -- ---------------------------- 250 | DROP TABLE IF EXISTS `review`; 251 | CREATE TABLE `review` ( 252 | `reviewid` char(255) NOT NULL, 253 | `context` char(255) default NULL, 254 | `courseid` int(50) default NULL, 255 | `username` char(255) default NULL, 256 | `time` datetime default NULL, 257 | `lable` char(255) default NULL, 258 | `sex` char(50) default NULL, 259 | `vip` int(50) default NULL, 260 | PRIMARY KEY (`reviewid`) 261 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 262 | 263 | -- ---------------------------- 264 | -- Records of review 265 | -- ---------------------------- 266 | INSERT INTO `review` VALUES ('201809060327341776', 'fgfdgdsgg', '2', 'zzz', '2018-09-06 15:34:27', '4', 'Female', '1'); 267 | INSERT INTO `review` VALUES ('201809060414381493', '钱花的有点多', '1', '雷宇锋', '2018-09-06 16:38:14', '0', null, '1'); 268 | INSERT INTO `review` VALUES ('201809060423031483', '这课不错', '4', 'admin', '2018-09-06 16:03:23', '2', 'Male', '1'); 269 | INSERT INTO `review` VALUES ('201809060444041617', '刷好评', '4', 'adm', '2018-09-06 16:04:44', '4', null, '0'); 270 | INSERT INTO `review` VALUES ('201809060450041302', '刷好评', '4', 'adm', '2018-09-06 16:04:50', '4', null, '0'); 271 | INSERT INTO `review` VALUES ('201809060452031217', '这还不错', '4', 'adm', '2018-09-06 16:03:52', '3', null, '0'); 272 | INSERT INTO `review` VALUES ('201809060457021559', '这课不错', '5', 'admin', '2018-09-06 16:02:57', '2', 'Male', '1'); 273 | INSERT INTO `review` VALUES ('201810151532321876', '测试测试!!!', '6', '1823544517', '2018-10-15 15:32:32', '3', 'Male', '1'); 274 | INSERT INTO `review` VALUES ('201810151554191404', 'en ?', '3', '1823544517', '2018-10-15 15:19:54', '2', 'Male', '1'); 275 | INSERT INTO `review` VALUES ('201810161036391342', '美太太', '3', 'abc', '2018-10-16 10:39:36', '4', 'Female', '1'); 276 | INSERT INTO `review` VALUES ('201810161522301059', '测试', '4', '1823544517', '2018-10-16 15:30:22', '4', 'Male', '1'); 277 | INSERT INTO `review` VALUES ('201810161530351701', 'en 很不错', '3', 'abc', '2018-10-16 15:35:30', '0', 'Female', '1'); 278 | INSERT INTO `review` VALUES ('201810161545271907', '测试测试', '4', '1823544517', '2018-10-16 15:27:45', '4', 'Male', '1'); 279 | INSERT INTO `review` VALUES ('201810161902561206', '', '2', '96321', '2018-10-16 19:02:56', '4', 'Male', '1'); 280 | INSERT INTO `review` VALUES ('201810161903551373', '6666', '6', '96321', '2018-10-16 19:03:55', '4', 'Male', '1'); 281 | INSERT INTO `review` VALUES ('201810291609501589', '还行', '2', 'admin', '2018-10-29 16:09:50', '4', 'Male', '1'); 282 | 283 | -- ---------------------------- 284 | -- Table structure for `user` 285 | -- ---------------------------- 286 | DROP TABLE IF EXISTS `user`; 287 | CREATE TABLE `user` ( 288 | `id` varchar(100) NOT NULL default '', 289 | `sex` varchar(50) default NULL, 290 | `phone` varchar(200) default NULL, 291 | `mail` varchar(200) default NULL, 292 | `vx` varchar(200) default NULL, 293 | `nickname` varchar(200) default NULL, 294 | `username` varchar(200) default NULL, 295 | `password` varchar(200) default NULL, 296 | `mission` varchar(500) default NULL, 297 | `buycase` varchar(200) default NULL, 298 | `mycase` varchar(200) default NULL, 299 | `collect` varchar(200) default NULL, 300 | `education` varchar(200) default NULL, 301 | `vip` datetime default NULL, 302 | `fristtime` datetime default NULL, 303 | PRIMARY KEY (`id`) 304 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 305 | 306 | -- ---------------------------- 307 | -- Records of user 308 | -- ---------------------------- 309 | INSERT INTO `user` VALUES ('20151612204', 'Male', '18235447109', '591284209@qq.com', '1111', '杨式人', 'admin', 'admin', 'admin', null, null, '458500', '高中/中专', '2033-10-01 19:57:53', null); 310 | INSERT INTO `user` VALUES ('201808100710171565', 'Female', '18235447109', '591284209@qq.com', null, null, 'admin1', 'admin', null, null, null, '500', null, null, '2018-08-10 19:17:10'); 311 | INSERT INTO `user` VALUES ('201808100930501831', 'Male', '18235447109', '591284209@qq.com', '1111111111111111111', '张三', 'zhangsan', 'asdasd', null, null, null, '0', '本科/大专', '2019-09-01 20:41:04', '2018-08-10 09:50:30'); 312 | INSERT INTO `user` VALUES ('201808101154331492', 'Female', '1111111111111', '1447883900@qq.com', null, null, 'zhazhabi', 'zxcvbnm', null, null, null, '500', null, null, '2018-08-10 11:33:54'); 313 | INSERT INTO `user` VALUES ('201808230425131682', null, '123456789', '125486', '15846', 'bad', 'bb', '123456', null, null, null, '500', '研究生以上', null, '2018-08-23 16:13:25'); 314 | INSERT INTO `user` VALUES ('201808230439101712', null, null, null, null, null, '18235445172', '1111', null, null, null, '500', null, null, '2018-08-23 16:10:39'); 315 | INSERT INTO `user` VALUES ('201808231058301205', 'Male', '12345689', '789@qq.com', '784554asdd', '雷', '1823544517', '123654', null, '0', null, '7000', '本科/大专', '2019-10-15 15:31:58', '2018-08-23 10:30:58'); 316 | INSERT INTO `user` VALUES ('201808240857431128', 'Female', '12345678907assa', '345424354@qq.com', '4dgde', 'zzzgf', 'zzz', '12345', null, null, null, '0', '研究生以上', '2023-01-06 15:33:03', '2018-08-24 08:43:57'); 317 | INSERT INTO `user` VALUES ('201808241105291520', null, null, null, null, null, '1823544517111111111111', '123456', null, null, null, '500', null, null, '2018-08-24 11:29:05'); 318 | INSERT INTO `user` VALUES ('201808241117291016', null, null, null, null, null, '182354451722222222222', '123456', null, null, null, '500', null, null, '2018-08-24 11:29:17'); 319 | INSERT INTO `user` VALUES ('201808241149281125', null, null, null, null, null, '18235445171111', '123456', null, null, null, '500', null, null, '2018-08-24 11:28:49'); 320 | INSERT INTO `user` VALUES ('201809030750151429', null, null, null, null, null, 'adm', '123', null, null, null, '500', null, null, '2018-09-03 19:15:50'); 321 | INSERT INTO `user` VALUES ('201809061018111546', 'Male', '110', '373254553@qq.com', 'js666', 'js', 'js', 'js666', null, null, null, '10000', '研究生以上', '2020-03-06 10:15:16', '2018-09-06 10:11:18'); 322 | INSERT INTO `user` VALUES ('201809061049051592', null, null, null, null, null, '雷宇锋', '110', null, null, null, '0', null, '2018-12-06 16:37:39', '2018-09-06 10:05:49'); 323 | INSERT INTO `user` VALUES ('201809061051011416', null, null, null, null, null, 'sdsd', '123', null, null, null, '500', null, null, '2018-09-06 10:01:51'); 324 | INSERT INTO `user` VALUES ('201809061055001264', null, null, null, null, null, 'aaa', '123', null, null, null, '500', null, null, '2018-09-06 10:00:55'); 325 | INSERT INTO `user` VALUES ('201809061108071033', 'Female', '12123', '1447883900@qq.com', null, null, '111', 'qweqwe', null, null, null, '500', null, null, '2018-09-06 11:07:08'); 326 | INSERT INTO `user` VALUES ('201810161045371069', 'Female', '13096613748', '872486471', '1223', '去玩儿', 'abc', '123456', null, '0', null, '0', '研究生以上', '2021-05-16 10:38:27', '2018-10-16 10:37:45'); 327 | INSERT INTO `user` VALUES ('201810161901381601', 'Male', '96321', '96321', '96321', '96321', '96321', '96321', null, '0', null, '0', '研究生以上', '2018-11-16 19:03:40', '2018-10-16 19:01:38'); 328 | --------------------------------------------------------------------------------