1. 程式人生 > >spring boot 微信點餐 (一)模組及架構介紹

spring boot 微信點餐 (一)模組及架構介紹

1、專案架構

2系統演進


3、兩大微服務架構


4、專案表結構關係


5、建表語句(基於oracel)

-- Create table
create table PRODUCT_INFO
(
  product_id          VARCHAR2(32) not null,
  product_name        VARCHAR2(64) not null,
  product_price       NUMBER(10,2),
  product_stock       NUMBER(10),
  product_description VARCHAR2(64),
  product_icon        VARCHAR2(512),
  catagory_type       NUMBER(10),
  create_time         TIMESTAMP(6) default sysdate,
  update_time         TIMESTAMP(6)
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255;
-- Add comments to the columns 
comment on column PRODUCT_INFO.product_name
  is '商品名稱';
comment on column PRODUCT_INFO.product_price
  is '商品單價';
comment on column PRODUCT_INFO.product_stock
  is '庫存';
comment on column PRODUCT_INFO.product_description
  is '描述';
comment on column PRODUCT_INFO.product_icon
  is '小圖';
comment on column PRODUCT_INFO.catagory_type
  is '編號類目';
comment on column PRODUCT_INFO.create_time
  is '建立時間';
comment on column PRODUCT_INFO.update_time
  is '更新時間';
-- Create/Recreate primary, unique and foreign key constraints 
alter table PRODUCT_INFO
  add constraint PK_ID primary key (PRODUCT_ID)
  using index 
  tablespace USERS
  pctfree 10
  initrans 2

  maxtrans 255;

-- Create table
create table PRODUCT_CATAGORY
(
  catagory_id   NUMBER not null,
  catagory_name NVARCHAR2(64),
  catagory_type NUMBER,
  create_time   TIMESTAMP(6),
  update_time   TIMESTAMP(6)
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255;
-- Add comments to the table 
comment on table PRODUCT_CATAGORY
  is '類目表';
-- Add comments to the columns 
comment on column PRODUCT_CATAGORY.catagory_name
  is 'l類目名稱';
comment on column PRODUCT_CATAGORY.catagory_type
  is '類目編號';
comment on column PRODUCT_CATAGORY.create_time
  is '建立時間';
comment on column PRODUCT_CATAGORY.update_time
  is '修改時間';
-- Create/Recreate primary, unique and foreign key constraints 
alter table PRODUCT_CATAGORY
  add constraint PC_ID primary key (CATAGORY_ID)
  using index 
  tablespace USERS
  pctfree 10
  initrans 2

  maxtrans 255;

-- Create table
create table ORDER_MASTER
(
  order_id      NVARCHAR2(32) not null,
  buyer_name    NVARCHAR2(32),
  buyer_phone   NVARCHAR2(32),
  buyer_address NVARCHAR2(128),
  buyer_openid  NVARCHAR2(64) not null,
  order_amount  NUMBER(10,2),
  order_status  CHAR(2) default '0',
  pay_status    CHAR(2) default '0',
  create_time   TIMESTAMP(6) default sysdate,
  update_time   TIMESTAMP(6)
)
tablespace USERS
  pctfree 10
  initrans 1
  maxtrans 255;
-- Add comments to the columns 
comment on column ORDER_MASTER.buyer_name
  is '買家名字
';
comment on column ORDER_MASTER.buyer_phone
  is '買家電話';
comment on column ORDER_MASTER.buyer_address
  is '買家地址';
comment on column ORDER_MASTER.buyer_openid
  is '買家微信openid
';
comment on column ORDER_MASTER.order_amount
  is '訂單總金額';
comment on column ORDER_MASTER.order_status
  is '訂單訂單狀態(‘0’新下單)
';
comment on column ORDER_MASTER.pay_status
  is '支付狀態(‘0’未支付)
';
-- Create/Recreate primary, unique and foreign key constraints 
alter table ORDER_MASTER
  add constraint OM_ID primary key (ORDER_ID, BUYER_OPENID)
  using index 
  tablespace USERS
  pctfree 10
  initrans 2
  maxtrans 255;