package shop.alien.lawyer.controller;

import io.swagger.annotations.*;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;
import shop.alien.entity.result.R;
import shop.alien.lawyer.service.TestService;

/**
 * @author ssk
 * @version 1.0
 * @date 2025/11/10 14:09
 */
@Slf4j
@Api(tags = {"测试接口"})
@ApiSort(1)
@CrossOrigin
@RestController
@RequestMapping("/test")
@RequiredArgsConstructor
public class TestController {

    private final TestService testService;

    @ApiOperation("测试")
    @ApiOperationSupport(order = 1)
    @ApiImplicitParams({
            @ApiImplicitParam(
                    name = "name",
                    value = "姓名",
                    dataType = "String",
                    paramType = "query",
                    required = true,
                    defaultValue = "张三")
    })
    @GetMapping("/test")
    public R getIdInfo(@RequestParam("name") String name) {
        log.info("AliController.getIdInfo?name={}", name);
        return R.data(testService.test(name));
    }

}
