From 93af1c6ffb9ae0e894689ad3a37b548e57d54cff Mon Sep 17 00:00:00 2001
From: linzhijie <19970921lzj>
Date: 星期四, 11 三月 2021 19:10:07 +0800
Subject: [PATCH] 有注释的测评系统业务代码

---
 src/main/java/com/ots/project/exam/service/impl/TTextContentServiceImpl.java |   66 ++++++++++++++++++++++++++++----
 1 files changed, 57 insertions(+), 9 deletions(-)

diff --git a/src/main/java/com/ots/project/exam/service/impl/TTextContentServiceImpl.java b/src/main/java/com/ots/project/exam/service/impl/TTextContentServiceImpl.java
index 778cf9c..131d4f8 100644
--- a/src/main/java/com/ots/project/exam/service/impl/TTextContentServiceImpl.java
+++ b/src/main/java/com/ots/project/exam/service/impl/TTextContentServiceImpl.java
@@ -1,4 +1,5 @@
 package com.ots.project.exam.service.impl;
+
 import com.ots.common.utils.DateUtils;
 import com.ots.common.utils.text.Convert;
 import com.ots.project.exam.domain.TTextContent;
@@ -8,55 +9,101 @@
 import com.ots.project.tool.exam.JsonUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
 import java.util.Date;
 import java.util.List;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
+/**
+ * 棰樼洰鐨勫唴瀹筍ervice涓氬姟灞傚鐞�
+ *
+ * @author ots
+ * @date 2019-11-24
+ */
 @Service
 public class TTextContentServiceImpl implements ITTextContentService {
     @Autowired
     private TTextContentMapper tTextContentMapper;
-    
+
+    /**
+     * 鏌ヨ棰樼洰鐨勫唴瀹�
+     *
+     * @param id 棰樼洰鐨勫唴瀹笽D
+     * @return 棰樼洰鐨勫唴瀹�
+     */
     @Override
     public TTextContent selectTTextContentById(Long id) {
         return tTextContentMapper.selectTTextContentById(id);
     }
-    
+
+    //鐢╥n鐨勬柟寮忔煡璇�
     @Override
     public List<TTextContent> selectTTextContentByIds(String[] ids) {
         return tTextContentMapper.selectTTextContentByIds(ids);
     }
+
     @Override
     public List<TTextContentAndQuestion> selectTextContentAndQuestion(String[] ids) {
         return tTextContentMapper.selectTextContentAndQuestion(ids);
     }
-    
+
+    /**
+     * 鏌ヨ棰樼洰鐨勫唴瀹瑰垪琛�
+     *
+     * @param tTextContent 棰樼洰鐨勫唴瀹�
+     * @return 棰樼洰鐨勫唴瀹�
+     */
     @Override
     public List<TTextContent> selectTTextContentList(TTextContent tTextContent) {
         return tTextContentMapper.selectTTextContentList(tTextContent);
     }
-    
+
+    /**
+     * 鏂板棰樼洰鐨勫唴瀹�
+     *
+     * @param tTextContent 棰樼洰鐨勫唴瀹�
+     * @return 缁撴灉
+     */
     @Override
     public int insertTTextContent(TTextContent tTextContent) {
         tTextContent.setCreateTime(DateUtils.getNowDate());
         return tTextContentMapper.insertTTextContent(tTextContent);
     }
-    
+
+    /**
+     * 淇敼棰樼洰鐨勫唴瀹�
+     *
+     * @param tTextContent 棰樼洰鐨勫唴瀹�
+     * @return 缁撴灉
+     */
     @Override
     public int updateTTextContent(TTextContent tTextContent) {
         tTextContent.setUpdateTime(DateUtils.getNowDate());
         return tTextContentMapper.updateTTextContent(tTextContent);
     }
-    
+
+    /**
+     * 鍒犻櫎棰樼洰鐨勫唴瀹瑰璞�
+     *
+     * @param ids 闇�瑕佸垹闄ょ殑鏁版嵁ID
+     * @return 缁撴灉
+     */
     @Override
     public int deleteTTextContentByIds(String ids) {
         return tTextContentMapper.deleteTTextContentByIds(Convert.toStrArray(ids));
     }
-    
+
+    /**
+     * 鍒犻櫎棰樼洰鐨勫唴瀹逛俊鎭�
+     *
+     * @param id 棰樼洰鐨勫唴瀹笽D
+     * @return 缁撴灉
+     */
     public int deleteTTextContentById(Long id) {
         return tTextContentMapper.deleteTTextContentById(id);
     }
+
     @Override
     public <T, R> TTextContent jsonConvertInsert(List<T> list, Date now, Function<? super T, ? extends R> mapper) {
         String frameTextContent = null;
@@ -67,9 +114,10 @@
             frameTextContent = JsonUtil.toJsonStr(mapList);
         }
         TTextContent textContent = new TTextContent(frameTextContent, now);
-        
+        //insertByFilter(textContent);  cache useless
         return textContent;
     }
+
     @Override
     public <T, R> TTextContent jsonConvertUpdate(TTextContent textContent, List<T> list, Function<? super T, ? extends R> mapper) {
         String frameTextContent = null;
@@ -80,7 +128,7 @@
             frameTextContent = JsonUtil.toJsonStr(mapList);
         }
         textContent.setContent(frameTextContent);
-        
+        //this.updateByIdFilter(textContent);  cache useless
         return textContent;
     }
 }

--
Gitblit v1.9.1