package com.ruoyi.oa.controller;


import com.ruoyi.oa.service.CodeGeneratorService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/code")
public class CodeGeneratorController {

    private final CodeGeneratorService gen;

    @GetMapping("/code/{prefix}")
    public String genCode(@PathVariable String prefix) {
        return gen.nextCode(prefix);
    }
}
