Skip to content

Commit

Permalink
feat: 剧集序号支持小数 (#645)
Browse files Browse the repository at this point in the history
* optimize: 剧集序号修改为浮点数

* build: gen new api-client v0.15.2+1

* optimize: console剧集编辑和新增弹框适应小数序号

* docs: update CHANGELOG.MD
  • Loading branch information
ChiveHao authored Aug 9, 2024
1 parent d05765e commit 9a5a625
Show file tree
Hide file tree
Showing 14 changed files with 100 additions and 187 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## 新特性

- 字幕匹配事件监听,支持ssa类型的后缀名
- 剧集序号支持小数

# 0.15.1

Expand Down
4 changes: 2 additions & 2 deletions api/src/main/java/run/ikaros/api/core/subject/Episode.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class Episode {
private String description;
@JsonProperty("air_time")
private LocalDateTime airTime;
private Integer sequence;
private Float sequence;
private EpisodeGroup group;

private List<EpisodeResource> resources;
Expand All @@ -36,7 +36,7 @@ public class Episode {
public static Episode defaultEpisode(Long subjectId) {
Episode episode = new Episode();
episode.setAirTime(LocalDateTime.now());
episode.setSequence(1);
episode.setSequence(1F);
episode.setGroup(EpisodeGroup.MAIN);
episode.setDescription("Default episode description");
episode.setName("Default episode name");
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.14.3+2"
git commit -am "build: gen new api-client v0.15.2+1"
```

合成版(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.14.3+2",
"version": "0.15.2+1",
"description": "Project ikaros console api-client package",
"type": "module",
"scripts": {
Expand Down
26 changes: 13 additions & 13 deletions console/packages/api-client/src/api/v1alpha1-indices-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ export const V1alpha1IndicesApiAxiosParamCreator = function (
* Search subjects with fuzzy query
* @param {string} keyword
* @param {number} [limit]
* @param {string} [highlightPreTag]
* @param {string} [highlightPostTag]
* @param {string} [highlightPreTag]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
searchSubject: async (
keyword: string,
limit?: number,
highlightPreTag?: string,
highlightPostTag?: string,
highlightPreTag?: string,
options: AxiosRequestConfig = {}
): Promise<RequestArgs> => {
// verify required parameter 'keyword' is not null or undefined
Expand Down Expand Up @@ -139,6 +139,10 @@ export const V1alpha1IndicesApiAxiosParamCreator = function (
localVarQueryParameter["limit"] = limit;
}

if (highlightPostTag !== undefined) {
localVarQueryParameter["highlightPostTag"] = highlightPostTag;
}

if (keyword !== undefined) {
localVarQueryParameter["keyword"] = keyword;
}
Expand All @@ -147,10 +151,6 @@ export const V1alpha1IndicesApiAxiosParamCreator = function (
localVarQueryParameter["highlightPreTag"] = highlightPreTag;
}

if (highlightPostTag !== undefined) {
localVarQueryParameter["highlightPostTag"] = highlightPostTag;
}

setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
Expand Down Expand Up @@ -199,25 +199,25 @@ export const V1alpha1IndicesApiFp = function (configuration?: Configuration) {
* Search subjects with fuzzy query
* @param {string} keyword
* @param {number} [limit]
* @param {string} [highlightPreTag]
* @param {string} [highlightPostTag]
* @param {string} [highlightPreTag]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async searchSubject(
keyword: string,
limit?: number,
highlightPreTag?: string,
highlightPostTag?: string,
highlightPreTag?: string,
options?: AxiosRequestConfig
): Promise<
(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SubjectHints>
> {
const localVarAxiosArgs = await localVarAxiosParamCreator.searchSubject(
keyword,
limit,
highlightPreTag,
highlightPostTag,
highlightPreTag,
options
);
return createRequestFunction(
Expand Down Expand Up @@ -265,8 +265,8 @@ export const V1alpha1IndicesApiFactory = function (
.searchSubject(
requestParameters.keyword,
requestParameters.limit,
requestParameters.highlightPreTag,
requestParameters.highlightPostTag,
requestParameters.highlightPreTag,
options
)
.then((request) => request(axios, basePath));
Expand Down Expand Up @@ -299,14 +299,14 @@ export interface V1alpha1IndicesApiSearchSubjectRequest {
* @type {string}
* @memberof V1alpha1IndicesApiSearchSubject
*/
readonly highlightPreTag?: string;
readonly highlightPostTag?: string;

/**
*
* @type {string}
* @memberof V1alpha1IndicesApiSearchSubject
*/
readonly highlightPostTag?: string;
readonly highlightPreTag?: string;
}

/**
Expand Down Expand Up @@ -343,8 +343,8 @@ export class V1alpha1IndicesApi extends BaseAPI {
.searchSubject(
requestParameters.keyword,
requestParameters.limit,
requestParameters.highlightPreTag,
requestParameters.highlightPostTag,
requestParameters.highlightPreTag,
options
)
.then((request) => request(this.axios, this.basePath));
Expand Down
119 changes: 36 additions & 83 deletions console/src/modules/content/subject/EpisodePostDialog.vue
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
<script setup lang="ts">
import { Episode } from '@runikaros/api-client';
import { ElMessage, FormInstance, FormRules } from 'element-plus';
import { computed, reactive, ref } from 'vue';
import {Episode} from '@runikaros/api-client';
import {
ElDialog,
ElForm,
ElFormItem,
ElDatePicker,
ElButton,
ElInput,
ElSelect,
ElOption,
ElButton,
ElDatePicker,
ElDialog,
ElForm,
ElFormItem,
ElInput,
ElMessage,
ElOption,
ElSelect,
FormInstance,
FormRules
} from 'element-plus';
import {
episodeGroups,
episodeGroupLabelMap,
} from '@/modules/common/constants';
import { useI18n } from 'vue-i18n';
import {computed, reactive, ref} from 'vue';
import {episodeGroupLabelMap, episodeGroups,} from '@/modules/common/constants';
import {useI18n} from 'vue-i18n';
const { t } = useI18n();
Expand Down Expand Up @@ -84,7 +83,7 @@ const episodeRuleFormRules = reactive<FormRules>({
trigger: 'blur',
},
{
type: 'number',
type: 'number',
message: t(
'module.subject.episode.post.message.episode.form-rule.sequence.type'
),
Expand Down Expand Up @@ -125,81 +124,35 @@ const episodeElFormRef = ref<FormInstance>();
</script>

<template>
<el-dialog
v-model="dialogVisible"
:title="t('module.subject.episode.post.title')"
@close="onClose"
>
<el-form
ref="episodeElFormRef"
:rules="episodeRuleFormRules"
:model="episode"
>
<el-form-item
:label="t('module.subject.episode.post.label.air_time')"
prop="air_time"
:label-width="formLabelWidth"
>
<el-date-picker
v-model="episode.air_time"
type="date"
:placeholder="
t('module.subject.episode.post.date-picker.placeholder')
"
/>
<el-dialog v-model="dialogVisible" :title="t('module.subject.episode.post.title')" @close="onClose">
<el-form ref="episodeElFormRef" :rules="episodeRuleFormRules" :model="episode">
<el-form-item :label="t('module.subject.episode.post.label.air_time')" prop="air_time"
:label-width="formLabelWidth">
<el-date-picker v-model="episode.air_time" type="date" :placeholder="t('module.subject.episode.post.date-picker.placeholder')
"/>
</el-form-item>
<el-form-item
:label="t('module.subject.episode.post.label.group')"
prop="group"
:label-width="formLabelWidth"
width="110px"
show-overflow-tooltip
>
<el-select
v-model="episode.group"
clearable
:placeholder="t('module.subject.episode.post.select.placeholder')"
>
<el-option
v-for="item in episodeGroups"
:key="item"
:label="episodeGroupLabelMap.get(item)"
:value="item"
/>
<el-form-item :label="t('module.subject.episode.post.label.group')" prop="group"
:label-width="formLabelWidth" width="110px" show-overflow-tooltip>
<el-select v-model="episode.group" clearable
:placeholder="t('module.subject.episode.post.select.placeholder')">
<el-option v-for="item in episodeGroups" :key="item" :label="episodeGroupLabelMap.get(item)"
:value="item"/>
</el-select>
</el-form-item>
<el-form-item
:label="t('module.subject.episode.post.label.name')"
:label-width="formLabelWidth"
prop="name"
>
<el-form-item :label="t('module.subject.episode.post.label.name')" :label-width="formLabelWidth"
prop="name">
<el-input v-model="episode.name" />
</el-form-item>
<el-form-item
:label="t('module.subject.episode.post.label.name_cn')"
:label-width="formLabelWidth"
>
<el-form-item :label="t('module.subject.episode.post.label.name_cn')" :label-width="formLabelWidth">
<el-input v-model="episode.name_cn" />
</el-form-item>
<el-form-item
:label="t('module.subject.episode.post.label.sequence')"
prop="sequence"
:label-width="formLabelWidth"
>
<el-form-item :label="t('module.subject.episode.post.label.sequence')" prop="sequence"
:label-width="formLabelWidth">
<el-input v-model.number="episode.sequence" type="text" />
</el-form-item>
<el-form-item
:label="t('module.subject.episode.post.label.description')"
:label-width="formLabelWidth"
>
<el-input
v-model="episode.description"
:autosize="{ minRows: 3 }"
maxlength="10000"
rows="3"
show-word-limit
type="textarea"
/>
<el-form-item :label="t('module.subject.episode.post.label.description')" :label-width="formLabelWidth">
<el-input v-model="episode.description" :autosize="{ minRows: 3 }" maxlength="10000" rows="3"
show-word-limit type="textarea"/>
</el-form-item>
</el-form>
<template #footer>
Expand Down
Loading

0 comments on commit 9a5a625

Please sign in to comment.