注册
This commit is contained in:
@@ -19,12 +19,14 @@ const TCategoryPersonalization TypeCategory = "personalization"
|
||||
const TCategory3DTools TypeCategory = "3dtools"
|
||||
const TCategoryQuotation TypeCategory = "quotation"
|
||||
const TCategoryRenderMegre TypeCategory = "render_megre"
|
||||
const TCategoryImage TypeCategory = "image"
|
||||
|
||||
var CategoryMap = map[string]bool{
|
||||
string(TCategoryPersonalization): true,
|
||||
string(TCategory3DTools): true,
|
||||
string(TCategoryQuotation): true,
|
||||
string(TCategoryRenderMegre): true,
|
||||
string(TCategoryImage): true,
|
||||
}
|
||||
|
||||
// FormatS3KeyName 需要输入选
|
||||
@@ -51,6 +53,8 @@ func FormatS3KeyNameUser(userid int64, now time.Time, env string, category TypeC
|
||||
}
|
||||
|
||||
switch category {
|
||||
case TCategoryImage:
|
||||
return fmt.Sprintf("/%s/%s/%d/%s_%d.%s", env, category, userid, name, now.UnixNano(), ext)
|
||||
case TCategoryPersonalization:
|
||||
// /{env}/personalization/{userid}/{filename}
|
||||
return fmt.Sprintf("/%s/%s/%d/%s.%s", env, category, userid, name, ext)
|
||||
@@ -82,12 +86,14 @@ func FormatS3KeyNameGuest(guestid int64, now time.Time, env string, category Typ
|
||||
}
|
||||
|
||||
switch category {
|
||||
case TCategoryImage:
|
||||
return fmt.Sprintf("/%s/%s/g/%d/%s_%d.%s", env, category, guestid, name, now.UnixNano(), ext)
|
||||
case TCategoryPersonalization:
|
||||
// /{env}/personalization/{guestid}/{filename}
|
||||
return fmt.Sprintf("/%s/%s/%d/%s.%s", env, category, guestid, name, ext)
|
||||
// /{env}/personalization/g/{guestid}/{filename}
|
||||
return fmt.Sprintf("/%s/%s/g/%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.UnixNano(), ext)
|
||||
return fmt.Sprintf("/%s/%s/g/%d/%s_%d.%s", env, category, guestid, name, now.UnixNano(), ext)
|
||||
case TCategory3DTools:
|
||||
panic(TCategory3DTools + "不存在游客")
|
||||
// /{env}/3dtools/年月/{guestid}/{filename}
|
||||
@@ -97,7 +103,7 @@ func FormatS3KeyNameGuest(guestid int64, now time.Time, env string, category Typ
|
||||
// /{env}/quotation/年月/{guestid}/{filename}
|
||||
// return fmt.Sprintf("/%s/%s/%04d%02d/%d/%s_%d.%s", env, category, year, int(month), guestid, name, now.UnixNano(), ext)
|
||||
default:
|
||||
return fmt.Sprintf("/%s/%s/%d/%04d%02d/%s_%d.%s", env, category, guestid, year, int(month), name, now.UnixNano(), ext)
|
||||
return fmt.Sprintf("/%s/%s/g/%d/%04d%02d/%s_%d.%s", env, category, guestid, year, int(month), name, now.UnixNano(), ext)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user