Skip to content

Commit 4d77b25

Browse files
authored
feat: add tag entity and init sql and repo and service (#507)
* build: upgrade to v0.11.6 and update changelog * feat: add tag entity and init sql and repo and service * feat: impl tag service and add tag endpoints. * optimize: subject details sync bgmtv link. * build: gen new api-client v0.11.5 * fix: create tag fail for no user id. * feat: subject tag add and remove in SubjectDetails.vue for console.
1 parent bd76a7b commit 4d77b25

File tree

25 files changed

+1626
-33
lines changed

25 files changed

+1626
-33
lines changed

CHANGELOG.MD

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,26 @@
22

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

5+
# 0.11.6
6+
7+
## 新特性
8+
9+
- 标签功能 #429
10+
- [X] 服务端接口
11+
- [X] 控制台条目详情页
12+
13+
## 优化
14+
15+
- 条目详情页,给番组集合平台加上对应的条目详情URL前缀
16+
- [WIP] 列表接口排序优化#506
17+
- [WIP] 条目收藏形式优化,一次性提交收藏类型和标签
18+
19+
## 插件
20+
21+
### 番组计划
22+
23+
- [WIP] 拉取条目时,转换对应的标签
24+
525
# 0.11.5
626

727
## 优化
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package run.ikaros.api.core.tag;
2+
3+
import java.time.LocalDateTime;
4+
import lombok.AllArgsConstructor;
5+
import lombok.Builder;
6+
import lombok.Data;
7+
import lombok.NoArgsConstructor;
8+
import lombok.experimental.Accessors;
9+
10+
11+
@Data
12+
@Builder
13+
@NoArgsConstructor
14+
@AllArgsConstructor
15+
@Accessors(chain = true)
16+
public class SubjectTag {
17+
private Long id;
18+
private Long subjectId;
19+
private String name;
20+
private Long userId;
21+
private LocalDateTime createTime;
22+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package run.ikaros.api.core.tag;
2+
3+
import java.time.LocalDateTime;
4+
import lombok.AllArgsConstructor;
5+
import lombok.Builder;
6+
import lombok.Data;
7+
import lombok.NoArgsConstructor;
8+
import lombok.experimental.Accessors;
9+
import run.ikaros.api.store.enums.TagType;
10+
11+
@Data
12+
@Builder
13+
@NoArgsConstructor
14+
@AllArgsConstructor
15+
@Accessors(chain = true)
16+
public class Tag {
17+
private Long id;
18+
private TagType type;
19+
private Long masterId;
20+
private String name;
21+
private Long userId;
22+
private LocalDateTime createTime;
23+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
package run.ikaros.api.store.enums;
2+
3+
public enum TagType {
4+
SUBJECT,
5+
EPISODE
6+
}

console/packages/api-client/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ npm publish
5858
选择当前目录下的更改进行`git add .`
5959

6060
```bash
61-
git commit -am "build: gen new api-client v0.10.11"
61+
git commit -am "build: gen new api-client v0.11.5"
6262
```
6363

6464
合成版(powershell),升级 package.json 版本,并启动服务端后,在 api-client 路径下:

console/packages/api-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@runikaros/api-client",
3-
"version": "0.10.11",
3+
"version": "0.11.5",
44
"description": "Project ikaros console api-client package",
55
"type": "module",
66
"scripts": {

console/packages/api-client/src/.openapi-generator/FILES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ api/v1alpha1-subject-api.ts
1414
api/v1alpha1-subject-collection-api.ts
1515
api/v1alpha1-subject-relation-api.ts
1616
api/v1alpha1-subject-sync-platform-api.ts
17+
api/v1alpha1-tag-api.ts
1718
api/v1alpha1-task-api.ts
1819
api/v1alpha1-user-api.ts
1920
base.ts
@@ -42,8 +43,11 @@ models/subject-hint.ts
4243
models/subject-hints.ts
4344
models/subject-relation.ts
4445
models/subject-sync.ts
46+
models/subject-tag.ts
4547
models/subject.ts
48+
models/tag.ts
4649
models/task-entity.ts
4750
models/update-user-request.ts
4851
models/user-entity.ts
4952
models/user.ts
53+
models/video-subtitle.ts

console/packages/api-client/src/api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@ export * from './api/v1alpha1-subject-api';
2525
export * from './api/v1alpha1-subject-collection-api';
2626
export * from './api/v1alpha1-subject-relation-api';
2727
export * from './api/v1alpha1-subject-sync-platform-api';
28+
export * from './api/v1alpha1-tag-api';
2829
export * from './api/v1alpha1-task-api';
2930
export * from './api/v1alpha1-user-api';

console/packages/api-client/src/api/v1alpha1-attachment-relation-api.ts

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ import {
3939
} from '../base';
4040
// @ts-ignore
4141
import { AttachmentRelation } from '../models';
42+
// @ts-ignore
43+
import { VideoSubtitle } from '../models';
4244
/**
4345
* V1alpha1AttachmentRelationApi - axios parameter creator
4446
* @export
@@ -112,6 +114,64 @@ export const V1alpha1AttachmentRelationApiAxiosParamCreator = function (
112114
...options.headers,
113115
};
114116

117+
return {
118+
url: toPathString(localVarUrlObj),
119+
options: localVarRequestOptions,
120+
};
121+
},
122+
/**
123+
*
124+
* @param {number} attachmentId Attachment ID
125+
* @param {*} [options] Override http request option.
126+
* @throws {RequiredError}
127+
*/
128+
findAttachmentVideoSubtitles: async (
129+
attachmentId: number,
130+
options: AxiosRequestConfig = {}
131+
): Promise<RequestArgs> => {
132+
// verify required parameter 'attachmentId' is not null or undefined
133+
assertParamExists(
134+
'findAttachmentVideoSubtitles',
135+
'attachmentId',
136+
attachmentId
137+
);
138+
const localVarPath =
139+
`/api/v1alpha1/attachment/relation/videoSubtitle/subtitles/{attachmentId}`.replace(
140+
`{${'attachmentId'}}`,
141+
encodeURIComponent(String(attachmentId))
142+
);
143+
// use dummy base URL string because the URL constructor only accepts absolute URLs.
144+
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
145+
let baseOptions;
146+
if (configuration) {
147+
baseOptions = configuration.baseOptions;
148+
}
149+
150+
const localVarRequestOptions = {
151+
method: 'GET',
152+
...baseOptions,
153+
...options,
154+
};
155+
const localVarHeaderParameter = {} as any;
156+
const localVarQueryParameter = {} as any;
157+
158+
// authentication BasicAuth required
159+
// http basic authentication required
160+
setBasicAuthToObject(localVarRequestOptions, configuration);
161+
162+
// authentication BearerAuth required
163+
// http bearer authentication required
164+
await setBearerAuthToObject(localVarHeaderParameter, configuration);
165+
166+
setSearchParams(localVarUrlObj, localVarQueryParameter);
167+
let headersFromBaseOptions =
168+
baseOptions && baseOptions.headers ? baseOptions.headers : {};
169+
localVarRequestOptions.headers = {
170+
...localVarHeaderParameter,
171+
...headersFromBaseOptions,
172+
...options.headers,
173+
};
174+
115175
return {
116176
url: toPathString(localVarUrlObj),
117177
options: localVarRequestOptions,
@@ -160,6 +220,33 @@ export const V1alpha1AttachmentRelationApiFp = function (
160220
configuration
161221
);
162222
},
223+
/**
224+
*
225+
* @param {number} attachmentId Attachment ID
226+
* @param {*} [options] Override http request option.
227+
* @throws {RequiredError}
228+
*/
229+
async findAttachmentVideoSubtitles(
230+
attachmentId: number,
231+
options?: AxiosRequestConfig
232+
): Promise<
233+
(
234+
axios?: AxiosInstance,
235+
basePath?: string
236+
) => AxiosPromise<Array<VideoSubtitle>>
237+
> {
238+
const localVarAxiosArgs =
239+
await localVarAxiosParamCreator.findAttachmentVideoSubtitles(
240+
attachmentId,
241+
options
242+
);
243+
return createRequestFunction(
244+
localVarAxiosArgs,
245+
globalAxios,
246+
BASE_PATH,
247+
configuration
248+
);
249+
},
163250
};
164251
};
165252

@@ -192,6 +279,20 @@ export const V1alpha1AttachmentRelationApiFactory = function (
192279
)
193280
.then((request) => request(axios, basePath));
194281
},
282+
/**
283+
*
284+
* @param {V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitlesRequest} requestParameters Request parameters.
285+
* @param {*} [options] Override http request option.
286+
* @throws {RequiredError}
287+
*/
288+
findAttachmentVideoSubtitles(
289+
requestParameters: V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitlesRequest,
290+
options?: AxiosRequestConfig
291+
): AxiosPromise<Array<VideoSubtitle>> {
292+
return localVarFp
293+
.findAttachmentVideoSubtitles(requestParameters.attachmentId, options)
294+
.then((request) => request(axios, basePath));
295+
},
195296
};
196297
};
197298

@@ -216,6 +317,20 @@ export interface V1alpha1AttachmentRelationApiFindAttachmentRelationsRequest {
216317
readonly relationType: 'VIDEO_SUBTITLE';
217318
}
218319

320+
/**
321+
* Request parameters for findAttachmentVideoSubtitles operation in V1alpha1AttachmentRelationApi.
322+
* @export
323+
* @interface V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitlesRequest
324+
*/
325+
export interface V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitlesRequest {
326+
/**
327+
* Attachment ID
328+
* @type {number}
329+
* @memberof V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitles
330+
*/
331+
readonly attachmentId: number;
332+
}
333+
219334
/**
220335
* V1alpha1AttachmentRelationApi - object-oriented interface
221336
* @export
@@ -242,4 +357,20 @@ export class V1alpha1AttachmentRelationApi extends BaseAPI {
242357
)
243358
.then((request) => request(this.axios, this.basePath));
244359
}
360+
361+
/**
362+
*
363+
* @param {V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitlesRequest} requestParameters Request parameters.
364+
* @param {*} [options] Override http request option.
365+
* @throws {RequiredError}
366+
* @memberof V1alpha1AttachmentRelationApi
367+
*/
368+
public findAttachmentVideoSubtitles(
369+
requestParameters: V1alpha1AttachmentRelationApiFindAttachmentVideoSubtitlesRequest,
370+
options?: AxiosRequestConfig
371+
) {
372+
return V1alpha1AttachmentRelationApiFp(this.configuration)
373+
.findAttachmentVideoSubtitles(requestParameters.attachmentId, options)
374+
.then((request) => request(this.axios, this.basePath));
375+
}
245376
}

0 commit comments

Comments
 (0)