Commit 3d5a8a28 authored by brent's avatar brent

modify app.conf

parent 938dcc37
...@@ -28,9 +28,12 @@ imageTransferUrl = "https://tmp-file.aigic.ai/api/v1/down/put" ...@@ -28,9 +28,12 @@ imageTransferUrl = "https://tmp-file.aigic.ai/api/v1/down/put"
replicateToken = "r8_9OCCea50go2Qkh0f0jhu3DbNjyzuyt61VNVI6" replicateToken = "r8_9OCCea50go2Qkh0f0jhu3DbNjyzuyt61VNVI6"
replicateTimeout = 10 replicateTimeout = 10
bucketName = "ai-watermark" bucketName = "ai-watermark"
region = "us-west-2"
awsAccessKeyID = "AKIAYS2NSY7MVGYC2W7M"
awsSecretAccessKey = "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"
[prod] [prod]
whoisApi = "aonet" whoisApi = "replicate"
apikey = "Rbhpcp0FKNrYNA1nZkrwrIbD0YSSRlVG" apikey = "Rbhpcp0FKNrYNA1nZkrwrIbD0YSSRlVG"
taskUrl = "https://api.aonet.ai/api/v1" taskUrl = "https://api.aonet.ai/api/v1"
imageUrl = "https://tmp-file.aigic.ai/api/v1/upload/persistence" imageUrl = "https://tmp-file.aigic.ai/api/v1/upload/persistence"
...@@ -38,6 +41,9 @@ imageTransferUrl = "https://tmp-file.aigic.ai/api/v1/down/put" ...@@ -38,6 +41,9 @@ imageTransferUrl = "https://tmp-file.aigic.ai/api/v1/down/put"
replicateToken = "r8_9OCCea50go2Qkh0f0jhu3DbNjyzuyt61VNVI6" replicateToken = "r8_9OCCea50go2Qkh0f0jhu3DbNjyzuyt61VNVI6"
replicateTimeout = 10 replicateTimeout = 10
bucketName = "ai-watermark" bucketName = "ai-watermark"
region = "us-west-2"
awsAccessKeyID = "AKIAYS2NSY7MVGYC2W7M"
awsSecretAccessKey = "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"
......
...@@ -27,6 +27,7 @@ import ( ...@@ -27,6 +27,7 @@ import (
"os" "os"
"path" "path"
"reflect" "reflect"
"strconv"
"strings" "strings"
"time" "time"
) )
...@@ -298,7 +299,9 @@ func uploadToS3(bucket, key string, img image.Image, format string) (string, err ...@@ -298,7 +299,9 @@ func uploadToS3(bucket, key string, img image.Image, format string) (string, err
filePath := "watermark" filePath := "watermark"
key = filePath + "/" + key timestamp := time.Now().Unix()
timestampStr := strconv.FormatInt(timestamp, 10)
key = filePath + "/" + timestampStr + "_" + key
_, err = client.PutObject(context.TODO(), &s3.PutObjectInput{ _, err = client.PutObject(context.TODO(), &s3.PutObjectInput{
Bucket: aws.String(bucket), Bucket: aws.String(bucket),
......
{"/Users/brent/Documents/wubanWork/aon_app_server/controllers":1721643676253627085} {"/Users/brent/Documents/wubanWork/aon_app_server/controllers":1721645388613888313}
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment