mirror of https://github.com/abpframework/abp
parent
0ba3652799
commit
b8f4125f02
@ -0,0 +1,7 @@
|
||||
{
|
||||
"$schema": "../../../node_modules/ng-packagr/ng-package.schema.json",
|
||||
"dest": "../../../dist/packages/setting-management/proxy",
|
||||
"lib": {
|
||||
"entryFile": "src/public-api.ts"
|
||||
}
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
import type { EmailSettingsDto, SendTestEmailInput, UpdateEmailSettingsDto } from './models';
|
||||
import { RestService, Rest } from '@abp/ng.core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class EmailSettingsService {
|
||||
apiName = 'SettingManagement';
|
||||
|
||||
|
||||
get = (config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, EmailSettingsDto>({
|
||||
method: 'GET',
|
||||
url: '/api/setting-management/emailing',
|
||||
},
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
sendTestEmail = (input: SendTestEmailInput, config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, void>({
|
||||
method: 'POST',
|
||||
url: '/api/setting-management/emailing/send-test-email',
|
||||
body: input,
|
||||
},
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
update = (input: UpdateEmailSettingsDto, config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, void>({
|
||||
method: 'POST',
|
||||
url: '/api/setting-management/emailing',
|
||||
body: input,
|
||||
},
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
constructor(private restService: RestService) {}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,5 @@
|
||||
import * as Volo from './volo';
|
||||
export * from './email-settings.service';
|
||||
export * from './models';
|
||||
export * from './time-zone-settings.service';
|
||||
export { Volo };
|
@ -0,0 +1,31 @@
|
||||
|
||||
export interface EmailSettingsDto {
|
||||
smtpHost?: string;
|
||||
smtpPort: number;
|
||||
smtpUserName?: string;
|
||||
smtpPassword?: string;
|
||||
smtpDomain?: string;
|
||||
smtpEnableSsl: boolean;
|
||||
smtpUseDefaultCredentials: boolean;
|
||||
defaultFromAddress?: string;
|
||||
defaultFromDisplayName?: string;
|
||||
}
|
||||
|
||||
export interface SendTestEmailInput {
|
||||
senderEmailAddress: string;
|
||||
targetEmailAddress: string;
|
||||
subject: string;
|
||||
body?: string;
|
||||
}
|
||||
|
||||
export interface UpdateEmailSettingsDto {
|
||||
smtpHost?: string;
|
||||
smtpPort: number;
|
||||
smtpUserName?: string;
|
||||
smtpPassword?: string;
|
||||
smtpDomain?: string;
|
||||
smtpEnableSsl: boolean;
|
||||
smtpUseDefaultCredentials: boolean;
|
||||
defaultFromAddress: string;
|
||||
defaultFromDisplayName: string;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
import type { NameValue } from './volo/abp/models';
|
||||
import { RestService, Rest } from '@abp/ng.core';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root',
|
||||
})
|
||||
export class TimeZoneSettingsService {
|
||||
apiName = 'SettingManagement';
|
||||
|
||||
|
||||
get = (config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, string>({
|
||||
method: 'GET',
|
||||
responseType: 'text',
|
||||
url: '/api/setting-management/timezone',
|
||||
},
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
getTimezones = (config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, NameValue[]>({
|
||||
method: 'GET',
|
||||
url: '/api/setting-management/timezone/timezones',
|
||||
},
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
|
||||
update = (timezone: string, config?: Partial<Rest.Config>) =>
|
||||
this.restService.request<any, void>({
|
||||
method: 'POST',
|
||||
url: '/api/setting-management/timezone',
|
||||
params: { timezone },
|
||||
},
|
||||
{ apiName: this.apiName,...config });
|
||||
|
||||
constructor(private restService: RestService) {}
|
||||
}
|
@ -0,0 +1 @@
|
||||
export * from './models';
|
@ -0,0 +1,5 @@
|
||||
|
||||
export interface NameValue<T = "string"> {
|
||||
name?: string;
|
||||
value: T;
|
||||
}
|
@ -0,0 +1,2 @@
|
||||
import * as Abp from './abp';
|
||||
export { Abp };
|
@ -0,0 +1 @@
|
||||
export * from './lib/proxy/index';
|
Loading…
Reference in new issue