Ver código fonte

特别鸣谢

jz.kai 1 ano atrás
pai
commit
4e2b116b7b

+ 3 - 0
common/src/main/resources/mapper/base/NewsInfo.xml

@@ -108,6 +108,9 @@
 					AND reg_user_id = #{searchParams.regUserId}
 				)
 			</if>
+			<foreach collection="searchParams.types" item="item"  open="and (" separator="or" close=")">
+				a.type_ = #{item}
+			</foreach>
 		</where>
 		<foreach item="sort" collection="sortList"  open="order by" separator=",">
 	        ${sort.name} ${sort.order}

+ 25 - 0
web/src/main/java/com/jpsoft/employment/modules/base/api/NewsApi.java

@@ -40,6 +40,7 @@ public class NewsApi {
         MessageResult msgResult = new MessageResult<>();
 
         Map<String,Object> searchParams = new HashMap<>();
+        searchParams.put("types", new String[]{"1","2","3"});
 
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("is_top","desc"));
@@ -61,6 +62,7 @@ public class NewsApi {
 
         Map<String,Object> searchParams = new HashMap<>();
         searchParams.put("regUserId",subject);
+        searchParams.put("types", new String[]{"1","2","3"});
 
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("create_time","desc"));
@@ -83,6 +85,7 @@ public class NewsApi {
 
         Map<String,Object> searchParams = new HashMap<>();
         searchParams.put("regUserId",subject);
+        searchParams.put("types", new String[]{"1","2","3"});
 
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("create_time","desc"));
@@ -120,4 +123,26 @@ public class NewsApi {
 
         return msgResult;
     }
+
+    @ApiOperation(value="特别鸣谢")
+    @RequestMapping(value = "thanksList",method = RequestMethod.POST)
+    public MessageResult thanksList(
+            @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
+            @RequestParam(value="pageSize",defaultValue="10") int pageSize){
+        MessageResult msgResult = new MessageResult<>();
+
+        Map<String,Object> searchParams = new HashMap<>();
+        searchParams.put("type", "4");
+
+        List<Sort> sortList = new ArrayList<>();
+        sortList.add(new Sort("is_top","desc"));
+        sortList.add(new Sort("create_time","desc"));
+
+        Page<NewsInfo> page = newsInfoService.pageSearch(searchParams,pageIndex,pageSize,true,sortList);
+
+        msgResult.setResult(true);
+        msgResult.setData(PojoUtils.pageWrapper(page));
+
+        return msgResult;
+    }
 }