Add system settings management api
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package top.fatweb.api.service.system
|
||||
|
||||
import top.fatweb.api.param.system.MailSettingsParam
|
||||
import top.fatweb.api.vo.system.SettingsVo
|
||||
|
||||
interface ISettingsService {
|
||||
fun get(): SettingsVo
|
||||
|
||||
fun updateMail(mailSettingsParam: MailSettingsParam)
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package top.fatweb.api.service.system
|
||||
|
||||
import top.fatweb.api.param.system.SettingParam
|
||||
import top.fatweb.api.vo.system.SettingVo
|
||||
|
||||
interface ISysSettingService {
|
||||
fun get(): SettingVo
|
||||
|
||||
fun update(settingParam: SettingParam)
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package top.fatweb.api.service.system.impl
|
||||
|
||||
import org.springframework.stereotype.Service
|
||||
import top.fatweb.api.converter.system.SettingsConverter
|
||||
import top.fatweb.api.param.system.MailSettingsParam
|
||||
import top.fatweb.api.service.system.ISettingsService
|
||||
import top.fatweb.api.settings.MailSettings
|
||||
import top.fatweb.api.settings.SettingsOperator
|
||||
import top.fatweb.api.vo.system.SettingsVo
|
||||
|
||||
@Service
|
||||
class SettingsServiceImpl : ISettingsService {
|
||||
override fun get(): SettingsVo = SettingsConverter.systemSettingsToSettingsVo(SettingsOperator.settings())
|
||||
|
||||
override fun updateMail(mailSettingsParam: MailSettingsParam) {
|
||||
mailSettingsParam.apply {
|
||||
SettingsOperator.setMailValue(MailSettings::host, host)
|
||||
SettingsOperator.setMailValue(MailSettings::port, port)
|
||||
SettingsOperator.setMailValue(MailSettings::username, username)
|
||||
SettingsOperator.setMailValue(MailSettings::password, password)
|
||||
SettingsOperator.setMailValue(MailSettings::from, from)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package top.fatweb.api.service.system.impl
|
||||
|
||||
import org.springframework.stereotype.Service
|
||||
import top.fatweb.api.param.system.SettingParam
|
||||
import top.fatweb.api.service.system.ISysSettingService
|
||||
import top.fatweb.api.vo.system.SettingVo
|
||||
|
||||
@Service
|
||||
class SysSettingServiceImpl : ISysSettingService {
|
||||
override fun get(): SettingVo {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
|
||||
override fun update(settingParam: SettingParam) {
|
||||
TODO("Not yet implemented")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user