49 lines
1.7 KiB
Go
49 lines
1.7 KiB
Go
// Copyright © 2023 OpenIM. All rights reserved.
|
||
//
|
||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||
// you may not use this file except in compliance with the License.
|
||
// You may obtain a copy of the License at
|
||
//
|
||
// http://www.apache.org/licenses/LICENSE-2.0
|
||
//
|
||
// Unless required by applicable law or agreed to in writing, software
|
||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||
// See the License for the specific language governing permissions and
|
||
// limitations under the License.
|
||
|
||
package model
|
||
|
||
import (
|
||
"time"
|
||
)
|
||
|
||
const (
|
||
SystemConfigTableName = "system_configs"
|
||
)
|
||
|
||
// SystemConfigValueType 配置值类型
|
||
const (
|
||
SystemConfigValueTypeString = 1 // 字符串
|
||
SystemConfigValueTypeNumber = 2 // 数字
|
||
SystemConfigValueTypeBool = 3 // 布尔
|
||
SystemConfigValueTypeJSON = 4 // JSON
|
||
)
|
||
|
||
// SystemConfig 系统配置表
|
||
type SystemConfig struct {
|
||
Key string `bson:"key"` // 配置键(唯一标识)
|
||
Title string `bson:"title"` // 配置标题
|
||
Value string `bson:"value"` // 配置值(字符串形式存储,根据ValueType解析)
|
||
ValueType int32 `bson:"value_type"` // 配置值类型:1-字符串,2-数字,3-布尔,4-JSON
|
||
Description string `bson:"description"` // 配置描述
|
||
Enabled bool `bson:"enabled"` // 是否启用(用于开关类配置)
|
||
ShowInApp bool `bson:"show_in_app"` // 是否在APP端展示
|
||
CreateTime time.Time `bson:"create_time"` // 创建时间
|
||
UpdateTime time.Time `bson:"update_time"` // 更新时间
|
||
}
|
||
|
||
func (*SystemConfig) TableName() string {
|
||
return SystemConfigTableName
|
||
}
|