package com.xiaoniu.system.platformsettings.information.controller;

import com.xiaoniu.common.core.resdata.Result;
import com.xiaoniu.system.platformsettings.information.dto.EditPlatformInformationDTO;
import com.xiaoniu.system.platformsettings.information.service.ITbPlatformInformationService;
import com.xiaoniu.system.platformsettings.information.vo.PlatformInformationVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 平台信息设置信息表 前端控制器
 * </p>
 *
 * @author haoxuyang
 * @since 2024-10-10 03:32:25
 */
@Tag(name = "平台信息设置管理")
@RestController
@RequestMapping("/information")
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class TbPlatformInformationController {
    private final ITbPlatformInformationService tbPlatformInformationService;

    @Operation(summary = "获取平台信息设置")
    @GetMapping("/details")
    public Result<PlatformInformationVO> details() {
        return Result.success("查询成功", tbPlatformInformationService.details());
    }

    @Operation(summary = "修改平台信息设置")
    @PostMapping("/edit")
    public Result<String> edit(@RequestBody EditPlatformInformationDTO dto) {
        tbPlatformInformationService.edit(dto);
        return Result.success("操作成功");
    }

}
