Procházet zdrojové kódy

首页滚动消息

lighter před 8 měsíci
rodič
revize
401e887584

+ 7 - 0
src/main/java/thyyxxk/wxservice_server/controller/HomePageController.java

@@ -5,9 +5,11 @@ import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 import thyyxxk.wxservice_server.config.auth.PassToken;
+import thyyxxk.wxservice_server.entity.PureCodeName;
 import thyyxxk.wxservice_server.entity.ResultVo;
 import thyyxxk.wxservice_server.entity.appointment.DoctorInfo;
 import thyyxxk.wxservice_server.service.HomePageService;
+import thyyxxk.wxservice_server.utils.ResultVoUtil;
 
 import java.util.List;
 
@@ -35,4 +37,9 @@ public class HomePageController {
     public ResultVo<String> refreshHomePageDoctors() {
         return service.refreshHomePageDoctors();
     }
+
+    @GetMapping("/getScrollNews")
+    public ResultVo<List<PureCodeName>> getScrollNews() {
+        return ResultVoUtil.success(service.getScrollNews());
+    }
 }

+ 5 - 0
src/main/java/thyyxxk/wxservice_server/dao/HomePageDao.java

@@ -2,6 +2,7 @@ package thyyxxk.wxservice_server.dao;
 
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Select;
+import thyyxxk.wxservice_server.entity.PureCodeName;
 import thyyxxk.wxservice_server.entity.appointment.DoctorInfo;
 
 import java.util.List;
@@ -20,4 +21,8 @@ public interface HomePageDao {
             "portrait,introduction from a_employee_mi with(nolock) where wx_homepage_flag=1 and " +
             "isnull(del_flag,0)!=1 and introduction is not null order by wx_homepage_order")
     List<DoctorInfo> selectHomePageDoctors();
+
+    @Select("select sort_no,title as name,link as code from wxservice_scroll_news " +
+            "where isnull(title,'')!='' and isnull(link,'')!='' order by sort_no")
+    List<PureCodeName> getScrollNews();
 }

+ 1 - 0
src/main/java/thyyxxk/wxservice_server/entity/PureCodeName.java

@@ -8,6 +8,7 @@ import lombok.Data;
  */
 @Data
 public class PureCodeName {
+    private Integer sortNo;
     private String code;
     private String name;
     private Transaction.TradeStateEnum tradeState;

+ 5 - 0
src/main/java/thyyxxk/wxservice_server/service/HomePageService.java

@@ -5,6 +5,7 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Service;
 import thyyxxk.wxservice_server.dao.HomePageDao;
+import thyyxxk.wxservice_server.entity.PureCodeName;
 import thyyxxk.wxservice_server.entity.ResultVo;
 import thyyxxk.wxservice_server.entity.appointment.DoctorInfo;
 import thyyxxk.wxservice_server.utils.ResultVoUtil;
@@ -58,4 +59,8 @@ public class HomePageService {
         HOME_PAGE_DOCTORS.clear();
         return ResultVoUtil.success("首页滚动医生缓存已清空。");
     }
+
+    public List<PureCodeName> getScrollNews() {
+        return dao.getScrollNews();
+    }
 }