生命周期的指令上传

This commit is contained in:
eson
2023-07-07 14:49:02 +08:00
parent 70fd711fa5
commit 975fe89eca
6 changed files with 146 additions and 18 deletions

View File

@@ -52,10 +52,21 @@ func FormatS3KeyNameUser(userid int64, now time.Time, env string, category TypeC
switch category {
case TCategoryPersonalization:
// TODO:
// /{env}/personalization/{userid}/{filename}
return fmt.Sprintf("/%s/%s/%d/%s.%s", env, category, userid, name, ext)
case TCategoryRenderMegre:
// /{env}/render_megre/{userid}/{filename} 自动删除
return fmt.Sprintf("/%s/%s/%d/%s_%d.%s", env, category, userid, name, now.Unix(), ext)
case TCategory3DTools:
// /{env}/3dtools/年月/{userid}/{filename}
return fmt.Sprintf("/%s/%s/%04d%02d/%d/%s_%d.%s", env, category, year, int(month), userid, name, now.Unix(), ext)
case TCategoryQuotation:
// /{env}/quotation/年月/{userid}/{filename}
return fmt.Sprintf("/%s/%s/%04d%02d/%d/%s_%d.%s", env, category, year, int(month), userid, name, now.Unix(), ext)
default:
return fmt.Sprintf("/%s/%s/%d/%04d%02d/%s_%d.%s", env, category, userid, year, int(month), name, now.Unix(), ext)
}
return fmt.Sprintf("/%s/%s/%d/%04d%02d/%s_%d.%s", env, category, userid, year, int(month), name, now.Unix(), ext)
}
// FormatS3KeyNameGuest 游客的格式化存储
@@ -69,5 +80,24 @@ func FormatS3KeyNameGuest(guestid int64, now time.Time, env string, category Typ
name = names[0]
ext = names[1]
}
return fmt.Sprintf("/%s/guest/%s/%d/%04d%02d/%s_%d.%s", env, category, guestid, year, int(month), name, now.Unix(), ext)
switch category {
case TCategoryPersonalization:
// /{env}/personalization/{guestid}/{filename}
return fmt.Sprintf("/%s/%s/%d/%s.%s", env, category, guestid, name, ext)
case TCategoryRenderMegre:
// /{env}/render_megre/{guestid}/{filename} 自动删除
return fmt.Sprintf("/%s/%s/%d/%s_%d.%s", env, category, guestid, name, now.Unix(), ext)
case TCategory3DTools:
panic(TCategory3DTools + "不存在游客")
// /{env}/3dtools/年月/{guestid}/{filename}
// return fmt.Sprintf("/%s/%s/%04d%02d/%d/%s_%d.%s", env, category, year, int(month), guestid, name, now.Unix(), ext)
case TCategoryQuotation:
panic(TCategoryQuotation + "不存在游客")
// /{env}/quotation/年月/{guestid}/{filename}
// return fmt.Sprintf("/%s/%s/%04d%02d/%d/%s_%d.%s", env, category, year, int(month), guestid, name, now.Unix(), ext)
default:
return fmt.Sprintf("/%s/%s/%d/%04d%02d/%s_%d.%s", env, category, guestid, year, int(month), name, now.Unix(), ext)
}
}