package com.easyproject.web.controller.operate;


import com.easyproject.service.domain.operate.OperateWebsiteSet;
import com.easyproject.system.service.operate.IOperateWebsiteSetService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.easyproject.common.annotation.Log;
import com.easyproject.common.core.controller.BaseController;
import com.easyproject.common.core.domain.AjaxResult;
import com.easyproject.common.enums.BusinessType;

/**
 * 网站设置Controller
 *
 * @author easyproject
 * @date 2025-03-14
 */
@RestController
@RequestMapping("/system/websiteSet")
public class OperateWebsiteSetController extends BaseController {
    @Autowired
    private IOperateWebsiteSetService operateWebsiteSetService;

    /**
     * 获取网站设置详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:websiteSet:query')")
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id) {
        return success(operateWebsiteSetService.selectOperateWebsiteSetById(id));
    }

    /**
     * 修改网站设置
     */
    @PreAuthorize("@ss.hasPermi('system:websiteSet:edit')")
    @Log(title = "网站设置", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody OperateWebsiteSet operateWebsiteSet) {
        return toAjax(operateWebsiteSetService.updateOperateWebsiteSet(operateWebsiteSet));
    }
}
