Add two TODOs of migration

pull/235/head
johnniang 2019-06-26 22:12:17 +08:00
parent 08d824b414
commit 2233dc8d12
4 changed files with 8 additions and 4 deletions

View File

@ -40,7 +40,7 @@ public class RecoveryController {
@ApiParam("This file content type should be json") @ApiParam("This file content type should be json")
@RequestPart("file") MultipartFile file) { @RequestPart("file") MultipartFile file) {
if (optionService.getByPropertyOrDefault(PrimaryProperties.IS_INSTALLED, Boolean.class, false)) { if (optionService.getByPropertyOrDefault(PrimaryProperties.IS_INSTALLED, Boolean.class, false)) {
throw new BadRequestException("不能在博客初始化完成之后迁移数据"); throw new BadRequestException("无法在博客初始化完成之后迁移数据");
} }
recoveryService.migrateFromV0_4_3(file); recoveryService.migrateFromV0_4_3(file);

View File

@ -10,7 +10,7 @@ import static run.halo.app.utils.BeanUtils.updateProperties;
* <b>The implementation type must be equal to DTO type</b> * <b>The implementation type must be equal to DTO type</b>
* *
* @param <DTO> the implementation class type * @param <DTO> the implementation class type
* @param <DOMAIN> doamin type * @param <DOMAIN> domain type
* @author johnniang * @author johnniang
*/ */
public interface OutputConverter<DTO extends OutputConverter<DTO, DOMAIN>, DOMAIN> { public interface OutputConverter<DTO extends OutputConverter<DTO, DOMAIN>, DOMAIN> {

View File

@ -135,7 +135,7 @@ public class AdminServiceImpl implements AdminService {
userService.getByEmailOfNonNull(username) : userService.getByUsernameOfNonNull(username); userService.getByEmailOfNonNull(username) : userService.getByUsernameOfNonNull(username);
} catch (NotFoundException e) { } catch (NotFoundException e) {
log.error("Failed to find user by name: " + username, e); log.error("Failed to find user by name: " + username, e);
eventPublisher.publishEvent(new LogEvent(this, "", LogType.LOGIN_FAILED, loginParam.getUsername())); eventPublisher.publishEvent(new LogEvent(this, loginParam.getUsername(), LogType.LOGIN_FAILED, loginParam.getUsername()));
throw new BadRequestException(mismatchTip); throw new BadRequestException(mismatchTip);
} }
@ -144,7 +144,7 @@ public class AdminServiceImpl implements AdminService {
if (!userService.passwordMatch(user, loginParam.getPassword())) { if (!userService.passwordMatch(user, loginParam.getPassword())) {
// If the password is mismatch // If the password is mismatch
eventPublisher.publishEvent(new LogEvent(this, "", LogType.LOGIN_FAILED, loginParam.getUsername())); eventPublisher.publishEvent(new LogEvent(this, loginParam.getUsername(), LogType.LOGIN_FAILED, loginParam.getUsername()));
throw new BadRequestException(mismatchTip); throw new BadRequestException(mismatchTip);
} }

View File

@ -218,6 +218,10 @@ public class RecoveryServiceImpl implements RecoveryService {
// Handle comments // Handle comments
List<BaseComment> baseComments = handleComment(commentsObject, createdPost.getId()); List<BaseComment> baseComments = handleComment(commentsObject, createdPost.getId());
// TODO Handle categories
// TODO Handle tags
List<PostComment> postComments = baseComments.stream() List<PostComment> postComments = baseComments.stream()
.map(baseComment -> BeanUtils.transformFrom(baseComment, PostComment.class)) .map(baseComment -> BeanUtils.transformFrom(baseComment, PostComment.class))
.collect(Collectors.toList()); .collect(Collectors.toList());