Prechádzať zdrojové kódy

常规提交2024-04-30

Administrator 2 rokov pred
rodič
commit
5162c4d241
3 zmenil súbory, kde vykonal 107 pridanie a 3 odobranie
  1. 89 3
      file/virtual_mall.sql
  2. 2 0
      router/FileRouter.go
  3. 16 0
      router/OrderRouter.go

+ 89 - 3
file/virtual_mall.sql

@@ -23,12 +23,16 @@ DROP TABLE IF EXISTS `artice`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
 /*!40101 SET character_set_client = utf8 */;
 CREATE TABLE `artice` (
 CREATE TABLE `artice` (
-  `id` int(11) NOT NULL COMMENT 'id',
+  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
   `article_title` varchar(255) DEFAULT NULL COMMENT '文章名称',
   `article_title` varchar(255) DEFAULT NULL COMMENT '文章名称',
   `artice_content` longblob COMMENT '文章内容',
   `artice_content` longblob COMMENT '文章内容',
   `state` varchar(255) DEFAULT NULL COMMENT '状态',
   `state` varchar(255) DEFAULT NULL COMMENT '状态',
+  `artice_tag_ids` varchar(255) DEFAULT NULL COMMENT '文章标签',
+  `artice_topic_id` int(11) DEFAULT NULL COMMENT '文章主题id',
   `image` varchar(255) DEFAULT NULL COMMENT '图片',
   `image` varchar(255) DEFAULT NULL COMMENT '图片',
   `publish_time` datetime DEFAULT NULL COMMENT '发表时间',
   `publish_time` datetime DEFAULT NULL COMMENT '发表时间',
+  `eye_fill` int(11) DEFAULT NULL COMMENT '浏览量',
+  `like_count` int(255) DEFAULT NULL COMMENT '点赞量',
   `create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
   `create_by` varchar(255) DEFAULT NULL COMMENT '创建人',
   `create_time` datetime DEFAULT NULL COMMENT '创建时间',
   `create_time` datetime DEFAULT NULL COMMENT '创建时间',
   `update_by` varchar(255) DEFAULT NULL COMMENT '更新人',
   `update_by` varchar(255) DEFAULT NULL COMMENT '更新人',
@@ -46,6 +50,55 @@ LOCK TABLES `artice` WRITE;
 /*!40000 ALTER TABLE `artice` ENABLE KEYS */;
 /*!40000 ALTER TABLE `artice` ENABLE KEYS */;
 UNLOCK TABLES;
 UNLOCK TABLES;
 
 
+--
+-- Table structure for table `artice_tag`
+--
+
+DROP TABLE IF EXISTS `artice_tag`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `artice_tag` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `tag_name` varchar(255) DEFAULT NULL COMMENT '标签名',
+  `tag_desc` varchar(255) DEFAULT NULL COMMENT '标签描述',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `artice_tag`
+--
+
+LOCK TABLES `artice_tag` WRITE;
+/*!40000 ALTER TABLE `artice_tag` DISABLE KEYS */;
+/*!40000 ALTER TABLE `artice_tag` ENABLE KEYS */;
+UNLOCK TABLES;
+
+--
+-- Table structure for table `artice_topic`
+--
+
+DROP TABLE IF EXISTS `artice_topic`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `artice_topic` (
+  `id` int(11) NOT NULL,
+  `image` varchar(255) NOT NULL COMMENT '图片',
+  `topic_name` varchar(255) DEFAULT NULL COMMENT '主题名称',
+  `topic_desc` varchar(255) DEFAULT NULL COMMENT '主题描述',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `artice_topic`
+--
+
+LOCK TABLES `artice_topic` WRITE;
+/*!40000 ALTER TABLE `artice_topic` DISABLE KEYS */;
+/*!40000 ALTER TABLE `artice_topic` ENABLE KEYS */;
+UNLOCK TABLES;
+
 --
 --
 -- Table structure for table `authority`
 -- Table structure for table `authority`
 --
 --
@@ -223,13 +276,15 @@ DROP TABLE IF EXISTS `goods_order`;
 /*!40101 SET character_set_client = utf8 */;
 /*!40101 SET character_set_client = utf8 */;
 CREATE TABLE `goods_order` (
 CREATE TABLE `goods_order` (
   `id` int(11) NOT NULL COMMENT 'id',
   `id` int(11) NOT NULL COMMENT 'id',
-  `create_by` int(255) DEFAULT NULL COMMENT '用户id',
   `order_name` varchar(255) DEFAULT NULL COMMENT '订单名',
   `order_name` varchar(255) DEFAULT NULL COMMENT '订单名',
   `sku_id` int(11) DEFAULT NULL COMMENT 'skuid',
   `sku_id` int(11) DEFAULT NULL COMMENT 'skuid',
   `count` int(11) DEFAULT NULL COMMENT '购买数量',
   `count` int(11) DEFAULT NULL COMMENT '购买数量',
   `price` decimal(10,2) DEFAULT NULL COMMENT '单价',
   `price` decimal(10,2) DEFAULT NULL COMMENT '单价',
   `total_price` decimal(10,2) DEFAULT NULL COMMENT '总价',
   `total_price` decimal(10,2) DEFAULT NULL COMMENT '总价',
+  `contact_information` varchar(255) DEFAULT NULL COMMENT '联系方式',
   `coupon_user_id` int(11) DEFAULT NULL COMMENT '使用的优惠券',
   `coupon_user_id` int(11) DEFAULT NULL COMMENT '使用的优惠券',
+  `create_by` int(255) DEFAULT NULL COMMENT '用户id',
+  `create_time` datetime DEFAULT NULL COMMENT '订单创建时间',
   PRIMARY KEY (`id`)
   PRIMARY KEY (`id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 /*!40101 SET character_set_client = @saved_cs_client */;
 /*!40101 SET character_set_client = @saved_cs_client */;
@@ -275,6 +330,37 @@ INSERT INTO `goods_sku` VALUES (1,'/api/static/20240423094145微信图片_202404
 /*!40000 ALTER TABLE `goods_sku` ENABLE KEYS */;
 /*!40000 ALTER TABLE `goods_sku` ENABLE KEYS */;
 UNLOCK TABLES;
 UNLOCK TABLES;
 
 
+--
+-- Table structure for table `goods_sku_card`
+--
+
+DROP TABLE IF EXISTS `goods_sku_card`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `goods_sku_card` (
+  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'id',
+  `card_name` varchar(255) DEFAULT NULL COMMENT '卡种名称',
+  `state` varchar(255) DEFAULT NULL COMMENT '状态,0未使用,1已用,2过期',
+  `count` int(11) DEFAULT NULL COMMENT '库存',
+  `total_count` varchar(255) DEFAULT NULL COMMENT '总数',
+  `card_key` varchar(255) DEFAULT NULL COMMENT '卡密',
+  `use` varchar(5) DEFAULT NULL COMMENT '是否已用',
+  `upload_time` datetime DEFAULT NULL COMMENT '入库时间',
+  `sku_id` int(11) DEFAULT NULL COMMENT '商品规格绑定',
+  `sort` varchar(255) DEFAULT NULL COMMENT '排序,出售优先级',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
+-- Dumping data for table `goods_sku_card`
+--
+
+LOCK TABLES `goods_sku_card` WRITE;
+/*!40000 ALTER TABLE `goods_sku_card` DISABLE KEYS */;
+/*!40000 ALTER TABLE `goods_sku_card` ENABLE KEYS */;
+UNLOCK TABLES;
+
 --
 --
 -- Table structure for table `goods_tag`
 -- Table structure for table `goods_tag`
 --
 --
@@ -475,4 +561,4 @@ UNLOCK TABLES;
 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
 
 
--- Dump completed on 2024-04-29 17:15:57
+-- Dump completed on 2024-04-30 16:55:24

+ 2 - 0
router/FileRouter.go

@@ -14,6 +14,7 @@ var (
 )
 )
 
 
 func FileRouter(engine *gin.RouterGroup) {
 func FileRouter(engine *gin.RouterGroup) {
+	//文件静态资源
 	engine.StaticFS("/static", http.Dir("file/resources"))
 	engine.StaticFS("/static", http.Dir("file/resources"))
 	user := engine.Group("/file")
 	user := engine.Group("/file")
 	{
 	{
@@ -21,6 +22,7 @@ func FileRouter(engine *gin.RouterGroup) {
 	}
 	}
 }
 }
 
 
+// 文件上传
 func uploadHandler(c *gin.Context) {
 func uploadHandler(c *gin.Context) {
 	header, err := c.FormFile("file")
 	header, err := c.FormFile("file")
 	fmt.Println("header", header.Size)
 	fmt.Println("header", header.Size)

+ 16 - 0
router/OrderRouter.go

@@ -0,0 +1,16 @@
+package router
+
+import "github.com/gin-gonic/gin"
+
+func OrderRouter(engine *gin.RouterGroup) {
+	order := engine.Group("/order")
+	{
+		order.GET("/get", GetOrderData)
+	}
+}
+
+//创建订单
+
+//支付回调模拟
+
+//订单详情