create table user (
id bigint not null auto_increment primary key,
name varchar(50) not null,
username varchar(100) not null,
password varchar(100) not null,
phone_number varchar(20) not null,
address varchar(50) not null,
detail_address varchar(50) not null,
zipcode varchar(20) not null,
reg_date datetime not null default CURRENT_TIMESTAMP,
is_email_verified int default 0
);
create table goods (
id bigint not null auto_increment primary key,
name varchar(50) not null,
categoryId bigint not null,
price int not null,
stock int not null,
description varchar(255) null,
imgUrl varchar(255) null,
reg_date datetime not null default CURRENT_TIMESTAMP
);
create table goods_category (
id bigint not null auto_increment primary key,
name varchar(50) not null,
categoryIdRef bigint null,
foreign key(categoryIdRef) references goods_category(id)
);
alter table goods add constraint fk_goods_category foreign key (categoryId) references goods_category(id);
@Getter
@Setter
public class UserVO {
private Long id;
private String username;
private String password;
private String name;
private String phoneNumber;
private String address;
private String detailAddress;
private String zipcode;
private Timestamp regDate;
private Integer isEmailVerified;
}
@Getter
@Setter
public class GoodsVO {
private Long id;
private String name;
private Long categoryId;
private int price;
private int stock;
private String description;
private String imgUrl;
private Timestamp regDate;
}
@Getter
@Setter
public class GoodsCategoryVO {
private Long id;
private String name;
private Long categoryIdRef;
private int level;
}