Change base package to run.halo.app.

pull/137/head
ruibaby 2019-04-03 20:06:59 +08:00
parent 68393361cd
commit 2db1669e3f
273 changed files with 1208 additions and 975 deletions

View File

@ -14,4 +14,4 @@ RUN cd /tmp && mvn package -Pci && mv target/dist/halo/* /opt/halo/ \
EXPOSE 8090
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dlogging.level.cc.ryanc.halo=INFO", "-jar","/opt/halo/halo-latest.jar","--spring.datasource.username=${DB_USER}","--spring.datasource.password=${DB_PASSWORD}"]
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-Dlogging.level.run.halo.app=INFO", "-jar","/opt/halo/halo-latest.jar","--spring.datasource.username=${DB_USER}","--spring.datasource.password=${DB_PASSWORD}"]

View File

@ -1,12 +0,0 @@
package cc.ryanc.halo.repository;
import cc.ryanc.halo.model.entity.Attachment;
import cc.ryanc.halo.repository.base.BaseRepository;
/**
* Attachment repository
*
* @author johnniang
*/
public interface AttachmentRepository extends BaseRepository<Attachment, Integer> {
}

View File

@ -1,12 +0,0 @@
package cc.ryanc.halo.repository;
import cc.ryanc.halo.model.entity.Gallery;
import cc.ryanc.halo.repository.base.BaseRepository;
/**
* Gallery repository.
*
* @author johnniang
*/
public interface GalleryRepository extends BaseRepository<Gallery, Integer> {
}

View File

@ -1,14 +0,0 @@
package cc.ryanc.halo.repository;
import cc.ryanc.halo.model.entity.Journal;
import cc.ryanc.halo.repository.base.BasePostRepository;
/**
* Journal repository.
*
* @author johnniang
* @date 3/22/19
*/
public interface JournalRepository extends BasePostRepository<Journal> {
}

View File

@ -1,12 +0,0 @@
package cc.ryanc.halo.repository;
import cc.ryanc.halo.model.entity.Link;
import cc.ryanc.halo.repository.base.BaseRepository;
/**
* Link repository.
*
* @author johnniang
*/
public interface LinkRepository extends BaseRepository<Link, Integer> {
}

View File

@ -1,13 +0,0 @@
package cc.ryanc.halo.repository;
import cc.ryanc.halo.model.entity.Log;
import cc.ryanc.halo.repository.base.BaseRepository;
/**
* Log repository.
*
* @author johnniang
*/
public interface LogRepository extends BaseRepository<Log, Long> {
}

View File

@ -1,14 +0,0 @@
package cc.ryanc.halo.repository;
import cc.ryanc.halo.model.entity.Page;
import cc.ryanc.halo.repository.base.BasePostRepository;
/**
* Page repository.
*
* @author johnniang
* @date 3/22/19
*/
public interface PageRepository extends BasePostRepository<Page> {
}

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo;
package run.halo.app;
import cc.ryanc.halo.repository.base.BaseRepositoryImpl;
import run.halo.app.repository.base.BaseRepositoryImpl;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
@ -18,7 +18,7 @@ import org.springframework.scheduling.annotation.EnableScheduling;
@SpringBootApplication
@EnableJpaAuditing
@EnableScheduling
@EnableJpaRepositories(basePackages = {"cc.ryanc.halo.repository"}, repositoryBaseClass = BaseRepositoryImpl.class)
@EnableJpaRepositories(basePackages = {"run.halo.app.repository"}, repositoryBaseClass = BaseRepositoryImpl.class)
public class Application {
public static void main(String[] args) {

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.cache;
package run.halo.app.cache;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.time.DateUtils;
@ -53,7 +53,7 @@ public abstract class AbstractCacheStore<K, V> implements CacheStore<K, V> {
log.debug("Cache wrapper: [{}]", cacheWrapper);
// Check expiration
if (cacheWrapper.getExpireAt() != null && cacheWrapper.getExpireAt().before(cc.ryanc.halo.utils.DateUtils.now())) {
if (cacheWrapper.getExpireAt() != null && cacheWrapper.getExpireAt().before(run.halo.app.utils.DateUtils.now())) {
// Expired then delete it
log.warn("Cache key: [{}] has been expired", key);
@ -96,7 +96,7 @@ public abstract class AbstractCacheStore<K, V> implements CacheStore<K, V> {
Assert.notNull(value, "Cache value must not be null");
Assert.isTrue(timeout >= 0, "Cache expiration timeout must not be less than 1");
Date now = cc.ryanc.halo.utils.DateUtils.now();
Date now = run.halo.app.utils.DateUtils.now();
Date expireAt = null;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.cache;
package run.halo.app.cache;
import org.springframework.lang.NonNull;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.cache;
package run.halo.app.cache;
import lombok.*;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.cache;
package run.halo.app.cache;
import lombok.extern.slf4j.Slf4j;
import org.springframework.util.Assert;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.cache;
package run.halo.app.cache;
import lombok.extern.slf4j.Slf4j;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.cache.lock;
package run.halo.app.cache.lock;
import org.springframework.core.annotation.AliasFor;

View File

@ -1,8 +1,8 @@
package cc.ryanc.halo.cache.lock;
package run.halo.app.cache.lock;
import cc.ryanc.halo.cache.StringCacheStore;
import cc.ryanc.halo.exception.FrequentAccessException;
import cc.ryanc.halo.exception.ServiceException;
import run.halo.app.cache.StringCacheStore;
import run.halo.app.exception.FrequentAccessException;
import run.halo.app.exception.ServiceException;
import cn.hutool.extra.servlet.ServletUtil;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -42,7 +42,7 @@ public class CacheLockInterceptor {
this.httpServletRequest = httpServletRequest;
}
@Around("@annotation(cc.ryanc.halo.cache.lock.CacheLock)")
@Around("@annotation(run.halo.app.cache.lock.CacheLock)")
public Object interceptCacheLock(ProceedingJoinPoint joinPoint) throws Throwable {
// Get method signature
MethodSignature methodSignature = (MethodSignature) joinPoint.getSignature();

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.cache.lock;
package run.halo.app.cache.lock;
import java.lang.annotation.*;

View File

@ -1,14 +1,14 @@
package cc.ryanc.halo.config;
package run.halo.app.config;
import cc.ryanc.halo.model.freemarker.method.RandomMethod;
import cc.ryanc.halo.model.freemarker.method.RecentCommentsMethod;
import cc.ryanc.halo.model.freemarker.method.RecentPostsMethod;
import cc.ryanc.halo.model.freemarker.tag.*;
import cc.ryanc.halo.service.OptionService;
import freemarker.template.TemplateModelException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import run.halo.app.model.freemarker.method.RandomMethod;
import run.halo.app.model.freemarker.method.RecentCommentsMethod;
import run.halo.app.model.freemarker.method.RecentPostsMethod;
import run.halo.app.model.freemarker.tag.*;
import run.halo.app.service.OptionService;
import javax.annotation.PostConstruct;

View File

@ -1,16 +1,16 @@
package cc.ryanc.halo.config;
package run.halo.app.config;
import cc.ryanc.halo.cache.InMemoryCacheStore;
import cc.ryanc.halo.cache.StringCacheStore;
import cc.ryanc.halo.config.properties.HaloProperties;
import cc.ryanc.halo.filter.CorsFilter;
import cc.ryanc.halo.filter.LogFilter;
import cc.ryanc.halo.security.filter.AdminAuthenticationFilter;
import cc.ryanc.halo.security.filter.ApiAuthenticationFilter;
import cc.ryanc.halo.security.handler.AdminAuthenticationFailureHandler;
import cc.ryanc.halo.security.handler.DefaultAuthenticationFailureHandler;
import cc.ryanc.halo.service.UserService;
import cc.ryanc.halo.utils.HttpClientUtils;
import run.halo.app.cache.InMemoryCacheStore;
import run.halo.app.cache.StringCacheStore;
import run.halo.app.config.properties.HaloProperties;
import run.halo.app.filter.CorsFilter;
import run.halo.app.filter.LogFilter;
import run.halo.app.security.filter.AdminAuthenticationFilter;
import run.halo.app.security.filter.ApiAuthenticationFilter;
import run.halo.app.security.handler.AdminAuthenticationFailureHandler;
import run.halo.app.security.handler.DefaultAuthenticationFailureHandler;
import run.halo.app.service.UserService;
import run.halo.app.utils.HttpClientUtils;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@ -23,6 +23,13 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;
import org.springframework.web.client.RestTemplate;
import run.halo.app.filter.CorsFilter;
import run.halo.app.filter.LogFilter;
import run.halo.app.security.filter.AdminAuthenticationFilter;
import run.halo.app.security.filter.ApiAuthenticationFilter;
import run.halo.app.security.handler.AdminAuthenticationFailureHandler;
import run.halo.app.security.handler.DefaultAuthenticationFailureHandler;
import run.halo.app.utils.HttpClientUtils;
import java.security.KeyManagementException;
import java.security.KeyStoreException;

View File

@ -1,8 +1,8 @@
package cc.ryanc.halo.config;
package run.halo.app.config;
import cc.ryanc.halo.config.properties.HaloProperties;
import cc.ryanc.halo.model.entity.User;
import cc.ryanc.halo.security.support.UserDetail;
import run.halo.app.config.properties.HaloProperties;
import run.halo.app.model.entity.User;
import run.halo.app.security.support.UserDetail;
import com.fasterxml.classmate.TypeResolver;
import io.swagger.models.auth.In;
import lombok.extern.slf4j.Slf4j;
@ -14,6 +14,7 @@ import org.springframework.data.domain.Sort;
import org.springframework.lang.NonNull;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RequestMethod;
import run.halo.app.security.support.UserDetail;
import springfox.documentation.builders.*;
import springfox.documentation.schema.AlternateTypeRule;
import springfox.documentation.schema.AlternateTypeRuleConvention;
@ -31,8 +32,8 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import static cc.ryanc.halo.model.support.HaloConst.HALO_VERSION;
import static cc.ryanc.halo.model.support.HaloConst.TOKEN_HEADER;
import static run.halo.app.model.support.HaloConst.HALO_VERSION;
import static run.halo.app.model.support.HaloConst.TOKEN_HEADER;
import static springfox.documentation.schema.AlternateTypeRules.newRule;
/**
@ -62,8 +63,8 @@ public class SwaggerConfiguration {
@Bean
public Docket haloDefaultApi() {
log.debug("Doc disabled: [{}]", haloProperties.getDocDisabled());
return buildApiDocket("cc.ryanc.halo.default",
"cc.ryanc.halo.web.controller.portal.api",
return buildApiDocket("run.halo.app.default",
"run.halo.app.web.controller.portal.api",
"/api/**")
.enable(!haloProperties.getDocDisabled());
}
@ -71,8 +72,8 @@ public class SwaggerConfiguration {
@Bean
public Docket haloAdminApi() {
log.debug("Doc disabled: [{}]", haloProperties.getDocDisabled());
return buildApiDocket("cc.ryanc.halo.admin",
"cc.ryanc.halo.web.controller.admin",
return buildApiDocket("run.halo.app.admin",
"run.halo.app.web.controller.admin",
"/admin/api/**")
.enable(!haloProperties.getDocDisabled());
}

View File

@ -1,10 +1,10 @@
package cc.ryanc.halo.config;
package run.halo.app.config;
import cc.ryanc.halo.config.properties.HaloProperties;
import cc.ryanc.halo.factory.StringToEnumConverterFactory;
import cc.ryanc.halo.model.support.HaloConst;
import cc.ryanc.halo.security.resolver.AuthenticationArgumentResolver;
import cc.ryanc.halo.web.controller.support.PageJacksonSerializer;
import run.halo.app.config.properties.HaloProperties;
import run.halo.app.factory.StringToEnumConverterFactory;
import run.halo.app.model.support.HaloConst;
import run.halo.app.security.resolver.AuthenticationArgumentResolver;
import run.halo.app.web.controller.support.PageJacksonSerializer;
import com.fasterxml.jackson.databind.ObjectMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
@ -25,6 +25,8 @@ import org.springframework.web.servlet.config.annotation.ViewResolverRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
import org.springframework.web.servlet.view.freemarker.FreeMarkerViewResolver;
import run.halo.app.factory.StringToEnumConverterFactory;
import run.halo.app.security.resolver.AuthenticationArgumentResolver;
import java.util.List;
@ -37,7 +39,7 @@ import java.util.List;
@Slf4j
@Configuration
@EnableWebMvc
@ComponentScan(basePackages = "cc.ryanc.halo.web.controller")
@ComponentScan(basePackages = "run.halo.app.web.controller")
@PropertySource(value = "classpath:application.yaml", ignoreResourceNotFound = true, encoding = "UTF-8")
public class WebMvcAutoConfiguration implements WebMvcConfigurer {

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.config.properties;
package run.halo.app.config.properties;
import cc.ryanc.halo.model.support.HaloConst;
import run.halo.app.model.support.HaloConst;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.exception;
package run.halo.app.exception;
/**
* Exception caused by entity existence already.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.exception;
package run.halo.app.exception;
import org.springframework.http.HttpStatus;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.exception;
package run.halo.app.exception;
import org.springframework.http.HttpStatus;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.exception;
package run.halo.app.exception;
import org.springframework.http.HttpStatus;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.exception;
package run.halo.app.exception;
/**
* File operation exception.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.exception;
package run.halo.app.exception;
import org.springframework.http.HttpStatus;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.exception;
package run.halo.app.exception;
/**
* Frequent access exception.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.exception;
package run.halo.app.exception;
import org.springframework.http.HttpStatus;
import org.springframework.lang.NonNull;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.exception;
package run.halo.app.exception;
/**
* Missing property value exception.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.exception;
package run.halo.app.exception;
import org.springframework.http.HttpStatus;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.exception;
package run.halo.app.exception;
/**
* Property format exception.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.exception;
package run.halo.app.exception;
import org.springframework.http.HttpStatus;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.factory;
package run.halo.app.factory;
import org.springframework.core.convert.converter.Converter;
import org.springframework.core.convert.converter.ConverterFactory;

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.filter;
package run.halo.app.filter;
import cc.ryanc.halo.security.filter.AdminAuthenticationFilter;
import run.halo.app.security.filter.AdminAuthenticationFilter;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.HttpHeaders;
import org.springframework.web.cors.CorsUtils;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.filter;
package run.halo.app.filter;
import cn.hutool.extra.servlet.ServletUtil;
import lombok.extern.slf4j.Slf4j;

View File

@ -1,8 +1,8 @@
package cc.ryanc.halo.handler.file;
package run.halo.app.handler.file;
import cc.ryanc.halo.exception.FileOperationException;
import cc.ryanc.halo.model.enums.AttachmentType;
import cc.ryanc.halo.model.support.UploadResult;
import run.halo.app.exception.FileOperationException;
import run.halo.app.model.enums.AttachmentType;
import run.halo.app.model.support.UploadResult;
import org.apache.commons.lang3.StringUtils;
import org.springframework.http.MediaType;
import org.springframework.lang.NonNull;

View File

@ -1,9 +1,9 @@
package cc.ryanc.halo.handler.file;
package run.halo.app.handler.file;
import cc.ryanc.halo.exception.FileOperationException;
import cc.ryanc.halo.model.entity.Attachment;
import cc.ryanc.halo.model.enums.AttachmentType;
import cc.ryanc.halo.model.support.UploadResult;
import run.halo.app.exception.FileOperationException;
import run.halo.app.model.entity.Attachment;
import run.halo.app.model.enums.AttachmentType;
import run.halo.app.model.support.UploadResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationContext;
import org.springframework.lang.NonNull;

View File

@ -1,13 +1,13 @@
package cc.ryanc.halo.handler.file;
package run.halo.app.handler.file;
import cc.ryanc.halo.config.properties.HaloProperties;
import cc.ryanc.halo.exception.FileOperationException;
import cc.ryanc.halo.exception.ServiceException;
import cc.ryanc.halo.model.enums.AttachmentType;
import cc.ryanc.halo.model.support.UploadResult;
import cc.ryanc.halo.service.OptionService;
import cc.ryanc.halo.utils.FilenameUtils;
import cc.ryanc.halo.utils.HaloUtils;
import run.halo.app.config.properties.HaloProperties;
import run.halo.app.exception.FileOperationException;
import run.halo.app.exception.ServiceException;
import run.halo.app.model.enums.AttachmentType;
import run.halo.app.model.support.UploadResult;
import run.halo.app.service.OptionService;
import run.halo.app.utils.FilenameUtils;
import run.halo.app.utils.HaloUtils;
import lombok.extern.slf4j.Slf4j;
import net.coobird.thumbnailator.Thumbnails;
import org.springframework.http.MediaType;

View File

@ -1,13 +1,13 @@
package cc.ryanc.halo.handler.file;
package run.halo.app.handler.file;
import cc.ryanc.halo.exception.FileOperationException;
import cc.ryanc.halo.model.enums.AttachmentType;
import cc.ryanc.halo.model.properties.QnYunProperties;
import cc.ryanc.halo.model.support.QiNiuPutSet;
import cc.ryanc.halo.model.support.UploadResult;
import cc.ryanc.halo.service.OptionService;
import cc.ryanc.halo.utils.FilenameUtils;
import cc.ryanc.halo.utils.JsonUtils;
import run.halo.app.exception.FileOperationException;
import run.halo.app.model.enums.AttachmentType;
import run.halo.app.model.properties.QnYunProperties;
import run.halo.app.model.support.QiNiuPutSet;
import run.halo.app.model.support.UploadResult;
import run.halo.app.service.OptionService;
import run.halo.app.utils.FilenameUtils;
import run.halo.app.utils.JsonUtils;
import com.qiniu.common.QiniuException;
import com.qiniu.common.Zone;
import com.qiniu.http.Response;
@ -29,7 +29,7 @@ import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Objects;
import static cc.ryanc.halo.handler.file.FileHandler.isImageType;
import static run.halo.app.handler.file.FileHandler.isImageType;
/**
* Qi niu yun file handler.

View File

@ -1,10 +1,10 @@
package cc.ryanc.halo.handler.file;
package run.halo.app.handler.file;
import cc.ryanc.halo.exception.FileOperationException;
import cc.ryanc.halo.model.enums.AttachmentType;
import cc.ryanc.halo.model.support.UploadResult;
import cc.ryanc.halo.utils.FilenameUtils;
import cc.ryanc.halo.utils.HttpClientUtils;
import run.halo.app.exception.FileOperationException;
import run.halo.app.model.enums.AttachmentType;
import run.halo.app.model.support.UploadResult;
import run.halo.app.utils.FilenameUtils;
import run.halo.app.utils.HttpClientUtils;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
@ -16,6 +16,7 @@ import org.springframework.util.Assert;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import run.halo.app.model.enums.AttachmentType;
import java.io.IOException;
import java.util.Objects;

View File

@ -1,11 +1,11 @@
package cc.ryanc.halo.handler.file;
package run.halo.app.handler.file;
import cc.ryanc.halo.exception.FileOperationException;
import cc.ryanc.halo.model.enums.AttachmentType;
import cc.ryanc.halo.model.properties.UpYunProperties;
import cc.ryanc.halo.model.support.UploadResult;
import cc.ryanc.halo.service.OptionService;
import cc.ryanc.halo.utils.FilenameUtils;
import run.halo.app.exception.FileOperationException;
import run.halo.app.model.enums.AttachmentType;
import run.halo.app.model.properties.UpYunProperties;
import run.halo.app.model.support.UploadResult;
import run.halo.app.service.OptionService;
import run.halo.app.utils.FilenameUtils;
import com.UpYun;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

View File

@ -1,16 +1,16 @@
package cc.ryanc.halo.listener;
package run.halo.app.listener;
import cc.ryanc.halo.config.properties.HaloProperties;
import cc.ryanc.halo.model.entity.User;
import cc.ryanc.halo.model.params.UserParam;
import cc.ryanc.halo.model.properties.BlogProperties;
import cc.ryanc.halo.model.properties.PrimaryProperties;
import cc.ryanc.halo.model.support.HaloConst;
import cc.ryanc.halo.model.support.Theme;
import cc.ryanc.halo.service.OptionService;
import cc.ryanc.halo.service.ThemeService;
import cc.ryanc.halo.service.UserService;
import cc.ryanc.halo.utils.HaloUtils;
import run.halo.app.config.properties.HaloProperties;
import run.halo.app.model.entity.User;
import run.halo.app.model.params.UserParam;
import run.halo.app.model.properties.BlogProperties;
import run.halo.app.model.properties.PrimaryProperties;
import run.halo.app.model.support.HaloConst;
import run.halo.app.model.support.Theme;
import run.halo.app.service.OptionService;
import run.halo.app.service.ThemeService;
import run.halo.app.service.UserService;
import run.halo.app.utils.HaloUtils;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
import com.fasterxml.jackson.databind.ObjectMapper;
@ -22,6 +22,13 @@ import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationListener;
import org.springframework.context.annotation.Configuration;
import org.springframework.util.ResourceUtils;
import run.halo.app.model.entity.User;
import run.halo.app.model.params.UserParam;
import run.halo.app.model.properties.BlogProperties;
import run.halo.app.model.properties.PrimaryProperties;
import run.halo.app.model.support.Theme;
import run.halo.app.service.ThemeService;
import run.halo.app.utils.HaloUtils;
import java.io.File;
import java.io.IOException;
@ -29,8 +36,8 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import static cc.ryanc.halo.model.support.HaloConst.ACTIVATED_THEME_NAME;
import static cc.ryanc.halo.model.support.HaloConst.DEFAULT_THEME_NAME;
import static run.halo.app.model.support.HaloConst.ACTIVATED_THEME_NAME;
import static run.halo.app.model.support.HaloConst.DEFAULT_THEME_NAME;
/**
* The method executed after the application is started.

View File

@ -1,8 +1,8 @@
package cc.ryanc.halo.model.dto;
package run.halo.app.model.dto;
import cc.ryanc.halo.model.dto.base.OutputConverter;
import cc.ryanc.halo.model.entity.Attachment;
import cc.ryanc.halo.model.enums.AttachmentType;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Attachment;
import run.halo.app.model.enums.AttachmentType;
import lombok.Data;
/**

View File

@ -1,8 +1,10 @@
package cc.ryanc.halo.model.dto;
package run.halo.app.model.dto;
import cc.ryanc.halo.model.dto.base.OutputConverter;
import cc.ryanc.halo.model.entity.Category;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Category;
import lombok.Data;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Category;
/**
* Category output dto.

View File

@ -1,11 +1,14 @@
package cc.ryanc.halo.model.dto;
package run.halo.app.model.dto;
import cc.ryanc.halo.model.dto.base.OutputConverter;
import cc.ryanc.halo.model.entity.Comment;
import cc.ryanc.halo.model.enums.CommentStatus;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Comment;
import run.halo.app.model.enums.CommentStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Comment;
import run.halo.app.model.enums.CommentStatus;
import java.util.Date;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.dto;
package run.halo.app.model.dto;
import lombok.Data;

View File

@ -1,8 +1,10 @@
package cc.ryanc.halo.model.dto;
package run.halo.app.model.dto;
import cc.ryanc.halo.model.dto.base.OutputConverter;
import cc.ryanc.halo.model.entity.Gallery;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Gallery;
import lombok.Data;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Gallery;
/**
* @author : RYAN0UP

View File

@ -1,8 +1,10 @@
package cc.ryanc.halo.model.dto;
package run.halo.app.model.dto;
import cc.ryanc.halo.model.dto.base.OutputConverter;
import cc.ryanc.halo.model.entity.Link;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Link;
import lombok.Data;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Link;
/**
* Link output dto.

View File

@ -1,11 +1,14 @@
package cc.ryanc.halo.model.dto;
package run.halo.app.model.dto;
import cc.ryanc.halo.model.dto.base.OutputConverter;
import cc.ryanc.halo.model.entity.Log;
import cc.ryanc.halo.model.enums.LogType;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Log;
import run.halo.app.model.enums.LogType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Log;
import run.halo.app.model.enums.LogType;
import java.util.Date;

View File

@ -1,8 +1,10 @@
package cc.ryanc.halo.model.dto;
package run.halo.app.model.dto;
import cc.ryanc.halo.model.dto.base.OutputConverter;
import cc.ryanc.halo.model.entity.Menu;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Menu;
import lombok.Data;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Menu;
/**
* Menu output dto.

View File

@ -1,8 +1,8 @@
package cc.ryanc.halo.model.dto;
package run.halo.app.model.dto;
import cc.ryanc.halo.model.dto.base.OutputConverter;
import cc.ryanc.halo.model.entity.Option;
import lombok.Data;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Option;
/**
* Option output dto.

View File

@ -1,8 +1,10 @@
package cc.ryanc.halo.model.dto;
package run.halo.app.model.dto;
import cc.ryanc.halo.model.dto.base.OutputConverter;
import cc.ryanc.halo.model.entity.Tag;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Tag;
import lombok.Data;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Tag;
/**
* Tag output dto.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.dto;
package run.halo.app.model.dto;
import lombok.Data;

View File

@ -1,10 +1,12 @@
package cc.ryanc.halo.model.dto;
package run.halo.app.model.dto;
import cc.ryanc.halo.model.dto.base.OutputConverter;
import cc.ryanc.halo.model.entity.User;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.User;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.User;
import java.util.Date;

View File

@ -1,12 +1,14 @@
package cc.ryanc.halo.model.dto.base;
package run.halo.app.model.dto.base;
import cc.ryanc.halo.utils.ReflectionUtils;
import run.halo.app.utils.ReflectionUtils;
import run.halo.app.utils.BeanUtils;
import run.halo.app.utils.ReflectionUtils;
import java.lang.reflect.ParameterizedType;
import java.util.Objects;
import static cc.ryanc.halo.utils.BeanUtils.transformFrom;
import static cc.ryanc.halo.utils.BeanUtils.updateProperties;
import static run.halo.app.utils.BeanUtils.transformFrom;
import static run.halo.app.utils.BeanUtils.updateProperties;
/**
* Converter interface for input DTO.
@ -30,7 +32,7 @@ public interface InputConverter<DOMAIN> {
Class<DOMAIN> domainClass = (Class<DOMAIN>) currentType.getActualTypeArguments()[0];
return transformFrom(this, domainClass);
return BeanUtils.transformFrom(this, domainClass);
}
/**
@ -39,7 +41,7 @@ public interface InputConverter<DOMAIN> {
* @param domain updated domain
*/
default void update(DOMAIN domain) {
updateProperties(this, domain);
BeanUtils.updateProperties(this, domain);
}
}

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.model.dto.base;
package run.halo.app.model.dto.base;
import static cc.ryanc.halo.utils.BeanUtils.updateProperties;
import static run.halo.app.utils.BeanUtils.updateProperties;
/**
* Converter interface for output DTO.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.dto.post;
package run.halo.app.model.dto.post;
import lombok.Data;
import lombok.EqualsAndHashCode;

View File

@ -1,12 +1,16 @@
package cc.ryanc.halo.model.dto.post;
package run.halo.app.model.dto.post;
import cc.ryanc.halo.model.dto.base.OutputConverter;
import cc.ryanc.halo.model.entity.Post;
import cc.ryanc.halo.model.enums.PostStatus;
import cc.ryanc.halo.model.enums.PostType;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Post;
import run.halo.app.model.enums.PostStatus;
import run.halo.app.model.enums.PostType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import run.halo.app.model.dto.base.OutputConverter;
import run.halo.app.model.entity.Post;
import run.halo.app.model.enums.PostStatus;
import run.halo.app.model.enums.PostType;
import java.util.Date;

View File

@ -1,10 +1,12 @@
package cc.ryanc.halo.model.dto.post;
package run.halo.app.model.dto.post;
import cc.ryanc.halo.model.enums.PostCreateFrom;
import cc.ryanc.halo.model.enums.PostType;
import run.halo.app.model.enums.PostCreateFrom;
import run.halo.app.model.enums.PostType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import run.halo.app.model.enums.PostCreateFrom;
import run.halo.app.model.enums.PostType;
/**
* Page simple output dto.

View File

@ -1,11 +1,12 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import cc.ryanc.halo.model.enums.AttachmentType;
import run.halo.app.model.enums.AttachmentType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import run.halo.app.model.enums.AttachmentType;
import javax.persistence.*;

View File

@ -1,9 +1,10 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import cc.ryanc.halo.utils.DateUtils;
import run.halo.app.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import run.halo.app.utils.DateUtils;
import javax.persistence.*;
import java.util.Date;

View File

@ -1,12 +1,13 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import cc.ryanc.halo.model.enums.PostCreateFrom;
import cc.ryanc.halo.model.enums.PostStatus;
import run.halo.app.model.enums.PostCreateFrom;
import run.halo.app.model.enums.PostStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import run.halo.app.utils.MarkdownUtils;
import javax.persistence.*;
import java.util.Date;
@ -57,7 +58,7 @@ public class BasePost extends BaseEntity {
/**
* Rendered content.
*
* @see cc.ryanc.halo.utils.MarkdownUtils#renderMarkdown(String)
* @see MarkdownUtils#renderMarkdown(String)
*/
@Column(name = "format_content", columnDefinition = "text not null")
private String formatContent;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import cc.ryanc.halo.model.enums.CommentStatus;
import run.halo.app.model.enums.CommentStatus;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;

View File

@ -1,7 +1,7 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import cc.ryanc.halo.model.enums.LogType;
import run.halo.app.model.enums.LogType;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import cc.ryanc.halo.model.enums.OptionSource;
import run.halo.app.model.enums.OptionSource;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import lombok.Data;
import lombok.ToString;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import lombok.Data;
import lombok.ToString;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import lombok.Data;
import lombok.EqualsAndHashCode;

View File

@ -1,11 +1,12 @@
package cc.ryanc.halo.model.entity;
package run.halo.app.model.entity;
import cc.ryanc.halo.utils.DateUtils;
import run.halo.app.utils.DateUtils;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;
import run.halo.app.utils.DateUtils;
import javax.persistence.*;
import java.util.Date;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.enums;
package run.halo.app.model.enums;
/**
* Attach origin.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.enums;
package run.halo.app.model.enums;
/**
* Comment status.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.enums;
package run.halo.app.model.enums;
/**
* Log type.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.enums;
package run.halo.app.model.enums;
/**
* Option source.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.enums;
package run.halo.app.model.enums;
/**
* Post create from type.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.enums;
package run.halo.app.model.enums;
/**
* Post status.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.enums;
package run.halo.app.model.enums;
/**
* Post type.

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.enums;
package run.halo.app.model.enums;
import org.springframework.util.Assert;

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.model.enums.converter;
package run.halo.app.model.enums.converter;
import cc.ryanc.halo.model.enums.ValueEnum;
import run.halo.app.model.enums.ValueEnum;
import javax.persistence.AttributeConverter;

View File

@ -1,6 +1,7 @@
package cc.ryanc.halo.model.enums.converter;
package run.halo.app.model.enums.converter;
import cc.ryanc.halo.model.enums.AttachmentType;
import run.halo.app.model.enums.AttachmentType;
import run.halo.app.model.enums.AttachmentType;
import javax.persistence.Converter;

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.model.enums.converter;
package run.halo.app.model.enums.converter;
import cc.ryanc.halo.model.enums.CommentStatus;
import run.halo.app.model.enums.CommentStatus;
import javax.persistence.Converter;

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.model.enums.converter;
package run.halo.app.model.enums.converter;
import cc.ryanc.halo.model.enums.LogType;
import run.halo.app.model.enums.LogType;
import javax.persistence.Converter;

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.model.enums.converter;
package run.halo.app.model.enums.converter;
import cc.ryanc.halo.model.enums.OptionSource;
import run.halo.app.model.enums.OptionSource;
import javax.persistence.Converter;

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.model.enums.converter;
package run.halo.app.model.enums.converter;
import cc.ryanc.halo.model.enums.PostCreateFrom;
import run.halo.app.model.enums.PostCreateFrom;
import javax.persistence.Converter;

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.model.enums.converter;
package run.halo.app.model.enums.converter;
import cc.ryanc.halo.model.enums.PostStatus;
import run.halo.app.model.enums.PostStatus;
import javax.persistence.Converter;

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.model.enums.converter;
package run.halo.app.model.enums.converter;
import cc.ryanc.halo.model.enums.PostType;
import run.halo.app.model.enums.PostType;
import javax.persistence.Converter;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.freemarker.method;
package run.halo.app.model.freemarker.method;
import cn.hutool.core.util.RandomUtil;
import freemarker.template.SimpleNumber;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.freemarker.method;
package run.halo.app.model.freemarker.method;
import freemarker.template.TemplateMethodModelEx;
import freemarker.template.TemplateModelException;

View File

@ -1,4 +1,4 @@
package cc.ryanc.halo.model.freemarker.method;
package run.halo.app.model.freemarker.method;
import freemarker.template.TemplateMethodModelEx;
import freemarker.template.TemplateModelException;

View File

@ -1,9 +1,10 @@
package cc.ryanc.halo.model.freemarker.tag;
package run.halo.app.model.freemarker.tag;
import cc.ryanc.halo.service.CategoryService;
import run.halo.app.service.CategoryService;
import freemarker.core.Environment;
import freemarker.template.*;
import org.springframework.stereotype.Component;
import run.halo.app.service.CategoryService;
import java.io.IOException;
import java.util.Map;

View File

@ -1,9 +1,10 @@
package cc.ryanc.halo.model.freemarker.tag;
package run.halo.app.model.freemarker.tag;
import cc.ryanc.halo.service.CommentService;
import run.halo.app.service.CommentService;
import freemarker.core.Environment;
import freemarker.template.*;
import org.springframework.stereotype.Component;
import run.halo.app.service.CommentService;
import java.io.IOException;
import java.util.Map;

View File

@ -1,6 +1,6 @@
package cc.ryanc.halo.model.freemarker.tag;
package run.halo.app.model.freemarker.tag;
import cc.ryanc.halo.service.LinkService;
import run.halo.app.service.LinkService;
import freemarker.core.Environment;
import freemarker.template.*;
import org.springframework.stereotype.Component;

View File

@ -1,9 +1,10 @@
package cc.ryanc.halo.model.freemarker.tag;
package run.halo.app.model.freemarker.tag;
import cc.ryanc.halo.service.MenuService;
import run.halo.app.service.MenuService;
import freemarker.core.Environment;
import freemarker.template.*;
import org.springframework.stereotype.Component;
import run.halo.app.service.MenuService;
import java.io.IOException;
import java.util.Map;

Some files were not shown because too many files have changed in this diff Show More