feat:完善项目
This commit is contained in:
@ -23,10 +23,10 @@ func (a *Config) Index(c *gin.Context) {
|
||||
|
||||
func (a *Config) Add(c *gin.Context) {
|
||||
form := &struct {
|
||||
Kind int `json:"kind" form:"kind" binding:"required"`
|
||||
Name string `json:"name" form:"name" binding:"required"`
|
||||
Key string `json:"key" form:"key" binding:"required"`
|
||||
Value interface{} `json:"value" form:"value" binding:"required"`
|
||||
Kind int `json:"kind" form:"kind" binding:"required"`
|
||||
Name string `json:"name" form:"name" binding:"required"`
|
||||
Key string `json:"key" form:"key" binding:"required"`
|
||||
Value string `json:"value" form:"value" binding:"required"`
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
@ -39,8 +39,8 @@ func (a *Config) Add(c *gin.Context) {
|
||||
func (a *Config) Edit(c *gin.Context) {
|
||||
form := &struct {
|
||||
api.IDStringForm
|
||||
Name string `json:"name" form:"name" binding:"required"`
|
||||
Value interface{} `json:"value" form:"value" binding:"required"`
|
||||
Name string `json:"name" form:"name" binding:"required"`
|
||||
Value string `json:"value" form:"value" binding:"required"`
|
||||
}{}
|
||||
if err := api.Bind(form)(c); err != nil {
|
||||
api.APIFailure(err.(error))(c)
|
||||
|
@ -102,12 +102,13 @@ func (c *Account) Login(mode int, params *AccountLoginParams, equipment, ip stri
|
||||
|
||||
_uid := data.UUIDString()
|
||||
|
||||
_session.Token = utils.JWTEncrypt(config.SettingInfo.TokenEffectTime, map[string]interface{}{config.TokenForUID: _uid})
|
||||
_session.Token = utils.JWTEncrypt(utils.StringToInt(config.SystemConfig[config.SysTokenEffectTime]),
|
||||
map[string]interface{}{config.TokenForUID: _uid})
|
||||
|
||||
service.Publish(config.EventForRedisHashProduce, config.RedisKeyForAccountAdmin, _uid, _session)
|
||||
service.Publish(config.EventForAccountLoginProduce, data.TenantID, data.ID, equipment, ip)
|
||||
|
||||
return &AccountLoginResponse{Token: _session.Token, EffectTime: config.SettingInfo.TokenEffectTime}, nil
|
||||
return &AccountLoginResponse{Token: _session.Token, EffectTime: utils.StringToInt(config.SystemConfig[config.SysTokenEffectTime])}, nil
|
||||
}
|
||||
|
||||
// Logout 退出请求
|
||||
|
@ -63,7 +63,7 @@ func (c *Apply) Instance(tenantID uint64, title, contact string, page, pageSize
|
||||
list := make([]*ApplyInfo, 0)
|
||||
|
||||
for _, v := range out {
|
||||
v.Image.Image = v.Analysis(config.SettingInfo.Domain)
|
||||
v.Image.Image = v.Analysis(config.SystemConfig[config.SysImageDomain])
|
||||
list = append(list, &ApplyInfo{
|
||||
ID: v.GetEncodeID(),
|
||||
TenantID: v.GetEncodeTenantID(),
|
||||
@ -82,7 +82,7 @@ func (c *Apply) Detail(id uint64) (*ApplyDetailInfo, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
out.Image.Image = out.Analysis(config.SettingInfo.Domain)
|
||||
out.Image.Image = out.Analysis(config.SystemConfig[config.SysImageDomain])
|
||||
|
||||
return &ApplyDetailInfo{
|
||||
ID: out.GetEncodeID(),
|
||||
|
@ -27,6 +27,7 @@ func (c *Config) Config(kind, page, pageSize int) (*controller.ReturnPages, erro
|
||||
mSysConfig := model.NewSysConfig()
|
||||
|
||||
where := []*model2.ModelWhereOrder{
|
||||
&model2.ModelWhereOrder{Order: model2.NewOrder("sort", model2.OrderModeToAsc)},
|
||||
&model2.ModelWhereOrder{Order: model2.NewOrder("kind", model2.OrderModeToAsc)},
|
||||
}
|
||||
if kind > 0 {
|
||||
@ -50,7 +51,7 @@ func (c *Config) Config(kind, page, pageSize int) (*controller.ReturnPages, erro
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
}
|
||||
|
||||
func (c *Config) Add(kind int, name, key string, value interface{}) error {
|
||||
func (c *Config) Add(kind int, name, key, value string) error {
|
||||
mSysConfig := model.NewSysConfig()
|
||||
|
||||
var count int64
|
||||
@ -75,7 +76,7 @@ func (c *Config) Add(kind int, name, key string, value interface{}) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (c *Config) Form(id uint64, name string, value interface{}) error {
|
||||
func (c *Config) Form(id uint64, name, value string) error {
|
||||
mSysConfig := model.NewSysConfig()
|
||||
mSysConfig.ID = id
|
||||
|
||||
|
@ -85,7 +85,7 @@ func (c *SolutionCase) Instance(tenantID uint64, title string, kindID uint64, pa
|
||||
list := make([]*SolutionCaseInfo, 0)
|
||||
|
||||
for _, v := range out {
|
||||
v.Image.Image = v.Image.Analysis(config2.SettingInfo.Domain)
|
||||
v.Image.Image = v.Image.Analysis(config2.SystemConfig[config2.SysImageDomain])
|
||||
|
||||
list = append(list, &SolutionCaseInfo{
|
||||
ID: v.GetEncodeID(),
|
||||
@ -108,7 +108,7 @@ func (c *SolutionCase) Detail(id uint64) (*SolutionCaseDetailInfo, error) {
|
||||
} else if !isExist {
|
||||
return nil, errors.New("操作错误,案例信息不存在或已被删除")
|
||||
}
|
||||
mServiceSolutionCase.Image.Image = mServiceSolutionCase.Image.Analysis(config2.SettingInfo.Domain)
|
||||
mServiceSolutionCase.Image.Image = mServiceSolutionCase.Image.Analysis(config2.SystemConfig[config2.SysImageDomain])
|
||||
|
||||
return &SolutionCaseDetailInfo{
|
||||
ID: mServiceSolutionCase.GetEncodeID(),
|
||||
@ -203,7 +203,7 @@ func (c *SolutionCase) Kind(tenantID uint64, mode int, title string, page, pageS
|
||||
list := make([]*SolutionCaseKindInfo, 0)
|
||||
|
||||
for _, v := range out {
|
||||
v.Image.Image = v.Image.Analysis(config2.SettingInfo.Domain)
|
||||
v.Image.Image = v.Image.Analysis(config2.SystemConfig[config2.SysImageDomain])
|
||||
|
||||
list = append(list, &SolutionCaseKindInfo{
|
||||
ID: v.GetEncodeID(),
|
||||
|
@ -130,7 +130,7 @@ func (c *Banner) Instance(tenantID uint64, title, local string, page, pageSize i
|
||||
ID: v.GetEncodeID(), TenantID: v.GetEncodeTenantID(),
|
||||
SysBanner: v.SysBanner,
|
||||
Area: v.FormatBasic(),
|
||||
Images: v.Images.AnalysisSlice(config.SettingInfo.Domain),
|
||||
Images: v.Images.AnalysisSlice(config.SystemConfig[config.SysImageDomain]),
|
||||
})
|
||||
}
|
||||
return &controller.ReturnPages{Data: list, Count: count}, nil
|
||||
|
Reference in New Issue
Block a user