style: 修改website的API和model

This commit is contained in:
zhengkunwang223
2022-12-13 17:20:13 +08:00
committed by zhengkunwang223
parent 2a0f2dcd6a
commit 09ef0ebc80
53 changed files with 520 additions and 548 deletions

View File

@@ -1,32 +1,34 @@
import http from '@/api';
import { ReqPage, ResPage } from '../interface';
import { WebSite } from '../interface/website';
import { Website } from '../interface/Website';
import { File } from '../interface/file';
export const SearchWebSites = (req: WebSite.WebSiteSearch) => {
return http.post<ResPage<WebSite.WebSite>>(`/websites/search`, req);
export const SearchWebsites = (req: Website.WebSiteSearch) => {
return http.post<ResPage<Website.Website>>(`/websites/search`, req);
};
export const CreateWebsite = (req: WebSite.WebSiteCreateReq) => {
export const CreateWebsite = (req: Website.WebSiteCreateReq) => {
return http.post<any>(`/websites`, req);
};
export const BackupWebsite = (id: number) => {
return http.post(`/websites/backup/${id}`);
};
export const RecoverWebsite = (req: WebSite.WebSiteRecover) => {
export const RecoverWebsite = (req: Website.WebSiteRecover) => {
return http.post(`/websites/recover`, req);
};
export const RecoverWebsiteByUpload = (req: WebSite.WebsiteRecoverByUpload) => {
export const RecoverWebsiteByUpload = (req: Website.WebsiteRecoverByUpload) => {
return http.post(`/websites/recover/byupload`, req);
};
export const UpdateWebsite = (req: WebSite.WebSiteUpdateReq) => {
export const UpdateWebsite = (req: Website.WebSiteUpdateReq) => {
return http.post<any>(`/websites/update`, req);
};
export const GetWebsite = (id: number) => {
return http.get<WebSite.WebSiteDTO>(`/websites/${id}`);
return http.get<Website.Website>(`/websites/${id}`);
};
export const GetWebsiteOptions = () => {
@@ -37,19 +39,19 @@ export const GetWebsiteNginx = (id: number) => {
return http.get<File.File>(`/websites/${id}/nginx`);
};
export const DeleteWebsite = (req: WebSite.WebSiteDel) => {
export const DeleteWebsite = (req: Website.WebSiteDel) => {
return http.post<any>(`/websites/del`, req);
};
export const ListGroups = () => {
return http.get<WebSite.Group[]>(`/websites/groups`);
return http.get<Website.Group[]>(`/websites/groups`);
};
export const CreateGroup = (req: WebSite.GroupOp) => {
export const CreateGroup = (req: Website.GroupOp) => {
return http.post<any>(`/websites/groups`, req);
};
export const UpdateGroup = (req: WebSite.GroupOp) => {
export const UpdateGroup = (req: Website.GroupOp) => {
return http.put<any>(`/websites/groups`, req);
};
@@ -58,34 +60,34 @@ export const DeleteGroup = (id: number) => {
};
export const ListDomains = (id: number) => {
return http.get<WebSite.Domain[]>(`/websites/domains/${id}`);
return http.get<Website.Domain[]>(`/websites/domains/${id}`);
};
export const DeleteDomain = (id: number) => {
return http.delete<any>(`/websites/domains/${id}`);
export const DeleteDomain = (req: Website.DomainDelete) => {
return http.post<any>(`/websites/domains/del/`, req);
};
export const CreateDomain = (req: WebSite.DomainCreate) => {
export const CreateDomain = (req: Website.DomainCreate) => {
return http.post<any>(`/websites/domains`, req);
};
export const GetNginxConfig = (req: WebSite.NginxConfigReq) => {
return http.post<WebSite.NginxScopeConfig>(`/websites/config`, req);
export const GetNginxConfig = (req: Website.NginxConfigReq) => {
return http.post<Website.NginxScopeConfig>(`/websites/config`, req);
};
export const UpdateNginxConfig = (req: WebSite.NginxConfigReq) => {
export const UpdateNginxConfig = (req: Website.NginxConfigReq) => {
return http.post<any>(`/websites/config/update`, req);
};
export const SearchDnsAccount = (req: ReqPage) => {
return http.post<ResPage<WebSite.DnsAccount>>(`/websites/dns/search`, req);
return http.post<ResPage<Website.DnsAccount>>(`/websites/dns/search`, req);
};
export const CreateDnsAccount = (req: WebSite.DnsAccountCreate) => {
export const CreateDnsAccount = (req: Website.DnsAccountCreate) => {
return http.post<any>(`/websites/dns`, req);
};
export const UpdateDnsAccount = (req: WebSite.DnsAccountUpdate) => {
export const UpdateDnsAccount = (req: Website.DnsAccountUpdate) => {
return http.post<any>(`/websites/dns/update`, req);
};
@@ -94,11 +96,11 @@ export const DeleteDnsAccount = (id: number) => {
};
export const SearchAcmeAccount = (req: ReqPage) => {
return http.post<ResPage<WebSite.AcmeAccount>>(`/websites/acme/search`, req);
return http.post<ResPage<Website.AcmeAccount>>(`/websites/acme/search`, req);
};
export const CreateAcmeAccount = (req: WebSite.AcmeAccountCreate) => {
return http.post<WebSite.AcmeAccount>(`/websites/acme`, req);
export const CreateAcmeAccount = (req: Website.AcmeAccountCreate) => {
return http.post<Website.AcmeAccount>(`/websites/acme`, req);
};
export const DeleteAcmeAccount = (id: number) => {
@@ -106,15 +108,15 @@ export const DeleteAcmeAccount = (id: number) => {
};
export const SearchSSL = (req: ReqPage) => {
return http.post<ResPage<WebSite.SSL>>(`/websites/ssl/search`, req);
return http.post<ResPage<Website.SSL>>(`/websites/ssl/search`, req);
};
export const ListSSL = (req: WebSite.SSLReq) => {
return http.post<WebSite.SSL[]>(`/websites/ssl/search`, req);
export const ListSSL = (req: Website.SSLReq) => {
return http.post<Website.SSL[]>(`/websites/ssl/search`, req);
};
export const CreateSSL = (req: WebSite.SSLCreate) => {
return http.post<WebSite.SSLCreate>(`/websites/ssl`, req);
export const CreateSSL = (req: Website.SSLCreate) => {
return http.post<Website.SSLCreate>(`/websites/ssl`, req);
};
export const DeleteSSL = (id: number) => {
@@ -122,37 +124,37 @@ export const DeleteSSL = (id: number) => {
};
export const GetWebsiteSSL = (websiteId: number) => {
return http.get<WebSite.SSL>(`/websites/ssl/${websiteId}`);
return http.get<Website.SSL>(`/websites/ssl/${websiteId}`);
};
export const ApplySSL = (req: WebSite.SSLApply) => {
return http.post<WebSite.SSLApply>(`/websites/ssl/apply`, req);
export const ApplySSL = (req: Website.SSLApply) => {
return http.post<Website.SSLApply>(`/websites/ssl/apply`, req);
};
export const RenewSSL = (req: WebSite.SSLRenew) => {
export const RenewSSL = (req: Website.SSLRenew) => {
return http.post<any>(`/websites/ssl/renew`, req);
};
export const GetDnsResolve = (req: WebSite.DNSResolveReq) => {
return http.post<WebSite.DNSResolve[]>(`/websites/ssl/resolve`, req);
export const GetDnsResolve = (req: Website.DNSResolveReq) => {
return http.post<Website.DNSResolve[]>(`/websites/ssl/resolve`, req);
};
export const GetHTTPSConfig = (id: number) => {
return http.get<WebSite.HTTPSConfig>(`/websites/${id}/https`);
return http.get<Website.HTTPSConfig>(`/websites/${id}/https`);
};
export const UpdateHTTPSConfig = (req: WebSite.HTTPSReq) => {
return http.post<WebSite.HTTPSConfig>(`/websites/${req.websiteId}/https`, req);
export const UpdateHTTPSConfig = (req: Website.HTTPSReq) => {
return http.post<Website.HTTPSConfig>(`/websites/${req.websiteId}/https`, req);
};
export const PreCheck = (req: WebSite.CheckReq) => {
return http.post<WebSite.CheckRes[]>(`/websites/check`, req);
export const PreCheck = (req: Website.CheckReq) => {
return http.post<Website.CheckRes[]>(`/websites/check`, req);
};
export const GetWafConfig = (req: WebSite.WafReq) => {
return http.post<WebSite.WafRes>(`/websites/waf/config`, req);
export const GetWafConfig = (req: Website.WafReq) => {
return http.post<Website.WafRes>(`/websites/waf/config`, req);
};
export const UpdateWafEnable = (req: WebSite.WafUpdate) => {
export const UpdateWafEnable = (req: Website.WafUpdate) => {
return http.post<any>(`/websites/waf/update`, req);
};