SUPPORT-9001: remove ugly
This commit is contained in:
parent
5d5b02ec83
commit
80cd9ef064
6 changed files with 0 additions and 52 deletions
|
|
@ -134,12 +134,6 @@ public class AdminController {
|
|||
return doRequestAndSaveTraceId(request, dto.appNumber());
|
||||
}
|
||||
|
||||
@GetMapping("/password/check")
|
||||
public ResponseEntity<Boolean> passwordCheck(@RequestParam(name = "login") String login) {
|
||||
boolean result = applicationListService.isPasswordExpired(login);
|
||||
return ResponseEntity.ok(result);
|
||||
}
|
||||
|
||||
private <R> ResponseEntity<?> doRequestAndSaveTraceId(ProcessRequest<R> request, long appNumber) {
|
||||
ResponseEntity<?> responseEntity = doRequest(request);
|
||||
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ public class UserApplicationListDao {
|
|||
dslContext.update(USER_APPLICATION_LIST)
|
||||
.set(USER_APPLICATION_LIST.APPLICATION_STATUS, ApplicationStatus.ACCEPTED.name())
|
||||
.set(USER_APPLICATION_LIST.USER_PASSWORD, encodedPass)
|
||||
.set(USER_APPLICATION_LIST.PASSWORD_LAST_UPDATED, Timestamp.valueOf(LocalDateTime.now()))
|
||||
.where(USER_APPLICATION_LIST.TRACE_ID.eq(traceId))
|
||||
.execute();
|
||||
}
|
||||
|
|
@ -59,11 +58,4 @@ public class UserApplicationListDao {
|
|||
.from(USER_APPLICATION_LIST)
|
||||
.where(USER_APPLICATION_LIST.USER_LOGIN.eq(login)));
|
||||
}
|
||||
|
||||
public Optional<LocalDateTime> getPasswordLastUpdated(String login) {
|
||||
return dslContext.select(USER_APPLICATION_LIST.PASSWORD_LAST_UPDATED)
|
||||
.from(USER_APPLICATION_LIST)
|
||||
.where(USER_APPLICATION_LIST.USER_LOGIN.eq(login))
|
||||
.fetchOptionalInto(LocalDateTime.class);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
package ru.micord.ervu.account_applications.service;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
import ru.micord.ervu.account_applications.dao.UserApplicationListDao;
|
||||
|
|
@ -30,12 +28,6 @@ public class UserApplicationListService {
|
|||
return dao.userExists(login);
|
||||
}
|
||||
|
||||
public boolean isPasswordExpired(String login) {
|
||||
return dao.getPasswordLastUpdated(login)
|
||||
.map(date -> ChronoUnit.DAYS.between(date, LocalDateTime.now()) > 20)
|
||||
.orElse(true);
|
||||
}
|
||||
|
||||
public void saveAcceptedStatus(String traceId) {
|
||||
dao.saveAcceptedStatus(traceId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<databaseChangeLog
|
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
|
||||
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
|
||||
|
||||
<changeSet id="0001" author="a.kalimullin">
|
||||
<comment>add password_last_updated column to user_application_list table</comment>
|
||||
<sql>
|
||||
ALTER TABLE user_application_list ADD COLUMN IF NOT EXISTS password_last_updated TIMESTAMP;
|
||||
COMMENT ON COLUMN user_application_list.password_last_updated IS 'Дата последнего обновления пароля';
|
||||
</sql>
|
||||
</changeSet>
|
||||
|
||||
</databaseChangeLog>
|
||||
|
|
@ -16,5 +16,4 @@
|
|||
<include file="20250307_ERVU-308_create_table_update.xml" relativeToChangelogFile="true"/>
|
||||
<include file="20250312-SUPPORT-8696_add_column_role.xml" relativeToChangelogFile="true"/>
|
||||
<include file="20250313-SUPPORT-8957_add_trace_id.xml" relativeToChangelogFile="true"/>
|
||||
<include file="20250314_SUPPORT-9001_add_password_last_update.xml" relativeToChangelogFile="true"/>
|
||||
</databaseChangeLog>
|
||||
|
|
@ -12,19 +12,6 @@ export class FieldChecker extends Behavior {
|
|||
this.control = this.getScript('component.ControlWithValue');
|
||||
}
|
||||
|
||||
@Visible()
|
||||
passwordCheck(login: string) {
|
||||
return this.client.get<boolean>(`user/password/check?login=${encodeURIComponent(login)}`)
|
||||
.toPromise()
|
||||
.then((isExpired: boolean) => {
|
||||
this.control.setValue(isExpired);
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error("Ошибка при проверке пароля:", error);
|
||||
this.control.setValue(null);
|
||||
});
|
||||
}
|
||||
|
||||
@Visible()
|
||||
userExists(login: string) {
|
||||
return this.client.get<boolean>(`user/exists?login=${encodeURIComponent(login)}`)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue