Feature #60
openFeature #56: CATEGORY POST PRODUCT
[api] xây dựng api cho lấy breadcrum, bài category post, blog post
0%
Description
1. Cách lấy breadcrum cho bài post
Dựa vào column name và parent_id của table hans_spa_categories
1.a Cách lấy tên breadcrum **
Đệ quy để lấy ra được cha - con - ....
Ex: Trang chủ - massage - body massage - body aroma massage
1.b Cách lấy link cho breadcrum **
Mỗi phần của breadcrum khi click vào sẽ có 1 url tương ứng
Dựa column full_path của table hans_spa_category_urls điều kiện là is_primary = 1
Ex:
Trang chủ -> về trang home (https://hans-spa.com)
message -> đến trang message (/massage)
body massage -> đến trang body massage (/massage/body-massage)
body aroma massage -> đến trang body aroma massage (/aroma-massage)
Updated by Redmine Admin 17 days ago
2. Cách lấy bài post
Bài post sẽ chia ra 2 loại
- category post
- blog post
-> Dựa vào table hans_spa_posts
Nếu type = category_page -> category post -> sẽ lấy url từ column full_path trong table hans_spa_category_urls
Ngược lại type = blog_post sẽ là blog post -> sẽ lấy url từ slug trong table hans_spa_categories và kết hợp với slug trong table hans_spa_posts
Ex: slug1/slug2 (slug1 là slug của hans_spa_categories , slug2 là slug của hans_spa_posts)
Updated by Redmine Admin 17 days ago · Edited
3. Cách lấy Product của post
Dựa vào column post_id trong table hans_spa_post_products để lấy được mối quan hệ giữ post và product
Thường category post sẽ được tạo thêm product, còn blog post thì không
Updated by KhoaBE Nguyen 12 days ago
blog post
/v1/hans-spa/resolve?path=blog
/v1/hans-spa/resolve?path=blog/massage
/v1/hans-spa/resolve?path=blog/shampoo
/v1/hans-spa/resolve?path=blog/massage-da-nong-la-gi
category post
/v1/hans-spa/resolve?path=aroma-massage
/v1/hans-spa/resolve?path=massage
/v1/hans-spa/resolve?path=massage/body-massage
get category child
//blog
/v1/hans-spa/resolve?path=blog/massage
/v1/hans-spa/resolve?path=blog
/v1/hans-spa/resolve?path=blog/massage-da-nong-la-gi
//service
/v1/hans-spa/resolve?path=massage
/v1/hans-spa/resolve?path=massage/body-massage
/v1/hans-spa/resolve?path=massage/foot-massage
Mô tả : https://docs.google.com/spreadsheets/d/1jX7PPKl5R2VPGBc0P3TwaEOZ5H1exWBBW-E2_vdf9n4/edit?gid=0#gid=0