|
@@ -1,14 +1,18 @@
|
|
package pay.platform.api.system.controller;
|
|
package pay.platform.api.system.controller;
|
|
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
import io.swagger.v3.oas.annotations.Parameters;
|
|
import io.swagger.v3.oas.annotations.Parameters;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
+import jakarta.servlet.http.HttpServletRequest;
|
|
import org.springdoc.core.annotations.ParameterObject;
|
|
import org.springdoc.core.annotations.ParameterObject;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import pay.platform.api.system.model.query.PayMerchantQuery;
|
|
import pay.platform.api.system.model.query.PayMerchantQuery;
|
|
import pay.platform.api.system.model.vo.PayMerchantVO;
|
|
import pay.platform.api.system.model.vo.PayMerchantVO;
|
|
|
|
+import pay.platform.api.system.model.vo.RestPasswdVO;
|
|
import pay.platform.api.system.servcie.PayMerchantService;
|
|
import pay.platform.api.system.servcie.PayMerchantService;
|
|
import pay.platform.core.common.Result;
|
|
import pay.platform.core.common.Result;
|
|
import pay.platform.core.common.domain.BasePage;
|
|
import pay.platform.core.common.domain.BasePage;
|
|
@@ -113,4 +117,18 @@ public class PayMerchantController {
|
|
public Result<BasePage<PayMerchantVO>> page(@ParameterObject PayMerchantQuery query) {
|
|
public Result<BasePage<PayMerchantVO>> page(@ParameterObject PayMerchantQuery query) {
|
|
return Result.OK(PayMerchantService.queryPage(query));
|
|
return Result.OK(PayMerchantService.queryPage(query));
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @PutMapping("/reset/passwd/{username}")
|
|
|
|
+ @Operation(summary = "重置密码")
|
|
|
|
+ public Result<String> resetPasswd(HttpServletRequest request, @PathVariable(value = "username") String username,
|
|
|
|
+ @Validated @RequestBody RestPasswdVO vo) {
|
|
|
|
+ if (StrUtil.isBlank(vo.getNewPassword())) {
|
|
|
|
+ return Result.NG("新密码不能为空");
|
|
|
|
+ }
|
|
|
|
+ if (!vo.getNewPassword().equals(vo.getConfirmPassword())) {
|
|
|
|
+ return Result.NG("两次密码不一致");
|
|
|
|
+ }
|
|
|
|
+ return PayMerchantService.resetPassword(username, vo.getConfirmPassword());
|
|
|
|
+ }
|
|
}
|
|
}
|