| | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.utils.MessageUtils; |
| | | import io.swagger.v3.oas.annotations.Parameter; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.Data; |
| | | import org.hibernate.validator.constraints.Range; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | |
| | | |
| | | /** |
| | |
| | | * @author Lion Li |
| | | */ |
| | | @Validated |
| | | @Tag(name ="测试国际化控制器", description = "测试国际化管理") |
| | | @RestController |
| | | @RequestMapping("/demo/i18n") |
| | | public class TestI18nController { |
| | |
| | | * code为 messages.properties 中的 key |
| | | * <p> |
| | | * 测试使用 user.register.success |
| | | * |
| | | * @param code 国际化code |
| | | */ |
| | | @GetMapping() |
| | | public R<Void> get(@Parameter(name = "国际化code") String code) { |
| | | public R<Void> get(String code) { |
| | | return R.ok(MessageUtils.message(code)); |
| | | } |
| | | |