未验证 提交 60001f80 编写于 作者: yeweiouyang's avatar yeweiouyang 提交者: GitHub

[Cherry-pick-2.0.2][Feature-7418][dolphinscheduler-api] Return domain object...

[Cherry-pick-2.0.2][Feature-7418][dolphinscheduler-api] Return domain object after UpdateXxx success (#7421)

* to feature 7418

* trigger e2e test
Co-authored-by: Nouyangyewei <yewei.oyyw@alibaba-inc.com>
上级 895b0fa9
......@@ -194,7 +194,7 @@ public class AccessTokenController extends BaseController {
* @param userId token for user
* @param expireTime token expire time
* @param token token string (if it is absent, it will be automatically generated)
* @return update result code
* @return updated access token entity
*/
@ApiOperation(value = "updateToken", notes = "UPDATE_TOKEN_NOTES")
@ApiImplicitParams({
......
......@@ -83,7 +83,7 @@ public interface AccessTokenService {
* @param userId token for user
* @param expireTime token expire time
* @param token token string (if it is absent, it will be automatically generated)
* @return update result code
* @return updated access token entity
*/
Map<String, Object> updateToken(User loginUser, int id, int userId, String expireTime, String token);
}
......@@ -208,7 +208,7 @@ public class AccessTokenServiceImpl extends BaseServiceImpl implements AccessTok
* @param userId token for user
* @param expireTime token expire time
* @param token token string (if it is absent, it will be automatically generated)
* @return update result code
* @return updated access token entity
*/
@Override
public Map<String, Object> updateToken(User loginUser, int id, int userId, String expireTime, String token) {
......@@ -241,6 +241,7 @@ public class AccessTokenServiceImpl extends BaseServiceImpl implements AccessTok
accessTokenMapper.updateById(accessToken);
result.put(Constants.DATA_LIST, accessToken);
putMsg(result, Status.SUCCESS);
return result;
}
......
......@@ -195,6 +195,7 @@ public class AccessTokenControllerTest extends AbstractControllerTest {
Result result = JSONUtils.parseObject(mvcResult.getResponse().getContentAsString(), Result.class);
Assert.assertEquals(Status.SUCCESS.getCode(), result.getCode().intValue());
Assert.assertNotNull(result.getData());
logger.info(mvcResult.getResponse().getContentAsString());
}
}
......@@ -152,11 +152,13 @@ public class AccessTokenServiceTest {
Map<String, Object> result = accessTokenService.updateToken(getLoginUser(), 1,Integer.MAX_VALUE,getDate(),"token");
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
Assert.assertNotNull(result.get(Constants.DATA_LIST));
// Token is absent
result = accessTokenService.updateToken(getLoginUser(), 1, Integer.MAX_VALUE,getDate(),null);
logger.info(result.toString());
Assert.assertEquals(Status.SUCCESS, result.get(Constants.STATUS));
Assert.assertNotNull(result.get(Constants.DATA_LIST));
// ACCESS_TOKEN_NOT_EXIST
result = accessTokenService.updateToken(getLoginUser(), 2,Integer.MAX_VALUE,getDate(),"token");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册