FileUpload&UserInfo&Accounts

This commit is contained in:
MaxKey
2022-04-05 10:08:19 +08:00
parent a14aeb1bd3
commit d11c499e81
10 changed files with 324 additions and 29 deletions

View File

@@ -0,0 +1,32 @@
/*
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
*
*/
package org.maxkey.persistence.mapper;
import org.apache.mybatis.jpa.persistence.IJpaBaseMapper;
import org.maxkey.entity.FileUpload;
/**
* @author Crystal.sea
*
*/
public interface FileUploadMapper extends IJpaBaseMapper<FileUpload> {
}

View File

@@ -0,0 +1,39 @@
/*
* Copyright [2021] [MaxKey of copyright http://www.maxkey.top]
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.maxkey.persistence.service;
import org.apache.mybatis.jpa.persistence.JpaBaseService;
import org.maxkey.entity.FileUpload;
import org.maxkey.persistence.mapper.FileUploadMapper;
import org.springframework.stereotype.Repository;
@Repository
public class FileUploadService extends JpaBaseService<FileUpload>{
public FileUploadService() {
super(FileUploadMapper.class);
}
/* (non-Javadoc)
* @see com.connsec.db.service.BaseService#getMapper()
*/
@Override
public FileUploadMapper getMapper() {
return (FileUploadMapper)super.getMapper();
}
}

View File

@@ -212,7 +212,7 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
public UserInfo passwordEncoder(UserInfo userInfo) {
//密码不为空,则需要进行加密处理
if(userInfo.getPassword()!=null && !userInfo.getPassword().equals("")) {
if(!StringUtils.isBlank(userInfo.getPassword())) {
String password = passwordEncoder.encode(userInfo.getPassword());
userInfo.setDecipherable(PasswordReciprocal.getInstance().encode(userInfo.getPassword()));
_logger.debug("decipherable : "+userInfo.getDecipherable());
@@ -220,6 +220,9 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
userInfo.setPasswordLastSetTime(DateUtils.getCurrentDateTimeAsString());
userInfo.setModifiedDate(DateUtils.getCurrentDateTimeAsString());
}else {
userInfo.setPassword(null);
userInfo.setDecipherable(null);
}
return userInfo;
}