|
|
@ -1,5 +1,6 @@ |
|
|
|
package com.epmet.controller; |
|
|
|
|
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.commons.tools.page.PageData; |
|
|
|
import com.epmet.commons.tools.utils.Result; |
|
|
@ -97,4 +98,20 @@ public class ExternalAppController { |
|
|
|
return new Result<PageData<ExternalAppResultDTO>>().ok(page); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 重置应用秘钥 |
|
|
|
* @param formDTO |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
@PostMapping("/resetsecret") |
|
|
|
public Result resetSecret(@RequestBody ExternalAppFormDTO formDTO) { |
|
|
|
ValidatorUtils.validateEntity(formDTO, ExternalAppFormDTO.UpdateAppSecret.class); |
|
|
|
String newSecret = externalAppService.resetSecret(formDTO.getAppId()); |
|
|
|
if (StringUtils.isBlank(newSecret)) { |
|
|
|
return new Result().error(EpmetErrorCode.OPER_EXT_APP_SECRET_RESET_FAIL.getCode(), |
|
|
|
EpmetErrorCode.OPER_EXT_APP_SECRET_RESET_FAIL.getMsg()); |
|
|
|
} |
|
|
|
return new Result().ok(newSecret); |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|