# Questionnaire **Repository Path**: edxuanlen/Questionnaire ## Basic Information - **Project Name**: Questionnaire - **Description**: 问卷调查 - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2020-07-02 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README * [调查问卷](#调查问卷) * [项目包结构](#项目包结构) * [数据库结构](#数据库结构) * [前端](#前端) * [数据库](#数据库) * [HikariCP](#hikaricp) * [Mybatis](#mybatis) * [单元测试](#单元测试) * [Junit5](#junit5) * [前端安全](#前端安全) * [Xss 攻击](#xss-攻击) * [CSRF 攻击](#csrf-攻击) * [JSR303 数据校验](#jsr303-数据校验) * [投票器](#投票器) # 调查问卷 [Click me to jump to English version Readme](./README.en.md) ## 项目包结构 一. 代码层结构 com.run 1. 启动类(QuestionaireApplication.java)放在根目录com.run包下 2. 实体类(pojo) com.run.pojo 3. 数据接口访问层(Dao) com.run.mapper 4. 数据服务接口层(Service)com.run.service 5. 数据服务实现层(Service Implements) com.run.serviceimpl 6. 前端控制器层(Controller) com.run.controller 7. 工具类库(com.run.utils)com.run.com.run.utils 8. 配置类(config)com.run.config 9. 数据传输对象(dto)com.run.dto 数据传输对象(Data Transfer Object)用于封装多个实体类(domain)之间的关系,不破坏原有的实体类结构 10. 视图包装对象(vo)com.run.vo 视图包装对象(View Object)用于封装客户端请求的数据,防止部分数据泄露(如:管理员ID),保证数据安全,不破坏 原有的实体类结构 二. 资源目录结构 根目录:resources 1. mybatis映射文件:resources/mapper/ 2. mybatis配置文件:resources/mapper/config/ 根目录: webapp classes statis: html js css ## 数据库结构 **注意 coding=utf-8** - 问卷表 questionnaire - 问卷编号 id - bigint unsigned not null auto_increment 主键 - 问卷名 name - varchar(100) not null - 问卷描述 qn_describe - text - 问卷创建时间 creat_time - datetime not null - 问卷更新时间 update_time - datetime not null - 问卷状态 status - enum('public', 'close') - comment "问卷当前是否开放" - 问题表 question - 问题编号 q_id - int unsigned not null auto_increment 主键 - 问题描述 q_describe - text - 问卷编号 id - int not null 外键 - 题型 question_type - enum('subjective', 'objective') not null - 选项表 question_option - 选项编号 op_id - int unsigned not null auto_increment 主键 - 选项内容 op_describe - varchar(50) - 问题编号 q_id - int not null 外键 - 主观题答案 subjective_question_answer - 答案编号 sub_q_id - int unsigned passwordnot null auto_increment 主键 - 答案内容 content - text - 客观题选择 objective_question_answer - 答案编号 obj_q_id - int unsigned not null auto_increment 主键 - 选项编号 op_id - int not null 外键 ## 前端 - login.html - 负责登陆跳转至后台界面 - questionnaire.html - 单个问卷展示模板 - addQuestionnaire.html - 创建新的问卷 - backstage.html - 后台管理 - 查看所有问卷 - thymeleaf和bootstrap - 1.bootstrap:https://v3.bootcss.com/css/ - 格栅系统 ```html