Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove deprecated code. #1334

Merged
merged 1 commit into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ checkstyle {

repositories {
mavenLocal()
// maven {
// url "https://maven.aliyun.com/nexus/content/groups/public"
// }
mavenCentral()
maven { url 'https://repo.spring.io/milestone' }
jcenter()
Expand Down Expand Up @@ -99,13 +96,11 @@ ext {
annotationsVersion = "3.0.1u2"
zxingVersion = "3.4.0"
huaweiObsVersion = "3.19.7"
githubApiVersion = "1.84"
templateInheritanceVersion = "0.4.RELEASE"
jsoupVersion = "1.13.1"
}

dependencies {
implementation "org.kohsuke:github-api:$githubApiVersion"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-data-jpa"
implementation "org.springframework.boot:spring-boot-starter-web"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import run.halo.app.cache.lock.CacheLock;
import run.halo.app.model.dto.EnvironmentDTO;
import run.halo.app.model.dto.LoginPreCheckDTO;
import run.halo.app.model.dto.StatisticDTO;
import run.halo.app.model.entity.User;
import run.halo.app.model.enums.MFAType;
import run.halo.app.model.params.LoginParam;
Expand Down Expand Up @@ -100,13 +99,6 @@ public AuthToken refresh(@PathVariable("refreshToken") String refreshToken) {
return adminService.refreshToken(refreshToken);
}

@GetMapping("counts")
@ApiOperation("Gets count info")
@Deprecated
public StatisticDTO getCount() {
return adminService.getCount();
}

@GetMapping("environments")
@ApiOperation("Gets environments info")
public EnvironmentDTO getEnvironments() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,43 +190,6 @@ public ThemeProperty fetchTheme(@RequestParam("uri") String uri) {
return themeService.fetch(uri);
}

@PostMapping(value = {"fetchingBranches", "/fetching/git/branches"})
@ApiOperation("Fetches all branches")
@Deprecated(since = "1.4.2", forRemoval = true)
public List<ThemeProperty> fetchBranches(@RequestParam("uri") String uri) {
return themeService.fetchBranches(uri);
}

@PostMapping("fetchingReleases")
@ApiOperation("Fetches all releases")
@Deprecated(since = "1.4.2", forRemoval = true)
public List<ThemeProperty> fetchReleases(@RequestParam("uri") String uri) {
return themeService.fetchReleases(uri);
}

@GetMapping("fetchingRelease")
@ApiOperation("Fetches a specific release")
@Deprecated(since = "1.4.2", forRemoval = true)
public ThemeProperty fetchRelease(@RequestParam("uri") String uri,
@RequestParam("tag") String tagName) {
return themeService.fetchRelease(uri, tagName);
}

@GetMapping("fetchBranch")
@ApiOperation("Fetch specific branch")
@Deprecated(since = "1.4.2", forRemoval = true)
public ThemeProperty fetchBranch(@RequestParam("uri") String uri,
@RequestParam("branch") String branchName) {
return themeService.fetchBranch(uri, branchName);
}

@GetMapping("fetchLatestRelease")
@ApiOperation("Fetch latest release")
@Deprecated(since = "1.4.2", forRemoval = true)
public ThemeProperty fetchLatestRelease(@RequestParam("uri") String uri) {
return themeService.fetchLatestRelease(uri);
}

@PutMapping("fetching/{themeId:.+}")
@ApiOperation("Upgrades theme from remote")
public ThemeProperty updateThemeByFetching(@PathVariable("themeId") String themeId) {
Expand Down
3 changes: 0 additions & 3 deletions src/main/java/run/halo/app/model/dto/StatisticDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ public class StatisticDTO {

private Long categoryCount;

@Deprecated
private Long attachmentCount;

private Long tagCount;

private Long journalCount;
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/run/halo/app/service/AdminService.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import org.springframework.lang.NonNull;
import run.halo.app.model.dto.EnvironmentDTO;
import run.halo.app.model.dto.LoginPreCheckDTO;
import run.halo.app.model.dto.StatisticDTO;
import run.halo.app.model.entity.User;
import run.halo.app.model.params.LoginParam;
import run.halo.app.model.params.ResetPasswordParam;
Expand Down Expand Up @@ -64,15 +63,6 @@ public interface AdminService {
*/
void resetPasswordByCode(@NonNull ResetPasswordParam param);

/**
* Get system counts.
*
* @return count dto
*/
@NonNull
@Deprecated
StatisticDTO getCount();

/**
* Get system environments
*
Expand Down
130 changes: 0 additions & 130 deletions src/main/java/run/halo/app/service/ThemeService.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package run.halo.app.service;

import java.io.IOException;
import java.nio.file.Path;
import java.util.List;
import java.util.Optional;
Expand All @@ -19,19 +18,6 @@
*/
public interface ThemeService {

/**
* Theme property file name.
*/
@Deprecated
String THEME_PROPERTY_FILE_NAME = "theme.yaml";

/**
* Theme property file name.
*/
@Deprecated
String[] THEME_PROPERTY_FILE_NAMES = {"theme.yaml", "theme.yml"};


/**
* Configuration file name.
*/
Expand All @@ -42,34 +28,11 @@ public interface ThemeService {
*/
String[] CAN_EDIT_SUFFIX = {".ftl", ".css", ".js", ".yaml", ".yml", ".properties"};

/**
* These file names cannot be displayed.
*/
String[] FILTER_FILES =
{".git", ".DS_Store", "theme.yaml", "theme.yml", "settings.yaml", "settings.yml"};

/**
* Theme folder location.
*/
String THEME_FOLDER = "templates/themes";

/**
* Theme screenshots name.
*/
@Deprecated
String THEME_SCREENSHOTS_NAME = "screenshot";


/**
* Render template.
*/
String RENDER_TEMPLATE = "themes/%s/%s";

/**
* Render template with suffix.
*/
String RENDER_TEMPLATE_SUFFIX = "themes/%s/%s.ftl";

/**
* Theme cache key.
*/
Expand All @@ -85,26 +48,6 @@ public interface ThemeService {
*/
String CUSTOM_POST_PREFIX = "post_";

/**
* Theme provider remote name.
*/
String THEME_PROVIDER_REMOTE_NAME = "origin";

/**
* Default remote branch name.
*/
String DEFAULT_REMOTE_BRANCH = "master";

/**
* Key to access the zip file url which is in the http response
*/
String ZIP_FILE_KEY = "zipball_url";

/**
* Key to access the tag name which is in the http response
*/
String TAG_KEY = "tag_name";

/**
* Get theme property by theme id.
*
Expand Down Expand Up @@ -140,16 +83,6 @@ public interface ThemeService {
@NonNull
List<ThemeFile> listThemeFolderBy(@NonNull String themeId);

/**
* Lists a set of custom template, such as sheet_xxx.ftl, and xxx will be template name
*
* @param themeId theme id must not be blank
* @return a set of templates
*/
@Deprecated
@NonNull
List<String> listCustomTemplates(@NonNull String themeId);

/**
* Lists a set of custom template, such as sheet_xxx.ftl/post_xxx.ftl, and xxx will be
* template name
Expand Down Expand Up @@ -296,17 +229,6 @@ void saveTemplateContent(@NonNull String themeId, @NonNull String absolutePath,
@NonNull
ThemeProperty upload(@NonNull MultipartFile file);

/**
* Adds a new theme.
*
* @param themeTmpPath theme temporary path must not be null
* @return theme property
* @throws IOException IOException
*/
@NonNull
@Deprecated
ThemeProperty add(@NonNull Path themeTmpPath) throws IOException;

/**
* Fetches a new theme.
*
Expand All @@ -316,58 +238,6 @@ void saveTemplateContent(@NonNull String themeId, @NonNull String absolutePath,
@NonNull
ThemeProperty fetch(@NonNull String uri);

/**
* Fetches the latest release
*
* @param uri theme remote uri must not be null
* @return theme property
*/
@NonNull
@Deprecated(since = "1.4.2", forRemoval = true)
ThemeProperty fetchLatestRelease(@NonNull String uri);

/**
* Fetches all the branches info
*
* @param uri theme remote uri must not be null
* @return list of theme properties
*/
@NonNull
@Deprecated(since = "1.4.2", forRemoval = true)
List<ThemeProperty> fetchBranches(@NonNull String uri);

/**
* Fetches all the release info
*
* @param uri theme remote uri must not be null
* @return list of theme properties
*/
@NonNull
@Deprecated(since = "1.4.2", forRemoval = true)
List<ThemeProperty> fetchReleases(@NonNull String uri);

/**
* Fetches a specific release
*
* @param uri theme remote uri must not be null
* @param tagName release tag name must not be null
* @return theme property
*/
@NonNull
@Deprecated(since = "1.4.2", forRemoval = true)
ThemeProperty fetchRelease(@NonNull String uri, @NonNull String tagName);

/**
* Fetches a specific branch (clone)
*
* @param uri theme remote uri must not be null
* @param branchName wanted branch must not be null
* @return theme property
*/
@NonNull
@Deprecated(since = "1.4.2", forRemoval = true)
ThemeProperty fetchBranch(@NonNull String uri, @NonNull String branchName);

/**
* Reloads themes
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
*/
public interface ThemeSettingService extends CrudService<ThemeSetting, Integer> {


/**
* Saves theme setting.
*
Expand Down
10 changes: 1 addition & 9 deletions src/main/java/run/halo/app/service/base/BaseCommentService.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,7 @@
*/
public interface BaseCommentService<COMMENT extends BaseComment>
extends CrudService<COMMENT, Long> {

/**
* %d: parent commentator id
* %s: parent commentator author name
* %s: comment content
*/
@Deprecated
String COMMENT_TEMPLATE = "<a href='#comment-id-%d'>@%s</a> %s";


/**
* Lists comments by post id.
*
Expand Down
Loading