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

feat: add tag entity and init sql and repo and service #507

Merged
merged 7 commits into from
Nov 11, 2023
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
20 changes: 20 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@

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

# 0.11.6

## 新特性

- 标签功能 #429
- [X] 服务端接口
- [X] 控制台条目详情页

## 优化

- 条目详情页,给番组集合平台加上对应的条目详情URL前缀
- [WIP] 列表接口排序优化#506
- [WIP] 条目收藏形式优化,一次性提交收藏类型和标签

## 插件

### 番组计划

- [WIP] 拉取条目时,转换对应的标签

# 0.11.5

## 优化
Expand Down
22 changes: 22 additions & 0 deletions api/src/main/java/run/ikaros/api/core/tag/SubjectTag.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package run.ikaros.api.core.tag;

import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;


@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class SubjectTag {
private Long id;
private Long subjectId;
private String name;
private Long userId;
private LocalDateTime createTime;
}
23 changes: 23 additions & 0 deletions api/src/main/java/run/ikaros/api/core/tag/Tag.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package run.ikaros.api.core.tag;

import java.time.LocalDateTime;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import run.ikaros.api.store.enums.TagType;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
public class Tag {
private Long id;
private TagType type;
private Long masterId;
private String name;
private Long userId;
private LocalDateTime createTime;
}
6 changes: 6 additions & 0 deletions api/src/main/java/run/ikaros/api/store/enums/TagType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package run.ikaros.api.store.enums;

public enum TagType {
SUBJECT,
EPISODE
}
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.10.11"
git commit -am "build: gen new api-client v0.11.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.10.11",
"version": "0.11.5",
"description": "Project ikaros console api-client package",
"type": "module",
"scripts": {
Expand Down
4 changes: 4 additions & 0 deletions console/packages/api-client/src/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ api/v1alpha1-subject-api.ts
api/v1alpha1-subject-collection-api.ts
api/v1alpha1-subject-relation-api.ts
api/v1alpha1-subject-sync-platform-api.ts
api/v1alpha1-tag-api.ts
api/v1alpha1-task-api.ts
api/v1alpha1-user-api.ts
base.ts
Expand Down Expand Up @@ -42,8 +43,11 @@ models/subject-hint.ts
models/subject-hints.ts
models/subject-relation.ts
models/subject-sync.ts
models/subject-tag.ts
models/subject.ts
models/tag.ts
models/task-entity.ts
models/update-user-request.ts
models/user-entity.ts
models/user.ts
models/video-subtitle.ts
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 @@ -25,5 +25,6 @@ export * from './api/v1alpha1-subject-api';
export * from './api/v1alpha1-subject-collection-api';
export * from './api/v1alpha1-subject-relation-api';
export * from './api/v1alpha1-subject-sync-platform-api';
export * from './api/v1alpha1-tag-api';
export * from './api/v1alpha1-task-api';
export * from './api/v1alpha1-user-api';
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import {
} from '../base';
// @ts-ignore
import { AttachmentRelation } from '../models';
// @ts-ignore
import { VideoSubtitle } from '../models';
/**
* V1alpha1AttachmentRelationApi - axios parameter creator
* @export
Expand Down Expand Up @@ -112,6 +114,64 @@ export const V1alpha1AttachmentRelationApiAxiosParamCreator = function (
...options.headers,
};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @param {number} attachmentId Attachment ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
findAttachmentVideoSubtitles: async (
attachmentId: number,
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
// verify required parameter 'attachmentId' is not null or undefined
assertParamExists(
'findAttachmentVideoSubtitles',
'attachmentId',
attachmentId
);
const localVarPath =
`/api/v1alpha1/attachment/relation/videoSubtitle/subtitles/{attachmentId}`.replace(
`{${'attachmentId'}}`,
encodeURIComponent(String(attachmentId))
);
// 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,
Expand Down Expand Up @@ -160,6 +220,33 @@ export const V1alpha1AttachmentRelationApiFp = function (
configuration
);
},
/**
*
* @param {number} attachmentId Attachment ID
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async findAttachmentVideoSubtitles(
attachmentId: number,
options?: AxiosRequestConfig
): Promise<
(
axios?: AxiosInstance,
basePath?: string
) => AxiosPromise<Array<VideoSubtitle>>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.findAttachmentVideoSubtitles(
attachmentId,
options
);
return createRequestFunction(
localVarAxiosArgs,
globalAxios,
BASE_PATH,
configuration
);
},
};
};

Expand Down Expand Up @@ -192,6 +279,20 @@ export const V1alpha1AttachmentRelationApiFactory = function (
)
.then((request) => request(axios, basePath));
},
/**
*
* @param {V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitlesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
findAttachmentVideoSubtitles(
requestParameters: V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitlesRequest,
options?: AxiosRequestConfig
): AxiosPromise<Array<VideoSubtitle>> {
return localVarFp
.findAttachmentVideoSubtitles(requestParameters.attachmentId, options)
.then((request) => request(axios, basePath));
},
};
};

Expand All @@ -216,6 +317,20 @@ export interface V1alpha1AttachmentRelationApiFindAttachmentRelationsRequest {
readonly relationType: 'VIDEO_SUBTITLE';
}

/**
* Request parameters for findAttachmentVideoSubtitles operation in V1alpha1AttachmentRelationApi.
* @export
* @interface V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitlesRequest
*/
export interface V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitlesRequest {
/**
* Attachment ID
* @type {number}
* @memberof V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitles
*/
readonly attachmentId: number;
}

/**
* V1alpha1AttachmentRelationApi - object-oriented interface
* @export
Expand All @@ -242,4 +357,20 @@ export class V1alpha1AttachmentRelationApi extends BaseAPI {
)
.then((request) => request(this.axios, this.basePath));
}

/**
*
* @param {V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitlesRequest} requestParameters Request parameters.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof V1alpha1AttachmentRelationApi
*/
public findAttachmentVideoSubtitles(
requestParameters: V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitlesRequest,
options?: AxiosRequestConfig
) {
return V1alpha1AttachmentRelationApiFp(this.configuration)
.findAttachmentVideoSubtitles(requestParameters.attachmentId, options)
.then((request) => request(this.axios, this.basePath));
}
}
Loading
Loading