Git Product home page Git Product logo

assignment-java-boot-camp's Introduction

assignment-java-boot-camp's People

Contributors

up1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

assignment-java-boot-camp's Issues

คำถามเกี่ยวกับ assignment

สวัสดีครับ ผมยังไม่เคยเริ่มงานในด้านสายนี้แบบจริงจังเลยยังตามไม่ค่อยทันเท่าไหร่ พอจะอธิบายให้ได้มั้ยครับว่า flow ที่หมายถึงคือเป็นแบบไหนครับ (อยากให้มีตัวอย่างด้วยครับ) แล้วก็ตัว api ที่ต้องทำนี่คือต้องใช้จริงได้เลยมั้ยครับ

ทำเสร็จแล้วครับ และรบกวนขอ feedback บางเรื่องครับ

ส่งไปใน link แล้วครับ

deliverables

เรื่องที่อยากขอ feedback

นอกจาก deliverables ด้านบน ใน wiki ผมได้เขียนแนวคิด และวิธีการทำงานที่ผมทำไว้เป็นหัวข้อต่าง ๆ ครับ อยากจะรบกวนคุณสมเกียรติและทุก ๆ ท่าน ช่วยอ่าน และ review แนวคิด วิธีการทำงานของผม ว่าถูกหรือผิด หรือคิดเห็นอย่างไรกันบ้าง โดยมีหัวข้อต่อไปนี้ครับ

ขอบคุณมากครับ

**Cards**

Cards can be added to your board to track the progress of issues and pull requests. You can also add note cards, like this one!

deadline ของ assignment Week 1....

deadline ของ assignment Week 1....
คือส่งภายใน วันอาทิตย์ ที่ 20/2/2022 23.59
ใช่ไหมครับ

สอบถามการใช้งาน Spring JPA หน่อยครับ

อยากสอบถามว่าตัวของ Spring data jpa นั้นสามารถที่จะปรับเปลี่ยน query statement ณ ตอน runtime ได้ไหมครับ ที่อยากได้แบบนี้เพราะอยากจะนำไปทำตัว order filter ที่หลังบ้านแล้วส่ง response ไปโชว์ที่หน้าบ้านได้เลยอะครับ usecase มีประมาณนี้ครับ

Use case

Request ที่ทาง FE ส่งเข้า

{
 "orderId" : "",
  "buyBy" :  "Hank Artisan",
  "buyAt" : "2022-03-09 15:47:54",
  ...
}
 select o from orders o where o.buyBy like :o.buyBy = :buyBy and o.buyAt = date :buyAt ;

กรณีที่ไม่ส่ง parameter บาง parameter มาจะปรับ where clause ตามด้านล่าง

{
 "orderId" : "",
  "buyBy" :  "",
  "buyAt" : "2022-03-09 15:47:54",
  ...
}
 select o from orders o where o.buyAt = date :buyAt ;

ขอตัวอย่างการเขียน select join table

ผมเก็บข้อมูล product กับ thumbsnail_images แยกกัน ผมต้องการเขียน join 2 table แล้วได้ response แบบนี้
image

ขอตัวอย่างโค้ดหน่อยครับ ลองทำตามตัวอย่างที่หามาแต่ไม่ได้ครับ

ผมสอบถามเกี่ยวกับ Data ที่ใช้ในการทำตัว work shop 01

ใน workshop นี้ เราต้องใช้ database h2 ที่อาจารย์ใช้ในคอร์สสอนเรื่อง repository หรือเปล่าครับ ผมมีคำถามตรงการสร้าง repository , entity ครับ ว่าถ้าสมมุติผมต้องการสร้าง repo ของ product ขึ้นมาใหม่ ผมก็สร้าง entity , repo ตามปกติแต่ว่าจังหวะ initial data ก็ใช้วิธี @PostConsturct
productRepo.save(); ตรงๆ ได้เลยมั้ยครับ spring boot จะไปทำการ generate product table , insert data ที่ผม initial ไว้หรือเปล่าครับ หรือว่าต้องไปสร้าง table เองในหน้า manage h2 ของ project แต่ทีนี้ถ้าทำแบบนี้ ตอน push code ส่งไปอาจารย์ก็จะไม่มี table ที่สร้างขึ้นมาใหม่นี้มันก็จะ error จังหวะเทสหรือเปล่าครับ อาจารย์ช่วยอธิบายหน่อยครับ ถามใน zoom เมื่อวานไปรอบก็ยังงงๆอยู่ดี

สอบถามการทำ Request Body หน่อยครับ

เวลาที่ต้องการรับ RequestBody ตอนนี้จะใช้วิธีการสร้าง pojo class ขึ้นมาตาม Request ที่จะส่งข้อมูลมาตาม code ด้านล่าง เลยอยากสอบถามว่าพอมีท่าการทำที่ดีกว่าอันนี้ไหมครับ ผมรู้สึกว่ายิ่งเรามี endpoint มากขึ้น เราจำเป็นต้องสร้าง class pojo มากขึ้นตามไปด้วยอะครับ ?

Endpoint

    @PostMapping("/addShippingAddress")
    public ResponseEntity<?> addShippingAddress(@RequestBody @Valid RequestShippingAddress address) {
        return ResponseEntity.ok().body(customerService.addShippingAddress(address));
    }

POJO Class

@NoArgsConstructor
@Getter
@Setter
@AllArgsConstructor
public class RequestShippingAddress {

    @NotNull
    private Long customerId;
    @NotBlank
    private String address;
    @NotBlank
    @Length(min = 5, max = 5)
    private String zipCode;
    @NotBlank
    private String province;
    @NotBlank
    @Length(min = 10, max = 10)
    private String phoneNumber;
}

สอบถามเกี่ยวกับ หน้า 9.Confirm to order กับ หน้า 10. Summary

หน้า 9. Confirm to order น่ะครับ สมมุติถ้าผมให้มันจ่าย 3 วิธีคือ debit ,credit และ rabbit line pay ซึ่งรับ 4 fields
คือ 1. เลขบัตร 2. ชื่อบนบัตร 3. วันหมดอายุบัตร 4. CVV คำถามคือหน้า 10 . Summary ผมต้องแสดง fields อะไรบ้างหรอครับหรือว่าคิดเองได้เลยครับ

ขอบคุณครับ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.