{"id":13714019,"url":"https://github.com/xuyisu/mi-beego","last_synced_at":"2025-05-07T00:34:42.975Z","repository":{"id":101891278,"uuid":"443759730","full_name":"xuyisu/mi-beego","owner":"xuyisu","description":"go 语言 模拟电商官网的后端服务，使用BeeGo V2.0.2 实现，前端使用Vue ","archived":false,"fork":false,"pushed_at":"2022-02-19T06:26:24.000Z","size":2207,"stargazers_count":15,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-08-03T23:29:31.363Z","etag":null,"topics":["beego","go","mysql","redis"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xuyisu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-02T12:24:55.000Z","updated_at":"2024-02-21T10:56:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"95310bd3-a4ae-485f-a9ac-235f3f09e90f","html_url":"https://github.com/xuyisu/mi-beego","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuyisu%2Fmi-beego","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuyisu%2Fmi-beego/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuyisu%2Fmi-beego/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xuyisu%2Fmi-beego/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xuyisu","download_url":"https://codeload.github.com/xuyisu/mi-beego/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224551129,"owners_count":17330077,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["beego","go","mysql","redis"],"created_at":"2024-08-02T23:01:50.216Z","updated_at":"2025-05-07T00:34:42.957Z","avatar_url":"https://github.com/xuyisu.png","language":"Go","funding_links":[],"categories":["Repositories"],"sub_categories":[],"readme":"# 仿小米商城后端服务\n## 介绍\n\n模拟小米官网的后端服务\n\n项目运行环境\n\n| go          | 1.15+   |\n| ------------ | ------ |\n| mysql        | 5.7+   |\n| redis        | 6.2.1  |\n| beego        | 2.0.1  |\n\n\n\n## 代码结构说明\n\n```\nmi-beego\n\n——conf      #相关目启动位置，包含启动端口、mysql、redis  配置\n\n——controller   #接口控制层\n\n——models   #实体层和db 的 crud\n\n——pkg   #通用组件\n\n——routers    #路由，接口请求先到达routers 再到对应的controller\n\n——swagger   #在线接口文档\n\n——tests   #单元测试\n\n——third_part    #第三方组件 例如 swagger\n```\n\n## 后端启动\n\n[代码地址Gitee](https://gitee.com/gitxys/mi_beego)\n\n[代码地址GitHub](https://github.com/xuyisu/mi_beego)\n\n###### 1.先下载代码\n\n###### 2.配置代理\n\n![image-20211230101706606](doc/images/image-20211230101706606.png)\n\n###### 3.下载依赖组件\n\n```\ngo mod download\n```\n\n###### 4.将doc 下面的mi-mall.sql 导入到mysql数据库,同时  启动mysql  和 redis\n\n**后端运行先配置数据库（mysql 和redis）**\n\n```\n#应用名称\nappname = mi-beego\n#端口\nhttpport = 8081\n#运行环境\nrunmode = dev\n#是否模板自动渲染，默认值为 true，对于 API 类型的应用，应用需要把该选项设置为 false，不需要渲染模板\nautorender = false\n#是否允许在 HTTP 请求时，返回原始请求体数据字节，默认为 false \ncopyrequestbody = true\n#开启swagger\nEnableDocs = true\n#数据库链接\nsqlconn = root:123456@tcp(127.0.0.1:3306)/mi-mall-go\n#redis 配置\nredis_key = default\nredis_conn = 127.0.0.1:6379\nredis_dbNum = 0\nredis_password = 123456\nredis_maxIdle = 10\nredis_maxActive = 10\nredis_timeout = 160s\n#session 过期时间(秒钟)\nsession_expire= 3600\n```\n\n###### 5.启动\n\n切到命令行窗口，并输入 `bee run`，看到以下结果即代表启动成功\n\n```\n______\n| ___ \\\n| |_/ /  ___   ___\n| ___ \\ / _ \\ / _ \\\n| |_/ /|  __/|  __/\n\\____/  \\___| \\___| v2.0.2\n2021/12/30 10:17:54 WARN     ▶ 0001 Running application outside of GOPATH\n2021/12/30 10:17:54 INFO     ▶ 0002 Using 'mi-beego' as 'appname'\n2021/12/30 10:17:54 INFO     ▶ 0003 Initializing watcher...\nmi-beego/pkg/utils\nmi-beego/pkg/lib\nmi-beego/pkg/log\nmi-beego/third_party/mysql\nmi-beego/third_party/swagger\nmi-beego/third_party/redis\nmi-beego/models\nmi-beego/pkg/filter\nmi-beego/controllers\nmi-beego/routers\nmi-beego\n2021/12/30 10:17:58 SUCCESS  ▶ 0004 Built Successfully!\n2021/12/30 10:17:58 INFO     ▶ 0005 Restarting 'mi-beego.exe'...\n2021/12/30 10:17:58 SUCCESS  ▶ 0006 './mi-beego.exe' is running...\n2021/12/30 10:17:58.768 [I] [parser.go:85]  D:\\workspaces\\mywork\\gitee\\mi-beego\\controllers no changed\n\n2021/12/30 10:17:58.769 [I] [server.go:241]  http server Running on http://:8081\n\n```\n\n浏览器输入 http://127.0.0.1:8081/swagger\n\n![image-20211230102018377](doc/images/swagger.png)\n\n## 其他语言后端地址\n\n| 名称                       | Gitee                                      | Github                                      |\n| -------------------------- | ------------------------------------------ | ------------------------------------------- |\n| mi_springboot (Java)       | https://gitee.com/gitxys/mi_springboot     | https://github.com/xuyisu/mi_springboot     |\n| mi-beego (Golang)          | https://gitee.com/gitxys/mi-beego          | https://github.com/xuyisu/mi-beego          |\n| mi-gin (Golang)            | https://gitee.com/gitxys/mi-gin            | https://github.com/xuyisu/mi-gin            |\n| mi_django (Python)         | https://gitee.com/gitxys/mi_django         | https://github.com/xuyisu/mi_django         |\n| mi_fastapi (Python)        | https://gitee.com/gitxys/mi_fastapi        | https://github.com/xuyisu/mi_fastapi        |\n| mi_koa_nodejs (nodejs)     | https://gitee.com/gitxys/mi_koa_nodejs     | https://github.com/xuyisu/mi_koa_nodejs     |\n| mi_express_nodejs (nodejs) | https://gitee.com/gitxys/mi_express_nodejs | https://github.com/xuyisu/mi_express_nodejs |\n| mi_egg_nodejs (nodejs)     | https://gitee.com/gitxys/mi_egg_nodejs     | https://github.com/xuyisu/mi_egg_nodejs     |\n|                            |                                            |                                             |\n\n\n\n## 前端启动\n\n项目地址https://gitee.com/gitxys/mi_vue\n\n[代码地址Gitee](https://gitee.com/gitxys/mi_vue)\n\n[代码地址GitHub](https://github.com/xuyisu/mi_vue)\n\n1.下载代码到本地\n\n2. 控制台先安装依赖包\n\n```\nnpm install \n```\n\n3.启动\n\n```\nnpm run serve\n```\n\n## 页面介绍\n\n浏览器输入http://localhost:8080 将看到一下页面\n\n![](images/index.png)\n\n登录:**用户名/密码**  admin/123456\n\n![image-20211219223115929](doc/images/login.png)\n\n购物车\n\n![image-20211219223220837](doc/images/cart.png)\n\n订单确认\n\n![image-20211219223323684](doc/images/order-confirm.png)\n\n订单结算(彩蛋！！！！   这里的结算做了特殊处理)\n\n![image-20211219223406482](doc/images/pay.png)\n\n订单列表\n\n![image-20211219223507791](doc/images/order.png)\n\n\n\n\n\n亲，留个star 吧\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuyisu%2Fmi-beego","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxuyisu%2Fmi-beego","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxuyisu%2Fmi-beego/lists"}