普通用户申请成为管理员

This commit is contained in:
遥望-倪浩天 2024-10-14 14:04:35 +08:00
parent 0dec46fc8b
commit dcee2ec067
3 changed files with 5 additions and 4 deletions

View File

@ -26,8 +26,8 @@ public class ApplyForAdminController {
* @return
*/
@PostMapping("/auditAnApplication")
public void auditAnApplication (@RequestBody ApplyForAdmin applyForAdmin){
applyForAdminServer.auditAnApplication(applyForAdmin);
public R auditAnApplication (@RequestBody ApplyForAdmin applyForAdmin){
return R.status(applyForAdminServer.auditAnApplication(applyForAdmin));
}
@PostMapping("/SendAnApplication")

View File

@ -11,5 +11,5 @@ public interface ApplyForAdminServer extends IService<ApplyForAdmin> {
void updateApplyForAdminData(ApplyForAdmin applyForAdmin);
void auditAnApplication(ApplyForAdmin applyForAdmin);
Boolean auditAnApplication(ApplyForAdmin applyForAdmin);
}

View File

@ -58,7 +58,7 @@ public class ApplyForAdminServerImpl extends ServiceImpl<ApplyForAdminMapper, Ap
}
@Override
public void auditAnApplication(ApplyForAdmin applyForAdmin) {
public Boolean auditAnApplication(ApplyForAdmin applyForAdmin) {
Email email = new Email();
email.setSubject("VORDMAdministrator application result");
email.setHtmlText(false);
@ -78,5 +78,6 @@ public class ApplyForAdminServerImpl extends ServiceImpl<ApplyForAdminMapper, Ap
log.error("发送邮件失败:{}", e);
}
baseMapper.updateById(applyForAdmin);
return true;
}
}