Skip to content

Let's use AI to Earn!

fix(channel): remove debug logs (#184)

Sakura2769a2273270
diff --git a/project/backend/apps/aitoearn-channel/src/core/publish/publishTask.controller.ts b/project/backend/apps/aitoearn-channel/src/core/publish/publishTask.controller.ts
index ba7e68eb..547e29bf 100644
--- a/project/backend/apps/aitoearn-channel/src/core/publish/publishTask.controller.ts
+++ b/project/backend/apps/aitoearn-channel/src/core/publish/publishTask.controller.ts
@@ -36,7 +36,7 @@ export class PublishTaskController {
// 更新任务时间
// @NatsMessagePattern('publish.task.changeTime')
- @Post('publish/task/changeTime')
+ @Post('plat/publish/changeTime')
async changeTaskTime(@Body() data: UpPublishTaskTimeDto) {
data.publishTime = new Date(data.publishTime)
const res = await this.publishTaskService.updatePublishTaskTime(
diff --git a/project/backend/apps/aitoearn-channel/src/libs/bilibili/bilibiliApi.service.ts b/project/backend/apps/aitoearn-channel/src/libs/bilibili/bilibiliApi.service.ts
index 0ae5e46a..3b140fb7 100644
--- a/project/backend/apps/aitoearn-channel/src/libs/bilibili/bilibiliApi.service.ts
+++ b/project/backend/apps/aitoearn-channel/src/libs/bilibili/bilibiliApi.service.ts
@@ -56,7 +56,7 @@ export class BilibiliApiService {
}
private async request<CommonResponse>(url: string, config: AxiosRequestConfig = {}): Promise<CommonResponse> {
- this.logger.debug(`Bilibili API Request: ${url} with config: ${JSON.stringify(config)}`)
+ this.logger.debug(`Bilibili API Request: ${url}`)
try {
const response: AxiosResponse<CommonResponse> = await axios(url, config)
if (response.data['code'] !== 0) {
diff --git a/project/backend/apps/aitoearn-channel/src/libs/threads/threads.service.ts b/project/backend/apps/aitoearn-channel/src/libs/threads/threads.service.ts
index 3ae50268..e132868e 100644
--- a/project/backend/apps/aitoearn-channel/src/libs/threads/threads.service.ts
+++ b/project/backend/apps/aitoearn-channel/src/libs/threads/threads.service.ts
@@ -30,7 +30,7 @@ export class ThreadsService {
config: AxiosRequestConfig = {},
): Promise<T> {
this.logger.debug(
- `Threads API Request: ${url} with config: ${JSON.stringify(config)}`,
+ `Threads API Request: ${url}`,
)
try {
const response: AxiosResponse<T> = await axios(url, config)
diff --git a/project/backend/apps/aitoearn-channel/src/libs/twitter/twitter.service.ts b/project/backend/apps/aitoearn-channel/src/libs/twitter/twitter.service.ts
index 0735595f..c4160019 100644
--- a/project/backend/apps/aitoearn-channel/src/libs/twitter/twitter.service.ts
+++ b/project/backend/apps/aitoearn-channel/src/libs/twitter/twitter.service.ts
@@ -50,7 +50,7 @@ export class TwitterService {
config: AxiosRequestConfig = {},
): Promise<T> {
this.logger.debug(
- `Twitter API Request: ${url} with config: ${JSON.stringify(config)}`,
+ `Twitter API Request: ${url}`,
)
try {
const response: AxiosResponse<T> = await axios(url, config)
diff --git a/project/backend/apps/aitoearn-server/src/channel/publish.service.ts b/project/backend/apps/aitoearn-server/src/channel/publish.service.ts
index a21b9abd..e246fc31 100644
--- a/project/backend/apps/aitoearn-server/src/channel/publish.service.ts
+++ b/project/backend/apps/aitoearn-server/src/channel/publish.service.ts
@@ -4,6 +4,7 @@ import { PublishRecord, PublishStatus } from '@yikart/mongodb'
import { PostData } from '@yikart/statistics-db'
import { PublishRecordService } from '../publishRecord/publishRecord.service'
import { PostService } from '../statistics/post/post.service'
+import { PlatPublishNatsApi } from '../transports/channel/api/publish.natsApi'
import { PublishTaskNatsApi } from '../transports/channel/api/publishTask.natsApi'
import { ChannelApi } from '../transports/channel/channel.api'
import { PublishingChannel } from '../transports/channel/common'
@@ -18,11 +19,12 @@ export class PublishService {
private readonly publishTaskNatsApi: PublishTaskNatsApi,
private readonly publishRecordService: PublishRecordService,
private readonly postService: PostService,
+ private readonly platPublishNatsApi: PlatPublishNatsApi,
private readonly channelApi: ChannelApi,
) { }
async create(newData: NewPublishData<PlatOptions>) {
- const res = await this.publishRecordService.createPublishRecord(newData)
+ const res = await this.platPublishNatsApi.create(newData)
return res
}
@@ -31,6 +33,11 @@ export class PublishService {
return res
}
+ async run(id: string) {
+ const res = await this.platPublishNatsApi.run(id)
+ return res
+ }
+
async getList(data: PubRecordListFilterDto, userId: string) {
const list1 = await this.publishRecordService.getPublishRecordList({
...data,
diff --git a/project/backend/libs/mongodb/src/repositories/media.repository.ts b/project/backend/libs/mongodb/src/repositories/media.repository.ts
index a4bcf7e2..93ae8b47 100644
--- a/project/backend/libs/mongodb/src/repositories/media.repository.ts
+++ b/project/backend/libs/mongodb/src/repositories/media.repository.ts
@@ -68,7 +68,7 @@ export class MediaRepository extends BaseRepository<Media> {
// 获取列表
async getList(inFilter: {
- userId: string
+ userId?: string
groupId?: string
type?: MediaType
userType?: UserType
@@ -80,9 +80,9 @@ export class MediaRepository extends BaseRepository<Media> {
const { pageNo, pageSize } = pageInfo
const filter: RootFilterQuery<Media> = {
- userId: inFilter.userId,
+ ...(inFilter.userId && { userId: inFilter.userId }),
...(inFilter.groupId && { groupId: inFilter.groupId }),
- userType: inFilter.userType || UserType.User,
+ ...(inFilter.userType && { userType: inFilter.userType }),
...(inFilter.type && { type: inFilter.type }),
...(inFilter.useCount !== undefined && { useCount: { $gte: inFilter.useCount } }),
}