Browse Source

Merge remote-tracking branch 'origin/xjw' into xjw

xujiawei 5 years ago
parent
commit
a4d04437b5

+ 4 - 0
src/main/java/edu/nju/controller/ItemController.java

@@ -0,0 +1,4 @@
+package edu.nju.controller;
+
+public class ItemController {
+}

+ 63 - 0
src/main/java/edu/nju/entities/Answer.java

@@ -0,0 +1,63 @@
+package edu.nju.entities;
+
+import org.springframework.data.annotation.Id;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+@Document
+public class Answer implements java.io.Serializable{
+
+
+    private static final long serialVersionUID = -8263451883506704407L;
+
+    @Id
+    private String id;
+
+    private String item_id;
+
+    private int[] answers;
+
+    private String user_id;
+
+    public Answer(String id, String item_id, int[] answers, String user_id) {
+        this.id = id;
+        this.item_id = item_id;
+        this.answers = answers;
+        this.user_id = user_id;
+    }
+
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getItem_id() {
+        return item_id;
+    }
+
+    public void setItem_id(String item_id) {
+        this.item_id = item_id;
+    }
+
+    public int[] getAnswers() {
+        return answers;
+    }
+
+    public void setAnswers(int[] answers) {
+        this.answers = answers;
+    }
+
+    public String getUser_id() {
+        return user_id;
+    }
+
+    public void setUser_id(String user_id) {
+        this.user_id = user_id;
+    }
+
+
+
+}

+ 113 - 0
src/main/java/edu/nju/entities/Item.java

@@ -0,0 +1,113 @@
+package edu.nju.entities;
+
+import org.springframework.data.annotation.Id;
+import org.springframework.data.annotation.PersistenceConstructor;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+import java.util.Set;
+
+@Document
+public class Item implements java.io.Serializable {
+
+    /**
+     *
+     */
+    private static final long serialVersionUID = 1884350958222679356L;
+
+    @Id
+    private String id;
+
+    private String job_id;
+
+    private String description;
+
+    private Set<String> img_urls;
+
+    private boolean isRequired;
+
+    private boolean isMultiple;
+
+    private String attachment_location;
+
+    private String[] answers;
+
+    @PersistenceConstructor
+    public Item(String id, String description, Set<String> img_urls, boolean isRequired, boolean isMultiple, String attachment_location,String[] answers,String job_id) {
+        this.id = id;
+        this.description = description;
+        this.img_urls = img_urls;
+        this.isRequired = isRequired;
+        this.isMultiple = isMultiple;
+        this.attachment_location = attachment_location;
+        this.answers = answers;
+        this.job_id = job_id;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getDescription() {
+        return description;
+    }
+
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    public Set<String> getImg_urls() {
+        return img_urls;
+    }
+
+    public void setImg_urls(Set<String> img_urls) {
+        this.img_urls = img_urls;
+    }
+
+    public boolean isRequired() {
+        return isRequired;
+    }
+
+    public void setRequired(boolean required) {
+        isRequired = required;
+    }
+
+    public boolean isMultiple() {
+        return isMultiple;
+    }
+
+    public void setMultiple(boolean multiple) {
+        isMultiple = multiple;
+    }
+
+    public String getAttachment_location() {
+        return attachment_location;
+    }
+
+    public void setAttachment_location(String attachment_location) {
+        this.attachment_location = attachment_location;
+    }
+
+    public String[] getAnswers() {
+        return answers;
+    }
+
+    public void setAnswers(String[] answers) {
+        this.answers = answers;
+    }
+
+    public String getJob_id() {
+        return job_id;
+    }
+
+    public void setJob_id(String job_id) {
+        this.job_id = job_id;
+    }
+
+
+
+
+}

+ 125 - 0
src/main/java/edu/nju/entities/Job.java

@@ -0,0 +1,125 @@
+package edu.nju.entities;
+
+import org.springframework.data.annotation.Id;
+import org.springframework.data.mongodb.core.mapping.Document;
+
+@Document
+public class Job implements java.io.Serializable{
+
+    private static final long serialVersionUID = 3417624501014997684L;
+
+    @Id
+    private String id;
+
+    private String desciption;
+
+    private String name;
+
+    private String create_time_millis;
+
+    private String device_model;
+
+    private String device_brand;
+
+    private String device_os;
+
+    private String script_location;
+
+    private String report_location;
+
+    private String log_location;
+
+    public Job(String id, String desciption, String name, String create_time_millis, String device_model, String device_brand, String device_os, String script_location, String report_location, String log_location) {
+        this.id = id;
+        this.desciption = desciption;
+        this.name = name;
+        this.create_time_millis = create_time_millis;
+        this.device_model = device_model;
+        this.device_brand = device_brand;
+        this.device_os = device_os;
+        this.script_location = script_location;
+        this.report_location = report_location;
+        this.log_location = log_location;
+    }
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getDesciption() {
+        return desciption;
+    }
+
+    public void setDesciption(String desciption) {
+        this.desciption = desciption;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getCreate_time_millis() {
+        return create_time_millis;
+    }
+
+    public void setCreate_time_millis(String create_time_millis) {
+        this.create_time_millis = create_time_millis;
+    }
+
+    public String getDevice_model() {
+        return device_model;
+    }
+
+    public void setDevice_model(String device_model) {
+        this.device_model = device_model;
+    }
+
+    public String getDevice_brand() {
+        return device_brand;
+    }
+
+    public void setDevice_brand(String device_brand) {
+        this.device_brand = device_brand;
+    }
+
+    public String getDevice_os() {
+        return device_os;
+    }
+
+    public void setDevice_os(String device_os) {
+        this.device_os = device_os;
+    }
+
+    public String getScript_location() {
+        return script_location;
+    }
+
+    public void setScript_location(String script_location) {
+        this.script_location = script_location;
+    }
+
+    public String getReport_location() {
+        return report_location;
+    }
+
+    public void setReport_location(String report_location) {
+        this.report_location = report_location;
+    }
+
+    public String getLog_location() {
+        return log_location;
+    }
+
+    public void setLog_location(String log_location) {
+        this.log_location = log_location;
+    }
+
+}

+ 0 - 40
src/main/resources/logback.xml

@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<configuration>
-
-    <include resource="org/springframework/boot/logging/logback/defaults.xml" />
-
-    <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>logs/crowdsource-backend.log</file>
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>logs/crowdsource-backend.log.%d{yyyy-MM-dd}.log</fileNamePattern>
-            <maxHistory>30</maxHistory>
-        </rollingPolicy>
-        <triggeringPolicy class="ch.qos.logback.core.rolling.SizeBasedTriggeringPolicy">
-            <maxFileSize>10MB</maxFileSize>
-        </triggeringPolicy>
-        <encoder>
-            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{35} - %msg %n</pattern>
-            <charset>UTF-8</charset> <!-- 此处设置字符集 -->
-        </encoder>
-    </appender>
-
-    <appender name="recommendAppender" class="ch.qos.logback.core.rolling.RollingFileAppender">
-        <file>logs/recommend.log</file>
-        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
-            <fileNamePattern>logs/recommend.log.%d{yyyy-MM-dd}.log</fileNamePattern>
-        </rollingPolicy>
-        <encoder>
-            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{5} - %msg%n</pattern>
-        </encoder>
-    </appender>
-
-    <logger name="edu.nju.service" level="DEBUG" additivity="false">
-        <appender-ref ref="recommendAppender" />
-    </logger>
-
-    <root level="INFO">
-        <appender-ref ref="FILE"></appender-ref>
-    </root>
-
-</configuration>