Skip to content

Commit

Permalink
refactor: user service find methods. (#699)
Browse files Browse the repository at this point in the history
* build: upgrade to v0.17.0

* refactor: user service find methods.

* refactor: episode service find methods.

* feat: add count episodes for subject id.

* feat: remove findMetaById in EpisodeService and add count endpoint in EpisodeEndpoint

* feat: add findEpisodesBySubjectId in EpisodeEndpoint

* feat: add GetSubjectSyncsBySubjectId in SubjectSyncPlatformEndpoint

* feat: add findTypeBySubjectId for collection endpoint.

* build: gen new api-client v0.17.0.1

* optimize: EpisodeEndpoint

* optimize: Subjects.vue

* build: gen new api-client v0.17.0.2

* optimize: subject count

* optimize: SubjectDetails.vue and EpisodeDetailsDialog.vue

* fix: countMatchingBySubjectId in DefaultEpisodeService

* optimize: Subjects.vue

* docs: update CHANGELOG.MD

* fix: unit test cases in SubjectEndpointTest

* fix: console格式问题

* feat: add post and put episode endpoint.

* build: gen new api-client v0.17.0.3

* optimize: episode.

* build: gen new api-client v0.17.0.4

* optimize: episode create and update to save.

* optimize: subject put page in console

* build: gen new api-client v0.17.0.5

* optimize: subject put page in console

* fix: subject details page

* style: run lint in console
  • Loading branch information
chivehao authored Oct 16, 2024
1 parent b2448e2 commit 5e22ba4
Show file tree
Hide file tree
Showing 51 changed files with 1,807 additions and 789 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

更新日志文档,版本顺序从新到旧,最新版本在最前(上)面。

# 0.17.0

## 优化

- 条目服务层重构优化接口性能

# 0.16.2

## 新特性
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import org.pf4j.ExtensionPoint;
import reactor.core.publisher.Flux;
import run.ikaros.api.core.subject.SubjectMeta;
import run.ikaros.api.core.subject.Subject;

public interface DelegateMetaService extends ExtensionPoint {
Flux<SubjectMeta> findAll(String keyword);
Flux<Subject> findAll(String keyword);
}
6 changes: 3 additions & 3 deletions api/src/main/java/run/ikaros/api/core/meta/MetaOperate.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import run.ikaros.api.core.subject.SubjectMeta;
import run.ikaros.api.core.subject.Subject;
import run.ikaros.api.plugin.AllowPluginOperate;

public interface MetaOperate extends AllowPluginOperate {
Mono<SubjectMeta> findOne(String keyword);
Mono<Subject> findOne(String keyword);

Flux<SubjectMeta> findAll(String keyword);
Flux<Subject> findAll(String keyword);
}
3 changes: 0 additions & 3 deletions api/src/main/java/run/ikaros/api/core/subject/Episode.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.LocalDateTime;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
Expand All @@ -28,8 +27,6 @@ public class Episode {
private Float sequence;
private EpisodeGroup group;

private List<EpisodeResource> resources;

/**
* Create a default episode instance.
*/
Expand Down
29 changes: 0 additions & 29 deletions api/src/main/java/run/ikaros/api/core/subject/EpisodeMeta.java

This file was deleted.

14 changes: 0 additions & 14 deletions api/src/main/java/run/ikaros/api/core/subject/Subject.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import java.time.LocalDateTime;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import run.ikaros.api.store.enums.CollectionType;
import run.ikaros.api.store.enums.SubjectType;

@Data
Expand All @@ -38,16 +36,4 @@ public class Subject {
private Boolean nsfw;
private LocalDateTime airTime;
private String cover;
private List<Episode> episodes;
@JsonProperty("total_episodes")
private Long totalEpisodes;
/**
* 已经绑定附件的剧集数量.
*/
@JsonProperty("matching_episode")
private Long matchingEpisodes;
@JsonProperty("collection_status")
private CollectionType collectionType;
private List<SubjectSync> syncs;
private boolean canRead;
}
50 changes: 0 additions & 50 deletions api/src/main/java/run/ikaros/api/core/subject/SubjectMeta.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public interface SubjectOperate extends AllowPluginOperate {

Mono<Subject> findById(Long id);

Flux<SubjectMeta> findAllByPageable(PagingWrap<Subject> pagingWrap);
Flux<Subject> findAllByPageable(PagingWrap<Subject> pagingWrap);

Mono<Subject> create(Subject subject);

Expand Down
2 changes: 1 addition & 1 deletion console/packages/api-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ npm publish
选择当前目录下的更改进行`git add .`

```bash
git commit -am "build: gen new api-client v0.15.7.1"
git commit -am "build: gen new api-client v0.17.0.5"
```

合成版(powershell),升级 package.json 版本,并启动服务端后,在 api-client 路径下:
Expand Down
2 changes: 1 addition & 1 deletion console/packages/api-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@runikaros/api-client",
"version": "0.15.7.1",
"version": "0.17.0.5",
"description": "Project ikaros console api-client package",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion console/packages/api-client/src/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ api/v1alpha1-attachment-api.ts
api/v1alpha1-attachment-reference-api.ts
api/v1alpha1-attachment-relation-api.ts
api/v1alpha1-authority-api.ts
api/v1alpha1-collection-api.ts
api/v1alpha1-collection-episode-api.ts
api/v1alpha1-collection-subject-api.ts
api/v1alpha1-episode-api.ts
Expand Down Expand Up @@ -41,7 +42,6 @@ models/batch-matching-subject-episodes-attachment.ts
models/config-map.ts
models/create-user-req-params.ts
models/episode-collection.ts
models/episode-meta.ts
models/episode-resource.ts
models/episode.ts
models/index.ts
Expand Down
1 change: 1 addition & 0 deletions console/packages/api-client/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export * from "./api/v1alpha1-attachment-api";
export * from "./api/v1alpha1-attachment-reference-api";
export * from "./api/v1alpha1-attachment-relation-api";
export * from "./api/v1alpha1-authority-api";
export * from "./api/v1alpha1-collection-api";
export * from "./api/v1alpha1-collection-episode-api";
export * from "./api/v1alpha1-collection-subject-api";
export * from "./api/v1alpha1-episode-api";
Expand Down
92 changes: 92 additions & 0 deletions console/packages/api-client/src/api/actuator-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,53 @@ export const ActuatorApiAxiosParamCreator = function (
options: localVarRequestOptions,
};
},
/**
*
* @summary Actuator web endpoint \'prometheus\'
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
prometheus: async (
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
const localVarPath = `/actuator/prometheus`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = {
method: "GET",
...baseOptions,
...options,
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

// authentication BasicAuth required
// http basic authentication required
setBasicAuthToObject(localVarRequestOptions, configuration);

// authentication BearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Actuator web endpoint \'scheduledtasks\'
Expand Down Expand Up @@ -1845,6 +1892,27 @@ export const ActuatorApiFp = function (configuration?: Configuration) {
configuration
);
},
/**
*
* @summary Actuator web endpoint \'prometheus\'
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async prometheus(
options?: AxiosRequestConfig
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.prometheus(
options
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
);
},
/**
*
* @summary Actuator web endpoint \'scheduledtasks\'
Expand Down Expand Up @@ -2202,6 +2270,17 @@ export const ActuatorApiFactory = function (
)
.then((request) => request(axios, basePath));
},
/**
*
* @summary Actuator web endpoint \'prometheus\'
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
prometheus(options?: AxiosRequestConfig): AxiosPromise<object> {
return localVarFp
.prometheus(options)
.then((request) => request(axios, basePath));
},
/**
*
* @summary Actuator web endpoint \'scheduledtasks\'
Expand Down Expand Up @@ -2697,6 +2776,19 @@ export class ActuatorApi extends BaseAPI {
.then((request) => request(this.axios, this.basePath));
}

/**
*
* @summary Actuator web endpoint \'prometheus\'
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ActuatorApi
*/
public prometheus(options?: AxiosRequestConfig) {
return ActuatorApiFp(this.configuration)
.prometheus(options)
.then((request) => request(this.axios, this.basePath));
}

/**
*
* @summary Actuator web endpoint \'scheduledtasks\'
Expand Down
Loading

0 comments on commit 5e22ba4

Please sign in to comment.