feat: 新增系统全局配置&修改账号密码

This commit is contained in:
meilin.huang
2022-08-26 20:15:36 +08:00
parent 09e6bdcf7e
commit 7761fe0288
89 changed files with 2035 additions and 209 deletions

View File

@@ -0,0 +1,29 @@
package entity
import "mayfly-go/pkg/model"
const (
ConfigKeyUseLoginCaptcha string = "UseLoginCaptcha" // 是否使用登录验证码
)
type Config struct {
model.Model
Name string `json:"name"` // 配置名
Key string `json:"key"` // 配置key
Value string `json:"value"`
Remark string `json:"remark"`
}
func (a *Config) TableName() string {
return "t_sys_config"
}
// 若配置信息不存在, 则返回传递的默认值.
// 否则只有value == "1"为true其他为false
func (c *Config) BoolValue(defaultValue bool) bool {
// 如果值不存在,则返回默认值
if c.Id == 0 {
return defaultValue
}
return c.Value == "1"
}

View File

@@ -0,0 +1,18 @@
package repository
import (
"mayfly-go/internal/sys/domain/entity"
"mayfly-go/pkg/model"
)
type Config interface {
GetPageList(condition *entity.Config, pageParam *model.PageParam, toEntity interface{}, orderBy ...string) *model.PageResult
Insert(config *entity.Config)
Update(config *entity.Config)
GetConfig(config *entity.Config, cols ...string) error
GetByCondition(condition *entity.Config, cols ...string) error
}