Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump version to v7.9.0 #214

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
## CHANGE LOG

## v7.9.0 (2024-10-21)

- 支持工作流模版

## v7.8.0 (2024-08-27)

- 支持闲时任务和 prefop 接口
Expand Down
1 change: 1 addition & 0 deletions examples/fop_video_avthumb.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ int main(int argc, char **argv) {
printf("Desc: %s\n", prefopRet.desc);
printf("InputBucket: %s\n", prefopRet.inputBucket);
printf("InputKey: %s\n", prefopRet.inputKey);
printf("TaskFrom: %s\n", prefopRet.taskFrom);
printf("Type: %d\n", prefopRet.type);
printf("CreationDate: %d-%d-%d %d:%d:%d +%d\n", prefopRet.creationDate.date.year, prefopRet.creationDate.date.month,
prefopRet.creationDate.date.day, prefopRet.creationDate.time.hour,
Expand Down
35 changes: 24 additions & 11 deletions qiniu/fop.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,20 @@ Qiniu_Error Qiniu_FOP_Pfop_v2(Qiniu_Client *self, Qiniu_FOP_PfopRet *ret, Qiniu_
char *typeStr = NULL;
char *url = NULL;
char *body = NULL;
Qiniu_Bool escapeBucketOk;
Qiniu_Bool escapeKeyOk;
Qiniu_Bool escapeFopsOk;
Qiniu_Bool escapePipelineOk;
Qiniu_Bool escapeNotifyURLOk;
Qiniu_Bool escapeBucketOk = Qiniu_False;
Qiniu_Bool escapeKeyOk = Qiniu_False;
Qiniu_Bool escapeFopsOk = Qiniu_False;
Qiniu_Bool escapePipelineOk = Qiniu_False;
Qiniu_Bool escapeNotifyURLOk = Qiniu_False;

// Add encoded bucket
encodedBucket = Qiniu_QueryEscape(params->bucket, &escapeBucketOk);
encodedKey = Qiniu_QueryEscape(params->key, &escapeKeyOk);
fopsStr = Qiniu_String_Join(";", params->fops, params->fopCount);
encodedFops = Qiniu_QueryEscape(fopsStr, &escapeFopsOk);
Qiniu_Free(fopsStr);
if (params->fopCount > 0 || params->fops){
fopsStr = Qiniu_String_Join(";", params->fops, params->fopCount);
encodedFops = Qiniu_QueryEscape(fopsStr, &escapeFopsOk);
Qiniu_Free(fopsStr);
}

if (params->pipeline)
{
Expand Down Expand Up @@ -84,9 +86,19 @@ Qiniu_Error Qiniu_FOP_Pfop_v2(Qiniu_Client *self, Qiniu_FOP_PfopRet *ret, Qiniu_
typeStr = "0";
}

body = Qiniu_String_Concat("bucket=", encodedBucket, "&key=", encodedKey, "&fops=", encodedFops,
"&pipeline=", encodedPipeline, "&notifyURL=", encodedNotifyURL, "&force=", forceStr,
"&type=", typeStr, NULL);
if (escapeFopsOk)
{
body = Qiniu_String_Concat("bucket=", encodedBucket, "&key=", encodedKey, "&fops=", encodedFops,
"&pipeline=", encodedPipeline, "&notifyURL=", encodedNotifyURL, "&force=", forceStr,
"&type=", typeStr, NULL);
}
else
{
body = Qiniu_String_Concat("bucket=", encodedBucket, "&key=", encodedKey, "&workflowTemplateID=", params->workflowTemplateID,
"&pipeline=", encodedPipeline, "&notifyURL=", encodedNotifyURL, "&force=", forceStr,
"&type=", typeStr, NULL);
}

if (escapeBucketOk)
{
Qiniu_Free(encodedBucket);
Expand Down Expand Up @@ -195,6 +207,7 @@ Qiniu_Error Qiniu_FOP_Prefop(Qiniu_Client *self, Qiniu_FOP_PrefopRet *ret, Qiniu
ret->desc = Qiniu_Json_GetString(root, "desc", NULL);
ret->inputBucket = Qiniu_Json_GetString(root, "inputBucket", NULL);
ret->inputKey = Qiniu_Json_GetString(root, "inputBucket", NULL);
ret->taskFrom = Qiniu_Json_GetString(root, "taskFrom", NULL);
ret->type = Qiniu_Json_GetInt(root, "type", 0);
creationDateStr = (char *)Qiniu_Json_GetString(root, "creationDate", NULL);
if (creationDateStr != NULL)
Expand Down
2 changes: 2 additions & 0 deletions qiniu/fop.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ typedef struct _Qiniu_FOP_PfopParams
const char *key;
const char *pipeline;
const char *notifyURL;
const char *workflowTemplateID;
char **fops;
int fopCount;
int force;
Expand All @@ -57,6 +58,7 @@ typedef struct _Qiniu_FOP_PrefopRet
const char *desc;
const char *inputBucket;
const char *inputKey;
const char *taskFrom;
int code;
int type;
Qiniu_DateTime creationDate;
Expand Down
4 changes: 4 additions & 0 deletions qiniu/rs.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ char *Qiniu_RS_PutPolicy_Token(Qiniu_RS_PutPolicy *auth, Qiniu_Mac *mac)
{
cJSON_AddStringToObject(root, "persistentPipeline", auth->persistentPipeline);
}
if (auth->persistentWorkflowTemplateID)
{
cJSON_AddStringToObject(root, "persistentWorkflowTemplateID", auth->persistentWorkflowTemplateID);
}
if (auth->mimeLimit)
{
cJSON_AddStringToObject(root, "mimeLimit", auth->mimeLimit);
Expand Down
1 change: 1 addition & 0 deletions qiniu/rs.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ typedef struct _Qiniu_RS_PutPolicy {
const char *persistentOps;
const char *persistentNotifyUrl;
const char *persistentPipeline;
const char *persistentWorkflowTemplateID;
const char *mimeLimit;
Qiniu_Uint64 fsizeLimit;
Qiniu_Uint64 fsizeMin;
Expand Down
Loading