Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
Sczlog committed Jan 3, 2023
1 parent 6e41846 commit a83b96b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ UserApi userApi = new UserApi(client);
LoginInput loginInput = new LoginInput()
.username("root")
.password("!QAZ2wsx").source(UserSource.LOCAL);
WithTaskTokenString token = userApi.login(loginInput);
WithTaskLoginResponse token = userApi.login(loginInput);
((ApiKeyAuth) client.getAuthentication("Authorization")).setApiKey(token.getData().getToken());
```

Expand Down
1 change: 1 addition & 0 deletions RELEASE NOTE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ v2.5.0 release
- feature: ClusterApi: [getMetaLeader]: 增加了获取集群 meta leader 的 api
- optimize: 增加 header 定义,可以从返回值中获取对应的 x-tower-request-id
- optimize: [NestedHost]: 嵌套的主机类型额外返回 management_ip
- optimize: UserApi: [login] 返回值重命名为 WithTaskLoginResponse

## release 日期 2022-11-18

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/smartx/tower/ClientUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.smartx.tower.auth.ApiKeyAuth;
import com.smartx.tower.model.LoginInput;
import com.smartx.tower.model.UserSource;
import com.smartx.tower.model.WithTaskTokenString;
import com.smartx.tower.model.WithTaskLoginResponse;

public class ClientUtil {

Expand All @@ -14,7 +14,7 @@ public static void login(String username, String password, ApiClient client) thr

public static void login(String username, String password, boolean useLDAP, ApiClient client) throws ApiException {
UserApi userApi = new UserApi(client);
WithTaskTokenString response = userApi.login(
WithTaskLoginResponse response = userApi.login(
new LoginInput()
.username(username)
.password(password)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ private void getToken() throws ApiException {
try {
LoginInput loginInput = new LoginInput().password(config.password).username(config.username)
.source(UserSource.fromValue(config.usersource));
com.smartx.tower.model.WithTaskTokenString tokenString = userApi.login(loginInput);
com.smartx.tower.model.WithTaskLoginResponse tokenString = userApi.login(loginInput);
token = tokenString.getData().getToken();
} catch (ApiException e) {
throw e;
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/com/smartx/tower/integration/ITUser.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public void login(String payload) {
// parse params from json payload
LoginInput params = gson.fromJson(payload, new TypeToken<LoginInput>() {}.getType());
// do some modify to params(optional)
WithTaskTokenString result = api.login(params);
WithTaskLoginResponse result = api.login(params);
assertThat(result).as("check result of login").isNotNull();
} catch (ApiException e) {
LOGGER.error(e.getResponseBody());
Expand Down

0 comments on commit a83b96b

Please sign in to comment.