Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e4184057a | |||
| 18aa1199ec |
@@ -1,3 +1,19 @@
|
|||||||
|
# halo-plugin-douban
|
||||||
|
|
||||||
|
> 基于原作者v1.2.2代码修改
|
||||||
|
|
||||||
|
#### v1.2.2-2
|
||||||
|
1. 新增类别接口`/apis/api.douban.moony.la/v1alpha1/doubanmovies/-/types`(基于原作者v1.2.5代码)
|
||||||
|
|
||||||
|
#### v1.2.2-1
|
||||||
|
1. 修改前台页面路由为/books
|
||||||
|
2. 控制台类别value不再限制
|
||||||
|
3. 修复构建失败等异常
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# plugin-douban
|
# plugin-douban
|
||||||
|
|
||||||
* 豆瓣管理插件, 支持在 Console 进行管理以及为主题端提供 `/douban` 页面路由。
|
* 豆瓣管理插件, 支持在 Console 进行管理以及为主题端提供 `/douban` 页面路由。
|
||||||
|
|||||||
@@ -144,6 +144,28 @@
|
|||||||
"tags" : [ "api.douban.moony.la/v1alpha1/DoubanMovie" ]
|
"tags" : [ "api.douban.moony.la/v1alpha1/DoubanMovie" ]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/apis/api.douban.moony.la/v1alpha1/doubanmovies/-/types" : {
|
||||||
|
"get" : {
|
||||||
|
"description" : "List all douban types.",
|
||||||
|
"operationId" : "ListTypes",
|
||||||
|
"responses" : {
|
||||||
|
"default" : {
|
||||||
|
"content" : {
|
||||||
|
"*/*" : {
|
||||||
|
"schema" : {
|
||||||
|
"type" : "array",
|
||||||
|
"items" : {
|
||||||
|
"$ref" : "#/components/schemas/DoubanTypeVo"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description" : "default response"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"tags" : [ "api.douban.moony.la/v1alpha1/DoubanMovie" ]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/apis/api.douban.moony.la/v1alpha1/doubanmovies/-/getDoubanDetail" : {
|
"/apis/api.douban.moony.la/v1alpha1/doubanmovies/-/getDoubanDetail" : {
|
||||||
"get" : {
|
"get" : {
|
||||||
"description" : "getDoubanDetail.",
|
"description" : "getDoubanDetail.",
|
||||||
@@ -851,6 +873,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"DoubanTypeVo" : {
|
||||||
|
"type" : "object",
|
||||||
|
"properties" : {
|
||||||
|
"doubanCount" : {
|
||||||
|
"type" : "integer",
|
||||||
|
"format" : "int32"
|
||||||
|
},
|
||||||
|
"key" : {
|
||||||
|
"type" : "string"
|
||||||
|
},
|
||||||
|
"name" : {
|
||||||
|
"type" : "string"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"JsonPatch" : {
|
"JsonPatch" : {
|
||||||
"minItems" : 1,
|
"minItems" : 1,
|
||||||
"uniqueItems" : true,
|
"uniqueItems" : true,
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation platform('run.halo.tools.platform:plugin:2.20.0-SNAPSHOT')
|
implementation platform('run.halo.tools.platform:plugin:2.20.11')
|
||||||
compileOnly 'run.halo.app:api'
|
compileOnly 'run.halo.app:api'
|
||||||
|
|
||||||
testImplementation 'run.halo.app:api'
|
testImplementation 'run.halo.app:api'
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
version=1.2.2
|
version=1.2.2-2
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ package la.moony.douban;
|
|||||||
|
|
||||||
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
import io.swagger.v3.oas.annotations.enums.ParameterIn;
|
||||||
import la.moony.douban.extension.DoubanMovie;
|
import la.moony.douban.extension.DoubanMovie;
|
||||||
|
import la.moony.douban.finders.DoubanFinder;
|
||||||
import la.moony.douban.service.DoubanService;
|
import la.moony.douban.service.DoubanService;
|
||||||
import la.moony.douban.vo.DoubanMovieVo;
|
import la.moony.douban.vo.DoubanMovieVo;
|
||||||
|
import la.moony.douban.vo.DoubanTypeVo;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springdoc.webflux.core.fn.SpringdocRouteBuilder;
|
import org.springdoc.webflux.core.fn.SpringdocRouteBuilder;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@@ -25,9 +27,12 @@ public class DoubanEndpoint implements CustomEndpoint {
|
|||||||
|
|
||||||
private final DoubanService doubanService;
|
private final DoubanService doubanService;
|
||||||
|
|
||||||
|
private final DoubanFinder doubanFinder;
|
||||||
|
|
||||||
public DoubanEndpoint(DoubanService doubanService) {
|
|
||||||
|
public DoubanEndpoint(DoubanService doubanService, DoubanFinder doubanFinder) {
|
||||||
this.doubanService = doubanService;
|
this.doubanService = doubanService;
|
||||||
|
this.doubanFinder = doubanFinder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -43,6 +48,13 @@ public class DoubanEndpoint implements CustomEndpoint {
|
|||||||
);
|
);
|
||||||
DoubanMovieQuery.buildParameters(builder);
|
DoubanMovieQuery.buildParameters(builder);
|
||||||
})
|
})
|
||||||
|
.GET("doubanmovies/-/types", this::ListTypes,
|
||||||
|
builder -> builder.operationId("ListTypes")
|
||||||
|
.description("List all douban types.")
|
||||||
|
.tag(doubanMovieTag)
|
||||||
|
.response(responseBuilder()
|
||||||
|
.implementationArray(DoubanTypeVo.class)
|
||||||
|
))
|
||||||
.GET("doubanmovies/-/genres", this::ListGenres,
|
.GET("doubanmovies/-/genres", this::ListGenres,
|
||||||
builder -> builder.operationId("ListGenres")
|
builder -> builder.operationId("ListGenres")
|
||||||
.description("List all douban genres.")
|
.description("List all douban genres.")
|
||||||
@@ -87,6 +99,12 @@ public class DoubanEndpoint implements CustomEndpoint {
|
|||||||
.flatMap(result -> ServerResponse.ok().bodyValue(result));
|
.flatMap(result -> ServerResponse.ok().bodyValue(result));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private Mono<ServerResponse> ListTypes(ServerRequest request) {
|
||||||
|
return doubanFinder.listAllType()
|
||||||
|
.collectList()
|
||||||
|
.flatMap(result -> ServerResponse.ok().bodyValue(result));
|
||||||
|
}
|
||||||
|
|
||||||
private Mono<ServerResponse> getDoubanDetail(ServerRequest request) {
|
private Mono<ServerResponse> getDoubanDetail(ServerRequest request) {
|
||||||
String url = request.queryParam("url").orElse(null);
|
String url = request.queryParam("url").orElse(null);
|
||||||
return doubanService.getDoubanDetail(url)
|
return doubanService.getDoubanDetail(url)
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class DoubanRouter {
|
|||||||
@Bean
|
@Bean
|
||||||
RouterFunction<ServerResponse> friendTemplateRoute() {
|
RouterFunction<ServerResponse> friendTemplateRoute() {
|
||||||
|
|
||||||
return RouterFunctions.route().GET("/douban",this::handlerFunction)
|
return RouterFunctions.route().GET("/books",this::handlerFunction)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ metadata:
|
|||||||
rbac.authorization.halo.run/display-name: "查看朋友圈提交模板"
|
rbac.authorization.halo.run/display-name: "查看朋友圈提交模板"
|
||||||
rules:
|
rules:
|
||||||
- apiGroups: [ "api.douban.moony.la" ]
|
- apiGroups: [ "api.douban.moony.la" ]
|
||||||
resources: [ "doubanmovies","doubanmovies/genres","doubanmovies/getDoubanDetail"]
|
resources: [ "doubanmovies","doubanmovies/types","doubanmovies/genres","doubanmovies/getDoubanDetail"]
|
||||||
verbs: [ "get", "list" ]
|
verbs: [ "get", "list" ]
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
"name": "@kunkunyu/plugin-douban",
|
"name": "@kunkunyu/plugin-douban",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite build --watch --mode=development",
|
"dev": "vite build --watch --mode=development",
|
||||||
"build": "vite build",
|
"build": "vite build",
|
||||||
|
|||||||
Generated
+5129
-3321
File diff suppressed because it is too large
Load Diff
@@ -218,32 +218,11 @@ const handleSaveFriend = async () => {
|
|||||||
></FormKit>
|
></FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
v-if="formState.spec.dataType=='halo'"
|
v-if="formState.spec.dataType=='halo'"
|
||||||
:options="[
|
type="text"
|
||||||
{
|
|
||||||
label: '电影',
|
|
||||||
value: 'movie',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '图书',
|
|
||||||
value: 'book',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '音乐',
|
|
||||||
value: 'music',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '游戏',
|
|
||||||
value: 'game',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '舞台剧',
|
|
||||||
value: 'drama',
|
|
||||||
},
|
|
||||||
]"
|
|
||||||
label="类型"
|
|
||||||
v-model="formState.spec.type"
|
v-model="formState.spec.type"
|
||||||
name="type"
|
name="type"
|
||||||
type="select"
|
label="类型"
|
||||||
|
placeholder="输入类型 value,例如 movie"
|
||||||
></FormKit>
|
></FormKit>
|
||||||
<FormKit
|
<FormKit
|
||||||
v-if="formState.spec.dataType=='halo'"
|
v-if="formState.spec.dataType=='halo'"
|
||||||
|
|||||||
+4
-27
@@ -332,35 +332,12 @@ const onEditingModalClose = async () => {
|
|||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
/>
|
/>
|
||||||
<FilterDropdown
|
<FormKit
|
||||||
v-model="selectedType"
|
v-model="selectedType"
|
||||||
label="类型"
|
label="类型"
|
||||||
:items="[
|
placeholder="输入类型 value 过滤,例如 movie"
|
||||||
{
|
type="text"
|
||||||
label: '全部',
|
outer-class="!moments-p-0"
|
||||||
value: undefined,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '电影',
|
|
||||||
value: 'movie',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '图书',
|
|
||||||
value: 'book',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '音乐',
|
|
||||||
value: 'music',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '游戏',
|
|
||||||
value: 'game',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: '舞台剧',
|
|
||||||
value: 'drama',
|
|
||||||
},
|
|
||||||
]"
|
|
||||||
/>
|
/>
|
||||||
<FilterDropdown
|
<FilterDropdown
|
||||||
v-model="selectedSort"
|
v-model="selectedSort"
|
||||||
|
|||||||
+15
-1
@@ -1,9 +1,23 @@
|
|||||||
{
|
{
|
||||||
"extends": "@vue/tsconfig/tsconfig.web.json",
|
|
||||||
"include": ["./env.d.ts", "./src/**/*", "./src/**/*.vue"],
|
"include": ["./env.d.ts", "./src/**/*", "./src/**/*.vue"],
|
||||||
"exclude": ["./src/**/__tests__/*"],
|
"exclude": ["./src/**/__tests__/*"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"composite": true,
|
"composite": true,
|
||||||
|
"target": "ES2020",
|
||||||
|
"useDefineForClassFields": true,
|
||||||
|
"module": "ESNext",
|
||||||
|
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"isolatedModules": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"jsx": "preserve",
|
||||||
|
"strict": true,
|
||||||
|
"noUnusedLocals": true,
|
||||||
|
"noUnusedParameters": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
"baseUrl": ".",
|
"baseUrl": ".",
|
||||||
"paths": {
|
"paths": {
|
||||||
"@/*": ["./src/*"]
|
"@/*": ["./src/*"]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "@vue/tsconfig/tsconfig.node.json",
|
"extends": "@tsconfig/node20/tsconfig.json",
|
||||||
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*"],
|
"include": ["vite.config.*", "vitest.config.*", "cypress.config.*"],
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"composite": true,
|
"composite": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user