springboot 单个参数校验
程序员文章站
2022-07-13 14:27:11
...
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@RestController
@RequestMapping("/sys/dictionary")
@Api(tags="数据字典接口")
@Validated
public class DictionaryController {
@Autowired
private DictionaryService dictionaryService;
@ApiOperation("字典")
@ApiImplicitParams({
@ApiImplicitParam(name = "codes", required = true, value = "数组"),
})
@GetMapping("/select")
public R select(@NotNull(message = "codes 不予许为空") String[] codes){
return R.ok();
}
}
下一篇: ITEXT 生成 导出 PDF