fkl_codegen_java

Crates.iofkl_codegen_java
lib.rsfkl_codegen_java
version0.4.0
sourcesrc
created_at2022-10-07 07:26:18.364918
updated_at2022-11-02 15:08:54.499019
descriptionFeakin is a architecture design and visual collaboration tool. This is the parser for Feakin.
homepage
repositoryhttps://github.com/feakin/fklang
max_upload_size
id682557
size12,637
Fengda Huang (phodal)

documentation

README

FKL Codegen

Feakin killall language,

Book API

// createBook with @PutMapping("/book/:id) and BookRequest in BookController, and return Book id
@PutMapping("/book/:id")
public Book createBook(@PathVariable("id") Long id, @RequestBody BookRequest bookRequest) {
    Book book = new Book();
    book.setId(id);
    book.setTitle(bookRequest.getTitle());
    book.setAuthor(bookRequest.getAuthor());
    book.setPrice(bookRequest.getPrice());
    return book;
}

BookCreated

// create book in bookRepository and return BookResponse
public BookResponse createBook(BookRequest bookRequest) {
    Book book = new Book(bookRequest);
    bookRepository.save(book);
    return new BookResponse(book);
}

BookUpdated

// updateBook with BookUpdateRequest and return BookResponse
public BookResponse updateBook(BookUpdateRequest bookUpdateRequest) {
    Book book = bookRepository.findById(bookUpdateRequest.getId());
    book.update(bookUpdateRequest);
    bookRepository.save(book);
    return new BookResponse(book);
}
Commit count: 462

cargo fmt