package cn.stylefeng.guns.modular.demovalue.controller;

import cn.hutool.core.util.RandomUtil;
import cn.stylefeng.guns.modular.demovalue.pojo.ValidateUserRequest;
import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import cn.stylefeng.roses.kernel.scanner.api.annotation.ApiResource;
import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@ApiResource(name = "内容校验控制器")
public class GunsValidateController {

    @PostResource(name = "校验用户名是否重复", path = "/demoData/validateUserRepeat")
    public ResponseData<Boolean> validateUserRepeat(@RequestBody ValidateUserRequest validateUserRequest) {
        System.out.println("validateUserRequest：" + validateUserRequest);
        return new SuccessResponseData<>(RandomUtil.randomBoolean());
    }

}
