feat: Add Jimeng image generation service and related functionality

- Implemented JimengService for image generation with API integration.
- Created OSSService for handling image uploads to S3.
- Developed PBService for managing PocketBase interactions.
- Added task management for image creation and downloading using BullMQ.
- Introduced routes for creating image generation tasks.
- Implemented logging and error handling for image processing.
- Added configuration management for Redis and other services.
- Created scripts for testing image generation and PocketBase integration.
- Updated package dependencies and added new scripts for worker management.
This commit is contained in:
2026-01-09 02:55:04 +08:00
parent 7cca41b457
commit 9da3d14752
31 changed files with 3193 additions and 5 deletions

View File

@@ -0,0 +1,15 @@
import { jimengService, ossService } from '../src/index.ts'
const url = 'https://p3-dreamina-sign.byteimg.com/tos-cn-i-tb4s082cfz/4947076125c64a999e4c392de03048f8~tplv-tb4s082cfz-aigc_resize:360:360.webp?lk3s=43402efa&x-expires=1770336000&x-signature=Fjeeb3qloxxzxmHJpmqu6v8fwrM%3D&format=.webp'
const uploadImage = async () => {
const response = await jimengService.downloadImage(url);
const filename = `uploaded_image_${Date.now()}.png`;
await ossService.putObject(filename, response);
const ossUrl = ossService.getLink(filename);
// console.log('Uploaded Image URL:', response)
// const uploadJons = await ossService.putObject('a1.json', { b: '123' })
// console.log('Upload JSON Result:', uploadJons)
return ossUrl;
}
uploadImage();