(req request.WebsiteNginxUpdate)
| 1109 | } |
| 1110 | |
| 1111 | func (w WebsiteService) UpdateNginxConfigFile(req request.WebsiteNginxUpdate) error { |
| 1112 | website, err := websiteRepo.GetFirst(repo.WithByID(req.ID)) |
| 1113 | if err != nil { |
| 1114 | return err |
| 1115 | } |
| 1116 | nginxFull, err := getNginxFull(&website) |
| 1117 | if err != nil { |
| 1118 | return err |
| 1119 | } |
| 1120 | |
| 1121 | filePath := nginxFull.SiteConfig.FilePath |
| 1122 | if err = files.NewFileOp().WriteFile(filePath, strings.NewReader(req.Content), constant.DirPerm); err != nil { |
| 1123 | return err |
| 1124 | } |
| 1125 | return nginxCheckAndReload(nginxFull.SiteConfig.OldContent, filePath, nginxFull.Install.ContainerName) |
| 1126 | } |
| 1127 | |
| 1128 | func (w WebsiteService) GetWebsiteLog(req request.WebsiteLogSearchReq) (*response.WebsiteLog, error) { |
| 1129 | website, err := websiteRepo.GetFirst(repo.WithByID(req.ID)) |
nothing calls this directly
no test coverage detected