deason %!s(int64=6) %!d(string=hai) anos
pai
achega
9cc92f2bd1

+ 8 - 0
src/main/java/cn/com/qmth/examcloud/app/service/BaseInfoService.java

@@ -17,6 +17,14 @@ import cn.com.qmth.examcloud.app.model.Result;
  */
 public interface BaseInfoService {
 
+    /**
+     * 获取学生用户信息
+     *
+     * @param key
+     * @param token
+     * @return
+     * @throws Exception
+     */
     Result getStudentInfo(String key, String token) throws Exception;
 
 }

+ 15 - 2
src/main/java/cn/com/qmth/examcloud/app/service/DeviceRecordService.java

@@ -20,8 +20,21 @@ import org.springframework.data.domain.Page;
  */
 public interface DeviceRecordService {
 
-    Result<Page<DeviceRecord>> getDeviceRecordList(DeviceRecordQuery params);
+    /**
+     * 查询设备访问记录(分页)
+     *
+     * @param params
+     * @return
+     * @throws Exception
+     */
+    Result<Page<DeviceRecord>> getDeviceRecordList(DeviceRecordQuery params) throws Exception;
 
-    void addDeviceRecord(DeviceRecord deviceRecord);
+    /**
+     * 新增设备访问记录
+     *
+     * @param deviceRecord
+     * @throws Exception
+     */
+    void addDeviceRecord(DeviceRecord deviceRecord) throws Exception;
 
 }

+ 18 - 0
src/main/java/cn/com/qmth/examcloud/app/service/ExamAdminService.java

@@ -17,8 +17,26 @@ import cn.com.qmth.examcloud.app.model.Result;
  */
 public interface ExamAdminService {
 
+    /**
+     * 获取某考生的“考试批次”列表
+     *
+     * @param key
+     * @param token
+     * @param studentId
+     * @return
+     * @throws Exception
+     */
     Result getPracticeExamList(String key, String token, String studentId) throws Exception;
 
+    /**
+     * 获取当前练习的考试基本信息
+     *
+     * @param key
+     * @param token
+     * @param examId
+     * @return
+     * @throws Exception
+     */
     Result getExamInfo(String key, String token, Long examId) throws Exception;
 
 }

+ 173 - 0
src/main/java/cn/com/qmth/examcloud/app/service/NetExamService.java

@@ -17,43 +17,216 @@ import cn.com.qmth.examcloud.app.model.Result;
  */
 public interface NetExamService {
 
+    /**
+     * 获取服务器当前时间
+     *
+     * @param key
+     * @param token
+     * @return
+     * @throws Exception
+     */
     Result getCurrentTime(String key, String token) throws Exception;
 
+    /**
+     * 获取当前用户参加的离线课程列表
+     *
+     * @param key
+     * @param token
+     * @return
+     * @throws Exception
+     */
     Result getOfflineExamCourseList(String key, String token) throws Exception;
 
+    /**
+     * 离线考试的抽取考题
+     *
+     * @param key
+     * @param token
+     * @param examStudentId
+     * @return
+     * @throws Exception
+     */
     Result startOfflineExamRecord(String key, String token, String examStudentId) throws Exception;
 
+    /**
+     * 上传作答文件
+     *
+     * @param key
+     * @param token
+     * @param examRecordId
+     * @param fileBytes
+     * @param fileName
+     * @param md5
+     * @return
+     * @throws Exception
+     */
     Result uploadPaperAnswer(String key, String token, String examRecordId, byte[] fileBytes, String fileName, String md5) throws Exception;
 
+    /**
+     * 获取某考试批次下的课程列表
+     *
+     * @param key
+     * @param token
+     * @param examId
+     * @return
+     * @throws Exception
+     */
     Result getPracticeExamCourseList(String key, String token, String examId) throws Exception;
 
+    /**
+     * 获取当前练习的剩余作答时间
+     *
+     * @param key
+     * @param token
+     * @param examRecordId
+     * @return
+     * @throws Exception
+     */
     Result getExamRecordHeartbeat(String key, String token, String examRecordId) throws Exception;
 
+    /**
+     * 考生“开始练习”
+     *
+     * @param key
+     * @param token
+     * @param examStudentId
+     * @return
+     * @throws Exception
+     */
     Result startPracticeExamRecord(String key, String token, String examStudentId) throws Exception;
 
+    /**
+     * 获取当前练习的试卷大题结构信息
+     *
+     * @param key
+     * @param token
+     * @param examRecordId
+     * @return
+     * @throws Exception
+     */
     Result getExamRecordPaperStructList(String key, String token, String examRecordId) throws Exception;
 
+    /**
+     * 获取当前练习的试卷试题列表
+     *
+     * @param key
+     * @param token
+     * @param examRecordId
+     * @return
+     * @throws Exception
+     */
     Result getExamRecordPaperQuestionList(String key, String token, String examRecordId) throws Exception;
 
+    /**
+     * 获取考生作答的某个试题的详细信息
+     *
+     * @param key
+     * @param token
+     * @param questionId
+     * @return
+     * @throws Exception
+     */
     Result getExamRecordPaperQuestionDetail(String key, String token, String questionId) throws Exception;
 
+    /**
+     * 保存或更新考生作答的某个试题答案
+     *
+     * @param key
+     * @param token
+     * @param examQuestionId
+     * @param studentAnswer
+     * @return
+     * @throws Exception
+     */
     Result updateExamRecordPaperQuestionAnswer(String key, String token, String examQuestionId, String studentAnswer) throws Exception;
 
+    /**
+     * 当前练习的交卷
+     *
+     * @param key
+     * @param token
+     * @param examRecordId
+     * @return
+     * @throws Exception
+     */
     Result submitPracticeExamRecord(String key, String token, String examRecordId) throws Exception;
 
+    /**
+     * 检查考生当前是否有正在进行的练习记录
+     *
+     * @param key
+     * @param token
+     * @return
+     * @throws Exception
+     */
     Result checkOnlineExamRecord(String key, String token) throws Exception;
 
+    /**
+     * 获取当前考生的当前课程练习统计信息
+     *
+     * @param key
+     * @param token
+     * @param examStudentId
+     * @return
+     * @throws Exception
+     */
     @Deprecated
     Result getExamRecordPracticeTotalInfo(String key, String token, String examStudentId) throws Exception;
 
+    /**
+     * 获取当前考生的当前课程的历史练习记录
+     *
+     * @param key
+     * @param token
+     * @param examStudentId
+     * @return
+     * @throws Exception
+     */
     Result getExamRecordPracticeHistoryList(String key, String token, String examStudentId) throws Exception;
 
+    /**
+     * 获取成绩报告的答题情况统计
+     *
+     * @param key
+     * @param token
+     * @param examRecordId
+     * @return
+     * @throws Exception
+     */
     Result getExamRecordTotalInfo(String key, String token, String examRecordId) throws Exception;
 
+    /**
+     * 获取作答的题列表
+     *
+     * @param key
+     * @param token
+     * @param examRecordId
+     * @return
+     * @throws Exception
+     */
     Result getExamRecordQuestionDetailList(String key, String token, String examRecordId) throws Exception;
 
+    /**
+     * 获取当前试题的音频已播放次数
+     *
+     * @param key
+     * @param token
+     * @param questionId
+     * @return
+     * @throws Exception
+     */
     Result getExamRecordQuestionAudioPlayTimes(String key, String token, String questionId) throws Exception;
 
+    /**
+     * 更新当前试题的音频已播放次数
+     *
+     * @param key
+     * @param token
+     * @param questionId
+     * @param mediaName
+     * @return
+     * @throws Exception
+     */
     Result updateExamRecordQuestionAudioPlayTimes(String key, String token, String questionId, String mediaName) throws Exception;
 
 }

+ 17 - 0
src/main/java/cn/com/qmth/examcloud/app/service/QuestionPoolService.java

@@ -17,8 +17,25 @@ import cn.com.qmth.examcloud.app.model.Result;
  */
 public interface QuestionPoolService {
 
+    /**
+     * 下载考题
+     *
+     * @param paperId
+     * @param orgName
+     * @return
+     * @throws Exception
+     */
     String downloadPaper(String paperId, String orgName) throws Exception;
 
+    /**
+     * 获取某份试卷的详细信息
+     *
+     * @param key
+     * @param token
+     * @param paperId
+     * @return
+     * @throws Exception
+     */
     Result getPaperDetail(String key, String token, String paperId) throws Exception;
 
 }

+ 19 - 0
src/main/java/cn/com/qmth/examcloud/app/service/SmsService.java

@@ -17,8 +17,27 @@ import cn.com.qmth.examcloud.app.model.Result;
  */
 public interface SmsService {
 
+    /**
+     * 获取短信验证码
+     *
+     * @param key
+     * @param token
+     * @param phone
+     * @return
+     * @throws Exception
+     */
     Result<String> sendSmsCode(String key, String token, String phone) throws Exception;
 
+    /**
+     * 校验短信验证码
+     *
+     * @param key
+     * @param token
+     * @param phone
+     * @param code
+     * @return
+     * @throws Exception
+     */
     Result<String> checkSmsCode(String key, String token, String phone, String code) throws Exception;
 
 }

+ 7 - 0
src/main/java/cn/com/qmth/examcloud/app/service/UpYunService.java

@@ -15,6 +15,13 @@ package cn.com.qmth.examcloud.app.service;
  */
 public interface UpYunService {
 
+    /**
+     * 下载已上传的“作答文件”
+     *
+     * @param filePath
+     * @return
+     * @throws Exception
+     */
     String downloadPaperAnswer(String filePath) throws Exception;
 
 }

+ 78 - 0
src/main/java/cn/com/qmth/examcloud/app/service/UserAuthService.java

@@ -19,27 +19,105 @@ import cn.com.qmth.examcloud.app.model.UserInfo;
  */
 public interface UserAuthService {
 
+    /**
+     * 用户登录
+     *
+     * @param loginInfo
+     * @return
+     * @throws Exception
+     */
     Result<UserInfo> login(LoginInfo loginInfo) throws Exception;
 
+    /**
+     * 用户退出登录
+     *
+     * @param key
+     * @param token
+     * @return
+     * @throws Exception
+     */
     Result logout(String key, String token) throws Exception;
 
+    /**
+     * 获取用户信息
+     *
+     * @param key
+     * @param token
+     * @return
+     * @throws Exception
+     */
     @Deprecated
     Result getUserInfo(String key, String token) throws Exception;
 
+    /**
+     * 修改密码
+     *
+     * @param key
+     * @param token
+     * @param userId
+     * @param password
+     * @return
+     * @throws Exception
+     */
     Result updatePassword(String key, String token, Long userId, String password) throws Exception;
 
+    /**
+     * 获取短信验证码
+     *
+     * @param key
+     * @param token
+     * @param phone
+     * @return
+     * @throws Exception
+     */
     Result sendSmsCode(String key, String token, String phone) throws Exception;
 
+    /**
+     * 保存用户绑定的手机号
+     *
+     * @param key
+     * @param token
+     * @param phone
+     * @param code
+     * @return
+     * @throws Exception
+     */
     Result userBindingPhone(String key, String token, String phone, String code) throws Exception;
 
+    /**
+     * 缓存用户登录信息
+     *
+     * @param loginInfo
+     * @param userInfo
+     */
     void cacheLoginInfo(LoginInfo loginInfo, UserInfo userInfo);
 
+    /**
+     * 缓存用户登录信息
+     *
+     * @param loginInfo
+     * @param key
+     */
     void cacheLoginInfo(LoginInfo loginInfo, String key);
 
+    /**
+     * 获取缓存中的用户登录信息
+     *
+     * @param key
+     * @return
+     */
     LoginInfo getLoginInfo(String key);
 
+    /**
+     * 获取平台端的默认过期时间(秒)
+     *
+     * @return
+     */
     int getSessionTimeout();
 
+    /**
+     * 初始化内部接口请求鉴权
+     */
     void initRequestTrace();
 
 }

+ 2 - 2
src/main/java/cn/com/qmth/examcloud/app/service/impl/DeviceRecordServiceImpl.java

@@ -46,7 +46,7 @@ public class DeviceRecordServiceImpl implements DeviceRecordService {
 
     @SuppressWarnings("unchecked")
     @Override
-    public Result<Page<DeviceRecord>> getDeviceRecordList(DeviceRecordQuery params) {
+    public Result<Page<DeviceRecord>> getDeviceRecordList(DeviceRecordQuery params) throws Exception {
         Specification<DeviceRecord> spec = null;
         if (params != null) {
             spec = new Specification<DeviceRecord>() {
@@ -107,7 +107,7 @@ public class DeviceRecordServiceImpl implements DeviceRecordService {
 
     @Async
     @Override
-    public void addDeviceRecord(DeviceRecord deviceRecord) {
+    public void addDeviceRecord(DeviceRecord deviceRecord) throws Exception {
         Assert.notNull(deviceRecord, "DeviceRecord must not be null.");
         deviceRecordRepository.save(deviceRecord);
     }