day08 前后端分离开发(lanmoyun)

1.后端:

  • 设计数据库,根据需求,分析数据库,建库建表(库:db_spring)


    day08-1.png
day08-2.png
  • 建立web模块类型的maven项目
    手动创建src,resources,test-java目录
    建立package,entity,dao,service,controller


    day08-3.png

    day08-4.png
  • pom依赖:web模块依赖,webmvc依赖,jackson依赖

    UTF-8
    1.8
    1.8
    5.1.5.RELEASE
    1.9.2
    4.12
    1.2.17
    1.7.12
    4.5.1
    5.1.47
    3.5.0
    2.0.0
    4.1.5
    1.1.14
    1.18.6
    2.9.8
    1.9.13
  
  
    
      junit
      junit
      4.12
      test
    
    
    
      org.springframework
      spring-context
      ${spring.version}
    
    
      org.springframework
      spring-aop
      ${spring.version}
    
    
      org.aspectj
      aspectjweaver
      ${aspectj.version}
    
    
      org.aspectj
      aspectjrt
      ${aspectj.version}
    
    
    
      org.springframework
      spring-test
      ${spring.version}
    
    
    
      junit
      junit
      ${junit.version}
      test
    
    
    
      log4j
      log4j
      ${log4j.version}
    
    
      org.slf4j
      slf4j-api
      ${slf4j.version}
    
    
      org.slf4j
      slf4j-log4j12
      ${slf4j.version}
    
    
      cn.hutool
      hutool-all
      ${hutool.version}
    
    
      com.google.zxing
      core
      3.3.3
    
    
    
      org.springframework
      spring-tx
      ${spring.version}
    
    
      org.springframework
      spring-jdbc
      ${spring.version}
    
    
      mysql
      mysql-connector-java
      ${mysql.version}
    
    
      org.mybatis
      mybatis
      ${mybatis.version}
    
    
      org.mybatis
      mybatis-spring
      ${mybatis-spring.version}
    
    
      tk.mybatis
      mapper
      ${tk-mybatis.version}
    
    
      com.alibaba
      druid
      ${druid.version}
    
    
      org.projectlombok
      lombok
      ${lombok.version}
      provided
    
    
      org.springframework
      spring-webmvc
      ${spring.version}
    
    
      com.fasterxml.jackson.core
      jackson-databind
      ${jackson.version}
    
    
      com.fasterxml.jackson.core
      jackson-core
      ${jackson.version}
    
    
      com.fasterxml.jackson.core
      jackson-annotations
      ${jackson.version}
    
    
      org.codehaus.jackson
      jackson-mapper-asl
      ${jackson-mapper.version}
    
    
      javax.servlet
      servlet-api
      2.5
    
  
  • entity实体类
    SysUser类、Course类、CourseVO类
  • dao接口,增加自定义的复杂关联查询(注解)
    SysDAO类、CourseDAO类、BaseDAO类
  • service接口,注入dao,调用相应方法
    CourseService类、CourseServiceImpl类
  • 对service做单元测试
    CourseServiceImplTest
  • controller,使用RESTful风格请求,完成控制层
    CourseController类、web.xml
  • 用postman对controller进行接口测试,杜绝一切404和500
    postman.png

    代码已推送到了Github

2.前端:


    
        
        Vue.js-访问API接口数据-蓝墨云班课练习
        
        
        
        
        
        
        
    
    
        

进行中的班课

{{courses.length}}个进行中的班课


{{course.courseClass}}

{{course.courseName}}

{{course.username}}

{{course.courseCode}}

效果图:


day08-5.png

你可能感兴趣的:(day08 前后端分离开发(lanmoyun))