Skip to content

Let's use AI to Earn!

feat: 小红书、抖音、微信视频号位置参数接入发布完成

gaoSirb0b372fa2aa5
diff --git a/electron/db/models/video.ts b/electron/db/models/video.ts
index 14d198ef..0fb208e7 100644
--- a/electron/db/models/video.ts
+++ b/electron/db/models/video.ts
@@ -12,6 +12,7 @@ import {
VisibleTypeEnum,
} from '../../../commont/publish/PublishEnum';
import { AccountType } from '../../../commont/AccountEnum';
+import type { ILocationDataItem } from '../../main/plat/plat.type';
// 包含一个name和一个value的对象
export interface ILableValue {
@@ -95,7 +96,7 @@ export class VideoModel extends WorkData {
// 位置
@Column({ type: 'json', nullable: true, comment: '位置' })
- location?: ILableValue;
+ location?: ILocationDataItem;
// 差异化参数
@Column({ type: 'json', nullable: true, comment: '不同平台的差异化参数' })
diff --git a/electron/main/plat/plat.type.ts b/electron/main/plat/plat.type.ts
index 8bf5471e..ca0e5671 100644
--- a/electron/main/plat/plat.type.ts
+++ b/electron/main/plat/plat.type.ts
@@ -7,7 +7,7 @@
*/
import { AccountModel } from '../../db/models/account';
import { VisibleTypeEnum } from '../../../commont/publish/PublishEnum';
-import { DiffParmasType, ILableValue } from '../../db/models/video';
+import { DiffParmasType } from '../../db/models/video';
export type CookiesType = Electron.Cookie[];
@@ -71,7 +71,7 @@ export interface IVideoPublishParams {
// 定时发布日期
timingTime?: Date;
// 地点
- location?: ILableValue;
+ location?: ILocationDataItem;
other?: any;
}
diff --git a/electron/main/plat/platforms/douyin/index.ts b/electron/main/plat/platforms/douyin/index.ts
index 201b9bc6..14711ffe 100644
--- a/electron/main/plat/platforms/douyin/index.ts
+++ b/electron/main/plat/platforms/douyin/index.ts
@@ -149,6 +149,7 @@ export class Douyin extends PlatformBase {
topics: params.topics,
cover: params.coverPath,
timingTime: params.timingTime?.getTime(),
+ // 可见性
visibility_type:
params.visibleType === VisibleTypeEnum.Public
? 0
@@ -159,8 +160,8 @@ export class Douyin extends PlatformBase {
...(params.location
? {
poiInfo: {
- poiId: `${params.location.value}`,
- poiName: params.location.label,
+ poiId: `${params.location.id}`,
+ poiName: params.location.name,
},
}
: {}),
diff --git a/electron/main/plat/platforms/wxSph/index.ts b/electron/main/plat/platforms/wxSph/index.ts
index aecfe745..60e2a148 100644
--- a/electron/main/plat/platforms/wxSph/index.ts
+++ b/electron/main/plat/platforms/wxSph/index.ts
@@ -138,6 +138,19 @@ export class WxSph extends PlatformBase {
topics: params.topics,
des: params.desc,
timingTime: params.timingTime?.getTime(),
+ // 位置
+ ...(params.location
+ ? {
+ poiInfo: {
+ latitude: params.location.latitude,
+ longitude: params.location.longitude,
+ poiCity: params.location.city,
+ poiName: params.location.name,
+ poiAddress: params.location.simpleAddress,
+ poiId: params.location.id,
+ },
+ }
+ : {}),
},
callback,
);
diff --git a/electron/main/plat/platforms/xhs/index.ts b/electron/main/plat/platforms/xhs/index.ts
index b6934e55..cfe1f6c5 100644
--- a/electron/main/plat/platforms/xhs/index.ts
+++ b/electron/main/plat/platforms/xhs/index.ts
@@ -155,6 +155,17 @@ export class Xhs extends PlatformBase {
params.diffParams?.[AccountType.Xhs]?.topicsDetail || [],
timingTime: params.timingTime?.getTime(),
privacy: params.visibleType !== VisibleTypeEnum.Public,
+ // 位置
+ ...(params.location
+ ? {
+ poiInfo: {
+ poiType: params.location.poi_type!,
+ poiId: params.location.id,
+ poiName: params.location.name,
+ poiAddress: params.location.simpleAddress,
+ },
+ }
+ : {}),
},
callback,
)
diff --git a/electron/plat/shipinhao/index.ts b/electron/plat/shipinhao/index.ts
index 0a6303b5..92f3f3ef 100644
--- a/electron/plat/shipinhao/index.ts
+++ b/electron/plat/shipinhao/index.ts
@@ -1231,8 +1231,8 @@ export class ShipinhaoService {
timingTime?: number;
// 位置信息
poiInfo?: {
- latitude: string;
- longitude: string;
+ latitude: number;
+ longitude: number;
poiCity: string;
poiName: string;
poiAddress: string;
diff --git a/src/views/publish/children/videoPage/components/VideoPubSetModal/components/LocationSelect.tsx b/src/views/publish/children/videoPage/components/VideoPubSetModal/components/LocationSelect.tsx
index efbacaa5..e41b4db4 100644
--- a/src/views/publish/children/videoPage/components/VideoPubSetModal/components/LocationSelect.tsx
+++ b/src/views/publish/children/videoPage/components/VideoPubSetModal/components/LocationSelect.tsx
@@ -49,6 +49,7 @@ export default function LocationSelect({
}
return [];
}
+ console.log(locationData);
return locationData.data!;
});
// 位置 0=经度 1=纬度
diff --git a/src/views/publish/children/videoPage/videoPage.d.ts b/src/views/publish/children/videoPage/videoPage.d.ts
index 42a93258..af0731aa 100644
--- a/src/views/publish/children/videoPage/videoPage.d.ts
+++ b/src/views/publish/children/videoPage/videoPage.d.ts
@@ -4,9 +4,9 @@ import { IImgFile } from '@/components/Choose/ImgChoose';
import { VisibleTypeEnum } from '@@/publish/PublishEnum';
import {
DiffParmasType,
- ILableValue,
TopicsArrType,
} from '../../../../../electron/db/models/video';
+import { ILocationDataItem } from '../../../../../electron/main/plat/plat.type';
export interface IPubParams {
// 视频标题
@@ -22,7 +22,7 @@ export interface IPubParams {
// 每个平台的差异性参数
diffParams?: DiffParmasType;
// 位置
- location?: ILableValue;
+ location?: ILocationDataItem;
// 定时发布日期
timingTime?: Date | null;
}