Merge branch 'main' of https://git.istt.kz/locust/org.ccalm.jwt
This commit is contained in:
@ -106,6 +106,9 @@ public class MainController implements ServletContextAware {
|
||||
@Value("${spring.redis.password}")
|
||||
String redis_password;
|
||||
|
||||
@Value("${personal_data.key}")
|
||||
String personal_data_key;
|
||||
|
||||
private ServletContext context;
|
||||
private final NamedParameterJdbcTemplate jdbcTemplate;
|
||||
private HikariDataSource dataSource;
|
||||
@ -630,9 +633,9 @@ public class MainController implements ServletContextAware {
|
||||
//Добавляем пользователя
|
||||
sql = """
|
||||
insert into main._users(
|
||||
_user_id, name, email, password, expiration
|
||||
_user_id, name, email, e_iin, password, expiration
|
||||
)values(
|
||||
1, :name, :email, crypt(:password, gen_salt('bf')), now()+interval '5 day'
|
||||
1, :name, :email, pgp_sym_encrypt(:e_iin,:key), crypt(:password, gen_salt('bf')), now()+interval '5 day'
|
||||
) RETURNING id;
|
||||
""";
|
||||
parameters = new MapSqlParameterSource();
|
||||
@ -644,6 +647,8 @@ public class MainController implements ServletContextAware {
|
||||
//parameters.addValue("patronymic",);
|
||||
//parameters.addValue("phone",);
|
||||
parameters.addValue("email",newUserModel.getEmail());
|
||||
parameters.addValue("e_iin",newUserModel.getIin()); //Для ЭЦП это поле обязательно
|
||||
parameters.addValue("key",newUserModel.getIin());
|
||||
parameters.addValue("password",password);
|
||||
|
||||
ret = jdbcTemplate.query(sql, parameters, new DBTools.JsonRowMapper());
|
||||
|
||||
@ -8,6 +8,8 @@ public class NewUserModel {
|
||||
private String name;
|
||||
@JsonProperty("email")
|
||||
private String email;
|
||||
@JsonProperty("iin")
|
||||
private String iin;
|
||||
@JsonProperty("code")
|
||||
private String code;
|
||||
@JsonProperty("token")
|
||||
@ -29,6 +31,15 @@ public class NewUserModel {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
|
||||
public String getIin() {
|
||||
if(iin==null) return "";
|
||||
else return iin;
|
||||
}
|
||||
public void setIin(String iin) {
|
||||
this.iin = iin;
|
||||
}
|
||||
|
||||
public String getCode() {
|
||||
if(code==null) return "";
|
||||
else return code;
|
||||
|
||||
Reference in New Issue
Block a user