Răsfoiți Sursa

注释core-fss中OssStore单元测试代码;去掉ZipReader中的main函数;core-solar中增加对于微信平台访问的接口,避免密钥信息的泄漏

Signed-off-by: luoshi <luoshi@qmth.com.cn>
luoshi 2 ani în urmă
părinte
comite
6047a679ae

+ 1 - 2
core-fss/src/test/java/com/qmth/boot/test/core/fss/OssStoreTest.java

@@ -4,7 +4,6 @@ import com.qmth.boot.core.fss.store.impl.OssStore;
 import com.qmth.boot.tools.models.ByteArray;
 import org.apache.commons.lang3.RandomStringUtils;
 import org.junit.Assert;
-import org.junit.Test;
 
 import java.io.ByteArrayInputStream;
 import java.time.Duration;
@@ -19,7 +18,7 @@ public class OssStoreTest {
 
     private String config_local = "oss://key:secret@test.oss-api.qmth.com.cn";
 
-    @Test
+    //@Test
     public void test() throws Exception {
         OssStore store = new OssStore(server_local, config_local);
         String content = RandomStringUtils.random(128, true, true);

+ 32 - 0
core-solar/src/main/java/com/qmth/boot/core/solar/api/SolarApiClient.java

@@ -4,6 +4,7 @@ import com.qmth.boot.core.retrofit.annotatioin.RetrofitClient;
 import com.qmth.boot.core.solar.config.SolarApiConfiguration;
 import com.qmth.boot.core.solar.model.AppInfo;
 import com.qmth.boot.core.solar.model.OrgInfo;
+import com.qmth.boot.core.solar.model.WxappSession;
 import retrofit2.http.POST;
 import retrofit2.http.Query;
 
@@ -12,9 +13,40 @@ import java.util.List;
 @RetrofitClient(configuration = SolarApiConfiguration.class)
 public interface SolarApiClient {
 
+    /**
+     * 获取当前访问应用信息接口
+     *
+     * @return
+     */
     @POST("app/info")
     AppInfo getAppInfo();
 
+    /**
+     * 获取当前应用可访问机构列表
+     *
+     * @param pageNumber
+     * @param pageSize
+     * @return
+     */
     @POST("org/query")
     List<OrgInfo> listOrgInfo(@Query("pageNumber") int pageNumber, @Query("pageSize") int pageSize);
+
+    /**
+     * 通过appId获取微信访问令牌接口
+     *
+     * @param appId
+     * @return
+     */
+    @POST("wxapp/access_token")
+    String getWxappAccessToken(@Query("appId") String appId);
+
+    /**
+     * 通过appId及临时凭证获取微信登录密钥接口
+     *
+     * @param appId
+     * @param code
+     * @return
+     */
+    @POST("wxapp/session_by_code")
+    WxappSession getWxappSessionByCode(@Query("appId") String appId, @Query("code") String code);
 }

+ 37 - 0
core-solar/src/main/java/com/qmth/boot/core/solar/model/WxappSession.java

@@ -0,0 +1,37 @@
+package com.qmth.boot.core.solar.model;
+
+/**
+ * 微信登录凭证校验返回数据
+ */
+public class WxappSession {
+
+    private String openId;
+
+    private String sessionKey;
+
+    private String unionId;
+
+    public String getOpenId() {
+        return openId;
+    }
+
+    public void setOpenId(String openId) {
+        this.openId = openId;
+    }
+
+    public String getSessionKey() {
+        return sessionKey;
+    }
+
+    public void setSessionKey(String sessionKey) {
+        this.sessionKey = sessionKey;
+    }
+
+    public String getUnionId() {
+        return unionId;
+    }
+
+    public void setUnionId(String unionId) {
+        this.unionId = unionId;
+    }
+}

+ 0 - 6
tools-common/src/main/java/com/qmth/boot/tools/io/ZipReader.java

@@ -127,10 +127,4 @@ public class ZipReader {
         }
     }
 
-    public static void main(String[] args) throws IOException {
-        ZipReader reader = new ZipReader(new File("/Users/luoshi/Downloads/data.zip"));
-        System.out.println(reader.list(false));
-        reader.close();
-    }
-
 }