Files
2026-01-09 11:21:29 +08:00

27 lines
860 B
JavaScript

const { getLogger, imageUtil, qiniuUtil } = require("../../util");
const logger = getLogger("image");
const path = require("path");
const Merge = async (call, callback) => {
const { name } = call.request;
logger.info({ name }, "参数");
const buffer = await imageUtil.mergeImage(name);
console.log(11111, buffer);
// const file = await qiniuUtil.uploadFileByBuffer(buffer)
callback(null, { path: "success" });
};
const CreateAvatarOrnament = async (call, callback) => {
const { avatarPath, ornamentPath } = call.request;
logger.info({ avatarPath, ornamentPath }, "参数");
const buffer = await imageUtil.avatarOrnament(avatarPath, ornamentPath);
// console.log(11111, buffer);
// const file = await qiniuUtil.uploadFileByBuffer(buffer)
callback(null, { path: "success" });
};
module.exports = {
Merge,
CreateAvatarOrnament,
};