Skip to content

Commit

Permalink
feat update sast-link-sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
feellmoose committed Jan 4, 2024
1 parent 521612f commit 552bea3
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 30 deletions.
Binary file removed lib/SastLink-Java-SDK-0.0.1.jar
Binary file not shown.
16 changes: 8 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,7 @@
<java.version>17</java.version>
</properties>
<dependencies>
<dependency>
<groupId>link.sast</groupId>
<artifactId>SastLink-Java-SDK</artifactId>
<type>jar</type>
<version>0.0.1</version>
<scope>system</scope>
<systemPath>${pom.basedir}/lib/SastLink-Java-SDK-0.0.1.jar</systemPath>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand All @@ -38,6 +31,13 @@
<artifactId>spring-boot-starter-cache</artifactId>
</dependency>

<!-- sast-link-sdk -->
<dependency>
<groupId>fun.feellmoose</groupId>
<artifactId>sast-link-SDK</artifactId>
<version>0.1.2</version>
</dependency>

<!-- quartz -->
<dependency>
<groupId>org.springframework.boot</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package sast.evento.common.typehandler;

import fun.feellmoose.enums.Organization;
import org.apache.ibatis.type.BaseTypeHandler;
import org.apache.ibatis.type.JdbcType;
import sast.sastlink.sdk.enums.Organization;

import java.sql.CallableStatement;
import java.sql.PreparedStatement;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/sast/evento/config/SastLinkServiceConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import sast.sastlink.sdk.service.SastLinkService;
import sast.sastlink.sdk.test.RestTemplateTestSastLinkService;
import fun.feellmoose.service.SastLinkService;
import fun.feellmoose.test.TestSastLinkServiceAdapter;

/**
* @projectName: sast-evento-backend
Expand Down Expand Up @@ -40,7 +40,7 @@ public class SastLinkServiceConfig {

@Bean
public SastLinkService sastLinkService() {
return RestTemplateTestSastLinkService.builder()
return new TestSastLinkServiceAdapter.Builder()
.setRedirectUri(redirectUri)
.setClientId(clientId)
.setClientSecret(clientSecret)
Expand All @@ -51,7 +51,7 @@ public SastLinkService sastLinkService() {

@Bean
public SastLinkService sastLinkServiceWeb() {
return RestTemplateTestSastLinkService.builder()
return new TestSastLinkServiceAdapter.Builder()
.setRedirectUri(redirectUri_web)
.setClientId(clientId_web)
.setClientSecret(clientSecret_web)
Expand All @@ -62,7 +62,7 @@ public SastLinkService sastLinkServiceWeb() {

@Bean
public SastLinkService sastLinkServiceMobileDev() {
return RestTemplateTestSastLinkService.builder()
return new TestSastLinkServiceAdapter.Builder()
.setRedirectUri(redirectUri_mobile_dev)
.setClientId(clientId_mobile_dev)
.setClientSecret(clientSecret_mobile_dev)
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/sast/evento/controller/LoginController.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
package sast.evento.controller;

import fun.feellmoose.exception.SastLinkException;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;
import sast.evento.annotation.DefaultActionState;
import sast.evento.annotation.OperateLog;
import sast.evento.common.enums.ActionState;
import sast.evento.common.enums.ErrorEnum;
import sast.evento.common.enums.Platform;
import sast.evento.entitiy.User;
import sast.evento.exception.LocalRunTimeException;
import sast.evento.interceptor.HttpInterceptor;
import sast.evento.model.UserModel;
import sast.evento.service.LoginService;
import sast.sastlink.sdk.exception.SastLinkException;


import java.util.Map;

Expand Down
13 changes: 7 additions & 6 deletions src/main/java/sast/evento/controller/TestController.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package sast.evento.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import fun.feellmoose.test.TestSastLinkServiceAdapter;
import fun.feellmoose.test.data.Token;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
Expand All @@ -22,8 +24,7 @@
import sast.evento.model.Action;
import sast.evento.model.UserModel;
import sast.evento.service.PermissionService;
import sast.sastlink.sdk.test.RestTemplateTestSastLinkService;
import sast.sastlink.sdk.test.data.Token;


import java.util.List;
import java.util.stream.Collectors;
Expand All @@ -38,11 +39,11 @@ public class TestController {
private String method;

@Resource
private RestTemplateTestSastLinkService sastLinkService;
private TestSastLinkServiceAdapter sastLinkService;
@Resource
private RestTemplateTestSastLinkService sastLinkServiceWeb;
private TestSastLinkServiceAdapter sastLinkServiceWeb;
@Resource
private RestTemplateTestSastLinkService sastLinkServiceMobileDev;
private TestSastLinkServiceAdapter sastLinkServiceMobileDev;
@Resource
private PermissionService permissionService;
@Resource
Expand All @@ -57,7 +58,7 @@ public class TestController {
public String linkLogin(@RequestParam Integer type,
@RequestParam String email,
@RequestParam String password) {
RestTemplateTestSastLinkService service = switch (type) {
TestSastLinkServiceAdapter service = switch (type) {
case 0 -> sastLinkService;
case 1 -> sastLinkServiceWeb;
case 2 -> sastLinkServiceMobileDev;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/sast/evento/entitiy/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonIgnore;
import fun.feellmoose.model.UserInfo;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import sast.evento.common.typehandler.OrganizationTypeHandler;
import sast.sastlink.sdk.model.UserInfo;

import java.util.List;

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/sast/evento/service/LoginService.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sast.evento.service;

import jakarta.annotation.Nullable;
import sast.sastlink.sdk.exception.SastLinkException;

import fun.feellmoose.exception.SastLinkException;

import java.util.Map;

Expand Down
9 changes: 5 additions & 4 deletions src/main/java/sast/evento/service/impl/LoginServiceImpl.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package sast.evento.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import fun.feellmoose.exception.SastLinkException;
import fun.feellmoose.model.UserInfo;
import fun.feellmoose.model.response.data.AccessToken;
import fun.feellmoose.service.SastLinkService;
import jakarta.annotation.Nonnull;
import jakarta.annotation.Nullable;
import jakarta.annotation.Resource;
Expand All @@ -17,10 +21,7 @@
import sast.evento.service.LoginService;
import sast.evento.service.WxService;
import sast.evento.utils.*;
import sast.sastlink.sdk.exception.SastLinkException;
import sast.sastlink.sdk.model.UserInfo;
import sast.sastlink.sdk.model.response.data.AccessToken;
import sast.sastlink.sdk.service.SastLinkService;


import java.util.HashMap;
import java.util.Map;
Expand Down

0 comments on commit 552bea3

Please sign in to comment.