generated from halo-dev/plugin-starter
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: replace the lib jar with Halo api dependency (#31)
### What this PR does? 使用 `run.halo.app:api` 依赖替换原先 lib jar 的方式 ```release-note 升级 halo plugin api 依赖 ```
- Loading branch information
Showing
9 changed files
with
65 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package run.halo.oauth; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.server.ResponseStatusException; | ||
|
||
/** | ||
* AccessDeniedException will resolve i18n message and response 403 status. | ||
* | ||
* @author guqing | ||
*/ | ||
public class AccessDeniedException extends ResponseStatusException { | ||
|
||
public AccessDeniedException() { | ||
this("Access to the resource is forbidden"); | ||
} | ||
|
||
public AccessDeniedException(String reason) { | ||
this(reason, null, null); | ||
} | ||
|
||
public AccessDeniedException(String reason, String detailCode, Object[] detailArgs) { | ||
super(HttpStatus.FORBIDDEN, reason, null, detailCode, detailArgs); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package run.halo.oauth; | ||
|
||
import org.springframework.http.HttpStatus; | ||
import org.springframework.lang.Nullable; | ||
import org.springframework.web.server.ResponseStatusException; | ||
|
||
/** | ||
* Not found exception. | ||
* | ||
* @author guqing | ||
* @since 2.0.0 | ||
*/ | ||
public class NotFoundException extends ResponseStatusException { | ||
|
||
public NotFoundException(@Nullable String reason) { | ||
this(reason, null); | ||
} | ||
|
||
public NotFoundException(@Nullable String reason, | ||
@Nullable Throwable cause) { | ||
super(HttpStatus.NOT_FOUND, reason, cause); | ||
} | ||
|
||
public NotFoundException(@Nullable Throwable cause) { | ||
this(cause == null ? "" : cause.getMessage(), cause); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters