mirror of
https://gitee.com/dromara/mayfly-go
synced 2025-11-03 16:00:25 +08:00
feat: 使用标签替代项目
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
package entity
|
||||
|
||||
import "mayfly-go/pkg/model"
|
||||
import (
|
||||
"encoding/json"
|
||||
"mayfly-go/pkg/model"
|
||||
)
|
||||
|
||||
const (
|
||||
ConfigKeyUseLoginCaptcha string = "UseLoginCaptcha" // 是否使用登录验证码
|
||||
@@ -10,6 +13,7 @@ type Config struct {
|
||||
model.Model
|
||||
Name string `json:"name"` // 配置名
|
||||
Key string `json:"key"` // 配置key
|
||||
Params string `json:"params"`
|
||||
Value string `json:"value"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
@@ -27,3 +31,13 @@ func (c *Config) BoolValue(defaultValue bool) bool {
|
||||
}
|
||||
return c.Value == "1"
|
||||
}
|
||||
|
||||
// 值返回json map
|
||||
func (c *Config) GetJsonMap() map[string]string {
|
||||
var res map[string]string
|
||||
if c.Id == 0 || c.Value == "" {
|
||||
return res
|
||||
}
|
||||
_ = json.Unmarshal([]byte(c.Value), &res)
|
||||
return res
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user