Browse Source

通知是否存在校验

tags/正式3.13.5
王宁 1 year ago
parent
commit
c1fa745f13

+ 6
- 0
sapi/src/main/java/com/xhkjedu/sapi/controller/notice/NoticeController.java View File

@@ -219,4 +219,10 @@ public class NoticeController {
219 219
         noticeService.chandleNoticeUser();
220 220
         return new ResultVo(0, "处理成功");
221 221
     }
222
+
223
+    @PostMapping("/isexits")
224
+    public ResultVo isExits(@RequestBody TNotice notice) {
225
+        N_Utils.validation(new Object[]{notice.getNoticeid(),"通知id",1});
226
+        return new ResultVo(0, "获取成功",noticeService.getNoticeid(notice.getNoticeid()));
227
+    }
222 228
 }

+ 2
- 0
sapi/src/main/java/com/xhkjedu/sapi/mapper/notice/NoticeMapper.java View File

@@ -77,4 +77,6 @@ public interface NoticeMapper extends TkMapper<TNotice> {
77 77
     List<TSchool> listSchool(Integer noticeid);
78 78
 
79 79
     int deleteNotice(@Param("noticeid")Integer noticeid);
80
+
81
+    Integer getNoticeid(@Param("noticeid")Integer noticeid);
80 82
 }

+ 12
- 0
sapi/src/main/java/com/xhkjedu/sapi/service/notice/NoticeService.java View File

@@ -304,4 +304,16 @@ public class NoticeService {
304 304
         map.put("classes", classes);
305 305
         return map;
306 306
     }
307
+
308
+    /*
309
+     * @Description 获取通知id是否存在
310
+     * @Date 2024/1/15 17:43:12
311
+     * @Author WN
312
+     * @Param [noticeid]
313
+     * @Return boolean
314
+     **/
315
+    public boolean getNoticeid(Integer noticeid){
316
+        Integer findid = noticeMapper.getNoticeid(noticeid);
317
+        return N_Utils.isTrueInteger(findid);
318
+    }
307 319
 }

+ 5
- 0
sapi/src/main/resources/mapper/notice/NoticeMapper.xml View File

@@ -127,4 +127,9 @@
127 127
     <delete id="deleteNotice">
128 128
         delete from t_notice where noticeid=#{noticeid}
129 129
     </delete>
130
+
131
+    <!--获取通知id-->
132
+    <select id="getNoticeid" resultType="java.lang.Integer">
133
+        select noticeid from t_notice where noticeid=#{noticeid}
134
+    </select>
130 135
 </mapper>

Loading…
Cancel
Save