(req dto.OllamaBindDomainReq)
| 301 | } |
| 302 | |
| 303 | func (u *AIToolService) GetBindDomain(req dto.OllamaBindDomainReq) (*dto.OllamaBindDomainRes, error) { |
| 304 | install, err := appInstallRepo.GetFirst(repo.WithByID(req.AppInstallID)) |
| 305 | if err != nil { |
| 306 | return nil, err |
| 307 | } |
| 308 | res := &dto.OllamaBindDomainRes{} |
| 309 | website, _ := websiteRepo.GetFirst(websiteRepo.WithAppInstallId(install.ID)) |
| 310 | if website.ID == 0 { |
| 311 | return res, nil |
| 312 | } |
| 313 | res.WebsiteID = website.ID |
| 314 | res.Domain = website.PrimaryDomain |
| 315 | if website.WebsiteSSLID > 0 { |
| 316 | res.SSLID = website.WebsiteSSLID |
| 317 | ssl, _ := websiteSSLRepo.GetFirst(repo.WithByID(website.WebsiteSSLID)) |
| 318 | res.AcmeAccountID = ssl.AcmeAccountID |
| 319 | } |
| 320 | res.ConnUrl = fmt.Sprintf("%s://%s", strings.ToLower(website.Protocol), website.PrimaryDomain) |
| 321 | res.AllowIPs = GetAllowIps(website) |
| 322 | return res, nil |
| 323 | } |
| 324 | |
| 325 | func (u *AIToolService) UpdateBindDomain(req dto.OllamaBindDomain) error { |
| 326 | nginxInstall, _ := getAppInstallByKey(constant.AppOpenresty) |
nothing calls this directly
no test coverage detected