Browse Source

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxNotifyServiceImpl.java
#	applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaApproveServiceImpl.java
#	applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxOaLeaveServiceImpl.java
#	applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxPrincipalMailboxServiceImpl.java
#	applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxTaskNotifyServiceImpl.java
#	applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/support/RemindTask.java
#	applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/WechatApplication.java
8966 6 years ago
parent
commit
82d26e7a5d

+ 7 - 1
README.md

@@ -119,4 +119,10 @@
 #接口环境
 [智慧校园接口地址](https://school-api.ubtob.com)
 [微信端web](https://school-wechat.ubtob.com)
-[pc端web地址](https://school.ubtob.com)
+[pc端web地址](https://school.ubtob.com
+
+
+#程序发布
+1. 将代码合并至master,推送至远程
+2. 登陆[jenkins](http://10.10.100.200:5001/job/school/)
+3. 先构建smartschool-platform-prod任务,等任务正确构建完成,再构建其它剩余任务

+ 0 - 10
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/SchoolApplication.java

@@ -19,19 +19,9 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
 @ServletComponentScan
 @EnableEurekaClient
 @EnableFeignClients("com.usoftchina.smartschool")
-@ComponentScan(basePackages = {"com.usoftchina.smartschool"})
 public class SchoolApplication extends WebMvcConfigurerAdapter {
     public static void main(String[] args) {
         SpringApplication.run(SchoolApplication.class, args);
     }
 
-    @Override
-    public void addCorsMappings(CorsRegistry registry) {
-
-        registry.addMapping("/**")
-                .allowCredentials(true)
-                .allowedHeaders("*")
-                .allowedOrigins("*")
-                .allowedMethods("*");
-    }
 }

+ 5 - 5
applications/school/school-server/src/main/java/com/usoftchina/smartschool/school/wxschool/basic/service/impl/WxMeetingServiceImpl.java

@@ -13,7 +13,7 @@ import com.usoftchina.smartschool.school.wxschool.basic.service.WxMeetingService
 import com.usoftchina.smartschool.school.wxschool.support.RemindTask;
 import com.usoftchina.smartschool.school.wxschool.utils.DateFormatUtil;
 import com.usoftchina.smartschool.school.wxschool.utils.ObjectUtils;
-import com.usoftchina.smartschool.wechat.service.WxPushService;
+import com.usoftchina.smartschool.wechat.api.WxPushApi;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -32,7 +32,7 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 	private WxTeacherMapper teacherMapper;
 
 	@Autowired
-	private WxPushService wxPushService;
+	private WxPushApi wxPushApi;
 
 	@Autowired
 	private WxSchoolMapper wxSchoolMapper;
@@ -80,9 +80,9 @@ public class WxMeetingServiceImpl implements WxMeetingService {
 				meetingRecordsMapper.save(meetingRecordsDO);
 			}
 			Timer timer = new Timer();
-			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushService,meetingMapper,1,meetingDO), startDate);
-			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushService,meetingMapper,2,meetingDO), endDate);
-			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushService,meetingMapper,3,meetingDO), reminderDate);
+			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushApi,meetingMapper,1,meetingDO), startDate);
+			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushApi,meetingMapper,2,meetingDO), endDate);
+			timer.schedule(new RemindTask(teacherMapper,wxSchoolMapper,wxPushApi,meetingMapper,3,meetingDO), reminderDate);
 			return "创建成功";
 		}else {
 			throw new Exception("创建失败,请核查");

+ 8 - 1
applications/wechat/wechat-api/pom.xml

@@ -76,7 +76,14 @@
             <groupId>net.logstash.logback</groupId>
             <artifactId>logstash-logback-encoder</artifactId>
         </dependency>
-
+        <dependency>
+            <groupId>org.springframework.cloud</groupId>
+            <artifactId>spring-cloud-starter-openfeign</artifactId>
+        </dependency>
+        <dependency>
+            <groupId>com.usoftchina.smartschool</groupId>
+            <artifactId>core</artifactId>
+        </dependency>
         <dependency>
             <groupId>com.github.pagehelper</groupId>
             <artifactId>pagehelper-spring-boot-starter</artifactId>

+ 0 - 4
applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/WxApiApplication.java

@@ -1,4 +0,0 @@
-package com.usoftchina.smartschool.wechat;
-
-public class WxApiApplication {
-}

+ 15 - 0
applications/wechat/wechat-api/src/main/java/com/usoftchina/smartschool/wechat/api/WxPushApi.java

@@ -0,0 +1,15 @@
+package com.usoftchina.smartschool.wechat.api;
+
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+
+@FeignClient(name = "wechat-server")
+public interface WxPushApi {
+
+    @PostMapping("/wxpush")
+    public String wxPush(@RequestParam("appId")String appId, @RequestParam("secret") String secret, @RequestParam("openid") String openid, @RequestParam("templateId")String templateId,
+                         @RequestParam("title")String title, @RequestParam("keyword1")String keyword1, @RequestParam("keyword2")String keyword2, @RequestParam("keyword3")String keyword3,
+                         @RequestParam("keyword4")String keyword4, @RequestParam("remark")String remark, @RequestParam("url")String url);
+
+}

+ 26 - 0
applications/wechat/wechat-server/src/main/java/com/usoftchina/smartschool/wechat/controller/WxPushController.java

@@ -0,0 +1,26 @@
+package com.usoftchina.smartschool.wechat.controller;
+
+import com.usoftchina.smartschool.wechat.service.WxPushService;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+/**
+ * @author: guq
+ * @create: 2019-01-27 12:41
+ **/
+@RestController
+public class WxPushController {
+
+    @Autowired
+    private WxPushService wxPushService;
+
+    @PostMapping("/wxpush")
+    public String wxPush(@RequestParam("appId")String appId, @RequestParam("secret") String secret, @RequestParam("openid") String openid, @RequestParam("templateId")String templateId, @RequestParam("title")String title, @RequestParam("keyword1")String keyword1, @RequestParam("keyword2")String keyword2, @RequestParam("keyword3")String keyword3, @RequestParam("keyword4")String keyword4, @RequestParam("remark")String remark, @RequestParam("url")String url){
+        return wxPushService.wxPush(appId, secret,openid, templateId, title, keyword1, keyword2, keyword3, keyword4, remark, url);
+    };
+
+}