소스 검색

增加话题关闭功能

沈静伟 4 년 전
부모
커밋
4a38ceaf32

+ 1 - 1
src/dsb/com/cnd3b/restcontroller/system/im/imdialog/SQL/话题查询.sql

@@ -1,2 +1,2 @@
-select t1.createby,t1.createdate,t1.timsubjectid from timsubject t1
+select t1.createby,t1.createdate,t1.timsubjectid,t1.fisclose,t1.closedate from timsubject t1
 where t1.siteid=$siteid$ and t1.timsubjectid=$timsubjectid$
 where t1.siteid=$siteid$ and t1.timsubjectid=$timsubjectid$

+ 16 - 0
src/dsb/com/cnd3b/restcontroller/system/im/imdialog/imdialog.java

@@ -256,6 +256,22 @@ public class imdialog extends Controller {
         return querySubject();
         return querySubject();
     }
     }
 
 
+    /**
+     * 话题关闭
+     * @return
+     * @throws D3bException
+     * @throws P2Exception
+     */
+    public String closeSubject() throws D3bException, P2Exception {
+        long timsubjectid = content.getLongValue("timsubjectid"); //话题ID 新增时默认传0
+        String status = dbConnect.runSqlUpdate("update timsubject set fisclose=1,closedate=getDate() where siteid='" + siteid + "' and timsubjectid=" + timsubjectid);
+        if ("true".equals(status)) {
+            return getSucReturnObject().toString();
+        } else {
+            return getErrReturnObject().toString();
+        }
+    }
+
     /**
     /**
      * 话题内容查询
      * 话题内容查询
      *
      *