本文整理匯總了Golang中github.com/citycloud/citycloud/cf-deploy-ui/entity.Service.Where方法的典型用法代碼示例。如果您正苦於以下問題:Golang Service.Where方法的具體用法?Golang Service.Where怎麽用?Golang Service.Where使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/citycloud/citycloud/cf-deploy-ui/entity.Service
的用法示例。
在下文中一共展示了Service.Where方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: Post
func (this *TemplatesController) Post() {
action := this.GetString("action")
switch action {
case "":
service := entity.Service{}
service.Name = this.GetString("name")
service.Description = this.GetString("description")
service.Where = this.GetString("where")
id, err := this.GetInt64("id", 0)
if err == nil {
if id == 0 {
service.Save()
if service.Where == utils.Deploy_On_PaaS {
deployOnPaaS := entity.OnPaaS{}
deployOnPaaS.Api = this.GetString("Api")
deployOnPaaS.Sid = service.Id
deployOnPaaS.User = this.GetString("UserName")
deployOnPaaS.Passwd = this.GetString("Passwd")
deployOnPaaS.Org = this.GetString("Org")
deployOnPaaS.Space = this.GetString("Space")
deployOnPaaS.Save()
}
if service.Where == utils.Deploy_On_Vms {
deployOnCustom := entity.OnCustom{}
deployOnCustom.Sid = service.Id
deployOnCustom.Ip = this.GetString("ip")
deployOnCustom.User = this.GetString("VmUserName")
deployOnCustom.Passwd = this.GetString("VmPasswd")
deployOnCustom.Save()
}
} else {
service.Id = id
service.Update()
if service.Where == utils.Deploy_On_PaaS {
paasid, _ := this.GetInt64("paasid", 0)
deployOnPaaS := entity.OnPaaS{}
deployOnPaaS.Id = paasid
deployOnPaaS.Api = this.GetString("Api")
deployOnPaaS.Sid = service.Id
deployOnPaaS.User = this.GetString("UserName")
deployOnPaaS.Passwd = this.GetString("Passwd")
deployOnPaaS.Org = this.GetString("Org")
deployOnPaaS.Space = this.GetString("Space")
deployOnPaaS.Update()
}
if service.Where == utils.Deploy_On_Vms {
vmid, _ := this.GetInt64("vmid", 0)
deployOnCustom := entity.OnCustom{}
deployOnCustom.Id = vmid
deployOnCustom.Sid = service.Id
deployOnCustom.Ip = this.GetString("ip")
deployOnCustom.User = this.GetString("VmUserName")
deployOnCustom.Passwd = this.GetString("VmPasswd")
deployOnCustom.Update()
}
}
}
case "delete":
this.DeleteCustomService()
}
this.Redirect("templates", 301) //this.Get()
}