Add system settings management api

This commit is contained in:
2023-12-04 17:13:20 +08:00
parent 5c8775bf12
commit 902fcef9b2
18 changed files with 229 additions and 149 deletions

View File

@@ -0,0 +1,33 @@
package top.fatweb.api.controller.system
import io.swagger.v3.oas.annotations.Operation
import io.swagger.v3.oas.annotations.tags.Tag
import org.springframework.web.bind.annotation.*
import top.fatweb.api.entity.common.ResponseResult
import top.fatweb.api.param.system.MailSettingsParam
import top.fatweb.api.service.system.ISettingsService
import top.fatweb.api.vo.system.SettingsVo
/**
* System settings controller
*
* @author FatttSnake, fatttsnake@gmail.com
* @since 1.0.0
*/
@Tag(name = "系统设置", description = "系统设置相关接口")
@RequestMapping("/system/settings")
@RestController
class SettingsController(
private val settingsService: ISettingsService
) {
@Operation(summary = "获取全部设置")
@GetMapping
fun get(): ResponseResult<SettingsVo> = ResponseResult.success(data = settingsService.get())
@Operation(summary = "更新邮件设置")
@PutMapping("/mail")
fun updateMail(@RequestBody mailSettingsParam: MailSettingsParam): ResponseResult<Nothing> {
settingsService.updateMail(mailSettingsParam)
return ResponseResult.success()
}
}