분류 전체보기29 Redis LUA Script print("Hello Lua World!")local value = 10 + 1print(value)if value > 0 then print ('value is positive')end if value ~= 0 then print("value is non zero")endif value == 11 then print("value is 11")endlocal country = {"south korea", "UC","north"}print(#country)table.insert(country,"ckck")print(country[4])for i,v in ipairs(country) do print(i,v)end for i =1, 5 do print(i)endlocal car.. 2024. 6. 24. Java Entity코드를 Kotlin Entity로.. User.java @Entity public class JavaUser { @Id @GeneratedValue(strategy = IDENTITY) private Long id; @Column(nullable = false) private String name; private Integer age; @OneToMany(mappedBy = "user", cascade = CascadeType.ALL, orphanRemoval = true) private final List userLoanHistories = new ArrayList(); public JavaUser() { } public JavaUser(String name, Integer age) { if (name.isBlank()) { throw n.. 2024. 1. 9. Java Service코드를 Kotlin Service코드로.. UserService.java @Service public class JavaUserService { private final UserRepository userRepository; public JavaUserService(UserRepository userRepository) { this.userRepository = userRepository; } @Transactional public void saveUser(UserCreateRequest request) { User user = new User(request.getName(), request.getAge(), Collections.EMPTY_LIST,null); userRepository.save(user); } @Transactional(rea.. 2024. 1. 8. Java Controller를 Kotlin Controller로 UserController.java @RestController public class UserController { private final UserService userService; public UserController(UserService userService) { this.userService = userService; } @PostMapping("/user") public void saveUser(@RequestBody UserCreateRequest request) { userService.saveUser(request); } @GetMapping("/user") public List getUsers() { return userService.getUsers(); } @PutMapping(".. 2024. 1. 8. 이전 1 2 3 4 ··· 8 다음