Browse Source

add DeviceRecord

deason 7 năm trước cách đây
mục cha
commit
11654289c3

+ 44 - 0
src/main/java/cn/com/qmth/examcloud/app/controller/DeviceRecordController.java

@@ -0,0 +1,44 @@
+/*
+ * *************************************************
+ * Copyright (c) 2018 QMTH. All Rights Reserved.
+ * Created by Deason on 2018-07-20 11:04:17.
+ * *************************************************
+ */
+
+package cn.com.qmth.examcloud.app.controller;
+
+import cn.com.qmth.examcloud.app.model.DeviceRecord;
+import cn.com.qmth.examcloud.app.model.Result;
+import cn.com.qmth.examcloud.app.service.DeviceRecordService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import java.util.List;
+
+/**
+ * 设备访问记录Controller
+ */
+@Controller
+@RequestMapping("/device/record")
+public class DeviceRecordController {
+    private static Logger log = LoggerFactory.getLogger(DeviceRecordController.class);
+    @Autowired
+    private DeviceRecordService deviceRecordService;
+
+    @RequestMapping(value = "/list", method = RequestMethod.GET)
+    public String main() {
+        return "deviceRecord";
+    }
+
+    @ResponseBody
+    @RequestMapping(value = "/list", method = RequestMethod.POST)
+    public Result<List<DeviceRecord>> list() throws Exception {
+        return deviceRecordService.getDeviceRecordList();
+    }
+
+}

+ 127 - 0
src/main/java/cn/com/qmth/examcloud/app/model/DeviceRecord.java

@@ -0,0 +1,127 @@
+/*
+ * *************************************************
+ * Copyright (c) 2018 QMTH. All Rights Reserved.
+ * Created by Deason on 2018-07-20 09:57:01.
+ * *************************************************
+ */
+
+package cn.com.qmth.examcloud.app.model;
+
+import java.io.Serializable;
+
+/**
+ * 设备访问记录
+ * 注:用于记录APP端调用接口时header中附带来源信息
+ */
+public class DeviceRecord implements Serializable {
+    private static final long serialVersionUID = 1L;
+    private String system;//系统标识,如:ios,android
+    private String deviceId;//设备编号
+    private String netType;//网络类型,如:WIFI,GPRS,2G,3G,4G,5G
+    private String brand;//设备品牌,如:iPhone,小米,华为
+    private String model;//型号,如:iPhone6 plus
+    private String sysVer;//系统版本号,如:android6.0,ios11.0.2
+    private String appVer;//app版本号,如:1.0.1,2.0.0
+    private String appCode;//app更新号[整数]
+    private String patchCode;//app补丁号
+    private String account;//来源账号(登录名或手机号)
+    private String key;//认证KEY
+    private String token;//认证TOKEN
+
+    public String getSystem() {
+        return system;
+    }
+
+    public void setSystem(String system) {
+        this.system = system;
+    }
+
+    public String getDeviceId() {
+        return deviceId;
+    }
+
+    public void setDeviceId(String deviceId) {
+        this.deviceId = deviceId;
+    }
+
+    public String getNetType() {
+        return netType;
+    }
+
+    public void setNetType(String netType) {
+        this.netType = netType;
+    }
+
+    public String getBrand() {
+        return brand;
+    }
+
+    public void setBrand(String brand) {
+        this.brand = brand;
+    }
+
+    public String getModel() {
+        return model;
+    }
+
+    public void setModel(String model) {
+        this.model = model;
+    }
+
+    public String getSysVer() {
+        return sysVer;
+    }
+
+    public void setSysVer(String sysVer) {
+        this.sysVer = sysVer;
+    }
+
+    public String getAppVer() {
+        return appVer;
+    }
+
+    public void setAppVer(String appVer) {
+        this.appVer = appVer;
+    }
+
+    public String getAppCode() {
+        return appCode;
+    }
+
+    public void setAppCode(String appCode) {
+        this.appCode = appCode;
+    }
+
+    public String getPatchCode() {
+        return patchCode;
+    }
+
+    public void setPatchCode(String patchCode) {
+        this.patchCode = patchCode;
+    }
+
+    public String getAccount() {
+        return account;
+    }
+
+    public void setAccount(String account) {
+        this.account = account;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getToken() {
+        return token;
+    }
+
+    public void setToken(String token) {
+        this.token = token;
+    }
+
+}

+ 29 - 0
src/main/java/cn/com/qmth/examcloud/app/service/DeviceRecordService.java

@@ -0,0 +1,29 @@
+/*
+ * *************************************************
+ * Copyright (c) 2018 QMTH. All Rights Reserved.
+ * Created by Deason on 2018-07-20 11:02:44.
+ * *************************************************
+ */
+
+package cn.com.qmth.examcloud.app.service;
+
+import cn.com.qmth.examcloud.app.model.DeviceRecord;
+import cn.com.qmth.examcloud.app.model.Result;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 设备访问记录Service
+ */
+@Service
+public class DeviceRecordService {
+    private static Logger log = LoggerFactory.getLogger(DeviceRecordService.class);
+
+    public Result<List<DeviceRecord>> getDeviceRecordList() {
+        return null;
+    }
+
+}

+ 13 - 0
src/main/resources/templates/deviceRecord.ftl

@@ -0,0 +1,13 @@
+<#assign base=request.contextPath>
+<!DOCTYPE html>
+<html lang="zh-cn">
+<head>
+    <title>设备访问记录</title>
+    <meta name="renderer" content="webkit"/>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
+</head>
+<body>
+todo
+</body>
+</html>