修复数据类型错误
This commit is contained in:
@@ -15,16 +15,7 @@ var Configs_file Configs_file_t
|
||||
|
||||
var Database_configs map[string]interface{}
|
||||
|
||||
var Allowed_avatar_ext = map[string]bool{
|
||||
".jpg": true,
|
||||
".jpeg": true,
|
||||
".png": true,
|
||||
}
|
||||
|
||||
var Allowed_avatar_mime = map[string]bool{
|
||||
"image/jpeg": true,
|
||||
"image/png": true,
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
||||
|
||||
@@ -1,5 +1,27 @@
|
||||
package models
|
||||
|
||||
//mime信息转换位拓展名
|
||||
var Mime_to_extname = map[string]string{
|
||||
|
||||
"image/jpeg": ".jpeg",
|
||||
"image/png": ".png",
|
||||
"image/gif": ".gif",
|
||||
"image/bmp": ".bmp",
|
||||
|
||||
"video/mp4": ".mp4",
|
||||
"video/x-msvideo": ".",
|
||||
"video/quicktime": ".",
|
||||
"video/x-flv": ".flv",
|
||||
"video/mpeg": ".mpeg",
|
||||
|
||||
"audio/mpeg": ".mp3",
|
||||
"audio/aac": ".acc",
|
||||
"audio/wav": ".wav",
|
||||
"audio/flac": ".flac",
|
||||
|
||||
"application/pdf": ".pdf",
|
||||
}
|
||||
|
||||
type Configs_web_t struct {
|
||||
Host string `mapstructure:"host"`
|
||||
Port string `mapstructure:"port"`
|
||||
@@ -17,10 +39,10 @@ type Configs_user_t struct {
|
||||
}
|
||||
|
||||
type Configs_file_t struct {
|
||||
Max_size uint64 `mapstructure:"max_size"`
|
||||
Pahts []string `mapstructure:"pahts"`
|
||||
Allow_image_mime map[string]bool `mapstructure:"allow_image_mime"`
|
||||
Allow_video_mime map[string]bool `mapstructure:"allow_video_mime"`
|
||||
Allow_music_mime map[string]bool `mapstructure:"allow_music_mime"`
|
||||
Allow_pdf_mime map[string]bool `mapstructure:"allow_pdf_mime"`
|
||||
Max_size uint64 `mapstructure:"max_size"`
|
||||
Pahts map[string]string `mapstructure:"pahts"`
|
||||
Allow_image_mime map[string]bool `mapstructure:"allow_image_mime"`
|
||||
Allow_video_mime map[string]bool `mapstructure:"allow_video_mime"`
|
||||
Allow_music_mime map[string]bool `mapstructure:"allow_music_mime"`
|
||||
Allow_pdf_mime map[string]bool `mapstructure:"allow_pdf_mime"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user