package com.yingpaipay.setting.controller;


import cn.dev33.satoken.annotation.SaCheckPermission;
import com.yingpaipay.setting.domain.bo.TextinSettingBo;
import com.yingpaipay.setting.domain.vo.TextinSettingVo;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import org.dromara.common.web.core.BaseController;
import com.yingpaipay.setting.service.ITextinSettingService;

/**
 * TextIn
 *
 * @author Huanyi
 * @date 2026-01-07
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/setting/textin")
public class TextinSettingController extends BaseController {

    private final ITextinSettingService textinSettingService;

    @SaCheckPermission("setting:textin:index")
    @GetMapping()
    public R<TextinSettingVo> query() {
        return R.ok(textinSettingService.query());
    }

    @SaCheckPermission("setting:textin:edit")
    @Log(title = "TextIn", businessType = BusinessType.UPDATE)
    @PutMapping()
    public R<Void> edit(@RequestBody TextinSettingBo bo) {
        return toAjax(textinSettingService.update(bo));
    }

}
