Skip to content

Commit

Permalink
云存储开发(未完,备份代码)
Browse files Browse the repository at this point in the history
  • Loading branch information
TruthHun88 committed Mar 24, 2019
1 parent 85174bf commit 930a821
Show file tree
Hide file tree
Showing 16 changed files with 578 additions and 456 deletions.
31 changes: 29 additions & 2 deletions controllers/AdminControllers/SysController.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (this *SysController) Get() {
var sys models.Sys
this.ParseForm(&sys)
if i, err := orm.NewOrm().Update(&sys); i > 0 && err == nil {
models.NewSys().UpdateGlobal() //更新全局变量
models.NewSys().UpdateGlobalConfig() //更新全局变量
} else {
if err != nil {
helper.Logger.Error(err.Error())
Expand All @@ -56,7 +56,7 @@ func (this *SysController) Get() {
modelCfg.UpdateByKey(helper.ConfigCate(tab), k, v[0])
}
//最后更新全局配置
modelCfg.UpdateGlobal()
modelCfg.UpdateGlobalConfig()
if tab == models.ConfigCateElasticSearch {
if err := models.NewElasticSearchClient().Init(); err != nil {
this.ResponseJson(false, "ElasticSearch初始化失败:"+err.Error())
Expand Down Expand Up @@ -198,3 +198,30 @@ func (this *SysController) TestOSS() {

this.Response(map[string]interface{}{"status": 1, "msg": "OSS连通成功"})
}

// 云存储配置
func (this *SysController) CloudStore() {
tab := this.GetString("tab", "cs-oss")
modelConfig := models.NewConfig()
this.Data["Config"] = modelConfig.GetByCate(helper.ConfigCate(tab))
this.Data["Tab"] = tab
this.Data["IsCloudStore"] = true
this.TplName = "cloud-store.html"
}

func (this *SysController) SetCloudStore() {
cate := helper.ConfigCate(this.GetString("tab", "cs-oss"))
if cate == "" {
this.ResponseJson(false, "参数错误:存储类别不正确")
}
modelConfig := models.NewConfig()
form, err := modelConfig.ParseForm(cate, this.Ctx.Request.Form)
if err != nil {
this.ResponseJson(false, err.Error())
}
err = modelConfig.UpdateCloudStore(cate, form)
if err != nil {
this.ResponseJson(false, err.Error())
}
this.ResponseJson(false, "sss", form)
}
32 changes: 0 additions & 32 deletions helper/cloudstore/README.md

This file was deleted.

67 changes: 0 additions & 67 deletions helper/cloudstore/bos.go

This file was deleted.

98 changes: 0 additions & 98 deletions helper/cloudstore/cos.go

This file was deleted.

9 changes: 0 additions & 9 deletions helper/cloudstore/interface.go

This file was deleted.

73 changes: 0 additions & 73 deletions helper/cloudstore/local.go

This file was deleted.

64 changes: 0 additions & 64 deletions helper/cloudstore/oss.go

This file was deleted.

Loading

0 comments on commit 930a821

Please sign in to comment.