删除没必要的文件

This commit is contained in:
eson 2023-06-19 10:14:44 +08:00
parent 038d2d36a4
commit 33c7d27b3b
238 changed files with 1 additions and 5907 deletions

View File

@ -1,20 +0,0 @@
-- fusentest.fs_address definition
CREATE TABLE `fs_address` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(10) unsigned NOT NULL COMMENT '用户ID',
`name` varchar(64) NOT NULL DEFAULT '' COMMENT '地址名称',
`first_name` varchar(64) NOT NULL COMMENT 'FirstName',
`last_name` varchar(64) NOT NULL COMMENT 'LastName',
`mobile` varchar(16) NOT NULL COMMENT '手机号码',
`street` varchar(128) NOT NULL COMMENT '街道',
`suite` varchar(128) NOT NULL COMMENT '房号',
`city` varchar(128) NOT NULL COMMENT '城市',
`state` varchar(128) NOT NULL COMMENT '州名',
`country` varchar(128) NOT NULL COMMENT '国家',
`zip_code` varchar(128) NOT NULL COMMENT '邮编',
`status` tinyint(1) NOT NULL COMMENT '1正常 0异常',
`is_default` tinyint(1) NOT NULL COMMENT '1默认地址0非默认地址',
PRIMARY KEY (`id`) USING BTREE,
KEY `user_id` (`user_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=129 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用户地址表';

View File

@ -1,14 +0,0 @@
-- fusentest.fs_canteen_product definition
CREATE TABLE `fs_canteen_product` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`canteen_type` int(10) NOT NULL DEFAULT '0' COMMENT '餐厅类别id',
`product_id` int(10) NOT NULL COMMENT '产品id',
`size_id` int(10) NOT NULL COMMENT '尺寸id',
`sort` tinyint(3) NOT NULL DEFAULT '0' COMMENT '排序',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态位 1启用0停用',
`ctime` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间',
`sid` varchar(50) NOT NULL DEFAULT '' COMMENT '前端带入的id',
PRIMARY KEY (`id`),
KEY `canteen_type` (`canteen_type`)
) ENGINE=MyISAM AUTO_INCREMENT=46 DEFAULT CHARSET=utf8 COMMENT='餐厅类别产品对应表';

View File

@ -1,10 +0,0 @@
-- fusentest.fs_canteen_type definition
CREATE TABLE `fs_canteen_type` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(50) NOT NULL DEFAULT '' COMMENT '餐厅名字',
`sort` smallint(6) NOT NULL DEFAULT '0' COMMENT '排序',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态位 1启用0停用',
`ctime` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=24 DEFAULT CHARSET=utf8 COMMENT='餐厅类型表';

View File

@ -1,29 +0,0 @@
-- fusentest.fs_cart definition
CREATE TABLE `fs_cart` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`user_id` int(10) unsigned DEFAULT NULL COMMENT '用户ID',
`product_id` int(10) unsigned NOT NULL COMMENT '产品ID',
`template_id` int(10) unsigned NOT NULL COMMENT '模板ID',
`price_id` int(10) unsigned NOT NULL COMMENT '价格ID',
`material_id` int(10) unsigned NOT NULL COMMENT '材质ID',
`size_id` int(10) unsigned NOT NULL COMMENT '尺寸ID',
`buy_num` int(10) unsigned NOT NULL COMMENT '购买数量',
`cover` varchar(128) NOT NULL COMMENT '截图',
`design_id` int(10) unsigned NOT NULL COMMENT '设计ID',
`ctime` int(10) unsigned DEFAULT NULL COMMENT '添加时间',
`status` tinyint(3) unsigned NOT NULL COMMENT '状态位',
`optional_id` int(11) NOT NULL DEFAULT '0' COMMENT '选项ID',
`is_check` int(11) NOT NULL COMMENT '是否选中状态0未选中1选中',
`ts_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`is_email` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否发送邮件',
PRIMARY KEY (`id`) USING BTREE,
KEY `user_id` (`user_id`) USING BTREE,
KEY `product_id` (`product_id`) USING BTREE,
KEY `template_id` (`template_id`) USING BTREE,
KEY `price_id` (`price_id`) USING BTREE,
KEY `material_id` (`material_id`) USING BTREE,
KEY `size_id` (`size_id`) USING BTREE,
KEY `design_id` (`design_id`) USING BTREE,
KEY `optional_id` (`optional_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=800 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='购物车';

View File

@ -1,13 +0,0 @@
-- fusentest.fs_faq definition
CREATE TABLE `fs_faq` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`tag_id` int(11) NOT NULL COMMENT '分类ID',
`tag_name` varchar(50) NOT NULL COMMENT '分类名称',
`title` varchar(64) NOT NULL COMMENT '标题',
`content` text COMMENT '内容',
`status` smallint(6) NOT NULL DEFAULT '0' COMMENT '状态(0:禁用1:启用)',
`sort` int(11) NOT NULL DEFAULT '1' COMMENT '排序',
`ctime` int(11) DEFAULT NULL COMMENT '添加时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='常见问题';

View File

@ -1,8 +0,0 @@
CREATE TABLE `fs_font` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`title` varchar(30) NOT NULL DEFAULT '' COMMENT '字体名字',
`linux_fontname` varchar(50) NOT NULL DEFAULT '' COMMENT 'linux对应字体名',
`file_path` varchar(100) NOT NULL DEFAULT '' COMMENT '字体文件路径',
`sort` tinyint(3) NOT NULL DEFAULT '0' COMMENT '排序',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=MyISAM AUTO_INCREMENT=38 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='字体配置';

View File

@ -1,17 +0,0 @@
-- fusentest.fs_guest definition
CREATE TABLE `fs_guest` (
`guest_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '游客ID',
`auth_key` varchar(512) NOT NULL DEFAULT '' COMMENT 'jwt token',
`status` tinyint(3) unsigned DEFAULT '1' COMMENT '1正常 0不正常',
`is_del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除 1删除',
`created_at` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间',
`updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
`is_open_render` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否打开个性化渲染1开启0关闭',
`is_thousand_face` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已经存在千人千面1存在0不存在',
`is_low_rendering` tinyint(1) unsigned zerofill NOT NULL DEFAULT '0' COMMENT '是否开启低渲染模型渲染',
`is_remove_bg` tinyint(1) NOT NULL DEFAULT '1' COMMENT '用户上传logo是否去除背景',
PRIMARY KEY (`guest_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='游客表';

View File

@ -1,12 +0,0 @@
-- fusentest.fs_map_library definition
CREATE TABLE `fs_map_library` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Id',
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '名称',
`info` text NOT NULL COMMENT '贴图数据',
`sort` smallint(5) NOT NULL DEFAULT '0' COMMENT '排序',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态 1启用',
`ctime` int(10) NOT NULL DEFAULT '0' COMMENT '创建时间',
`tag_id` int(10) NOT NULL DEFAULT '0' COMMENT '模板标签id',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='贴图库';

View File

@ -1,44 +0,0 @@
-- fusentest.fs_order definition
CREATE TABLE `fs_order` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sn` char(16) NOT NULL COMMENT '订单编号 FS211224OL2XDKNP',
`user_id` int(11) DEFAULT NULL COMMENT '用户ID',
`seller_user_id` int(11) DEFAULT NULL COMMENT '销售员ID 0:自主下单',
`total_amount` int(11) NOT NULL COMMENT '总价',
`payed_amount` int(11) NOT NULL COMMENT '已支付金额',
`pay_method` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付方式 1paypal 2strip',
`ctime` int(11) DEFAULT NULL COMMENT '添加时间',
`utime` int(11) DEFAULT NULL COMMENT '更新时间',
`ptime` int(11) DEFAULT NULL COMMENT '最后一次 支付时间(可能多次支付)',
`address_id` int(11) NOT NULL COMMENT '地址ID或者云仓ID',
`delivery_method` int(11) NOT NULL COMMENT '配送方式 1:直接发货到收获地址 2云仓',
`customer_mark` varchar(255) DEFAULT NULL COMMENT '客户备注',
`mark` text COMMENT '后台订单备注',
`address_info` text COMMENT '详细地址信息JSON',
`is_sup` tinyint(1) NOT NULL DEFAULT '0' COMMENT '0不是补货 1是补货',
`status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '状态位0未支付1部分支付2支付完成3部分生产4部分生产完成5全部生产6全部生产完成7部分发货8发货完成9完成订单10取消订单11:退款中12退款完成13:订单已删除14:订单已关闭)',
`is_part_pay` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否部分支付01',
`is_pay_completed` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否支付完成01',
`is_part_product` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否部分生产01',
`is_part_product_completed` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否部分生产完成01',
`is_all_product` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否全部生产01',
`is_all_product_completed` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否全部生产完成01',
`is_part_delivery` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否部分发货01',
`is_delivery_completed` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否发货完成01',
`is_complated` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否完成订单01',
`is_cancel` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否取消订单01',
`is_refunding` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否退款中01',
`is_refunded` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否退款完成01',
`is_deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否删除01',
`refund_reason_id` tinyint(4) DEFAULT NULL COMMENT '取消订单原因ID',
`refund_reason` varchar(255) DEFAULT NULL COMMENT '取消订单原因',
`ts_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`is_sure` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否确认订单 1确认0未确认',
`deliver_sn` varchar(50) NOT NULL DEFAULT '' COMMENT '发货单号',
`email_time` int(11) NOT NULL DEFAULT '0' COMMENT '邮件发送时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `sn` (`sn`) USING BTREE,
KEY `user_id` (`user_id`) USING BTREE,
KEY `address_id` (`address_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=691 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

View File

@ -1,32 +0,0 @@
-- fusentest.fs_order_detail definition
CREATE TABLE `fs_order_detail` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sn` char(32) NOT NULL COMMENT '唯一编码',
`order_id` int(11) NOT NULL COMMENT '订单ID',
`user_id` int(11) DEFAULT NULL COMMENT '用户ID',
`factory_id` smallint(6) DEFAULT '0' COMMENT '工厂ID',
`order_detail_template_id` int(11) NOT NULL COMMENT '详情templateID',
`product_id` int(11) NOT NULL COMMENT '产品ID',
`buy_num` int(11) NOT NULL COMMENT '购买数量',
`push_num` int(11) NOT NULL COMMENT '已发数量',
`amount` int(11) NOT NULL COMMENT '单价',
`cover` varchar(128) NOT NULL COMMENT '截图',
`ctime` int(11) NOT NULL COMMENT '添加时间',
`status` tinyint(4) NOT NULL COMMENT '状态位 是否推送到厂家 是否生产完成 是否发货完成',
`optional_id` int(11) NOT NULL DEFAULT '0' COMMENT '选项ID',
`optional_title` varchar(64) NOT NULL COMMENT '选项名称',
`option_price` int(11) NOT NULL DEFAULT '0' COMMENT '配件价格',
`is_tofactory` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否推送到工厂',
`is_product` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否生产中',
`is_product_completion` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否生产完成',
`is_cloud` tinyint(1) NOT NULL COMMENT '是否是云仓订单',
`is_tocloud` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已发云仓(云仓单要发货到云仓,直接发到用户的不需要发到云仓)',
`is_deliver` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已发货',
`is_end` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否完成订单(签收)',
`cart_id` int(10) NOT NULL DEFAULT '0' COMMENT '购物车编号',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `sn` (`sn`) USING BTREE,
KEY `order_id` (`order_id`) USING BTREE,
KEY `cart_id` (`cart_id`)
) ENGINE=InnoDB AUTO_INCREMENT=1049 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='订单详细表';

View File

@ -1,22 +0,0 @@
-- fusentest.fs_order_detail_template definition
CREATE TABLE `fs_order_detail_template` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sn` char(32) NOT NULL COMMENT '唯一编码',
`product_id` int(11) NOT NULL COMMENT '产品ID',
`model_id` int(11) NOT NULL DEFAULT '0' COMMENT '模型ID',
`template_id` int(11) NOT NULL COMMENT '模板ID',
`material_id` int(11) NOT NULL COMMENT '材质id',
`size_id` int(11) NOT NULL COMMENT '尺寸id',
`each_box_num` int(11) NOT NULL COMMENT '每一箱的个数',
`each_box_weight` decimal(10,2) DEFAULT '0.00' COMMENT '每一箱的重量 单位KG',
`design_id` int(11) NOT NULL COMMENT '设计ID',
`ctime` int(11) DEFAULT NULL COMMENT '添加时间',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `sn` (`sn`) USING BTREE,
KEY `product_id` (`product_id`) USING BTREE,
KEY `template_id` (`template_id`) USING BTREE,
KEY `material_id` (`material_id`) USING BTREE,
KEY `size_id` (`size_id`) USING BTREE,
KEY `design_id` (`design_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=934 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='订单模板详细表';

View File

@ -1,22 +0,0 @@
-- fusentest.fs_pay definition
CREATE TABLE `fs_pay` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL COMMENT '用户id',
`order_number` varchar(255) NOT NULL COMMENT '订单编号',
`trade_no` varchar(255) NOT NULL DEFAULT '' COMMENT '第三方支付编号',
`pay_amount` int(11) NOT NULL COMMENT '支付金额 (分)',
`pay_status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '支付状态 0 不成功 1 成功',
`is_refund` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否退款 0 未退款 1退款',
`payment_method` tinyint(1) NOT NULL COMMENT '支付方式 1 stripe 2 paypal',
`pay_stage` tinyint(1) DEFAULT '0' COMMENT '支付阶段 1首付 2尾款',
`order_source` tinyint(1) NOT NULL DEFAULT '1' COMMENT '订单来源 1pc',
`pay_time` int(11) DEFAULT NULL COMMENT '支付时间',
`created_at` int(11) NOT NULL COMMENT '创建时间',
`updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
`card_no` char(10) NOT NULL DEFAULT '' COMMENT '卡后4位',
`brand` char(20) NOT NULL DEFAULT '' COMMENT '银行品牌',
PRIMARY KEY (`id`) USING BTREE,
KEY `user_id` (`user_id`) USING BTREE,
KEY `trade_no` (`trade_no`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=778 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='支付记录';

View File

@ -1,35 +0,0 @@
-- fusentest.fs_product definition
CREATE TABLE `fs_product` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sn` char(8) NOT NULL COMMENT '商品编号 P98f087j',
`type` tinyint(4) NOT NULL COMMENT '分类ID',
`title` varchar(64) NOT NULL COMMENT '名称',
`title_cn` varchar(64) NOT NULL COMMENT '中文名称',
`cover` varchar(128) NOT NULL COMMENT '封面图',
`imgs` text NOT NULL COMMENT '一个或多个介绍图或视频',
`keywords` varchar(128) NOT NULL COMMENT '关键字',
`intro` text COMMENT '简要描述',
`sort` smallint(6) DEFAULT '0' COMMENT '排序',
`selled_num` int(11) DEFAULT '0' COMMENT '已卖数量',
`ctime` int(11) DEFAULT NULL COMMENT '添加时间',
`view` int(11) DEFAULT '0' COMMENT '浏览量',
`size_ids` varchar(128) DEFAULT NULL COMMENT '尺寸 1,2,3,4',
`material_ids` varchar(128) NOT NULL DEFAULT '' COMMENT '材质 1,2,3',
`tag_ids` varchar(128) DEFAULT NULL COMMENT '标签 逗号间隔',
`status` tinyint(4) DEFAULT '0' COMMENT '状态位 弃用',
`produce_days` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '生产天数',
`delivery_days` mediumint(8) unsigned NOT NULL DEFAULT '0' COMMENT '运送天数',
`cover_img` varchar(128) NOT NULL DEFAULT '' COMMENT '背景图',
`is_shelf` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否上架',
`is_recommend` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否推荐',
`is_hot` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否热销',
`is_protection` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否环保',
`is_microwave` tinyint(1) NOT NULL DEFAULT '1' COMMENT '是否可微波炉',
`is_del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除',
`recommend_product` varchar(500) DEFAULT NULL COMMENT '推荐产品id例如: 1,3,4,5',
`recommend_product_sort` varchar(500) DEFAULT NULL COMMENT '推荐排序例如:1324',
`scene_ids` varchar(500) DEFAULT NULL COMMENT '关联的场景id',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `sn` (`sn`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=60 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品表';

View File

@ -1,28 +0,0 @@
-- fusentest.fs_product_design definition
CREATE TABLE `fs_product_design` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sn` char(8) NOT NULL COMMENT '唯一标识',
`user_id` int(11) NOT NULL COMMENT '用户ID',
`product_id` int(11) NOT NULL COMMENT '产品ID',
`template_id` int(11) NOT NULL COMMENT '模型ID',
`material_id` int(11) NOT NULL COMMENT '材质ID',
`size_id` int(11) NOT NULL COMMENT '尺寸ID',
`optional_id` int(11) NOT NULL DEFAULT '0' COMMENT '选项ID',
`cover` varchar(128) NOT NULL COMMENT '封面图',
`info` text COMMENT '保留的设计信息',
`utime` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '状态',
`is_del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除 0未删除 1删除',
`is_pay` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已有支付 0 未 1 有',
`logo_color` text COMMENT 'logo图片备选项',
`page_guid` varchar(50) NOT NULL DEFAULT '' COMMENT '页面识别id',
PRIMARY KEY (`id`) USING BTREE,
KEY `sn` (`sn`) USING BTREE,
KEY `user_id` (`user_id`) USING BTREE,
KEY `product_id` (`product_id`) USING BTREE,
KEY `template_id` (`template_id`) USING BTREE,
KEY `material_id` (`material_id`) USING BTREE,
KEY `size_id` (`size_id`) USING BTREE,
KEY `optional_id` (`optional_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=727 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品设计表';

View File

@ -1,24 +0,0 @@
-- fusentest.fs_product_model definition
CREATE TABLE `fs_product_model3d` (
`id` int(10) NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned DEFAULT NULL COMMENT '产品ID',
`tag` tinyint(1) NOT NULL DEFAULT '1' COMMENT '类别1模型2配件3场景',
`title` varchar(255) NOT NULL COMMENT '标题',
`name` varchar(255) DEFAULT '' COMMENT '详情页展示名称',
`model_info` varchar(3000) NOT NULL COMMENT '模型详情',
`material_id` tinyint(3) unsigned NOT NULL COMMENT '材质ID',
`size_id` int(10) unsigned NOT NULL COMMENT '尺寸ID',
`sort` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
`light` int(10) DEFAULT NULL COMMENT '灯光组',
`light_list` varchar(255) DEFAULT NULL COMMENT '灯光备选项',
`part_id` int(10) DEFAULT NULL COMMENT '配件选项id配件就是模型的id',
`part_list` varchar(255) DEFAULT NULL COMMENT '配件备选项',
`status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态位 显示 删除',
`ctime` int(10) unsigned NOT NULL COMMENT '添加时间',
`option_template` int(10) DEFAULT NULL COMMENT '配件绑定的公共模板',
`price` int(10) NOT NULL DEFAULT '0' COMMENT '仅配件用,配件的价格, 单位:美分',
`sku` varchar(255) NOT NULL DEFAULT '' COMMENT 'sku',
PRIMARY KEY (`id`) USING BTREE,
KEY `product_id` (`product_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=215 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品模型表';

View File

@ -1,10 +0,0 @@
-- fusentest.fs_product_model3d_light definition
CREATE TABLE `fs_product_model3d_light` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL COMMENT '灯光名称',
`info` text NOT NULL COMMENT '灯光数据json格式',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态值1显示0删除',
`ctime` int(11) DEFAULT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=58 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='模型-灯光组表';

View File

@ -1,22 +0,0 @@
-- fusentest.fs_product_price definition
CREATE TABLE `fs_product_price` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`sn` char(8) NOT NULL COMMENT '唯一编码',
`title` varchar(255) NOT NULL COMMENT '标题描述',
`product_id` int(11) NOT NULL COMMENT '产品ID',
`material_id` int(11) NOT NULL COMMENT '材质ID',
`size_id` int(11) NOT NULL COMMENT '尺寸ID',
`each_box_num` int(11) NOT NULL COMMENT '每一箱的个数',
`each_box_weight` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '每一箱的重量 单位KG',
`min_buy_num` int(11) NOT NULL COMMENT '最少购买量',
`step_num` varchar(255) NOT NULL COMMENT '数量阶梯 eg:10,20,30',
`step_price` varchar(255) NOT NULL COMMENT '价格阶梯 eg:100,50,25',
`status` int(11) DEFAULT '1' COMMENT '是否可用',
`is_default` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否默认',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `fields_index` (`product_id`,`material_id`,`size_id`) USING BTREE,
KEY `product_id` (`product_id`) USING BTREE,
KEY `material_id` (`material_id`) USING BTREE,
KEY `size_id` (`size_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=103 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='阶梯价格表';

View File

@ -1,16 +0,0 @@
-- fusentest.fs_product_size definition
CREATE TABLE `fs_product_size` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL COMMENT '产品ID',
`title` text NOT NULL COMMENT '标题 10*10*20',
`cover` varchar(255) DEFAULT NULL COMMENT '封面图',
`cover_img` varchar(255) DEFAULT NULL COMMENT '背景图',
`capacity` varchar(255) NOT NULL COMMENT '自己填的尺寸名称',
`status` tinyint(3) unsigned NOT NULL DEFAULT '0' COMMENT '状态位 显示 删除',
`sort` smallint(6) NOT NULL DEFAULT '50' COMMENT '排序',
`remark` varchar(255) DEFAULT NULL COMMENT '备注信息',
`parts_can_deleted` tinyint(1) NOT NULL DEFAULT '1' COMMENT '配件是否可移除 1是0否',
PRIMARY KEY (`id`) USING BTREE,
KEY `product_id` (`product_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=130 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品尺寸表';

View File

@ -1,9 +0,0 @@
-- fusentest.fs_product_template_tags definition
CREATE TABLE `fs_product_template_tags` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`title` varchar(25) NOT NULL COMMENT '标题',
`status` tinyint(1) unsigned NOT NULL COMMENT '状态 1可用',
`create_at` int(10) unsigned NOT NULL COMMENT '创建时间',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT=' 模板标签表';

View File

@ -1,22 +0,0 @@
-- fusentest.fs_product_template_v2 definition
CREATE TABLE `fs_product_template_v2` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL COMMENT '产品ID',
`model_id` int(11) NOT NULL COMMENT '模型ID',
`title` varchar(255) NOT NULL DEFAULT '' COMMENT '模板sku,预留字段',
`name` varchar(255) NOT NULL DEFAULT '' COMMENT '名称',
`cover_img` varchar(255) DEFAULT NULL COMMENT '模板背景图',
`template_info` text NOT NULL COMMENT '模板详情',
`material_img` varchar(255) DEFAULT NULL COMMENT '合成好的贴图',
`sort` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT '排序',
`logo_width` int(10) NOT NULL DEFAULT '0' COMMENT 'logo图最大宽度',
`logo_height` int(10) NOT NULL DEFAULT '0' COMMENT 'logo图最大高度',
`is_public` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否可公用1:可以0不可以',
`status` tinyint(1) unsigned NOT NULL DEFAULT '0' COMMENT '状态1正常 2异常',
`ctime` int(10) unsigned NOT NULL COMMENT '添加时间',
`tag` varchar(255) NOT NULL COMMENT '标签(用户自填)',
`is_del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除 1删除',
PRIMARY KEY (`id`) USING BTREE,
KEY `product_id` (`product_id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=463 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品-模型-模板表';

View File

@ -1,17 +0,0 @@
-- fusentest.fs_qrcode_set definition
CREATE TABLE `fs_qrcode_set` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'id',
`name` varchar(25) NOT NULL DEFAULT '' COMMENT '二维码组件名称',
`size` smallint(6) NOT NULL DEFAULT '0' COMMENT '二维码内容尺寸',
`index_x` smallint(6) NOT NULL DEFAULT '0' COMMENT 'x偏移量',
`index_y` smallint(6) NOT NULL DEFAULT '0' COMMENT 'y偏移量',
`svg_website` text COMMENT 'website d数据',
`svg_instagram` text COMMENT 'svg instagram d数据',
`svg_facebook` text COMMENT 'svg facebook d数据',
`status` tinyint(1) NOT NULL DEFAULT '0' COMMENT '状态',
`admin_id` int(10) NOT NULL DEFAULT '0' COMMENT '操作人',
`ctime` int(10) NOT NULL DEFAULT '0' COMMENT '添加时间',
`utime` int(10) NOT NULL DEFAULT '0' COMMENT '更新时间',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='二维码边框配置表';

View File

@ -1,10 +0,0 @@
-- fusentest.fs_standard_logo definition
CREATE TABLE `fs_standard_logo` (
`id` int(10) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`name` varchar(20) CHARACTER SET utf8mb4 NOT NULL COMMENT 'logo名称',
`image` varchar(255) CHARACTER SET utf8mb4 NOT NULL COMMENT '图片地址',
`ctime` int(10) NOT NULL DEFAULT '0' COMMENT '添加时间',
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态 1正常 0删除',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='标准logo';

View File

@ -1,16 +0,0 @@
-- fusentest.fs_tags definition
CREATE TABLE `fs_tags` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ID',
`title` varchar(32) NOT NULL COMMENT '标题',
`level` int(10) unsigned NOT NULL COMMENT '层级、分类 1 => 二维码分类',
`click_num` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '点击次数',
`sort` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '排序(从大到小)',
`create_at` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
`icon` varchar(200) DEFAULT NULL COMMENT '标签图标',
`status` tinyint(3) unsigned NOT NULL DEFAULT '1' COMMENT '状态 1可用',
`description` varchar(255) NOT NULL DEFAULT '' COMMENT '介绍 Seo',
`recommend_product` varchar(255) DEFAULT NULL COMMENT '推荐产品id例如: 1,3,4,5',
`recommend_product_sort` varchar(255) DEFAULT NULL COMMENT '推荐排序例如:1324',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=40 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='产品分类表';

View File

@ -1,34 +0,0 @@
-- fusentest.fs_user definition
CREATE TABLE `fs_user` (
`id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'ID',
`face_id` bigint(20) NOT NULL DEFAULT '0' COMMENT 'facebook的userid',
`sub` bigint(20) NOT NULL DEFAULT '0' COMMENT 'google的sub',
`first_name` varchar(64) DEFAULT NULL COMMENT 'FirstName',
`last_name` varchar(64) DEFAULT NULL COMMENT 'LastName',
`username` varchar(255) DEFAULT NULL COMMENT '用户名',
`company` varchar(64) DEFAULT NULL COMMENT '公司名称',
`mobile` varchar(16) DEFAULT NULL COMMENT '手机号码',
`auth_key` varchar(32) NOT NULL,
`password_hash` varchar(255) NOT NULL,
`verification_token` varchar(255) DEFAULT NULL,
`password_reset_token` varchar(255) DEFAULT NULL,
`email` varchar(255) NOT NULL COMMENT '邮箱',
`type` tinyint(1) NOT NULL COMMENT '1普通餐厅 2连锁餐厅',
`status` tinyint(3) unsigned DEFAULT '1' COMMENT '1正常 0不正常',
`is_del` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否删除 1删除',
`created_at` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间',
`updated_at` int(11) NOT NULL DEFAULT '0' COMMENT '更新时间',
`is_order_status_email` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单状态改变时是否接收邮件',
`is_email_advertisement` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否接收邮件广告',
`is_order_status_phone` tinyint(1) NOT NULL DEFAULT '0' COMMENT '订单状态改变是是否接收电话',
`is_phone_advertisement` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否接收短信广告',
`is_open_render` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否打开个性化渲染1开启0关闭',
`is_thousand_face` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否已经存在千人千面1存在0不存在',
`is_low_rendering` tinyint(1) unsigned zerofill NOT NULL DEFAULT '0' COMMENT '是否开启低渲染模型渲染',
`is_remove_bg` tinyint(1) NOT NULL DEFAULT '1' COMMENT '用户上传logo是否去除背景',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE KEY `email` (`email`) USING BTREE,
UNIQUE KEY `username` (`username`) USING BTREE,
UNIQUE KEY `password_reset_token` (`password_reset_token`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT COMMENT='用户表';

View File

@ -18,7 +18,7 @@ import (
)
var testName = "fs_auth_item"
var testGenDir = "model/gmodel_gen"
var testGenDir = "model/gmodel"
func toPascalCase(s string) string {
words := strings.Split(s, "_")

View File

@ -1,67 +0,0 @@
package gmodel
import (
"context"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var _ FsAddressModel = (*customFsAddressModel)(nil)
type (
// FsAddressModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsAddressModel.
FsAddressModel interface {
fsAddressModel
FindDataAddressList(ctx context.Context, userid int64) (*DataAddressList, error)
}
customFsAddressModel struct {
*defaultFsAddressModel
}
DataAddressList struct {
Id int64 `db:"id" json:"id"`
UserId int64 `db:"user_id" json:"user_id"` // 用户ID
Name string `db:"name" json:"name"` // 地址名称
FirstName string `db:"first_name" json:"first_name"` // FirstName
LastName string `db:"last_name" json:"last_name"` // LastName
Mobile string `db:"mobile" json:"mobile"` // 手机号码
Street string `db:"street" json:"street"` // 街道
Suite string `db:"suite" json:"suite"` // 房号
City string `db:"city" json:"city"` // 城市
State string `db:"state" json:"state"` // 州名
ZipCode string `db:"zip_code" json:"zip_code"` // 邮编
IsDefault int64 `db:"is_default" json:"is_default"` // 1默认地址0非默认地址
}
)
var (
// DataAddressList 结构需要的字段
fsDataAddressListRows = strings.Join(stringx.Remove(fsAddressFieldNames, "`status`", "`country`"), ",")
)
// NewFsAddressModel returns a model for the database table.
func NewFsAddressModel(conn sqlx.SqlConn) FsAddressModel {
return &customFsAddressModel{
defaultFsAddressModel: newFsAddressModel(conn),
}
}
func (m *defaultFsAddressModel) FindDataAddressList(ctx context.Context, userid int64) (*DataAddressList, error) {
query := fmt.Sprintf("select %s from %s where `user_id` = ? ", fsDataAddressListRows, m.table)
var resp DataAddressList
err := m.conn.QueryRowCtx(ctx, &resp, query, userid)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}

View File

@ -1,96 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsAddressFieldNames = builder.RawFieldNames(&FsAddress{})
fsAddressRows = strings.Join(fsAddressFieldNames, ",")
fsAddressRowsExpectAutoSet = strings.Join(stringx.Remove(fsAddressFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsAddressRowsWithPlaceHolder = strings.Join(stringx.Remove(fsAddressFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsAddressModel interface {
Insert(ctx context.Context, data *FsAddress) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsAddress, error)
Update(ctx context.Context, data *FsAddress) error
Delete(ctx context.Context, id int64) error
}
defaultFsAddressModel struct {
conn sqlx.SqlConn
table string
}
FsAddress struct {
Id int64 `db:"id"`
UserId int64 `db:"user_id"` // 用户ID
Name string `db:"name"` // 地址名称
FirstName string `db:"first_name"` // FirstName
LastName string `db:"last_name"` // LastName
Mobile string `db:"mobile"` // 手机号码
Street string `db:"street"` // 街道
Suite string `db:"suite"` // 房号
City string `db:"city"` // 城市
State string `db:"state"` // 州名
Country string `db:"country"` // 国家
ZipCode string `db:"zip_code"` // 邮编
Status int64 `db:"status"` // 1正常 0异常
IsDefault int64 `db:"is_default"` // 1默认地址0非默认地址
}
)
func newFsAddressModel(conn sqlx.SqlConn) *defaultFsAddressModel {
return &defaultFsAddressModel{
conn: conn,
table: "`fs_address`",
}
}
func (m *defaultFsAddressModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsAddressModel) FindOne(ctx context.Context, id int64) (*FsAddress, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsAddressRows, m.table)
var resp FsAddress
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsAddressModel) Insert(ctx context.Context, data *FsAddress) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsAddressRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.UserId, data.Name, data.FirstName, data.LastName, data.Mobile, data.Street, data.Suite, data.City, data.State, data.Country, data.ZipCode, data.Status, data.IsDefault)
return ret, err
}
func (m *defaultFsAddressModel) Update(ctx context.Context, data *FsAddress) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsAddressRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.UserId, data.Name, data.FirstName, data.LastName, data.Mobile, data.Street, data.Suite, data.City, data.State, data.Country, data.ZipCode, data.Status, data.IsDefault, data.Id)
return err
}
func (m *defaultFsAddressModel) tableName() string {
return m.table
}

View File

@ -1,39 +0,0 @@
package gmodel
import (
"context"
"fmt"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsCanteenProductModel = (*customFsCanteenProductModel)(nil)
type (
// FsCanteenProductModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsCanteenProductModel.
FsCanteenProductModel interface {
fsCanteenProductModel
GetAllByCanteenTypeId(ctx context.Context, canteenTypeId int64) (resp []FsCanteenProduct, err error)
}
customFsCanteenProductModel struct {
*defaultFsCanteenProductModel
}
)
// NewFsCanteenProductModel returns a model for the database table.
func NewFsCanteenProductModel(conn sqlx.SqlConn) FsCanteenProductModel {
return &customFsCanteenProductModel{
defaultFsCanteenProductModel: newFsCanteenProductModel(conn),
}
}
func (m *defaultFsCanteenProductModel) GetAllByCanteenTypeId(ctx context.Context, canteenTypeId int64) (resp []FsCanteenProduct, err error) {
query := fmt.Sprintf("select %s from %s where `canteen_type` = ? and `status` = ?", fsCanteenProductRows, m.table)
err = m.conn.QueryRowsCtx(ctx, &resp, query, canteenTypeId, 1)
if err != nil {
return nil, err
}
return
}

View File

@ -1,90 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsCanteenProductFieldNames = builder.RawFieldNames(&FsCanteenProduct{})
fsCanteenProductRows = strings.Join(fsCanteenProductFieldNames, ",")
fsCanteenProductRowsExpectAutoSet = strings.Join(stringx.Remove(fsCanteenProductFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsCanteenProductRowsWithPlaceHolder = strings.Join(stringx.Remove(fsCanteenProductFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsCanteenProductModel interface {
Insert(ctx context.Context, data *FsCanteenProduct) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsCanteenProduct, error)
Update(ctx context.Context, data *FsCanteenProduct) error
Delete(ctx context.Context, id int64) error
}
defaultFsCanteenProductModel struct {
conn sqlx.SqlConn
table string
}
FsCanteenProduct struct {
Id int64 `db:"id"` // ID
CanteenType int64 `db:"canteen_type"` // 餐厅类别id
ProductId int64 `db:"product_id"` // 产品id
SizeId int64 `db:"size_id"` // 尺寸id
Sort int64 `db:"sort"` // 排序
Status int64 `db:"status"` // 状态位 1启用0停用
Ctime int64 `db:"ctime"` // 添加时间
Sid string `db:"sid"` // 前端带入的id
}
)
func newFsCanteenProductModel(conn sqlx.SqlConn) *defaultFsCanteenProductModel {
return &defaultFsCanteenProductModel{
conn: conn,
table: "`fs_canteen_product`",
}
}
func (m *defaultFsCanteenProductModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsCanteenProductModel) FindOne(ctx context.Context, id int64) (*FsCanteenProduct, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsCanteenProductRows, m.table)
var resp FsCanteenProduct
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsCanteenProductModel) Insert(ctx context.Context, data *FsCanteenProduct) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?)", m.table, fsCanteenProductRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.CanteenType, data.ProductId, data.SizeId, data.Sort, data.Status, data.Ctime, data.Sid)
return ret, err
}
func (m *defaultFsCanteenProductModel) Update(ctx context.Context, data *FsCanteenProduct) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsCanteenProductRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.CanteenType, data.ProductId, data.SizeId, data.Sort, data.Status, data.Ctime, data.Sid, data.Id)
return err
}
func (m *defaultFsCanteenProductModel) tableName() string {
return m.table
}

View File

@ -1,53 +0,0 @@
package gmodel
import (
"context"
"fmt"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsCanteenTypeModel = (*customFsCanteenTypeModel)(nil)
type (
// FsCanteenTypeModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsCanteenTypeModel.
FsCanteenTypeModel interface {
fsCanteenTypeModel
FindGetType(ctx context.Context) ([]*FsGetTypeCanteenType, error)
}
customFsCanteenTypeModel struct {
*defaultFsCanteenTypeModel
}
)
// NewFsCanteenTypeModel returns a model for the database table.
func NewFsCanteenTypeModel(conn sqlx.SqlConn) FsCanteenTypeModel {
return &customFsCanteenTypeModel{
defaultFsCanteenTypeModel: newFsCanteenTypeModel(conn),
}
}
// FsGetTypeCanteenType GetType返回前端的结构
type FsGetTypeCanteenType struct {
Id int64 `db:"id" json:"key"` // ID
Name string `db:"name" json:"name"` // 餐厅名字
}
// FindGetType 根据status = 1查询出所有,fs_canteen_type 的类型,并排序desc
func (m *defaultFsCanteenTypeModel) FindGetType(ctx context.Context) ([]*FsGetTypeCanteenType, error) {
query := fmt.Sprintf("select X.id,X.name from (select %s from %s where status = 1 order by sort desc) X", fsCanteenTypeRows, m.table)
var resp []*FsGetTypeCanteenType
err := m.conn.QueryRows(&resp, query)
switch err {
case nil:
return resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}

View File

@ -1,87 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsCanteenTypeFieldNames = builder.RawFieldNames(&FsCanteenType{})
fsCanteenTypeRows = strings.Join(fsCanteenTypeFieldNames, ",")
fsCanteenTypeRowsExpectAutoSet = strings.Join(stringx.Remove(fsCanteenTypeFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsCanteenTypeRowsWithPlaceHolder = strings.Join(stringx.Remove(fsCanteenTypeFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsCanteenTypeModel interface {
Insert(ctx context.Context, data *FsCanteenType) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsCanteenType, error)
Update(ctx context.Context, data *FsCanteenType) error
Delete(ctx context.Context, id int64) error
}
defaultFsCanteenTypeModel struct {
conn sqlx.SqlConn
table string
}
FsCanteenType struct {
Id int64 `db:"id"` // ID
Name string `db:"name"` // 餐厅名字
Sort int64 `db:"sort"` // 排序
Status int64 `db:"status"` // 状态位 1启用0停用
Ctime int64 `db:"ctime"` // 添加时间
}
)
func newFsCanteenTypeModel(conn sqlx.SqlConn) *defaultFsCanteenTypeModel {
return &defaultFsCanteenTypeModel{
conn: conn,
table: "`fs_canteen_type`",
}
}
func (m *defaultFsCanteenTypeModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsCanteenTypeModel) FindOne(ctx context.Context, id int64) (*FsCanteenType, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsCanteenTypeRows, m.table)
var resp FsCanteenType
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsCanteenTypeModel) Insert(ctx context.Context, data *FsCanteenType) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?)", m.table, fsCanteenTypeRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Name, data.Sort, data.Status, data.Ctime)
return ret, err
}
func (m *defaultFsCanteenTypeModel) Update(ctx context.Context, data *FsCanteenType) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsCanteenTypeRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.Name, data.Sort, data.Status, data.Ctime, data.Id)
return err
}
func (m *defaultFsCanteenTypeModel) tableName() string {
return m.table
}

View File

@ -1,24 +0,0 @@
package gmodel
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var _ FsCartModel = (*customFsCartModel)(nil)
type (
// FsCartModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsCartModel.
FsCartModel interface {
fsCartModel
}
customFsCartModel struct {
*defaultFsCartModel
}
)
// NewFsCartModel returns a model for the database table.
func NewFsCartModel(conn sqlx.SqlConn) FsCartModel {
return &customFsCartModel{
defaultFsCartModel: newFsCartModel(conn),
}
}

View File

@ -1,99 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"time"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsCartFieldNames = builder.RawFieldNames(&FsCart{})
fsCartRows = strings.Join(fsCartFieldNames, ",")
fsCartRowsExpectAutoSet = strings.Join(stringx.Remove(fsCartFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsCartRowsWithPlaceHolder = strings.Join(stringx.Remove(fsCartFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsCartModel interface {
Insert(ctx context.Context, data *FsCart) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsCart, error)
Update(ctx context.Context, data *FsCart) error
Delete(ctx context.Context, id int64) error
}
defaultFsCartModel struct {
conn sqlx.SqlConn
table string
}
FsCart struct {
Id int64 `db:"id"` // id
UserId sql.NullInt64 `db:"user_id"` // 用户ID
ProductId int64 `db:"product_id"` // 产品ID
TemplateId int64 `db:"template_id"` // 模板ID
PriceId int64 `db:"price_id"` // 价格ID
MaterialId int64 `db:"material_id"` // 材质ID
SizeId int64 `db:"size_id"` // 尺寸ID
BuyNum int64 `db:"buy_num"` // 购买数量
Cover string `db:"cover"` // 截图
DesignId int64 `db:"design_id"` // 设计ID
Ctime sql.NullInt64 `db:"ctime"` // 添加时间
Status int64 `db:"status"` // 状态位
OptionalId int64 `db:"optional_id"` // 选项ID
IsCheck int64 `db:"is_check"` // 是否选中状态0未选中1选中
TsTime time.Time `db:"ts_time"`
IsEmail int64 `db:"is_email"` // 是否发送邮件
}
)
func newFsCartModel(conn sqlx.SqlConn) *defaultFsCartModel {
return &defaultFsCartModel{
conn: conn,
table: "`fs_cart`",
}
}
func (m *defaultFsCartModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsCartModel) FindOne(ctx context.Context, id int64) (*FsCart, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsCartRows, m.table)
var resp FsCart
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsCartModel) Insert(ctx context.Context, data *FsCart) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsCartRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.UserId, data.ProductId, data.TemplateId, data.PriceId, data.MaterialId, data.SizeId, data.BuyNum, data.Cover, data.DesignId, data.Ctime, data.Status, data.OptionalId, data.IsCheck, data.TsTime, data.IsEmail)
return ret, err
}
func (m *defaultFsCartModel) Update(ctx context.Context, data *FsCart) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsCartRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.UserId, data.ProductId, data.TemplateId, data.PriceId, data.MaterialId, data.SizeId, data.BuyNum, data.Cover, data.DesignId, data.Ctime, data.Status, data.OptionalId, data.IsCheck, data.TsTime, data.IsEmail, data.Id)
return err
}
func (m *defaultFsCartModel) tableName() string {
return m.table
}

View File

@ -1,24 +0,0 @@
package gmodel
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var _ FsFaqModel = (*customFsFaqModel)(nil)
type (
// FsFaqModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsFaqModel.
FsFaqModel interface {
fsFaqModel
}
customFsFaqModel struct {
*defaultFsFaqModel
}
)
// NewFsFaqModel returns a model for the database table.
func NewFsFaqModel(conn sqlx.SqlConn) FsFaqModel {
return &customFsFaqModel{
defaultFsFaqModel: newFsFaqModel(conn),
}
}

View File

@ -1,90 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsFaqFieldNames = builder.RawFieldNames(&FsFaq{})
fsFaqRows = strings.Join(fsFaqFieldNames, ",")
fsFaqRowsExpectAutoSet = strings.Join(stringx.Remove(fsFaqFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsFaqRowsWithPlaceHolder = strings.Join(stringx.Remove(fsFaqFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsFaqModel interface {
Insert(ctx context.Context, data *FsFaq) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsFaq, error)
Update(ctx context.Context, data *FsFaq) error
Delete(ctx context.Context, id int64) error
}
defaultFsFaqModel struct {
conn sqlx.SqlConn
table string
}
FsFaq struct {
Id int64 `db:"id"`
TagId int64 `db:"tag_id"` // 分类ID
TagName string `db:"tag_name"` // 分类名称
Title string `db:"title"` // 标题
Content sql.NullString `db:"content"` // 内容
Status int64 `db:"status"` // 状态(0:禁用1:启用)
Sort int64 `db:"sort"` // 排序
Ctime sql.NullInt64 `db:"ctime"` // 添加时间
}
)
func newFsFaqModel(conn sqlx.SqlConn) *defaultFsFaqModel {
return &defaultFsFaqModel{
conn: conn,
table: "`fs_faq`",
}
}
func (m *defaultFsFaqModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsFaqModel) FindOne(ctx context.Context, id int64) (*FsFaq, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsFaqRows, m.table)
var resp FsFaq
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsFaqModel) Insert(ctx context.Context, data *FsFaq) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?)", m.table, fsFaqRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.TagId, data.TagName, data.Title, data.Content, data.Status, data.Sort, data.Ctime)
return ret, err
}
func (m *defaultFsFaqModel) Update(ctx context.Context, data *FsFaq) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsFaqRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.TagId, data.TagName, data.Title, data.Content, data.Status, data.Sort, data.Ctime, data.Id)
return err
}
func (m *defaultFsFaqModel) tableName() string {
return m.table
}

View File

@ -1,46 +0,0 @@
package gmodel
import (
"context"
"fmt"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsFontModel = (*customFsFontModel)(nil)
type (
// FsFontModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsFontModel.
FsFontModel interface {
fsFontModel
FindAllOrderSortByDesc(ctx context.Context) ([]*FsFont, error)
}
customFsFontModel struct {
*defaultFsFontModel
}
)
// NewFsFontModel returns a model for the database table.
func NewFsFontModel(conn sqlx.SqlConn) FsFontModel {
return &customFsFontModel{
defaultFsFontModel: newFsFontModel(conn),
}
}
func (m *defaultFsFontModel) FindAllOrderSortByDesc(ctx context.Context) ([]*FsFont, error) {
query := fmt.Sprintf("select %s from %s order by sort desc", fsFontRows, m.table)
var resp []*FsFont
err := m.conn.QueryRows(&resp, query)
switch err {
case nil:
return resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}

View File

@ -1,87 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsFontFieldNames = builder.RawFieldNames(&FsFont{})
fsFontRows = strings.Join(fsFontFieldNames, ",")
fsFontRowsExpectAutoSet = strings.Join(stringx.Remove(fsFontFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsFontRowsWithPlaceHolder = strings.Join(stringx.Remove(fsFontFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsFontModel interface {
Insert(ctx context.Context, data *FsFont) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsFont, error)
Update(ctx context.Context, data *FsFont) error
Delete(ctx context.Context, id int64) error
}
defaultFsFontModel struct {
conn sqlx.SqlConn
table string
}
FsFont struct {
Id int64 `db:"id"` // id
Title string `db:"title"` // 字体名字
LinuxFontname string `db:"linux_fontname"` // linux对应字体名
FilePath string `db:"file_path"` // 字体文件路径
Sort int64 `db:"sort"` // 排序
}
)
func newFsFontModel(conn sqlx.SqlConn) *defaultFsFontModel {
return &defaultFsFontModel{
conn: conn,
table: "`fs_font`",
}
}
func (m *defaultFsFontModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsFontModel) FindOne(ctx context.Context, id int64) (*FsFont, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsFontRows, m.table)
var resp FsFont
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsFontModel) Insert(ctx context.Context, data *FsFont) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?)", m.table, fsFontRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.LinuxFontname, data.FilePath, data.Sort)
return ret, err
}
func (m *defaultFsFontModel) Update(ctx context.Context, data *FsFont) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsFontRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.Title, data.LinuxFontname, data.FilePath, data.Sort, data.Id)
return err
}
func (m *defaultFsFontModel) tableName() string {
return m.table
}

View File

@ -1,24 +0,0 @@
package gmodel
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var _ FsGuestModel = (*customFsGuestModel)(nil)
type (
// FsGuestModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsGuestModel.
FsGuestModel interface {
fsGuestModel
}
customFsGuestModel struct {
*defaultFsGuestModel
}
)
// NewFsGuestModel returns a model for the database table.
func NewFsGuestModel(conn sqlx.SqlConn) FsGuestModel {
return &customFsGuestModel{
defaultFsGuestModel: newFsGuestModel(conn),
}
}

View File

@ -1,92 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsGuestFieldNames = builder.RawFieldNames(&FsGuest{})
fsGuestRows = strings.Join(fsGuestFieldNames, ",")
fsGuestRowsExpectAutoSet = strings.Join(stringx.Remove(fsGuestFieldNames, "`guest_id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsGuestRowsWithPlaceHolder = strings.Join(stringx.Remove(fsGuestFieldNames, "`guest_id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsGuestModel interface {
Insert(ctx context.Context, data *FsGuest) (sql.Result, error)
FindOne(ctx context.Context, guestId int64) (*FsGuest, error)
Update(ctx context.Context, data *FsGuest) error
Delete(ctx context.Context, guestId int64) error
}
defaultFsGuestModel struct {
conn sqlx.SqlConn
table string
}
FsGuest struct {
GuestId int64 `db:"guest_id"` // 游客ID
AuthKey string `db:"auth_key"` // jwt token
Status int64 `db:"status"` // 1正常 0不正常
IsDel int64 `db:"is_del"` // 是否删除 1删除
CreatedAt int64 `db:"created_at"` // 添加时间
UpdatedAt int64 `db:"updated_at"` // 更新时间
IsOpenRender int64 `db:"is_open_render"` // 是否打开个性化渲染1开启0关闭
IsThousandFace int64 `db:"is_thousand_face"` // 是否已经存在千人千面1存在0不存在
IsLowRendering int64 `db:"is_low_rendering"` // 是否开启低渲染模型渲染
IsRemoveBg int64 `db:"is_remove_bg"` // 用户上传logo是否去除背景
}
)
func newFsGuestModel(conn sqlx.SqlConn) *defaultFsGuestModel {
return &defaultFsGuestModel{
conn: conn,
table: "`fs_guest`",
}
}
func (m *defaultFsGuestModel) Delete(ctx context.Context, guestId int64) error {
query := fmt.Sprintf("delete from %s where `guest_id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, guestId)
return err
}
func (m *defaultFsGuestModel) FindOne(ctx context.Context, guestId int64) (*FsGuest, error) {
query := fmt.Sprintf("select %s from %s where `guest_id` = ? limit 1", fsGuestRows, m.table)
var resp FsGuest
err := m.conn.QueryRowCtx(ctx, &resp, query, guestId)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsGuestModel) Insert(ctx context.Context, data *FsGuest) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?)", m.table, fsGuestRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.AuthKey, data.Status, data.IsDel, data.IsOpenRender, data.IsThousandFace, data.IsLowRendering, data.IsRemoveBg)
return ret, err
}
func (m *defaultFsGuestModel) Update(ctx context.Context, data *FsGuest) error {
query := fmt.Sprintf("update %s set %s where `guest_id` = ?", m.table, fsGuestRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.AuthKey, data.Status, data.IsDel, data.IsOpenRender, data.IsThousandFace, data.IsLowRendering, data.IsRemoveBg, data.GuestId)
return err
}
func (m *defaultFsGuestModel) tableName() string {
return m.table
}

View File

@ -1,24 +0,0 @@
package gmodel
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var _ FsMapLibraryModel = (*customFsMapLibraryModel)(nil)
type (
// FsMapLibraryModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsMapLibraryModel.
FsMapLibraryModel interface {
fsMapLibraryModel
}
customFsMapLibraryModel struct {
*defaultFsMapLibraryModel
}
)
// NewFsMapLibraryModel returns a model for the database table.
func NewFsMapLibraryModel(conn sqlx.SqlConn) FsMapLibraryModel {
return &customFsMapLibraryModel{
defaultFsMapLibraryModel: newFsMapLibraryModel(conn),
}
}

View File

@ -1,89 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsMapLibraryFieldNames = builder.RawFieldNames(&FsMapLibrary{})
fsMapLibraryRows = strings.Join(fsMapLibraryFieldNames, ",")
fsMapLibraryRowsExpectAutoSet = strings.Join(stringx.Remove(fsMapLibraryFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsMapLibraryRowsWithPlaceHolder = strings.Join(stringx.Remove(fsMapLibraryFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsMapLibraryModel interface {
Insert(ctx context.Context, data *FsMapLibrary) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsMapLibrary, error)
Update(ctx context.Context, data *FsMapLibrary) error
Delete(ctx context.Context, id int64) error
}
defaultFsMapLibraryModel struct {
conn sqlx.SqlConn
table string
}
FsMapLibrary struct {
Id int64 `db:"id"` // Id
Title string `db:"title"` // 名称
Info string `db:"info"` // 贴图数据
Sort int64 `db:"sort"` // 排序
Status int64 `db:"status"` // 状态 1启用
Ctime int64 `db:"ctime"` // 创建时间
TagId int64 `db:"tag_id"` // 模板标签id
}
)
func newFsMapLibraryModel(conn sqlx.SqlConn) *defaultFsMapLibraryModel {
return &defaultFsMapLibraryModel{
conn: conn,
table: "`fs_map_library`",
}
}
func (m *defaultFsMapLibraryModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsMapLibraryModel) FindOne(ctx context.Context, id int64) (*FsMapLibrary, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsMapLibraryRows, m.table)
var resp FsMapLibrary
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsMapLibraryModel) Insert(ctx context.Context, data *FsMapLibrary) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?)", m.table, fsMapLibraryRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.Info, data.Sort, data.Status, data.Ctime, data.TagId)
return ret, err
}
func (m *defaultFsMapLibraryModel) Update(ctx context.Context, data *FsMapLibrary) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsMapLibraryRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.Title, data.Info, data.Sort, data.Status, data.Ctime, data.TagId, data.Id)
return err
}
func (m *defaultFsMapLibraryModel) tableName() string {
return m.table
}

View File

@ -1,24 +0,0 @@
package gmodel
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var _ FsOrderDetailModel = (*customFsOrderDetailModel)(nil)
type (
// FsOrderDetailModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsOrderDetailModel.
FsOrderDetailModel interface {
fsOrderDetailModel
}
customFsOrderDetailModel struct {
*defaultFsOrderDetailModel
}
)
// NewFsOrderDetailModel returns a model for the database table.
func NewFsOrderDetailModel(conn sqlx.SqlConn) FsOrderDetailModel {
return &customFsOrderDetailModel{
defaultFsOrderDetailModel: newFsOrderDetailModel(conn),
}
}

View File

@ -1,121 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsOrderDetailFieldNames = builder.RawFieldNames(&FsOrderDetail{})
fsOrderDetailRows = strings.Join(fsOrderDetailFieldNames, ",")
fsOrderDetailRowsExpectAutoSet = strings.Join(stringx.Remove(fsOrderDetailFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsOrderDetailRowsWithPlaceHolder = strings.Join(stringx.Remove(fsOrderDetailFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsOrderDetailModel interface {
Insert(ctx context.Context, data *FsOrderDetail) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsOrderDetail, error)
FindOneBySn(ctx context.Context, sn string) (*FsOrderDetail, error)
Update(ctx context.Context, data *FsOrderDetail) error
Delete(ctx context.Context, id int64) error
}
defaultFsOrderDetailModel struct {
conn sqlx.SqlConn
table string
}
FsOrderDetail struct {
Id int64 `db:"id"`
Sn string `db:"sn"` // 唯一编码
OrderId int64 `db:"order_id"` // 订单ID
UserId sql.NullInt64 `db:"user_id"` // 用户ID
FactoryId int64 `db:"factory_id"` // 工厂ID
OrderDetailTemplateId int64 `db:"order_detail_template_id"` // 详情templateID
ProductId int64 `db:"product_id"` // 产品ID
BuyNum int64 `db:"buy_num"` // 购买数量
PushNum int64 `db:"push_num"` // 已发数量
Amount int64 `db:"amount"` // 单价
Cover string `db:"cover"` // 截图
Ctime int64 `db:"ctime"` // 添加时间
Status int64 `db:"status"` // 状态位 是否推送到厂家 是否生产完成 是否发货完成
OptionalId int64 `db:"optional_id"` // 选项ID
OptionalTitle string `db:"optional_title"` // 选项名称
OptionPrice int64 `db:"option_price"` // 配件价格
IsTofactory int64 `db:"is_tofactory"` // 是否推送到工厂
IsProduct int64 `db:"is_product"` // 是否生产中
IsProductCompletion int64 `db:"is_product_completion"` // 是否生产完成
IsCloud int64 `db:"is_cloud"` // 是否是云仓订单
IsTocloud int64 `db:"is_tocloud"` // 是否已发云仓(云仓单要发货到云仓,直接发到用户的不需要发到云仓)
IsDeliver int64 `db:"is_deliver"` // 是否已发货
IsEnd int64 `db:"is_end"` // 是否完成订单(签收)
CartId int64 `db:"cart_id"` // 购物车编号
}
)
func newFsOrderDetailModel(conn sqlx.SqlConn) *defaultFsOrderDetailModel {
return &defaultFsOrderDetailModel{
conn: conn,
table: "`fs_order_detail`",
}
}
func (m *defaultFsOrderDetailModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsOrderDetailModel) FindOne(ctx context.Context, id int64) (*FsOrderDetail, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsOrderDetailRows, m.table)
var resp FsOrderDetail
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsOrderDetailModel) FindOneBySn(ctx context.Context, sn string) (*FsOrderDetail, error) {
var resp FsOrderDetail
query := fmt.Sprintf("select %s from %s where `sn` = ? limit 1", fsOrderDetailRows, m.table)
err := m.conn.QueryRowCtx(ctx, &resp, query, sn)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsOrderDetailModel) Insert(ctx context.Context, data *FsOrderDetail) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsOrderDetailRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Sn, data.OrderId, data.UserId, data.FactoryId, data.OrderDetailTemplateId, data.ProductId, data.BuyNum, data.PushNum, data.Amount, data.Cover, data.Ctime, data.Status, data.OptionalId, data.OptionalTitle, data.OptionPrice, data.IsTofactory, data.IsProduct, data.IsProductCompletion, data.IsCloud, data.IsTocloud, data.IsDeliver, data.IsEnd, data.CartId)
return ret, err
}
func (m *defaultFsOrderDetailModel) Update(ctx context.Context, newData *FsOrderDetail) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsOrderDetailRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, newData.Sn, newData.OrderId, newData.UserId, newData.FactoryId, newData.OrderDetailTemplateId, newData.ProductId, newData.BuyNum, newData.PushNum, newData.Amount, newData.Cover, newData.Ctime, newData.Status, newData.OptionalId, newData.OptionalTitle, newData.OptionPrice, newData.IsTofactory, newData.IsProduct, newData.IsProductCompletion, newData.IsCloud, newData.IsTocloud, newData.IsDeliver, newData.IsEnd, newData.CartId, newData.Id)
return err
}
func (m *defaultFsOrderDetailModel) tableName() string {
return m.table
}

View File

@ -1,24 +0,0 @@
package gmodel
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var _ FsOrderDetailTemplateModel = (*customFsOrderDetailTemplateModel)(nil)
type (
// FsOrderDetailTemplateModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsOrderDetailTemplateModel.
FsOrderDetailTemplateModel interface {
fsOrderDetailTemplateModel
}
customFsOrderDetailTemplateModel struct {
*defaultFsOrderDetailTemplateModel
}
)
// NewFsOrderDetailTemplateModel returns a model for the database table.
func NewFsOrderDetailTemplateModel(conn sqlx.SqlConn) FsOrderDetailTemplateModel {
return &customFsOrderDetailTemplateModel{
defaultFsOrderDetailTemplateModel: newFsOrderDetailTemplateModel(conn),
}
}

View File

@ -1,108 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsOrderDetailTemplateFieldNames = builder.RawFieldNames(&FsOrderDetailTemplate{})
fsOrderDetailTemplateRows = strings.Join(fsOrderDetailTemplateFieldNames, ",")
fsOrderDetailTemplateRowsExpectAutoSet = strings.Join(stringx.Remove(fsOrderDetailTemplateFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsOrderDetailTemplateRowsWithPlaceHolder = strings.Join(stringx.Remove(fsOrderDetailTemplateFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsOrderDetailTemplateModel interface {
Insert(ctx context.Context, data *FsOrderDetailTemplate) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsOrderDetailTemplate, error)
FindOneBySn(ctx context.Context, sn string) (*FsOrderDetailTemplate, error)
Update(ctx context.Context, data *FsOrderDetailTemplate) error
Delete(ctx context.Context, id int64) error
}
defaultFsOrderDetailTemplateModel struct {
conn sqlx.SqlConn
table string
}
FsOrderDetailTemplate struct {
Id int64 `db:"id"`
Sn string `db:"sn"` // 唯一编码
ProductId int64 `db:"product_id"` // 产品ID
ModelId int64 `db:"model_id"` // 模型ID
TemplateId int64 `db:"template_id"` // 模板ID
MaterialId int64 `db:"material_id"` // 材质id
SizeId int64 `db:"size_id"` // 尺寸id
EachBoxNum int64 `db:"each_box_num"` // 每一箱的个数
EachBoxWeight float64 `db:"each_box_weight"` // 每一箱的重量 单位KG
DesignId int64 `db:"design_id"` // 设计ID
Ctime sql.NullInt64 `db:"ctime"` // 添加时间
}
)
func newFsOrderDetailTemplateModel(conn sqlx.SqlConn) *defaultFsOrderDetailTemplateModel {
return &defaultFsOrderDetailTemplateModel{
conn: conn,
table: "`fs_order_detail_template`",
}
}
func (m *defaultFsOrderDetailTemplateModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsOrderDetailTemplateModel) FindOne(ctx context.Context, id int64) (*FsOrderDetailTemplate, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsOrderDetailTemplateRows, m.table)
var resp FsOrderDetailTemplate
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsOrderDetailTemplateModel) FindOneBySn(ctx context.Context, sn string) (*FsOrderDetailTemplate, error) {
var resp FsOrderDetailTemplate
query := fmt.Sprintf("select %s from %s where `sn` = ? limit 1", fsOrderDetailTemplateRows, m.table)
err := m.conn.QueryRowCtx(ctx, &resp, query, sn)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsOrderDetailTemplateModel) Insert(ctx context.Context, data *FsOrderDetailTemplate) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsOrderDetailTemplateRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Sn, data.ProductId, data.ModelId, data.TemplateId, data.MaterialId, data.SizeId, data.EachBoxNum, data.EachBoxWeight, data.DesignId, data.Ctime)
return ret, err
}
func (m *defaultFsOrderDetailTemplateModel) Update(ctx context.Context, newData *FsOrderDetailTemplate) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsOrderDetailTemplateRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, newData.Sn, newData.ProductId, newData.ModelId, newData.TemplateId, newData.MaterialId, newData.SizeId, newData.EachBoxNum, newData.EachBoxWeight, newData.DesignId, newData.Ctime, newData.Id)
return err
}
func (m *defaultFsOrderDetailTemplateModel) tableName() string {
return m.table
}

View File

@ -1,24 +0,0 @@
package gmodel
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var _ FsOrderModel = (*customFsOrderModel)(nil)
type (
// FsOrderModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsOrderModel.
FsOrderModel interface {
fsOrderModel
}
customFsOrderModel struct {
*defaultFsOrderModel
}
)
// NewFsOrderModel returns a model for the database table.
func NewFsOrderModel(conn sqlx.SqlConn) FsOrderModel {
return &customFsOrderModel{
defaultFsOrderModel: newFsOrderModel(conn),
}
}

View File

@ -1,134 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"time"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsOrderFieldNames = builder.RawFieldNames(&FsOrder{})
fsOrderRows = strings.Join(fsOrderFieldNames, ",")
fsOrderRowsExpectAutoSet = strings.Join(stringx.Remove(fsOrderFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsOrderRowsWithPlaceHolder = strings.Join(stringx.Remove(fsOrderFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsOrderModel interface {
Insert(ctx context.Context, data *FsOrder) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsOrder, error)
FindOneBySn(ctx context.Context, sn string) (*FsOrder, error)
Update(ctx context.Context, data *FsOrder) error
Delete(ctx context.Context, id int64) error
}
defaultFsOrderModel struct {
conn sqlx.SqlConn
table string
}
FsOrder struct {
Id int64 `db:"id"`
Sn string `db:"sn"` // 订单编号 FS211224OL2XDKNP
UserId sql.NullInt64 `db:"user_id"` // 用户ID
SellerUserId sql.NullInt64 `db:"seller_user_id"` // 销售员ID 0:自主下单
TotalAmount int64 `db:"total_amount"` // 总价
PayedAmount int64 `db:"payed_amount"` // 已支付金额
PayMethod int64 `db:"pay_method"` // 支付方式 1paypal 2strip
Ctime sql.NullInt64 `db:"ctime"` // 添加时间
Utime sql.NullInt64 `db:"utime"` // 更新时间
Ptime sql.NullInt64 `db:"ptime"` // 最后一次 支付时间(可能多次支付)
AddressId int64 `db:"address_id"` // 地址ID或者云仓ID
DeliveryMethod int64 `db:"delivery_method"` // 配送方式 1:直接发货到收获地址 2云仓
CustomerMark sql.NullString `db:"customer_mark"` // 客户备注
Mark sql.NullString `db:"mark"` // 后台订单备注
AddressInfo sql.NullString `db:"address_info"` // 详细地址信息JSON
IsSup int64 `db:"is_sup"` // 0不是补货 1是补货
Status int64 `db:"status"` // 状态位0未支付1部分支付2支付完成3部分生产4部分生产完成5全部生产6全部生产完成7部分发货8发货完成9完成订单10取消订单11:退款中12退款完成13:订单已删除14:订单已关闭)
IsPartPay int64 `db:"is_part_pay"` // 是否部分支付01
IsPayCompleted int64 `db:"is_pay_completed"` // 是否支付完成01
IsPartProduct int64 `db:"is_part_product"` // 是否部分生产01
IsPartProductCompleted int64 `db:"is_part_product_completed"` // 是否部分生产完成01
IsAllProduct int64 `db:"is_all_product"` // 是否全部生产01
IsAllProductCompleted int64 `db:"is_all_product_completed"` // 是否全部生产完成01
IsPartDelivery int64 `db:"is_part_delivery"` // 是否部分发货01
IsDeliveryCompleted int64 `db:"is_delivery_completed"` // 是否发货完成01
IsComplated int64 `db:"is_complated"` // 是否完成订单01
IsCancel int64 `db:"is_cancel"` // 是否取消订单01
IsRefunding int64 `db:"is_refunding"` // 是否退款中01
IsRefunded int64 `db:"is_refunded"` // 是否退款完成01
IsDeleted int64 `db:"is_deleted"` // 是否删除01
RefundReasonId sql.NullInt64 `db:"refund_reason_id"` // 取消订单原因ID
RefundReason sql.NullString `db:"refund_reason"` // 取消订单原因
TsTime time.Time `db:"ts_time"`
IsSure int64 `db:"is_sure"` // 是否确认订单 1确认0未确认
DeliverSn string `db:"deliver_sn"` // 发货单号
EmailTime int64 `db:"email_time"` // 邮件发送时间
}
)
func newFsOrderModel(conn sqlx.SqlConn) *defaultFsOrderModel {
return &defaultFsOrderModel{
conn: conn,
table: "`fs_order`",
}
}
func (m *defaultFsOrderModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsOrderModel) FindOne(ctx context.Context, id int64) (*FsOrder, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsOrderRows, m.table)
var resp FsOrder
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsOrderModel) FindOneBySn(ctx context.Context, sn string) (*FsOrder, error) {
var resp FsOrder
query := fmt.Sprintf("select %s from %s where `sn` = ? limit 1", fsOrderRows, m.table)
err := m.conn.QueryRowCtx(ctx, &resp, query, sn)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsOrderModel) Insert(ctx context.Context, data *FsOrder) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsOrderRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Sn, data.UserId, data.SellerUserId, data.TotalAmount, data.PayedAmount, data.PayMethod, data.Ctime, data.Utime, data.Ptime, data.AddressId, data.DeliveryMethod, data.CustomerMark, data.Mark, data.AddressInfo, data.IsSup, data.Status, data.IsPartPay, data.IsPayCompleted, data.IsPartProduct, data.IsPartProductCompleted, data.IsAllProduct, data.IsAllProductCompleted, data.IsPartDelivery, data.IsDeliveryCompleted, data.IsComplated, data.IsCancel, data.IsRefunding, data.IsRefunded, data.IsDeleted, data.RefundReasonId, data.RefundReason, data.TsTime, data.IsSure, data.DeliverSn, data.EmailTime)
return ret, err
}
func (m *defaultFsOrderModel) Update(ctx context.Context, newData *FsOrder) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsOrderRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, newData.Sn, newData.UserId, newData.SellerUserId, newData.TotalAmount, newData.PayedAmount, newData.PayMethod, newData.Ctime, newData.Utime, newData.Ptime, newData.AddressId, newData.DeliveryMethod, newData.CustomerMark, newData.Mark, newData.AddressInfo, newData.IsSup, newData.Status, newData.IsPartPay, newData.IsPayCompleted, newData.IsPartProduct, newData.IsPartProductCompleted, newData.IsAllProduct, newData.IsAllProductCompleted, newData.IsPartDelivery, newData.IsDeliveryCompleted, newData.IsComplated, newData.IsCancel, newData.IsRefunding, newData.IsRefunded, newData.IsDeleted, newData.RefundReasonId, newData.RefundReason, newData.TsTime, newData.IsSure, newData.DeliverSn, newData.EmailTime, newData.Id)
return err
}
func (m *defaultFsOrderModel) tableName() string {
return m.table
}

View File

@ -1,24 +0,0 @@
package gmodel
import "github.com/zeromicro/go-zero/core/stores/sqlx"
var _ FsProductDesignModel = (*customFsProductDesignModel)(nil)
type (
// FsProductDesignModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsProductDesignModel.
FsProductDesignModel interface {
fsProductDesignModel
}
customFsProductDesignModel struct {
*defaultFsProductDesignModel
}
)
// NewFsProductDesignModel returns a model for the database table.
func NewFsProductDesignModel(conn sqlx.SqlConn) FsProductDesignModel {
return &customFsProductDesignModel{
defaultFsProductDesignModel: newFsProductDesignModel(conn),
}
}

View File

@ -1,99 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"time"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsProductDesignFieldNames = builder.RawFieldNames(&FsProductDesign{})
fsProductDesignRows = strings.Join(fsProductDesignFieldNames, ",")
fsProductDesignRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductDesignFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsProductDesignRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductDesignFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsProductDesignModel interface {
Insert(ctx context.Context, data *FsProductDesign) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsProductDesign, error)
Update(ctx context.Context, data *FsProductDesign) error
Delete(ctx context.Context, id int64) error
}
defaultFsProductDesignModel struct {
conn sqlx.SqlConn
table string
}
FsProductDesign struct {
Id int64 `db:"id"`
Sn string `db:"sn"` // 唯一标识
UserId int64 `db:"user_id"` // 用户ID
ProductId int64 `db:"product_id"` // 产品ID
TemplateId int64 `db:"template_id"` // 模型ID
MaterialId int64 `db:"material_id"` // 材质ID
SizeId int64 `db:"size_id"` // 尺寸ID
OptionalId int64 `db:"optional_id"` // 选项ID
Cover string `db:"cover"` // 封面图
Info sql.NullString `db:"info"` // 保留的设计信息
Utime time.Time `db:"utime"` // 更新时间
Status int64 `db:"status"` // 状态
IsDel int64 `db:"is_del"` // 是否删除 0未删除 1删除
IsPay int64 `db:"is_pay"` // 是否已有支付 0 未 1 有
LogoColor sql.NullString `db:"logo_color"` // logo图片备选项
PageGuid string `db:"page_guid"` // 页面识别id
}
)
func newFsProductDesignModel(conn sqlx.SqlConn) *defaultFsProductDesignModel {
return &defaultFsProductDesignModel{
conn: conn,
table: "`fs_product_design`",
}
}
func (m *defaultFsProductDesignModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsProductDesignModel) FindOne(ctx context.Context, id int64) (*FsProductDesign, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductDesignRows, m.table)
var resp FsProductDesign
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsProductDesignModel) Insert(ctx context.Context, data *FsProductDesign) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsProductDesignRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Sn, data.UserId, data.ProductId, data.TemplateId, data.MaterialId, data.SizeId, data.OptionalId, data.Cover, data.Info, data.Utime, data.Status, data.IsDel, data.IsPay, data.LogoColor, data.PageGuid)
return ret, err
}
func (m *defaultFsProductDesignModel) Update(ctx context.Context, data *FsProductDesign) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductDesignRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.Sn, data.UserId, data.ProductId, data.TemplateId, data.MaterialId, data.SizeId, data.OptionalId, data.Cover, data.Info, data.Utime, data.Status, data.IsDel, data.IsPay, data.LogoColor, data.PageGuid, data.Id)
return err
}
func (m *defaultFsProductDesignModel) tableName() string {
return m.table
}

View File

@ -1,76 +0,0 @@
package gmodel
import (
"context"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsProductModel = (*customFsProductModel)(nil)
type (
// FsProductModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsProductModel.
FsProductModel interface {
fsProductModel
GetProductListByConditions(ctx context.Context, productTypes []string, sort string) ([]FsProduct, error)
GetRandomProductList(ctx context.Context, limit int) (resp []FsProduct, err error)
GetProductListByIds(ctx context.Context, ids []string, sort string) (resp []FsProduct, err error)
}
customFsProductModel struct {
*defaultFsProductModel
}
)
// NewFsProductModel returns a model for the database table.
func NewFsProductModel(conn sqlx.SqlConn) FsProductModel {
return &customFsProductModel{
defaultFsProductModel: newFsProductModel(conn),
}
}
func (m *defaultFsProductModel) GetProductListByConditions(ctx context.Context, productTypes []string, sort string) (resp []FsProduct, err error) {
query := fmt.Sprintf("select %s from %s where `type` in (?) and `is_del` =? and `is_shelf` = ? and `status` =?",
fsProductRows, m.table)
switch sort {
case "sort-asc":
query = fmt.Sprintf("%s order by sort ASC", query)
case "sort-desc":
query = fmt.Sprintf("%s order by sort DESC", query)
default:
query = fmt.Sprintf("%s order by sort DESC", query)
}
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(productTypes, ","), 0, 1, 1)
if err != nil {
return nil, err
}
return
}
func (m *defaultFsProductModel) GetRandomProductList(ctx context.Context, limit int) (resp []FsProduct, err error) {
query := fmt.Sprintf("select %s from %s where `is_del` =? and `is_shelf` = ? order by RAND() limit ?",
fsProductRows, m.table)
err = m.conn.QueryRowsCtx(ctx, &resp, query, 0, 1, limit)
if err != nil {
return nil, err
}
return
}
func (m *defaultFsProductModel) GetProductListByIds(ctx context.Context, ids []string, sort string) (resp []FsProduct, err error) {
query := fmt.Sprintf("select %s from %s where `id` in (?) and `is_del` =? and `is_shelf` = ? and `status` =?",
fsProductRows, m.table)
switch sort {
case "sort-asc":
query = fmt.Sprintf("%s order by sort ASC", query)
case "sort-desc":
query = fmt.Sprintf("%s order by sort DESC", query)
default:
query = fmt.Sprintf("%s order by sort DESC", query)
}
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(ids, ","), 0, 1, 1)
if err != nil {
return nil, err
}
return
}

View File

@ -1,39 +0,0 @@
package gmodel
import (
"context"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsProductModel3dLightModel = (*customFsProductModel3dLightModel)(nil)
type (
// FsProductModel3dLightModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsProductModel3dLightModel.
FsProductModel3dLightModel interface {
fsProductModel3dLightModel
ListByIds(ctx context.Context, ids []string) (resp []FsProductModel3dLight, err error)
}
customFsProductModel3dLightModel struct {
*defaultFsProductModel3dLightModel
}
)
// NewFsProductModel3dLightModel returns a model for the database table.
func NewFsProductModel3dLightModel(conn sqlx.SqlConn) FsProductModel3dLightModel {
return &customFsProductModel3dLightModel{
defaultFsProductModel3dLightModel: newFsProductModel3dLightModel(conn),
}
}
func (m *defaultFsProductModel3dLightModel) ListByIds(ctx context.Context, ids []string) (resp []FsProductModel3dLight, err error) {
query := fmt.Sprintf("select %s from %s where `id` in (?)", fsProductModel3dLightRows, m.table)
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(ids, ","))
if err != nil {
return nil, err
}
return
}

View File

@ -1,87 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsProductModel3dLightFieldNames = builder.RawFieldNames(&FsProductModel3dLight{})
fsProductModel3dLightRows = strings.Join(fsProductModel3dLightFieldNames, ",")
fsProductModel3dLightRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductModel3dLightFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsProductModel3dLightRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductModel3dLightFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsProductModel3dLightModel interface {
Insert(ctx context.Context, data *FsProductModel3dLight) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsProductModel3dLight, error)
Update(ctx context.Context, data *FsProductModel3dLight) error
Delete(ctx context.Context, id int64) error
}
defaultFsProductModel3dLightModel struct {
conn sqlx.SqlConn
table string
}
FsProductModel3dLight struct {
Id int64 `db:"id"`
Name string `db:"name"` // 灯光名称
Info string `db:"info"` // 灯光数据json格式
Status int64 `db:"status"` // 状态值1显示0删除
Ctime sql.NullInt64 `db:"ctime"` // 创建时间
}
)
func newFsProductModel3dLightModel(conn sqlx.SqlConn) *defaultFsProductModel3dLightModel {
return &defaultFsProductModel3dLightModel{
conn: conn,
table: "`fs_product_model3d_light`",
}
}
func (m *defaultFsProductModel3dLightModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsProductModel3dLightModel) FindOne(ctx context.Context, id int64) (*FsProductModel3dLight, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductModel3dLightRows, m.table)
var resp FsProductModel3dLight
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsProductModel3dLightModel) Insert(ctx context.Context, data *FsProductModel3dLight) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?)", m.table, fsProductModel3dLightRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Name, data.Info, data.Status, data.Ctime)
return ret, err
}
func (m *defaultFsProductModel3dLightModel) Update(ctx context.Context, data *FsProductModel3dLight) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductModel3dLightRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.Name, data.Info, data.Status, data.Ctime, data.Id)
return err
}
func (m *defaultFsProductModel3dLightModel) tableName() string {
return m.table
}

View File

@ -1,42 +0,0 @@
package gmodel
import (
"context"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsProductModel3dModel = (*customFsProductModel3dModel)(nil)
type (
// FsProductModel3dModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsProductModel3dModel.
FsProductModel3dModel interface {
fsProductModel3dModel
ListBySizeIdsTag(ctx context.Context, sizeIds []string, tag int) (resp []FsProductModel3d, err error)
}
customFsProductModel3dModel struct {
*defaultFsProductModel3dModel
}
)
// NewFsProductModel3dModel returns a model for the database table.
func NewFsProductModel3dModel(conn sqlx.SqlConn) FsProductModel3dModel {
return &customFsProductModel3dModel{
defaultFsProductModel3dModel: newFsProductModel3dModel(conn),
}
}
func (m *defaultFsProductModel3dModel) ListBySizeIdsTag(ctx context.Context, sizeIds []string, tag int) (resp []FsProductModel3d, err error) {
if len(sizeIds) == 0 {
return nil, nil
}
query := fmt.Sprintf("select %s from %s where `size_id` in (?) and `tag` = ?", fsProductModel3dRows, m.table)
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(sizeIds, ","), tag)
if err != nil {
return nil, err
}
return
}

View File

@ -1,100 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsProductModel3dFieldNames = builder.RawFieldNames(&FsProductModel3d{})
fsProductModel3dRows = strings.Join(fsProductModel3dFieldNames, ",")
fsProductModel3dRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductModel3dFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsProductModel3dRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductModel3dFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsProductModel3dModel interface {
Insert(ctx context.Context, data *FsProductModel3d) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsProductModel3d, error)
Update(ctx context.Context, data *FsProductModel3d) error
Delete(ctx context.Context, id int64) error
}
defaultFsProductModel3dModel struct {
conn sqlx.SqlConn
table string
}
FsProductModel3d struct {
Id int64 `db:"id"`
ProductId sql.NullInt64 `db:"product_id"` // 产品ID
Tag int64 `db:"tag"` // 类别1模型2配件3场景
Title string `db:"title"` // 标题
Name string `db:"name"` // 详情页展示名称
ModelInfo string `db:"model_info"` // 模型详情
MaterialId int64 `db:"material_id"` // 材质ID
SizeId int64 `db:"size_id"` // 尺寸ID
Sort int64 `db:"sort"` // 排序
Light sql.NullInt64 `db:"light"` // 灯光组
LightList sql.NullString `db:"light_list"` // 灯光备选项
PartId sql.NullInt64 `db:"part_id"` // 配件选项id配件就是模型的id
PartList sql.NullString `db:"part_list"` // 配件备选项
Status int64 `db:"status"` // 状态位 显示 删除
Ctime int64 `db:"ctime"` // 添加时间
OptionTemplate sql.NullInt64 `db:"option_template"` // 配件绑定的公共模板
Price int64 `db:"price"` // 仅配件用,配件的价格, 单位:美分
Sku string `db:"sku"` // sku
}
)
func newFsProductModel3dModel(conn sqlx.SqlConn) *defaultFsProductModel3dModel {
return &defaultFsProductModel3dModel{
conn: conn,
table: "`fs_product_model3d`",
}
}
func (m *defaultFsProductModel3dModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsProductModel3dModel) FindOne(ctx context.Context, id int64) (*FsProductModel3d, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductModel3dRows, m.table)
var resp FsProductModel3d
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsProductModel3dModel) Insert(ctx context.Context, data *FsProductModel3d) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsProductModel3dRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.ProductId, data.Tag, data.Title, data.Name, data.ModelInfo, data.MaterialId, data.SizeId, data.Sort, data.Light, data.LightList, data.PartId, data.PartList, data.Status, data.Ctime, data.OptionTemplate, data.Price, data.Sku)
return ret, err
}
func (m *defaultFsProductModel3dModel) Update(ctx context.Context, data *FsProductModel3d) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductModel3dRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.ProductId, data.Tag, data.Title, data.Name, data.ModelInfo, data.MaterialId, data.SizeId, data.Sort, data.Light, data.LightList, data.PartId, data.PartList, data.Status, data.Ctime, data.OptionTemplate, data.Price, data.Sku, data.Id)
return err
}
func (m *defaultFsProductModel3dModel) tableName() string {
return m.table
}

View File

@ -1,126 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsProductFieldNames = builder.RawFieldNames(&FsProduct{})
fsProductRows = strings.Join(fsProductFieldNames, ",")
fsProductRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsProductRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsProductModel interface {
Insert(ctx context.Context, data *FsProduct) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsProduct, error)
FindOneBySn(ctx context.Context, sn string) (*FsProduct, error)
Update(ctx context.Context, data *FsProduct) error
Delete(ctx context.Context, id int64) error
}
defaultFsProductModel struct {
conn sqlx.SqlConn
table string
}
FsProduct struct {
Id int64 `db:"id"`
Sn string `db:"sn"` // 商品编号 P98f087j
Type int64 `db:"type"` // 分类ID
Title string `db:"title"` // 名称
TitleCn string `db:"title_cn"` // 中文名称
Cover string `db:"cover"` // 封面图
Imgs string `db:"imgs"` // 一个或多个介绍图或视频
Keywords string `db:"keywords"` // 关键字
Intro sql.NullString `db:"intro"` // 简要描述
Sort int64 `db:"sort"` // 排序
SelledNum int64 `db:"selled_num"` // 已卖数量
Ctime sql.NullInt64 `db:"ctime"` // 添加时间
View int64 `db:"view"` // 浏览量
SizeIds sql.NullString `db:"size_ids"` // 尺寸 1,2,3,4
MaterialIds string `db:"material_ids"` // 材质 1,2,3
TagIds sql.NullString `db:"tag_ids"` // 标签 逗号间隔
Status int64 `db:"status"` // 状态位 弃用
ProduceDays int64 `db:"produce_days"` // 生产天数
DeliveryDays int64 `db:"delivery_days"` // 运送天数
CoverImg string `db:"cover_img"` // 背景图
IsShelf int64 `db:"is_shelf"` // 是否上架
IsRecommend int64 `db:"is_recommend"` // 是否推荐
IsHot int64 `db:"is_hot"` // 是否热销
IsProtection int64 `db:"is_protection"` // 是否环保
IsMicrowave int64 `db:"is_microwave"` // 是否可微波炉
IsDel int64 `db:"is_del"` // 是否删除
RecommendProduct sql.NullString `db:"recommend_product"` // 推荐产品id例如: 1,3,4,5
RecommendProductSort sql.NullString `db:"recommend_product_sort"` // 推荐排序例如:1324
SceneIds sql.NullString `db:"scene_ids"` // 关联的场景id
}
)
func newFsProductModel(conn sqlx.SqlConn) *defaultFsProductModel {
return &defaultFsProductModel{
conn: conn,
table: "`fs_product`",
}
}
func (m *defaultFsProductModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsProductModel) FindOne(ctx context.Context, id int64) (*FsProduct, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductRows, m.table)
var resp FsProduct
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsProductModel) FindOneBySn(ctx context.Context, sn string) (*FsProduct, error) {
var resp FsProduct
query := fmt.Sprintf("select %s from %s where `sn` = ? limit 1", fsProductRows, m.table)
err := m.conn.QueryRowCtx(ctx, &resp, query, sn)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsProductModel) Insert(ctx context.Context, data *FsProduct) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsProductRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Sn, data.Type, data.Title, data.TitleCn, data.Cover, data.Imgs, data.Keywords, data.Intro, data.Sort, data.SelledNum, data.Ctime, data.View, data.SizeIds, data.MaterialIds, data.TagIds, data.Status, data.ProduceDays, data.DeliveryDays, data.CoverImg, data.IsShelf, data.IsRecommend, data.IsHot, data.IsProtection, data.IsMicrowave, data.IsDel, data.RecommendProduct, data.RecommendProductSort, data.SceneIds)
return ret, err
}
func (m *defaultFsProductModel) Update(ctx context.Context, newData *FsProduct) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, newData.Sn, newData.Type, newData.Title, newData.TitleCn, newData.Cover, newData.Imgs, newData.Keywords, newData.Intro, newData.Sort, newData.SelledNum, newData.Ctime, newData.View, newData.SizeIds, newData.MaterialIds, newData.TagIds, newData.Status, newData.ProduceDays, newData.DeliveryDays, newData.CoverImg, newData.IsShelf, newData.IsRecommend, newData.IsHot, newData.IsProtection, newData.IsMicrowave, newData.IsDel, newData.RecommendProduct, newData.RecommendProductSort, newData.SceneIds, newData.Id)
return err
}
func (m *defaultFsProductModel) tableName() string {
return m.table
}

View File

@ -1,74 +0,0 @@
package gmodel
import (
"context"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsProductPriceModel = (*customFsProductPriceModel)(nil)
type (
// FsProductPriceModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsProductPriceModel.
FsProductPriceModel interface {
fsProductPriceModel
GetPriceListByProductIds(ctx context.Context, productIds []string) (resp []GetPriceListRsp, err error)
GetPriceListBySizeIds(ctx context.Context, sizeIds []string) (resp []FsProductPrice, err error)
FindOneByProductIdMaterialIdSizeId(ctx context.Context, productId int64, materialId int64, sizeId int64) (*FsProductPrice, error)
}
customFsProductPriceModel struct {
*defaultFsProductPriceModel
}
)
// NewFsProductPriceModel returns a model for the database table.
func NewFsProductPriceModel(conn sqlx.SqlConn) FsProductPriceModel {
return &customFsProductPriceModel{
defaultFsProductPriceModel: newFsProductPriceModel(conn),
}
}
type GetPriceListRsp struct {
ProductId int64 `json:"product_id"`
Price string `json:"price"`
}
func (m *defaultFsProductPriceModel) GetPriceListByProductIds(ctx context.Context, productIds []string) (resp []GetPriceListRsp, err error) {
if len(productIds) == 0 {
return nil, nil
}
query := fmt.Sprintf("select %s from %s where `product_id` in (?) and `status` = ? group by product_id", "product_id,group_concat(step_price) as price ", m.table)
if err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(productIds, ","), 1); err != nil {
return nil, err
}
return
}
func (m *defaultFsProductPriceModel) FindOneByProductIdMaterialIdSizeId(ctx context.Context, productId int64, materialId int64, sizeId int64) (*FsProductPrice, error) {
var resp FsProductPrice
query := fmt.Sprintf("select %s from %s where `product_id` = ? and `material_id` = ? and `size_id` = ? limit 1", fsProductPriceRows, m.table)
err := m.conn.QueryRowCtx(ctx, &resp, query, productId, materialId, sizeId)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsProductPriceModel) GetPriceListBySizeIds(ctx context.Context, sizeIds []string) (resp []FsProductPrice, err error) {
if len(sizeIds) == 0 {
return nil, nil
}
query := fmt.Sprintf("select %s from %s where `size_id` in (?) and `status` = ? ", fsProductPriceRows, m.table)
if err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(sizeIds, ","), 1); err != nil {
return nil, err
}
return
}

View File

@ -1,95 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsProductPriceFieldNames = builder.RawFieldNames(&FsProductPrice{})
fsProductPriceRows = strings.Join(fsProductPriceFieldNames, ",")
fsProductPriceRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductPriceFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsProductPriceRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductPriceFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsProductPriceModel interface {
Insert(ctx context.Context, data *FsProductPrice) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsProductPrice, error)
Update(ctx context.Context, data *FsProductPrice) error
Delete(ctx context.Context, id int64) error
}
defaultFsProductPriceModel struct {
conn sqlx.SqlConn
table string
}
FsProductPrice struct {
Id int64 `db:"id"`
Sn string `db:"sn"` // 唯一编码
Title string `db:"title"` // 标题描述
ProductId int64 `db:"product_id"` // 产品ID
MaterialId int64 `db:"material_id"` // 材质ID
SizeId int64 `db:"size_id"` // 尺寸ID
EachBoxNum int64 `db:"each_box_num"` // 每一箱的个数
EachBoxWeight float64 `db:"each_box_weight"` // 每一箱的重量 单位KG
MinBuyNum int64 `db:"min_buy_num"` // 最少购买量
StepNum string `db:"step_num"` // 数量阶梯 eg:10,20,30
StepPrice string `db:"step_price"` // 价格阶梯 eg:100,50,25
Status int64 `db:"status"` // 是否可用
IsDefault int64 `db:"is_default"` // 是否默认
}
)
func newFsProductPriceModel(conn sqlx.SqlConn) *defaultFsProductPriceModel {
return &defaultFsProductPriceModel{
conn: conn,
table: "`fs_product_price`",
}
}
func (m *defaultFsProductPriceModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsProductPriceModel) FindOne(ctx context.Context, id int64) (*FsProductPrice, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductPriceRows, m.table)
var resp FsProductPrice
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsProductPriceModel) Insert(ctx context.Context, data *FsProductPrice) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsProductPriceRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Sn, data.Title, data.ProductId, data.MaterialId, data.SizeId, data.EachBoxNum, data.EachBoxWeight, data.MinBuyNum, data.StepNum, data.StepPrice, data.Status, data.IsDefault)
return ret, err
}
func (m *defaultFsProductPriceModel) Update(ctx context.Context, newData *FsProductPrice) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductPriceRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, newData.Sn, newData.Title, newData.ProductId, newData.MaterialId, newData.SizeId, newData.EachBoxNum, newData.EachBoxWeight, newData.MinBuyNum, newData.StepNum, newData.StepPrice, newData.Status, newData.IsDefault, newData.Id)
return err
}
func (m *defaultFsProductPriceModel) tableName() string {
return m.table
}

View File

@ -1,70 +0,0 @@
package gmodel
import (
"context"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsProductSizeModel = (*customFsProductSizeModel)(nil)
type (
// FsProductSizeModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsProductSizeModel.
FsProductSizeModel interface {
fsProductSizeModel
CountByStatus(ctx context.Context, status int) (total int, err error)
GetAllByProductIds(ctx context.Context, productIds []string, sort string) (resp []FsProductSize, err error)
GetAllByIds(ctx context.Context, ids []string, sort string) (resp []FsProductSize, err error)
}
customFsProductSizeModel struct {
*defaultFsProductSizeModel
}
)
// NewFsProductSizeModel returns a model for the database table.
func NewFsProductSizeModel(conn sqlx.SqlConn) FsProductSizeModel {
return &customFsProductSizeModel{
defaultFsProductSizeModel: newFsProductSizeModel(conn),
}
}
func (m *defaultFsProductSizeModel) CountByStatus(ctx context.Context, status int) (total int, err error) {
query := fmt.Sprintf("select %s from %s where `status` = ? limit 1", "count(*) as num", m.table)
err = m.conn.QueryRowCtx(ctx, &total, query, status)
if err != nil {
return 0, err
}
return
}
func (m *defaultFsProductSizeModel) GetAllByProductIds(ctx context.Context, productIds []string, sort string) (resp []FsProductSize, err error) {
query := fmt.Sprintf("select %s from %s where `product_id` in(?) and `status` = ? ", fsProductSizeRows, m.table)
switch sort {
case "sort-asc":
query = fmt.Sprintf("%s order by `sort` ASC", query)
case "sort-desc":
query = fmt.Sprintf("%s order by `sort` DESC", query)
}
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(productIds, ","), 1)
if err != nil {
return nil, err
}
return
}
func (m *defaultFsProductSizeModel) GetAllByIds(ctx context.Context, ids []string, sort string) (resp []FsProductSize, err error) {
query := fmt.Sprintf("select %s from %s where `id` in (?) and `status` = ? ", fsProductSizeRows, m.table)
switch sort {
case "sort-asc":
query = fmt.Sprintf("%s order by `sort` ASC", query)
case "sort-desc":
query = fmt.Sprintf("%s order by `sort` DESC", query)
}
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(ids, ","), 1)
if err != nil {
return nil, err
}
return
}

View File

@ -1,92 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsProductSizeFieldNames = builder.RawFieldNames(&FsProductSize{})
fsProductSizeRows = strings.Join(fsProductSizeFieldNames, ",")
fsProductSizeRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductSizeFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsProductSizeRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductSizeFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsProductSizeModel interface {
Insert(ctx context.Context, data *FsProductSize) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsProductSize, error)
Update(ctx context.Context, data *FsProductSize) error
Delete(ctx context.Context, id int64) error
}
defaultFsProductSizeModel struct {
conn sqlx.SqlConn
table string
}
FsProductSize struct {
Id int64 `db:"id"`
ProductId int64 `db:"product_id"` // 产品ID
Title string `db:"title"` // 标题 10*10*20
Cover sql.NullString `db:"cover"` // 封面图
CoverImg sql.NullString `db:"cover_img"` // 背景图
Capacity string `db:"capacity"` // 自己填的尺寸名称
Status int64 `db:"status"` // 状态位 显示 删除
Sort int64 `db:"sort"` // 排序
Remark sql.NullString `db:"remark"` // 备注信息
PartsCanDeleted int64 `db:"parts_can_deleted"` // 配件是否可移除 1是0否
}
)
func newFsProductSizeModel(conn sqlx.SqlConn) *defaultFsProductSizeModel {
return &defaultFsProductSizeModel{
conn: conn,
table: "`fs_product_size`",
}
}
func (m *defaultFsProductSizeModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsProductSizeModel) FindOne(ctx context.Context, id int64) (*FsProductSize, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductSizeRows, m.table)
var resp FsProductSize
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsProductSizeModel) Insert(ctx context.Context, data *FsProductSize) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsProductSizeRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.ProductId, data.Title, data.Cover, data.CoverImg, data.Capacity, data.Status, data.Sort, data.Remark, data.PartsCanDeleted)
return ret, err
}
func (m *defaultFsProductSizeModel) Update(ctx context.Context, data *FsProductSize) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductSizeRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.ProductId, data.Title, data.Cover, data.CoverImg, data.Capacity, data.Status, data.Sort, data.Remark, data.PartsCanDeleted, data.Id)
return err
}
func (m *defaultFsProductSizeModel) tableName() string {
return m.table
}

View File

@ -1,41 +0,0 @@
package gmodel
import (
"context"
"fmt"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsProductTemplateTagsModel = (*customFsProductTemplateTagsModel)(nil)
type (
// FsProductTemplateTagsModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsProductTemplateTagsModel.
FsProductTemplateTagsModel interface {
fsProductTemplateTagsModel
ListByIds(ctx context.Context, ids []string) (resp []FsProductTemplateTags, err error)
}
customFsProductTemplateTagsModel struct {
*defaultFsProductTemplateTagsModel
}
)
// NewFsProductTemplateTagsModel returns a model for the database table.
func NewFsProductTemplateTagsModel(conn sqlx.SqlConn) FsProductTemplateTagsModel {
return &customFsProductTemplateTagsModel{
defaultFsProductTemplateTagsModel: newFsProductTemplateTagsModel(conn),
}
}
func (m *defaultFsProductTemplateTagsModel) ListByIds(ctx context.Context, ids []string) (resp []FsProductTemplateTags, err error) {
if len(ids) == 0 {
return nil, nil
}
query := fmt.Sprintf("select %s from %s where `id` in (?) ", fsProductTemplateTagsRows, m.table)
err = m.conn.QueryRowsCtx(ctx, &resp, query, ids)
if err != nil {
return nil, err
}
return
}

View File

@ -1,86 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsProductTemplateTagsFieldNames = builder.RawFieldNames(&FsProductTemplateTags{})
fsProductTemplateTagsRows = strings.Join(fsProductTemplateTagsFieldNames, ",")
fsProductTemplateTagsRowsExpectAutoSet = strings.Join(stringx.Remove(fsProductTemplateTagsFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsProductTemplateTagsRowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductTemplateTagsFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsProductTemplateTagsModel interface {
Insert(ctx context.Context, data *FsProductTemplateTags) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsProductTemplateTags, error)
Update(ctx context.Context, data *FsProductTemplateTags) error
Delete(ctx context.Context, id int64) error
}
defaultFsProductTemplateTagsModel struct {
conn sqlx.SqlConn
table string
}
FsProductTemplateTags struct {
Id int64 `db:"id"` // ID
Title string `db:"title"` // 标题
Status int64 `db:"status"` // 状态 1可用
CreateAt int64 `db:"create_at"` // 创建时间
}
)
func newFsProductTemplateTagsModel(conn sqlx.SqlConn) *defaultFsProductTemplateTagsModel {
return &defaultFsProductTemplateTagsModel{
conn: conn,
table: "`fs_product_template_tags`",
}
}
func (m *defaultFsProductTemplateTagsModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsProductTemplateTagsModel) FindOne(ctx context.Context, id int64) (*FsProductTemplateTags, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductTemplateTagsRows, m.table)
var resp FsProductTemplateTags
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsProductTemplateTagsModel) Insert(ctx context.Context, data *FsProductTemplateTags) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?)", m.table, fsProductTemplateTagsRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.Status)
return ret, err
}
func (m *defaultFsProductTemplateTagsModel) Update(ctx context.Context, data *FsProductTemplateTags) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductTemplateTagsRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.Title, data.Status, data.Id)
return err
}
func (m *defaultFsProductTemplateTagsModel) tableName() string {
return m.table
}

View File

@ -1,73 +0,0 @@
package gmodel
import (
"context"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsProductTemplateV2Model = (*customFsProductTemplateV2Model)(nil)
type (
// FsProductTemplateV2Model is an interface to be customized, add more methods here,
// and implement the added methods in customFsProductTemplateV2Model.
FsProductTemplateV2Model interface {
fsProductTemplateV2Model
FindAllByCondition(ctx context.Context, productIds []string) (resp []FsProductTemplateV2, err error)
FindAllByModelIdsProduct(ctx context.Context, modelIds []string, productId int64, sort int) (resp []FsProductTemplateV2, err error)
FindAllByModelIds(ctx context.Context, modelIds []string, sort int) (resp []FsProductTemplateV2, err error)
}
customFsProductTemplateV2Model struct {
*defaultFsProductTemplateV2Model
}
)
// NewFsProductTemplateV2Model returns a model for the database table.
func NewFsProductTemplateV2Model(conn sqlx.SqlConn) FsProductTemplateV2Model {
return &customFsProductTemplateV2Model{
defaultFsProductTemplateV2Model: newFsProductTemplateV2Model(conn),
}
}
func (m *defaultFsProductTemplateV2Model) FindAllByCondition(ctx context.Context, productIds []string) (resp []FsProductTemplateV2, err error) {
query := fmt.Sprintf("select %s from %s where `id` in (?) and `is_del` = ? and `status` = ?", fsProductTemplateV2Rows, m.table)
if err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(productIds, ","), 0, 1); err != nil {
return nil, err
}
return
}
func (m *defaultFsProductTemplateV2Model) FindAllByModelIdsProduct(ctx context.Context, modelIds []string, productId int64, sort int) (resp []FsProductTemplateV2, err error) {
if len(modelIds) == 0 {
return
}
query := fmt.Sprintf("select %s from %s where `model_id` in (?) and `product_id` = ? and `is_del` = ? and `status` = ?", fsProductTemplateV2Rows, m.table)
switch sort {
case 1:
query = fmt.Sprintf("%s order by `sort` ASC", query)
case 2:
query = fmt.Sprintf("%s order by `sort` DESC", query)
}
if err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(modelIds, ","), productId, 0, 1); err != nil {
return nil, err
}
return
}
func (m *defaultFsProductTemplateV2Model) FindAllByModelIds(ctx context.Context, modelIds []string, sort int) (resp []FsProductTemplateV2, err error) {
if len(modelIds) == 0 {
return
}
query := fmt.Sprintf("select %s from %s where `model_id` in (?) and `is_del` = ? and `status` = ?", fsProductTemplateV2Rows, m.table)
switch sort {
case 1:
query = fmt.Sprintf("%s order by `sort` ASC", query)
case 2:
query = fmt.Sprintf("%s order by `sort` DESC", query)
}
if err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(modelIds, ","), 0, 1); err != nil {
return nil, err
}
return
}

View File

@ -1,97 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsProductTemplateV2FieldNames = builder.RawFieldNames(&FsProductTemplateV2{})
fsProductTemplateV2Rows = strings.Join(fsProductTemplateV2FieldNames, ",")
fsProductTemplateV2RowsExpectAutoSet = strings.Join(stringx.Remove(fsProductTemplateV2FieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsProductTemplateV2RowsWithPlaceHolder = strings.Join(stringx.Remove(fsProductTemplateV2FieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsProductTemplateV2Model interface {
Insert(ctx context.Context, data *FsProductTemplateV2) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsProductTemplateV2, error)
Update(ctx context.Context, data *FsProductTemplateV2) error
Delete(ctx context.Context, id int64) error
}
defaultFsProductTemplateV2Model struct {
conn sqlx.SqlConn
table string
}
FsProductTemplateV2 struct {
Id int64 `db:"id"`
ProductId int64 `db:"product_id"` // 产品ID
ModelId int64 `db:"model_id"` // 模型ID
Title string `db:"title"` // 模板sku,预留字段
Name string `db:"name"` // 名称
CoverImg sql.NullString `db:"cover_img"` // 模板背景图
TemplateInfo string `db:"template_info"` // 模板详情
MaterialImg sql.NullString `db:"material_img"` // 合成好的贴图
Sort int64 `db:"sort"` // 排序
LogoWidth int64 `db:"logo_width"` // logo图最大宽度
LogoHeight int64 `db:"logo_height"` // logo图最大高度
IsPublic int64 `db:"is_public"` // 是否可公用1:可以0不可以
Status int64 `db:"status"` // 状态1正常 2异常
Ctime int64 `db:"ctime"` // 添加时间
Tag string `db:"tag"` // 标签(用户自填)
IsDel int64 `db:"is_del"` // 是否删除 1删除
}
)
func newFsProductTemplateV2Model(conn sqlx.SqlConn) *defaultFsProductTemplateV2Model {
return &defaultFsProductTemplateV2Model{
conn: conn,
table: "`fs_product_template_v2`",
}
}
func (m *defaultFsProductTemplateV2Model) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsProductTemplateV2Model) FindOne(ctx context.Context, id int64) (*FsProductTemplateV2, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsProductTemplateV2Rows, m.table)
var resp FsProductTemplateV2
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsProductTemplateV2Model) Insert(ctx context.Context, data *FsProductTemplateV2) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsProductTemplateV2RowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.ProductId, data.ModelId, data.Title, data.Name, data.CoverImg, data.TemplateInfo, data.MaterialImg, data.Sort, data.LogoWidth, data.LogoHeight, data.IsPublic, data.Status, data.Ctime, data.Tag, data.IsDel)
return ret, err
}
func (m *defaultFsProductTemplateV2Model) Update(ctx context.Context, data *FsProductTemplateV2) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsProductTemplateV2RowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.ProductId, data.ModelId, data.Title, data.Name, data.CoverImg, data.TemplateInfo, data.MaterialImg, data.Sort, data.LogoWidth, data.LogoHeight, data.IsPublic, data.Status, data.Ctime, data.Tag, data.IsDel, data.Id)
return err
}
func (m *defaultFsProductTemplateV2Model) tableName() string {
return m.table
}

View File

@ -1,39 +0,0 @@
package gmodel
import (
"context"
"fmt"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsQrcodeSetModel = (*customFsQrcodeSetModel)(nil)
type (
// FsQrcodeSetModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsQrcodeSetModel.
FsQrcodeSetModel interface {
fsQrcodeSetModel
GetAll(ctx context.Context) (resp []FsQrcodeSet, err error)
}
customFsQrcodeSetModel struct {
*defaultFsQrcodeSetModel
}
)
// NewFsQrcodeSetModel returns a model for the database table.
func NewFsQrcodeSetModel(conn sqlx.SqlConn) FsQrcodeSetModel {
return &customFsQrcodeSetModel{
defaultFsQrcodeSetModel: newFsQrcodeSetModel(conn),
}
}
func (m *defaultFsQrcodeSetModel) GetAll(ctx context.Context) (resp []FsQrcodeSet, err error) {
query := fmt.Sprintf("select %s from %s where `status` = ?", fsQrcodeSetRows, m.table)
err = m.conn.QueryRowsCtx(ctx, &resp, query, 1)
if err != nil {
return nil, err
}
return
}

View File

@ -1,94 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsQrcodeSetFieldNames = builder.RawFieldNames(&FsQrcodeSet{})
fsQrcodeSetRows = strings.Join(fsQrcodeSetFieldNames, ",")
fsQrcodeSetRowsExpectAutoSet = strings.Join(stringx.Remove(fsQrcodeSetFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsQrcodeSetRowsWithPlaceHolder = strings.Join(stringx.Remove(fsQrcodeSetFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsQrcodeSetModel interface {
Insert(ctx context.Context, data *FsQrcodeSet) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsQrcodeSet, error)
Update(ctx context.Context, data *FsQrcodeSet) error
Delete(ctx context.Context, id int64) error
}
defaultFsQrcodeSetModel struct {
conn sqlx.SqlConn
table string
}
FsQrcodeSet struct {
Id int64 `db:"id"` // id
Name string `db:"name"` // 二维码组件名称
Size int64 `db:"size"` // 二维码内容尺寸
IndexX int64 `db:"index_x"` // x偏移量
IndexY int64 `db:"index_y"` // y偏移量
SvgWebsite sql.NullString `db:"svg_website"` // website d数据
SvgInstagram sql.NullString `db:"svg_instagram"` // svg instagram d数据
SvgFacebook sql.NullString `db:"svg_facebook"` // svg facebook d数据
Status int64 `db:"status"` // 状态
AdminId int64 `db:"admin_id"` // 操作人
Ctime int64 `db:"ctime"` // 添加时间
Utime int64 `db:"utime"` // 更新时间
}
)
func newFsQrcodeSetModel(conn sqlx.SqlConn) *defaultFsQrcodeSetModel {
return &defaultFsQrcodeSetModel{
conn: conn,
table: "`fs_qrcode_set`",
}
}
func (m *defaultFsQrcodeSetModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsQrcodeSetModel) FindOne(ctx context.Context, id int64) (*FsQrcodeSet, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsQrcodeSetRows, m.table)
var resp FsQrcodeSet
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsQrcodeSetModel) Insert(ctx context.Context, data *FsQrcodeSet) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsQrcodeSetRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Name, data.Size, data.IndexX, data.IndexY, data.SvgWebsite, data.SvgInstagram, data.SvgFacebook, data.Status, data.AdminId, data.Ctime, data.Utime)
return ret, err
}
func (m *defaultFsQrcodeSetModel) Update(ctx context.Context, data *FsQrcodeSet) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsQrcodeSetRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.Name, data.Size, data.IndexX, data.IndexY, data.SvgWebsite, data.SvgInstagram, data.SvgFacebook, data.Status, data.AdminId, data.Ctime, data.Utime, data.Id)
return err
}
func (m *defaultFsQrcodeSetModel) tableName() string {
return m.table
}

View File

@ -1,39 +0,0 @@
package gmodel
import (
"context"
"fmt"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsStandardLogoModel = (*customFsStandardLogoModel)(nil)
type (
// FsStandardLogoModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsStandardLogoModel.
FsStandardLogoModel interface {
fsStandardLogoModel
GetAll(ctx context.Context) (resp []FsStandardLogo, err error)
}
customFsStandardLogoModel struct {
*defaultFsStandardLogoModel
}
)
// NewFsStandardLogoModel returns a model for the database table.
func NewFsStandardLogoModel(conn sqlx.SqlConn) FsStandardLogoModel {
return &customFsStandardLogoModel{
defaultFsStandardLogoModel: newFsStandardLogoModel(conn),
}
}
func (m *defaultFsStandardLogoModel) GetAll(ctx context.Context) (resp []FsStandardLogo, err error) {
query := fmt.Sprintf("select %s from %s where `status` = ? ", fsStandardLogoRows, m.table)
err = m.conn.QueryRowsCtx(ctx, &resp, query, 1)
if err != nil {
return nil, err
}
return
}

View File

@ -1,87 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsStandardLogoFieldNames = builder.RawFieldNames(&FsStandardLogo{})
fsStandardLogoRows = strings.Join(fsStandardLogoFieldNames, ",")
fsStandardLogoRowsExpectAutoSet = strings.Join(stringx.Remove(fsStandardLogoFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsStandardLogoRowsWithPlaceHolder = strings.Join(stringx.Remove(fsStandardLogoFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsStandardLogoModel interface {
Insert(ctx context.Context, data *FsStandardLogo) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsStandardLogo, error)
Update(ctx context.Context, data *FsStandardLogo) error
Delete(ctx context.Context, id int64) error
}
defaultFsStandardLogoModel struct {
conn sqlx.SqlConn
table string
}
FsStandardLogo struct {
Id int64 `db:"id"` // ID
Name string `db:"name"` // logo名称
Image string `db:"image"` // 图片地址
Ctime int64 `db:"ctime"` // 添加时间
Status int64 `db:"status"` // 状态 1正常 0删除
}
)
func newFsStandardLogoModel(conn sqlx.SqlConn) *defaultFsStandardLogoModel {
return &defaultFsStandardLogoModel{
conn: conn,
table: "`fs_standard_logo`",
}
}
func (m *defaultFsStandardLogoModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsStandardLogoModel) FindOne(ctx context.Context, id int64) (*FsStandardLogo, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsStandardLogoRows, m.table)
var resp FsStandardLogo
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsStandardLogoModel) Insert(ctx context.Context, data *FsStandardLogo) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?)", m.table, fsStandardLogoRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Name, data.Image, data.Ctime, data.Status)
return ret, err
}
func (m *defaultFsStandardLogoModel) Update(ctx context.Context, data *FsStandardLogo) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsStandardLogoRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.Name, data.Image, data.Ctime, data.Status, data.Id)
return err
}
func (m *defaultFsStandardLogoModel) tableName() string {
return m.table
}

View File

@ -1,49 +0,0 @@
package gmodel
import (
"context"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsTagsModel = (*customFsTagsModel)(nil)
type (
// FsTagsModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsTagsModel.
FsTagsModel interface {
fsTagsModel
GetAllByLevel(ctx context.Context, level int) (resp []FsTags, err error)
GetAllByIds(ctx context.Context, ids []string) (resp []FsTags, err error)
}
customFsTagsModel struct {
*defaultFsTagsModel
}
)
// NewFsTagsModel returns a model for the database table.
func NewFsTagsModel(conn sqlx.SqlConn) FsTagsModel {
return &customFsTagsModel{
defaultFsTagsModel: newFsTagsModel(conn),
}
}
func (m *defaultFsTagsModel) GetAllByLevel(ctx context.Context, level int) (resp []FsTags, err error) {
query := fmt.Sprintf("select %s from %s where `level` = ? and `status` = ?", fsTagsRows, m.table)
err = m.conn.QueryRowsCtx(ctx, &resp, query, level, 1)
if err != nil {
return nil, err
}
return
}
func (m *defaultFsTagsModel) GetAllByIds(ctx context.Context, ids []string) (resp []FsTags, err error) {
query := fmt.Sprintf("select %s from %s where `id` in (?) and `status` = ?", fsTagsRows, m.table)
err = m.conn.QueryRowsCtx(ctx, &resp, query, strings.Join(ids, ","), 1)
if err != nil {
return nil, err
}
return
}

View File

@ -1,93 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsTagsFieldNames = builder.RawFieldNames(&FsTags{})
fsTagsRows = strings.Join(fsTagsFieldNames, ",")
fsTagsRowsExpectAutoSet = strings.Join(stringx.Remove(fsTagsFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsTagsRowsWithPlaceHolder = strings.Join(stringx.Remove(fsTagsFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsTagsModel interface {
Insert(ctx context.Context, data *FsTags) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsTags, error)
Update(ctx context.Context, data *FsTags) error
Delete(ctx context.Context, id int64) error
}
defaultFsTagsModel struct {
conn sqlx.SqlConn
table string
}
FsTags struct {
Id int64 `db:"id"` // ID
Title string `db:"title"` // 标题
Level int64 `db:"level"` // 层级、分类 1 => 二维码分类
ClickNum int64 `db:"click_num"` // 点击次数
Sort int64 `db:"sort"` // 排序(从大到小)
CreateAt int64 `db:"create_at"` // 创建时间
Icon sql.NullString `db:"icon"` // 标签图标
Status int64 `db:"status"` // 状态 1可用
Description string `db:"description"` // 介绍 Seo
RecommendProduct sql.NullString `db:"recommend_product"` // 推荐产品id例如: 1,3,4,5
RecommendProductSort sql.NullString `db:"recommend_product_sort"` // 推荐排序例如:1324
}
)
func newFsTagsModel(conn sqlx.SqlConn) *defaultFsTagsModel {
return &defaultFsTagsModel{
conn: conn,
table: "`fs_tags`",
}
}
func (m *defaultFsTagsModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsTagsModel) FindOne(ctx context.Context, id int64) (*FsTags, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsTagsRows, m.table)
var resp FsTags
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsTagsModel) Insert(ctx context.Context, data *FsTags) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsTagsRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.Title, data.Level, data.ClickNum, data.Sort, data.Icon, data.Status, data.Description, data.RecommendProduct, data.RecommendProductSort)
return ret, err
}
func (m *defaultFsTagsModel) Update(ctx context.Context, data *FsTags) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsTagsRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, data.Title, data.Level, data.ClickNum, data.Sort, data.Icon, data.Status, data.Description, data.RecommendProduct, data.RecommendProductSort, data.Id)
return err
}
func (m *defaultFsTagsModel) tableName() string {
return m.table
}

View File

@ -1,36 +0,0 @@
package gmodel
import (
"context"
"fmt"
"github.com/zeromicro/go-zero/core/stores/sqlx"
)
var _ FsUserModel = (*customFsUserModel)(nil)
type (
// FsUserModel is an interface to be customized, add more methods here,
// and implement the added methods in customFsUserModel.
FsUserModel interface {
fsUserModel
UpdateVerificationToken(ctx context.Context, userid int64, token string) error
}
customFsUserModel struct {
*defaultFsUserModel
}
)
// NewFsUserModel returns a model for the database table.
func NewFsUserModel(conn sqlx.SqlConn) FsUserModel {
return &customFsUserModel{
defaultFsUserModel: newFsUserModel(conn),
}
}
func (m *defaultFsUserModel) UpdateVerificationToken(ctx context.Context, userid int64, verificationToken string) error {
query := fmt.Sprintf("update %s set `verification_token` = ? where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, verificationToken, userid)
return err
}

View File

@ -1,153 +0,0 @@
// Code generated by goctl. DO NOT EDIT.
package gmodel
import (
"context"
"database/sql"
"fmt"
"strings"
"github.com/zeromicro/go-zero/core/stores/builder"
"github.com/zeromicro/go-zero/core/stores/sqlc"
"github.com/zeromicro/go-zero/core/stores/sqlx"
"github.com/zeromicro/go-zero/core/stringx"
)
var (
fsUserFieldNames = builder.RawFieldNames(&FsUser{})
fsUserRows = strings.Join(fsUserFieldNames, ",")
fsUserRowsExpectAutoSet = strings.Join(stringx.Remove(fsUserFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",")
fsUserRowsWithPlaceHolder = strings.Join(stringx.Remove(fsUserFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?"
)
type (
fsUserModel interface {
Insert(ctx context.Context, data *FsUser) (sql.Result, error)
FindOne(ctx context.Context, id int64) (*FsUser, error)
FindOneByEmail(ctx context.Context, email string) (*FsUser, error)
FindOneByPasswordResetToken(ctx context.Context, passwordResetToken sql.NullString) (*FsUser, error)
FindOneByUsername(ctx context.Context, username sql.NullString) (*FsUser, error)
Update(ctx context.Context, data *FsUser) error
Delete(ctx context.Context, id int64) error
}
defaultFsUserModel struct {
conn sqlx.SqlConn
table string
}
FsUser struct {
Id int64 `db:"id"` // ID
FaceId int64 `db:"face_id"` // facebook的userid
Sub int64 `db:"sub"` // google的sub
FirstName sql.NullString `db:"first_name"` // FirstName
LastName sql.NullString `db:"last_name"` // LastName
Username sql.NullString `db:"username"` // 用户名
Company sql.NullString `db:"company"` // 公司名称
Mobile sql.NullString `db:"mobile"` // 手机号码
AuthKey string `db:"auth_key"`
PasswordHash string `db:"password_hash"`
VerificationToken sql.NullString `db:"verification_token"`
PasswordResetToken sql.NullString `db:"password_reset_token"`
Email string `db:"email"` // 邮箱
Type int64 `db:"type"` // 1普通餐厅 2连锁餐厅
Status int64 `db:"status"` // 1正常 0不正常
IsDel int64 `db:"is_del"` // 是否删除 1删除
CreatedAt int64 `db:"created_at"` // 添加时间
UpdatedAt int64 `db:"updated_at"` // 更新时间
IsOrderStatusEmail int64 `db:"is_order_status_email"` // 订单状态改变时是否接收邮件
IsEmailAdvertisement int64 `db:"is_email_advertisement"` // 是否接收邮件广告
IsOrderStatusPhone int64 `db:"is_order_status_phone"` // 订单状态改变是是否接收电话
IsPhoneAdvertisement int64 `db:"is_phone_advertisement"` // 是否接收短信广告
IsOpenRender int64 `db:"is_open_render"` // 是否打开个性化渲染1开启0关闭
IsThousandFace int64 `db:"is_thousand_face"` // 是否已经存在千人千面1存在0不存在
IsLowRendering int64 `db:"is_low_rendering"` // 是否开启低渲染模型渲染
IsRemoveBg int64 `db:"is_remove_bg"` // 用户上传logo是否去除背景
}
)
func newFsUserModel(conn sqlx.SqlConn) *defaultFsUserModel {
return &defaultFsUserModel{
conn: conn,
table: "`fs_user`",
}
}
func (m *defaultFsUserModel) Delete(ctx context.Context, id int64) error {
query := fmt.Sprintf("delete from %s where `id` = ?", m.table)
_, err := m.conn.ExecCtx(ctx, query, id)
return err
}
func (m *defaultFsUserModel) FindOne(ctx context.Context, id int64) (*FsUser, error) {
query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", fsUserRows, m.table)
var resp FsUser
err := m.conn.QueryRowCtx(ctx, &resp, query, id)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsUserModel) FindOneByEmail(ctx context.Context, email string) (*FsUser, error) {
var resp FsUser
query := fmt.Sprintf("select %s from %s where `email` = ? limit 1", fsUserRows, m.table)
err := m.conn.QueryRowCtx(ctx, &resp, query, email)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsUserModel) FindOneByPasswordResetToken(ctx context.Context, passwordResetToken sql.NullString) (*FsUser, error) {
var resp FsUser
query := fmt.Sprintf("select %s from %s where `password_reset_token` = ? limit 1", fsUserRows, m.table)
err := m.conn.QueryRowCtx(ctx, &resp, query, passwordResetToken)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsUserModel) FindOneByUsername(ctx context.Context, username sql.NullString) (*FsUser, error) {
var resp FsUser
query := fmt.Sprintf("select %s from %s where `username` = ? limit 1", fsUserRows, m.table)
err := m.conn.QueryRowCtx(ctx, &resp, query, username)
switch err {
case nil:
return &resp, nil
case sqlc.ErrNotFound:
return nil, ErrNotFound
default:
return nil, err
}
}
func (m *defaultFsUserModel) Insert(ctx context.Context, data *FsUser) (sql.Result, error) {
query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", m.table, fsUserRowsExpectAutoSet)
ret, err := m.conn.ExecCtx(ctx, query, data.FaceId, data.Sub, data.FirstName, data.LastName, data.Username, data.Company, data.Mobile, data.AuthKey, data.PasswordHash, data.VerificationToken, data.PasswordResetToken, data.Email, data.Type, data.Status, data.IsDel, data.IsOrderStatusEmail, data.IsEmailAdvertisement, data.IsOrderStatusPhone, data.IsPhoneAdvertisement, data.IsOpenRender, data.IsThousandFace, data.IsLowRendering, data.IsRemoveBg)
return ret, err
}
func (m *defaultFsUserModel) Update(ctx context.Context, newData *FsUser) error {
query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, fsUserRowsWithPlaceHolder)
_, err := m.conn.ExecCtx(ctx, query, newData.FaceId, newData.Sub, newData.FirstName, newData.LastName, newData.Username, newData.Company, newData.Mobile, newData.AuthKey, newData.PasswordHash, newData.VerificationToken, newData.PasswordResetToken, newData.Email, newData.Type, newData.Status, newData.IsDel, newData.IsOrderStatusEmail, newData.IsEmailAdvertisement, newData.IsOrderStatusPhone, newData.IsPhoneAdvertisement, newData.IsOpenRender, newData.IsThousandFace, newData.IsLowRendering, newData.IsRemoveBg, newData.Id)
return err
}
func (m *defaultFsUserModel) tableName() string {
return m.table
}

View File

@ -1,26 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_address 用户地址表
type FsAddress struct {
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
UserId *int64 `gorm:"index;default:0;" json:"user_id"` // 用户ID
Name *string `gorm:"default:'';" json:"name"` // 地址名称
FirstName *string `gorm:"default:'';" json:"first_name"` // FirstName
LastName *string `gorm:"default:'';" json:"last_name"` // LastName
Mobile *string `gorm:"default:'';" json:"mobile"` // 手机号码
Street *string `gorm:"default:'';" json:"street"` // 街道
Suite *string `gorm:"default:'';" json:"suite"` // 房号
City *string `gorm:"default:'';" json:"city"` // 城市
State *string `gorm:"default:'';" json:"state"` // 州名
Country *string `gorm:"default:'';" json:"country"` // 国家
ZipCode *string `gorm:"default:'';" json:"zip_code"` // 邮编
Status *int64 `gorm:"default:0;" json:"status"` // 1正常 0异常
IsDefault *int64 `gorm:"default:0;" json:"is_default"` // 1默认地址0非默认地址
}
type FsAddressModel struct{ db *gorm.DB }
func NewFsAddressModel(db *gorm.DB) *FsAddressModel { return &FsAddressModel{db} }

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,16 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_auth_assignment 用户角色和权限信息
type FsAuthAssignment struct {
ItemName *string `gorm:"index;default:'';" json:"item_name"` // 角色或权限名称
UserId *string `gorm:"index;default:'';" json:"user_id"` // 用户ID
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 创建时间
// FsAuthAssignmentIbfk1 foreign `gorm:"" json:"fs_auth_assignment_ibfk_1"`//
}
type FsAuthAssignmentModel struct{ db *gorm.DB }
func NewFsAuthAssignmentModel(db *gorm.DB) *FsAuthAssignmentModel { return &FsAuthAssignmentModel{db} }

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,16 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_auth_item_child 角色和权限关系表
type FsAuthItemChild struct {
Parent *string `gorm:"index;default:'';" json:"parent"` // 父角色或权限名称
Child *string `gorm:"index;default:'';" json:"child"` // 子角色或权限名称
// FsAuthItemChildIbfk1 foreign `gorm:"" json:"fs_auth_item_child_ibfk_1"`//
// FsAuthItemChildIbfk2 foreign `gorm:"" json:"fs_auth_item_child_ibfk_2"`//
}
type FsAuthItemChildModel struct{ db *gorm.DB }
func NewFsAuthItemChildModel(db *gorm.DB) *FsAuthItemChildModel { return &FsAuthItemChildModel{db} }

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,20 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_auth_item 用户角色和权限信息
type FsAuthItem struct {
Name string `gorm:"primary_key;default:'';" json:"name"` // 角色或权限名称
Type *int64 `gorm:"index;default:0;" json:"type"` // 权限类型1 表示角色2 表示权限
Description *string `gorm:"default:'';" json:"description"` // 角色或权限描述
RuleName *string `gorm:"index;default:'';" json:"rule_name"` //
Data *[]byte `gorm:"default:'';" json:"data"` // 角色或权限的额外数据
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` //
UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` //
// FsAuthItemIbfk1 foreign `gorm:"" json:"fs_auth_item_ibfk_1"`//
}
type FsAuthItemModel struct{ db *gorm.DB }
func NewFsAuthItemModel(db *gorm.DB) *FsAuthItemModel { return &FsAuthItemModel{db} }

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,16 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_auth_rule 规则表
type FsAuthRule struct {
Name string `gorm:"primary_key;default:'';" json:"name"` // 规则名称
Data *[]byte `gorm:"default:'';" json:"data"` // 规则的额外数据
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` //
UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` //
}
type FsAuthRuleModel struct{ db *gorm.DB }
func NewFsAuthRuleModel(db *gorm.DB) *FsAuthRuleModel { return &FsAuthRuleModel{db} }

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,20 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_canteen_product 餐厅类别产品对应表
type FsCanteenProduct struct {
Id int64 `gorm:"primary_key;default:0;" json:"id"` // ID
CanteenType *int64 `gorm:"index;default:0;" json:"canteen_type"` // 餐厅类别id
ProductId *int64 `gorm:"default:0;" json:"product_id"` // 产品id
SizeId *int64 `gorm:"default:0;" json:"size_id"` // 尺寸id
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序
Status *int64 `gorm:"default:0;" json:"status"` // 状态位 1启用0停用
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
Sid *string `gorm:"default:'';" json:"sid"` // 前端带入的id
}
type FsCanteenProductModel struct{ db *gorm.DB }
func NewFsCanteenProductModel(db *gorm.DB) *FsCanteenProductModel { return &FsCanteenProductModel{db} }

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,17 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_canteen_type 餐厅类型表
type FsCanteenType struct {
Id int64 `gorm:"primary_key;default:0;" json:"id"` // ID
Name *string `gorm:"default:'';" json:"name"` // 餐厅名字
Sort *int64 `gorm:"default:0;" json:"sort"` // 排序
Status *int64 `gorm:"default:0;" json:"status"` // 状态位 1启用0停用
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
}
type FsCanteenTypeModel struct{ db *gorm.DB }
func NewFsCanteenTypeModel(db *gorm.DB) *FsCanteenTypeModel { return &FsCanteenTypeModel{db} }

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,17 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_card 卡号表
type FsCard struct {
Id int64 `gorm:"primary_key;default:0;" json:"id"` // Id
CardNo *string `gorm:"default:'';" json:"card_no"` // 卡号
GroupId *int64 `gorm:"default:0;" json:"group_id"` // 分组id
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 创建时间
CardNum *string `gorm:"default:'';" json:"card_num"` // 卡号 无空格
}
type FsCardModel struct{ db *gorm.DB }
func NewFsCardModel(db *gorm.DB) *FsCardModel { return &FsCardModel{db} }

View File

@ -1,17 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_card_group 卡号分组表
type FsCardGroup struct {
Id int64 `gorm:"primary_key;default:0;" json:"id"` // id
GroupName *string `gorm:"default:'';" json:"group_name"` // 分组名字
PreNo *string `gorm:"default:'';" json:"pre_no"` // 规则前几位数
Num *int64 `gorm:"default:0;" json:"num"` // 生成数量
Ctime *int64 `gorm:"default:0;" json:"ctime"` //
}
type FsCardGroupModel struct{ db *gorm.DB }
func NewFsCardGroupModel(db *gorm.DB) *FsCardGroupModel { return &FsCardGroupModel{db} }

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,30 +0,0 @@
package gmodel
import (
"time"
"gorm.io/gorm"
)
// fs_cart 购物车
type FsCart struct {
Id int64 `gorm:"primary_key;default:0;" json:"id"` // id
UserId *int64 `gorm:"index;default:0;" json:"user_id"` //
ProductId *int64 `gorm:"index;default:0;" json:"product_id"` // 产品ID
TemplateId *int64 `gorm:"index;default:0;" json:"template_id"` // 模板ID
PriceId *int64 `gorm:"index;default:0;" json:"price_id"` // 价格ID
MaterialId *int64 `gorm:"index;default:0;" json:"material_id"` // 材质ID
SizeId *int64 `gorm:"index;default:0;" json:"size_id"` // 尺寸ID
BuyNum *int64 `gorm:"default:0;" json:"buy_num"` // 购买数量
Cover *string `gorm:"default:'';" json:"cover"` // 截图
DesignId *int64 `gorm:"index;default:0;" json:"design_id"` // 设计ID
Ctime *int64 `gorm:"default:0;" json:"ctime"` //
Status *int64 `gorm:"default:0;" json:"status"` // 状态位
OptionalId *int64 `gorm:"index;default:0;" json:"optional_id"` // 选项ID
IsCheck *int64 `gorm:"default:0;" json:"is_check"` // 是否选中状态0未选中1选中
TsTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ts_time"` //
IsEmail *int64 `gorm:"default:0;" json:"is_email"` // 是否发送邮件
}
type FsCartModel struct{ db *gorm.DB }
func NewFsCartModel(db *gorm.DB) *FsCartModel { return &FsCartModel{db} }

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,17 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_change_code 忘记密码code表
type FsChangeCode struct {
Id int64 `gorm:"primary_key;default:0;" json:"id"` // id
Email *string `gorm:"default:'';" json:"email"` //
Code *string `gorm:"default:'';" json:"code"` //
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 创建时间
IsUse *int64 `gorm:"default:0;" json:"is_use"` // 是否使用 1已使用 0未使用
}
type FsChangeCodeModel struct{ db *gorm.DB }
func NewFsChangeCodeModel(db *gorm.DB) *FsChangeCodeModel { return &FsChangeCodeModel{db} }

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,20 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_cloud_deliver_every_tmp
type FsCloudDeliverEveryTmp struct {
Id int64 `gorm:"primary_key;default:0;" json:"id"` //
AdminId *int64 `gorm:"default:0;" json:"admin_id"` // 管理员
CloudId *int64 `gorm:"default:0;" json:"cloud_id"` // 云仓ID 暂且只有一个默认为 1
OrderDetailTemplateSn *string `gorm:"default:'';" json:"order_detail_template_sn"` // 详情modelSn
Num *int64 `gorm:"default:0;" json:"num"` // 发货数量
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
}
type FsCloudDeliverEveryTmpModel struct{ db *gorm.DB }
func NewFsCloudDeliverEveryTmpModel(db *gorm.DB) *FsCloudDeliverEveryTmpModel {
return &FsCloudDeliverEveryTmpModel{db}
}

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,25 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_cloud_deliver_tmp
type FsCloudDeliverTmp struct {
Id int64 `gorm:"primary_key;default:0;" json:"id"` // id
CloudId *int64 `gorm:"default:0;" json:"cloud_id"` // 云仓id
UserId *int64 `gorm:"default:0;" json:"user_id"` // 用户id
AdminId *int64 `gorm:"default:0;" json:"admin_id"` // 操作员id
DeliveryType *int64 `gorm:"default:1;" json:"delivery_type"` // 发货公司 之后配置默认1
Fee *int64 `gorm:"default:0;" json:"fee"` // 价格
AddressId *int64 `gorm:"default:0;" json:"address_id"` // 地址
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 创建时间
IsDeliver *int64 `gorm:"default:0;" json:"is_deliver"` // 0未发货1已发货
IsEnd *int64 `gorm:"default:0;" json:"is_end"` // 0未完成1已完成
DeliverId *int64 `gorm:"default:0;" json:"deliver_id"` // 发货总表id
}
type FsCloudDeliverTmpModel struct{ db *gorm.DB }
func NewFsCloudDeliverTmpModel(db *gorm.DB) *FsCloudDeliverTmpModel {
return &FsCloudDeliverTmpModel{db}
}

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,15 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_cloud 云仓表
type FsCloud struct {
Id int64 `gorm:"primary_key;default:0;" json:"id"` // id
Address *string `gorm:"default:'';" json:"address"` // 云仓地址
Title *string `gorm:"default:'';" json:"title"` // 云仓名称
}
type FsCloudModel struct{ db *gorm.DB }
func NewFsCloudModel(db *gorm.DB) *FsCloudModel { return &FsCloudModel{db} }

View File

@ -1,3 +0,0 @@
package gmodel
// TODO: 使用model的属性做你想做的

View File

@ -1,20 +0,0 @@
package gmodel
import (
"gorm.io/gorm"
)
// fs_cloud_pick_up_detail 云仓提货单-详情
type FsCloudPickUpDetail struct {
Id int64 `gorm:"primary_key;default:0;" json:"id"` // Id
PickId *int64 `gorm:"index;default:0;" json:"pick_id"` // 提货单id
StockId *int64 `gorm:"default:0;" json:"stock_id"` // 用户云仓记录id
Num *int64 `gorm:"default:0;" json:"num"` // 提取数量
Boxes *int64 `gorm:"default:0;" json:"boxes"` // 提取箱数
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
}
type FsCloudPickUpDetailModel struct{ db *gorm.DB }
func NewFsCloudPickUpDetailModel(db *gorm.DB) *FsCloudPickUpDetailModel {
return &FsCloudPickUpDetailModel{db}
}

Some files were not shown because too many files have changed in this diff Show More