Project

General

Profile

Actions

Feature #60

open

Feature #56: CATEGORY POST PRODUCT

[api] xây dựng api cho lấy breadcrum, bài category post, blog post

Added by Redmine Admin 17 days ago. Updated 13 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Start date:
01/30/2026
Due date:
% Done:

0%

Estimated time:

Description

1. Cách lấy breadcrum cho bài post
Dựa vào column nameparent_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)

Actions #1

Updated by Redmine Admin 17 days ago

2. Cách lấy bài post
Bài post sẽ chia ra 2 loại

  1. category post
  2. 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)

Actions #2

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

Actions #3

Updated by Redmine Admin 17 days ago

  • Assignee set to KhoaBE Nguyen
Actions #4

Updated by Redmine Admin 13 days ago

  • Status changed from New to In Progress
Actions #5

Updated by KhoaBE Nguyen 13 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

Actions

Also available in: Atom PDF