Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- C# SELCT
- 리눅스 마스터 1급 합격 후기
- 리눅스마스터 1급 실기
- Vue.js
- 웹 구현
- 산업제어시스템 보안
- 웹 앱 만드는법
- 데이터베이스 생성 예제
- 제어시스템 보안
- node.js
- mysql 기초문법
- 정보처리기능사
- 산업제어시스템
- html
- MySQL
- C# 문법 기초
- 프론트엔드
- C#\
- 백엔드
- 웹 앱 개발
- 리눅스마스터
- 리눅스 마스터 1급 실기
- C# SELECT 문
- 리눅스마스터 1급 필기
- c#
- 리눅스 마스터 2급 실기
- C# 문법
- 리눅스 마스터 1급 필기
- 웹앱 구현
- 웹 개발
Archives
- Today
- Total
보안 루피
node.js 를 이용한 웹 앱 구현 - 백엔드 구축 (2), sql.js 본문
const { query } = require("express")
module.exports ={
productList: { //Productlist : 상품 리스트 가져오는 쿼리
query : 'select t1.*, t2.path, t3.category1, t3.category2, t3.category3 from t_product t1, t_image t2, t_category t3 where t1.id = t2.product_id and t2.type =1 and t1.category_id =t3.id'
},
productDetail:{
query : 'select t1.*, t2.path, t3.category1, t3.category2, t3.category3 from t_product t1, t_image t2, t_category t3 where t1.id =? and t1.id = t2.product_id and t2.type=3 and t1.category_id=t3.id'
}, //상품 상세정보 가져오는 쿼리
productMainImage: { //상품 사진들 (썸네일 X)
query : 'select * from t_image where product_id =? and type =2'
},
sellerList: {
query: 'select * from t_seller'
},
productInsert: { //로그인한 사용자만 이 쿼리 가능, 쿼리안에서 로그인했는지 체크 코드 추가해야됨
query: 'INSERT INTO `dev_class`.`t_product` (`id`, `product_name`, `product_price`, `delivery_price`, `add_delivery`, `tags`, `outbound_days`, `created_date`, `seller_id`, `category_id`) VALUES (?, ?, ?, ?, ?, ?, ?, ? ,?)'
},
productImageInsert: {
query: 'insert into t_image (product_id,type,path) values (?,?,?)'
},
sellerList : {
query: 'select 8 from t_seller'
},
signUp:{
query:'insert into t_user set ? on duplicate key update ?'
}
}
//product_create.html 쿼리
sql.js 파일을 따로 생성후 DB 로 넘겨질 sql문 작성
'웹 > node.js' 카테고리의 다른 글
node.js 를 이용한 웹 앱 구현 - 백엔드 구축 (2), 라우터 설정 /router/index.js (0) | 2023.11.26 |
---|---|
node.js 를 이용한 웹 앱 구현 - 백엔드 구축 (2), store.js (1) | 2023.11.26 |
node.js 를 이용한 웹 앱 구현 - 백엔드 구축 (2), mixin.js (axios) (1) | 2023.11.26 |
node.js 를 이용한 웹 앱 구현 - 백엔드 구축 (2), index.js (2) | 2023.11.26 |
node.js 를 이용한 웹 앱 구현 - 백엔드 구축 (1), app.js (0) | 2023.11.26 |