MCPcopy Index your code
hub / github.com/ChangSZ/mall-go

github.com/ChangSZ/mall-go @v0.0.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.1 ↗ · + Follow
8,221 symbols 18,378 edges 904 files 1,177 documented · 14% updated 13mo agov0.0.1 · 2024-07-17★ 60
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

关于

go-mall 是基于 go-gin-api 框架(基本已经改得面目全非了)实现的一套电商系统的后台管理系统,包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。

! 本项目暂未未包含任何效果图, 可以去源项目查看, 链接如下:

本项目对macrozheng/mall商城项目后端代码的重构 ==> 进度

mall_admin前端 --> mall-admin-web

mall_portal(app)前端 --> mall-app-web


友情提示

铁子们, 当前mall_admin、mall_portal基本功能均已OK, 使用中暂未发现问题, 我还未进行覆盖性测试, 你们可以搭建前后端自己先玩着. 有问题麻烦狠狠issue

工程相关文档后期会逐步补充完善

推荐先mark吧🤩, 靠谱楼主, 会持续更新的~

快速开始

拉取代码

$ git clone https://github.com/ChangSZ/mall-go.git
$ cd mall-go

环境准备

# 启动mysql、redis等中间件(也可以选择其他方式)
$ docker-compose -f deploy/docker-compose-env.yml up -d
# sql文件拷贝进mysql镜像中
$ docker cp internal/proposal/tablesqls/mall.sql mysql:/
# 进入mysql容器
$ docker exec -it mysql bash
# 登录数据库
$ mysql -u root -proot
# 创建数据库并退出登录
$ CREATE DATABASE api;  # 框架使用
$ CREATE DATABASE mall; 
$ exit;
# 数据导入
$ mysql -u root -p mall < mall.sql

开始运行

# 运行GO框架
$ go run main.go -env fat  
# 运行mall_admin
$ go run cmd/mall_admin/main.go -env fat
# 运行mall_portal
$ go run cmd/mall_portal/main.go -env fat
# -env 表示设置哪个环境,主要是区分使用哪个配置文件,默认为 fat

Go框架

安装界面

首次启动程序之后,会在浏览器中自动打开安装界面,链接地址

重新启动程序,会在浏览器中自动打开登录界面,链接地址

输入默认账号 admin,密码 admin 即可登录成功

如果想重新安装,删除INSTALL.lock文件即可。该文件存在即认为无需安装。

格式化代码

  go run cmd/mfmt/main.go

重点使用

  • 代码生成器
  • 生成数据表CURD - 选择对应的mysql数据表即可
  • 生成控制器方法 - 输入相对于/internal/api的目录路径即可
  • 查询小助手
  • 其他的可以用来学习娱乐

使用介绍

参见go-gin-api语雀, 前端几乎没动, 可以参考使用

Extension points exported contracts — how you extend this code

Error (Interface)
Error a error with caller stack information [2 implementers]
pkg/errors/err.go
Environment (Interface)
Environment 环境配置 [1 implementers]
pkg/env/env.go
UmsAdminCacheServiceI (Interface)
后台用户缓存管理Service [1 implementers]
internal/services/mall_admin/ums_admin/interface.go
NotifyHandler (FuncType)
NotifyHandler 告警的发送句柄
internal/proposal/alert.go
Signature (Interface)
(no doc) [1 implementers]
pkg/signature/signature.go
BusinessError (Interface)
(no doc) [1 implementers]
internal/pkg/core/error.go
Repo (Interface)
(no doc)
internal/repository/mongodb/mongodb.go
Handler (Interface)
(no doc)
internal/api/mall_admin/pms_product_attr/handler.go

Core symbols most depended-on inside this repo

Error
called by 1193
pkg/errors/err.go
DB
called by 398
internal/repository/mysql/mysql.go
GetValidationError
called by 272
pkg/validator/validate.go
Failed
called by 233
internal/api/response.go
ValidateFailed
called by 224
internal/api/response.go
Success
called by 220
internal/api/response.go
GetDbR
called by 194
internal/repository/mysql/mysql.go
GetDbW
called by 194
internal/repository/mysql/mysql.go

Shape

Method 5,475
Function 1,571
Struct 1,034
Interface 110
Class 22
TypeAlias 7
FuncType 2

Languages

Go86%
TypeScript14%

Modules by API surface

internal/repository/mysql/oms_order/gen_oms_order.go189 symbols
internal/repository/mysql/pms_product/gen_pms_product.go181 symbols
internal/repository/mysql/oms_order_return_apply/gen_oms_order_return_apply.go121 symbols
assets/bootstrap/js/bootstrap-table/bootstrap-table.min.js101 symbols
assets/bootstrap/js/bootstrap-table/bootstrap-table.js101 symbols
internal/repository/mysql/oms_order_item/gen_oms_order_item.go97 symbols
internal/repository/mysql/ums_member/gen_ums_member.go89 symbols
internal/repository/mysql/cron_task/gen_cron_task.go89 symbols
internal/repository/mysql/sms_coupon/gen_sms_coupon.go85 symbols
internal/repository/mysql/oms_cart_item/gen_oms_cart_item.go85 symbols
assets/bootstrap/js/jquery.min.js83 symbols
internal/repository/mysql/ums_member_statistics_info/gen_ums_member_statistics_info.go77 symbols

Datastores touched

memberBrandAttentionCollection · 1 repos
memberProductCollectionCollection · 1 repos
memberReadHistoryCollection · 1 repos
(mongodb)Database · 1 repos

For agents

$ claude mcp add mall-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page