├── boot ├── .gitkeep └── boot.go ├── config └── .gitkeep ├── router ├── .gitkeep ├── example2.go └── example.go ├── app ├── service │ ├── .gitkeep │ ├── user_role.go │ ├── oper_log.go │ ├── login_log.go │ ├── login.go │ ├── role_menu.go │ ├── config.go │ ├── dict.go │ └── member_level.go ├── utils │ └── .gitignore ├── model │ ├── user_role.go │ ├── internal │ │ ├── role_menu.go │ │ ├── user_role.go │ │ ├── config.go │ │ ├── member_level.go │ │ ├── dict.go │ │ ├── level.go │ │ ├── example_2.go │ │ ├── position.go │ │ ├── role.go │ │ ├── dict_data.go │ │ ├── notice.go │ │ ├── item.go │ │ ├── dept.go │ │ ├── example.go │ │ ├── config_data.go │ │ ├── ad_sort.go │ │ ├── item_cate.go │ │ ├── city.go │ │ ├── link.go │ │ ├── menu.go │ │ ├── ad.go │ │ ├── login_log.go │ │ ├── oper_log.go │ │ ├── user.go │ │ └── member.go │ ├── oper_log.go │ ├── login_log.go │ ├── role_menu.go │ ├── config.go │ ├── member_level.go │ ├── dict.go │ ├── position.go │ ├── level.go │ ├── role.go │ ├── dept.go │ ├── dict_data.go │ ├── example2.go │ ├── notice.go │ ├── generate.go │ ├── ad_sort.go │ ├── item.go │ ├── city.go │ ├── config_data.go │ ├── item_cate.go │ ├── link.go │ ├── menu.go │ ├── ad.go │ ├── example.go │ └── member.go ├── dao │ ├── ad.go │ ├── city.go │ ├── dept.go │ ├── dict.go │ ├── item.go │ ├── link.go │ ├── menu.go │ ├── role.go │ ├── user.go │ ├── level.go │ ├── config.go │ ├── member.go │ ├── notice.go │ ├── ad_sort.go │ ├── example.go │ ├── oper_log.go │ ├── dict_data.go │ ├── example_2.go │ ├── item_cate.go │ ├── login_log.go │ ├── position.go │ ├── role_menu.go │ ├── user_role.go │ ├── config_data.go │ └── member_level.go └── controller │ ├── analysis.go │ ├── oper_log.go │ ├── upload.go │ ├── role_menu.go │ ├── login_log.go │ ├── generate.go │ ├── dict.go │ ├── config.go │ ├── login.go │ ├── dict_data.go │ └── dept.go ├── public ├── html │ └── .gitkeep ├── plugin │ └── .gitkeep ├── resource │ ├── css │ │ └── .gitkeep │ ├── js │ │ └── .gitkeep │ └── image │ │ ├── .gitkeep │ │ ├── gf.ico │ │ ├── cover.png │ │ └── favicon.ico └── uploads │ ├── demo │ ├── 1.png │ ├── 10.png │ ├── 11.png │ ├── 12.png │ ├── 13.png │ ├── 14.png │ ├── 15.png │ ├── 16.png │ ├── 17.png │ ├── 18.png │ ├── 19.png │ ├── 2.png │ ├── 20.png │ ├── 21.png │ ├── 22.png │ ├── 23.png │ ├── 24.png │ ├── 3.png │ ├── 4.png │ ├── 5.png │ ├── 6.png │ ├── 7.png │ ├── 8.png │ └── 9.png │ ├── level.xlsx │ └── images │ ├── ad │ └── 20220512 │ │ ├── 60a0a68d-6f7e-490f-a266-e37502947275.png │ │ ├── b8140564-d39f-49b6-ab7d-0fca2026464b.png │ │ └── c3d8a433-a0de-46e2-9622-a45f69629bba.png │ ├── item │ └── 20220512 │ │ └── a9b00b16-1760-4123-9667-bf37c232bf9c.png │ ├── link │ └── 20220512 │ │ └── 28ce13e0-9c55-47ba-ada3-7aa6eae1b2ce.png │ ├── user │ └── 20220512 │ │ └── e888c9f7-3e3a-4532-ba8e-d27a18a92ad8.jpg │ ├── config │ └── 20220512 │ │ ├── 126b531a-f7aa-4a28-a0a1-6d776c89943f.png │ │ ├── 1ce04093-9b1d-498b-86a6-cd2c5ec1b9e9.png │ │ ├── 440bcd4f-7ddf-499d-8b71-8c11fd2ae9b7.png │ │ ├── 54bb037e-cfba-4002-ad1c-06bc0ed32190.png │ │ ├── 782cc280-161d-43c7-8866-899f291a7cec.png │ │ ├── 7c3ee413-361f-463c-8ef6-8e8effa12426.png │ │ ├── 816aab8c-f7d2-400d-a953-10d7f45ec8fc.png │ │ ├── 89dc2fc2-696f-4320-b173-760c165b62fa.png │ │ ├── 970ecc5f-c46b-4c10-b81f-7072ae9046b7.png │ │ ├── b0e0f4cc-f5e7-4800-adff-f3e615197731.png │ │ ├── c2b7efb1-9c62-4842-9d43-7a2181b055cf.png │ │ └── fb6a74f3-d5b6-4131-9100-d4eb123d5e90.png │ ├── example │ └── 20220512 │ │ └── 74765043-ec58-4576-82a4-d72a7c2dd6fa.png │ ├── member │ └── 20220512 │ │ └── 9e03312a-6308-4e9d-888b-126ec81a919f.jpg │ ├── notice │ └── 20220512 │ │ └── cd3cae56-85c6-4dad-914b-4620cb4adcd0.png │ └── item_cate │ └── 20220512 │ └── 0cc51040-50bd-49af-b146-5ec72ef55836.png ├── .gitattributes ├── document └── .gitignore ├── packed ├── packed.go └── swagger.go ├── template └── .gitignore ├── .gitignore ├── go.mod ├── Dockerfile ├── README.en.md ├── middleware ├── cros.go ├── checklogin.go ├── loginlog.go └── operlog.go ├── main.go └── library └── response └── response.go /boot/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /router/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /app/service/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/html/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/plugin/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/resource/css/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/resource/js/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/resource/image/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | * linguist-language=GO -------------------------------------------------------------------------------- /app/utils/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /document/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /packed/packed.go: -------------------------------------------------------------------------------- 1 | package packed 2 | -------------------------------------------------------------------------------- /template/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /public/uploads/demo/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/1.png -------------------------------------------------------------------------------- /public/uploads/demo/10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/10.png -------------------------------------------------------------------------------- /public/uploads/demo/11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/11.png -------------------------------------------------------------------------------- /public/uploads/demo/12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/12.png -------------------------------------------------------------------------------- /public/uploads/demo/13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/13.png -------------------------------------------------------------------------------- /public/uploads/demo/14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/14.png -------------------------------------------------------------------------------- /public/uploads/demo/15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/15.png -------------------------------------------------------------------------------- /public/uploads/demo/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/16.png -------------------------------------------------------------------------------- /public/uploads/demo/17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/17.png -------------------------------------------------------------------------------- /public/uploads/demo/18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/18.png -------------------------------------------------------------------------------- /public/uploads/demo/19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/19.png -------------------------------------------------------------------------------- /public/uploads/demo/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/2.png -------------------------------------------------------------------------------- /public/uploads/demo/20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/20.png -------------------------------------------------------------------------------- /public/uploads/demo/21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/21.png -------------------------------------------------------------------------------- /public/uploads/demo/22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/22.png -------------------------------------------------------------------------------- /public/uploads/demo/23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/23.png -------------------------------------------------------------------------------- /public/uploads/demo/24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/24.png -------------------------------------------------------------------------------- /public/uploads/demo/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/3.png -------------------------------------------------------------------------------- /public/uploads/demo/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/4.png -------------------------------------------------------------------------------- /public/uploads/demo/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/5.png -------------------------------------------------------------------------------- /public/uploads/demo/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/6.png -------------------------------------------------------------------------------- /public/uploads/demo/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/7.png -------------------------------------------------------------------------------- /public/uploads/demo/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/8.png -------------------------------------------------------------------------------- /public/uploads/demo/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/demo/9.png -------------------------------------------------------------------------------- /public/uploads/level.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/level.xlsx -------------------------------------------------------------------------------- /public/resource/image/gf.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/resource/image/gf.ico -------------------------------------------------------------------------------- /public/resource/image/cover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/resource/image/cover.png -------------------------------------------------------------------------------- /public/resource/image/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/resource/image/favicon.ico -------------------------------------------------------------------------------- /public/uploads/images/ad/20220512/60a0a68d-6f7e-490f-a266-e37502947275.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/ad/20220512/60a0a68d-6f7e-490f-a266-e37502947275.png -------------------------------------------------------------------------------- /public/uploads/images/ad/20220512/b8140564-d39f-49b6-ab7d-0fca2026464b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/ad/20220512/b8140564-d39f-49b6-ab7d-0fca2026464b.png -------------------------------------------------------------------------------- /public/uploads/images/ad/20220512/c3d8a433-a0de-46e2-9622-a45f69629bba.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/ad/20220512/c3d8a433-a0de-46e2-9622-a45f69629bba.png -------------------------------------------------------------------------------- /public/uploads/images/item/20220512/a9b00b16-1760-4123-9667-bf37c232bf9c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/item/20220512/a9b00b16-1760-4123-9667-bf37c232bf9c.png -------------------------------------------------------------------------------- /public/uploads/images/link/20220512/28ce13e0-9c55-47ba-ada3-7aa6eae1b2ce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/link/20220512/28ce13e0-9c55-47ba-ada3-7aa6eae1b2ce.png -------------------------------------------------------------------------------- /public/uploads/images/user/20220512/e888c9f7-3e3a-4532-ba8e-d27a18a92ad8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/user/20220512/e888c9f7-3e3a-4532-ba8e-d27a18a92ad8.jpg -------------------------------------------------------------------------------- /public/uploads/images/config/20220512/126b531a-f7aa-4a28-a0a1-6d776c89943f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/config/20220512/126b531a-f7aa-4a28-a0a1-6d776c89943f.png -------------------------------------------------------------------------------- /public/uploads/images/config/20220512/1ce04093-9b1d-498b-86a6-cd2c5ec1b9e9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/config/20220512/1ce04093-9b1d-498b-86a6-cd2c5ec1b9e9.png -------------------------------------------------------------------------------- /public/uploads/images/config/20220512/440bcd4f-7ddf-499d-8b71-8c11fd2ae9b7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/config/20220512/440bcd4f-7ddf-499d-8b71-8c11fd2ae9b7.png -------------------------------------------------------------------------------- /public/uploads/images/config/20220512/54bb037e-cfba-4002-ad1c-06bc0ed32190.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/config/20220512/54bb037e-cfba-4002-ad1c-06bc0ed32190.png -------------------------------------------------------------------------------- /public/uploads/images/config/20220512/782cc280-161d-43c7-8866-899f291a7cec.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/config/20220512/782cc280-161d-43c7-8866-899f291a7cec.png -------------------------------------------------------------------------------- /public/uploads/images/config/20220512/7c3ee413-361f-463c-8ef6-8e8effa12426.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/config/20220512/7c3ee413-361f-463c-8ef6-8e8effa12426.png -------------------------------------------------------------------------------- /public/uploads/images/config/20220512/816aab8c-f7d2-400d-a953-10d7f45ec8fc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/config/20220512/816aab8c-f7d2-400d-a953-10d7f45ec8fc.png -------------------------------------------------------------------------------- /public/uploads/images/config/20220512/89dc2fc2-696f-4320-b173-760c165b62fa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/config/20220512/89dc2fc2-696f-4320-b173-760c165b62fa.png -------------------------------------------------------------------------------- /public/uploads/images/config/20220512/970ecc5f-c46b-4c10-b81f-7072ae9046b7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/config/20220512/970ecc5f-c46b-4c10-b81f-7072ae9046b7.png -------------------------------------------------------------------------------- /public/uploads/images/config/20220512/b0e0f4cc-f5e7-4800-adff-f3e615197731.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/config/20220512/b0e0f4cc-f5e7-4800-adff-f3e615197731.png -------------------------------------------------------------------------------- /public/uploads/images/config/20220512/c2b7efb1-9c62-4842-9d43-7a2181b055cf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/config/20220512/c2b7efb1-9c62-4842-9d43-7a2181b055cf.png -------------------------------------------------------------------------------- /public/uploads/images/config/20220512/fb6a74f3-d5b6-4131-9100-d4eb123d5e90.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/config/20220512/fb6a74f3-d5b6-4131-9100-d4eb123d5e90.png -------------------------------------------------------------------------------- /public/uploads/images/example/20220512/74765043-ec58-4576-82a4-d72a7c2dd6fa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/example/20220512/74765043-ec58-4576-82a4-d72a7c2dd6fa.png -------------------------------------------------------------------------------- /public/uploads/images/member/20220512/9e03312a-6308-4e9d-888b-126ec81a919f.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/member/20220512/9e03312a-6308-4e9d-888b-126ec81a919f.jpg -------------------------------------------------------------------------------- /public/uploads/images/notice/20220512/cd3cae56-85c6-4dad-914b-4620cb4adcd0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/notice/20220512/cd3cae56-85c6-4dad-914b-4620cb4adcd0.png -------------------------------------------------------------------------------- /public/uploads/images/item_cate/20220512/0cc51040-50bd-49af-b146-5ec72ef55836.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/easygoadmin/EasyGoAdmin_GoFrame_EleVue/HEAD/public/uploads/images/item_cate/20220512/0cc51040-50bd-49af-b146-5ec72ef55836.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .buildpath 3 | .hgignore.swp 4 | .project 5 | .orig 6 | .swp 7 | .idea/ 8 | .settings/ 9 | .vscode/ 10 | vender/ 11 | log/ 12 | composer.lock 13 | gitpush.sh 14 | pkg/ 15 | bin/ 16 | cbuild 17 | */.DS_Store 18 | config/config.toml 19 | main 20 | .vscode 21 | go.sum 22 | 23 | .svn 24 | evui/ 25 | app/service/generate.go 26 | go_build_main_go.exe -------------------------------------------------------------------------------- /app/model/user_role.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // UserRole is the golang structure for table sys_user_role. 12 | type UserRole internal.UserRole 13 | 14 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/model/internal/role_menu.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | 8 | 9 | // RoleMenu is the golang structure for table sys_role_menu. 10 | type RoleMenu struct { 11 | RoleId int `orm:"role_id" json:"roleId"` // 角色ID 12 | MenuId int `orm:"menu_id" json:"menuId"` // 菜单ID 13 | } -------------------------------------------------------------------------------- /app/model/internal/user_role.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | 8 | 9 | // UserRole is the golang structure for table sys_user_role. 10 | type UserRole struct { 11 | UserId int `orm:"user_id" json:"userId"` // 人员ID 12 | RoleId int `orm:"role_id" json:"roleId"` // 角色ID 13 | } -------------------------------------------------------------------------------- /go.mod: -------------------------------------------------------------------------------- 1 | module easygoadmin 2 | 3 | go 1.16 4 | 5 | require ( 6 | github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect 7 | github.com/gogf/gf v1.16.1 8 | github.com/gogf/swagger v1.2.0 9 | github.com/gorilla/websocket v1.4.2 // indirect 10 | github.com/grokify/html-strip-tags-go v0.0.0-20200322061010-ea0c1cf2f119 // indirect 11 | github.com/kr/text v0.2.0 // indirect 12 | github.com/mojocn/base64Captcha v1.2.2 13 | github.com/mssola/user_agent v0.5.3 // indirect 14 | github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e // indirect 15 | gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect 16 | gopkg.in/yaml.v3 v3.0.0-20200605160147-a5ece683394c // indirect 17 | ) 18 | -------------------------------------------------------------------------------- /app/model/oper_log.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // OperLog is the golang structure for table sys_oper_log. 12 | type OperLog internal.OperLog 13 | 14 | // Fill with you ideas below. 15 | 16 | // 分页查询条件 17 | type OperLogPageReq struct { 18 | Username string `p:"username"` // 操作账号 19 | Model string `p:"model"` // 操作模块 20 | Page int `p:"page"` // 页码 21 | Limit int `p:"limit"` // 每页数 22 | } 23 | -------------------------------------------------------------------------------- /app/dao/ad.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // AdDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type AdDao struct { 15 | internal.AdDao 16 | } 17 | 18 | var ( 19 | // Ad is globally public accessible object for table sys_ad operations. 20 | Ad = AdDao{ 21 | internal.Ad, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/city.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // CityDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type CityDao struct { 15 | internal.CityDao 16 | } 17 | 18 | var ( 19 | // City is globally public accessible object for table sys_city operations. 20 | City = CityDao{ 21 | internal.City, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/dept.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // DeptDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type DeptDao struct { 15 | internal.DeptDao 16 | } 17 | 18 | var ( 19 | // Dept is globally public accessible object for table sys_dept operations. 20 | Dept = DeptDao{ 21 | internal.Dept, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/dict.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // DictDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type DictDao struct { 15 | internal.DictDao 16 | } 17 | 18 | var ( 19 | // Dict is globally public accessible object for table sys_dict operations. 20 | Dict = DictDao{ 21 | internal.Dict, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/item.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // ItemDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type ItemDao struct { 15 | internal.ItemDao 16 | } 17 | 18 | var ( 19 | // Item is globally public accessible object for table sys_item operations. 20 | Item = ItemDao{ 21 | internal.Item, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/link.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // LinkDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type LinkDao struct { 15 | internal.LinkDao 16 | } 17 | 18 | var ( 19 | // Link is globally public accessible object for table sys_link operations. 20 | Link = LinkDao{ 21 | internal.Link, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/menu.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // MenuDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type MenuDao struct { 15 | internal.MenuDao 16 | } 17 | 18 | var ( 19 | // Menu is globally public accessible object for table sys_menu operations. 20 | Menu = MenuDao{ 21 | internal.Menu, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/role.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // RoleDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type RoleDao struct { 15 | internal.RoleDao 16 | } 17 | 18 | var ( 19 | // Role is globally public accessible object for table sys_role operations. 20 | Role = RoleDao{ 21 | internal.Role, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/user.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // userDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type userDao struct { 15 | internal.UserDao 16 | } 17 | 18 | var ( 19 | // User is globally public accessible object for table user operations. 20 | User = userDao{ 21 | internal.User, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. 26 | -------------------------------------------------------------------------------- /app/model/login_log.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // LoginLog is the golang structure for table sys_login_log. 12 | type LoginLog internal.LoginLog 13 | 14 | // Fill with you ideas below. 15 | 16 | // 分页信息查询条件 17 | type LoginLogPageReq struct { 18 | Username string `p:"username"` // 操作账号 19 | Page int `p:"page"` // 页码 20 | Limit int `p:"limit"` // 每页数 21 | } 22 | 23 | // 删除登录日志 24 | type LoginLogDeleteReq struct { 25 | Ids string `p:"ids" v:"required#请选择要删除的数据记录"` 26 | } 27 | -------------------------------------------------------------------------------- /app/dao/level.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // LevelDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type LevelDao struct { 15 | internal.LevelDao 16 | } 17 | 18 | var ( 19 | // Level is globally public accessible object for table sys_level operations. 20 | Level = LevelDao{ 21 | internal.Level, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/config.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // ConfigDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type ConfigDao struct { 15 | internal.ConfigDao 16 | } 17 | 18 | var ( 19 | // Config is globally public accessible object for table sys_config operations. 20 | Config = ConfigDao{ 21 | internal.Config, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/member.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // MemberDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type MemberDao struct { 15 | internal.MemberDao 16 | } 17 | 18 | var ( 19 | // Member is globally public accessible object for table ums_member operations. 20 | Member = MemberDao{ 21 | internal.Member, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/notice.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // NoticeDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type NoticeDao struct { 15 | internal.NoticeDao 16 | } 17 | 18 | var ( 19 | // Notice is globally public accessible object for table sys_notice operations. 20 | Notice = NoticeDao{ 21 | internal.Notice, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/ad_sort.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // AdSortDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type AdSortDao struct { 15 | internal.AdSortDao 16 | } 17 | 18 | var ( 19 | // AdSort is globally public accessible object for table sys_ad_sort operations. 20 | AdSort = AdSortDao{ 21 | internal.AdSort, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/example.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // exampleDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type exampleDao struct { 15 | internal.ExampleDao 16 | } 17 | 18 | var ( 19 | // Example is globally public accessible object for table sys_example operations. 20 | Example = exampleDao{ 21 | internal.Example, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/oper_log.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // OperLogDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type OperLogDao struct { 15 | internal.OperLogDao 16 | } 17 | 18 | var ( 19 | // OperLog is globally public accessible object for table sys_oper_log operations. 20 | OperLog = OperLogDao{ 21 | internal.OperLog, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/dict_data.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // DictDataDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type DictDataDao struct { 15 | internal.DictDataDao 16 | } 17 | 18 | var ( 19 | // DictData is globally public accessible object for table sys_dict_data operations. 20 | DictData = DictDataDao{ 21 | internal.DictData, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/example_2.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // example2Dao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type example2Dao struct { 15 | internal.Example2Dao 16 | } 17 | 18 | var ( 19 | // Example2 is globally public accessible object for table sys_example2 operations. 20 | Example2 = example2Dao{ 21 | internal.Example2, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/item_cate.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // ItemCateDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type ItemCateDao struct { 15 | internal.ItemCateDao 16 | } 17 | 18 | var ( 19 | // ItemCate is globally public accessible object for table sys_item_cate operations. 20 | ItemCate = ItemCateDao{ 21 | internal.ItemCate, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/login_log.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // LoginLogDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type LoginLogDao struct { 15 | internal.LoginLogDao 16 | } 17 | 18 | var ( 19 | // LoginLog is globally public accessible object for table sys_login_log operations. 20 | LoginLog = LoginLogDao{ 21 | internal.LoginLog, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/position.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // PositionDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type PositionDao struct { 15 | internal.PositionDao 16 | } 17 | 18 | var ( 19 | // Position is globally public accessible object for table sys_position operations. 20 | Position = PositionDao{ 21 | internal.Position, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/role_menu.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // RoleMenuDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type RoleMenuDao struct { 15 | internal.RoleMenuDao 16 | } 17 | 18 | var ( 19 | // RoleMenu is globally public accessible object for table sys_role_menu operations. 20 | RoleMenu = RoleMenuDao{ 21 | internal.RoleMenu, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/user_role.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // UserRoleDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type UserRoleDao struct { 15 | internal.UserRoleDao 16 | } 17 | 18 | var ( 19 | // UserRole is globally public accessible object for table sys_user_role operations. 20 | UserRole = UserRoleDao{ 21 | internal.UserRole, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/config_data.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // ConfigDataDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type ConfigDataDao struct { 15 | internal.ConfigDataDao 16 | } 17 | 18 | var ( 19 | // ConfigData is globally public accessible object for table sys_config_data operations. 20 | ConfigData = ConfigDataDao{ 21 | internal.ConfigData, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /app/dao/member_level.go: -------------------------------------------------------------------------------- 1 | // ============================================================================ 2 | // This is auto-generated by gf cli tool only once. Fill this file as you wish. 3 | // ============================================================================ 4 | 5 | package dao 6 | 7 | import ( 8 | "easygoadmin/app/dao/internal" 9 | ) 10 | 11 | // MemberLevelDao is the manager for logic model data accessing 12 | // and custom defined data operations functions management. You can define 13 | // methods on it to extend its functionality as you wish. 14 | type MemberLevelDao struct { 15 | internal.MemberLevelDao 16 | } 17 | 18 | var ( 19 | // MemberLevel is globally public accessible object for table ums_member_level operations. 20 | MemberLevel = MemberLevelDao{ 21 | internal.MemberLevel, 22 | } 23 | ) 24 | 25 | // Fill with you ideas below. -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # gf docker -t gf-demos 2 | FROM loads/alpine:3.8 3 | 4 | LABEL maintainer="john@goframe.org" 5 | 6 | ############################################################################### 7 | # INSTALLATION 8 | ############################################################################### 9 | 10 | # 设置固定的项目路径 11 | ENV WORKDIR /var/www/gf-demos 12 | 13 | # 添加应用可执行文件,并设置执行权限 14 | ADD ./bin/linux_amd64/main $WORKDIR/main 15 | RUN chmod +x $WORKDIR/main 16 | 17 | # 添加I18N多语言文件、静态文件、配置文件、模板文件 18 | ADD public $WORKDIR/public 19 | ADD config $WORKDIR/config 20 | ADD template $WORKDIR/template 21 | 22 | ############################################################################### 23 | # START 24 | ############################################################################### 25 | WORKDIR $WORKDIR 26 | CMD ./main 27 | -------------------------------------------------------------------------------- /app/model/role_menu.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // RoleMenu is the golang structure for table sys_role_menu. 12 | type RoleMenu internal.RoleMenu 13 | 14 | // Fill with you ideas below. 15 | 16 | // 角色权限菜单列表 17 | type RoleMenuInfo struct { 18 | Id int `json:"id"` 19 | Title string `json:"title"` 20 | ParentId int `json:"parentId"` 21 | Checked bool `json:"checked"` 22 | Open bool `json:"open"` 23 | } 24 | 25 | type RoleMenuSaveReq struct { 26 | RoleId int `p:"roleId" v:"required#角色ID不能为空"` 27 | MenuIds []int `p:"menuIds" v:"required#菜单权限节点不能为空"` 28 | } 29 | -------------------------------------------------------------------------------- /app/model/internal/config.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Config is the golang structure for table sys_config. 12 | type Config struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | Name string `orm:"name" json:"name"` // 分组名称 15 | Sort int `orm:"sort" json:"sort"` // 排序 16 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 17 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 18 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 19 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 20 | Mark int `orm:"mark" json:"mark"` // 有效标识 21 | } -------------------------------------------------------------------------------- /app/model/config.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // Config is the golang structure for table sys_config. 12 | type Config internal.Config 13 | 14 | // Fill with you ideas below. 15 | 16 | // 列表查询条件 17 | type ConfigQueryReq struct { 18 | Name string `p:"name"` // 配置名称 19 | } 20 | 21 | // 添加配置 22 | type ConfigAddReq struct { 23 | Name string `p:"name" v:"required#配置名称不能为空"` // 配置名称 24 | Sort int `p:"sort" v:"required#配置排序不能为空"` // 显示顺序 25 | } 26 | 27 | // 修改配置 28 | type ConfigUpdateReq struct { 29 | Id int `p:"id" v:"required#主键ID不能为空"` // 主键ID 30 | Name string `p:"name" v:"required#配置名称不能为空"` // 配置名称 31 | Sort int `p:"sort" v:"required#配置排序不能为空"` // 显示顺序 32 | } 33 | 34 | // 删除配置 35 | type ConfigDeleteReq struct { 36 | Ids string `p:"ids" v:"required#请选择需要删除的数据记录"` 37 | } 38 | -------------------------------------------------------------------------------- /app/model/internal/member_level.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // MemberLevel is the golang structure for table ums_member_level. 12 | type MemberLevel struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | Name string `orm:"name" json:"name"` // 级别名称 15 | Sort int `orm:"sort" json:"sort"` // 排序号 16 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 17 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 创建时间 18 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 19 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 20 | Mark int `orm:"mark" json:"mark"` // 有效标识 21 | } -------------------------------------------------------------------------------- /README.en.md: -------------------------------------------------------------------------------- 1 | # GoAdmin_Pro 2 | 3 | #### Description 4 | {**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} 5 | 6 | #### Software Architecture 7 | Software architecture description 8 | 9 | #### Installation 10 | 11 | 1. xxxx 12 | 2. xxxx 13 | 3. xxxx 14 | 15 | #### Instructions 16 | 17 | 1. xxxx 18 | 2. xxxx 19 | 3. xxxx 20 | 21 | #### Contribution 22 | 23 | 1. Fork the repository 24 | 2. Create Feat_xxx branch 25 | 3. Commit your code 26 | 4. Create Pull Request 27 | 28 | 29 | #### Gitee Feature 30 | 31 | 1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md 32 | 2. Gitee blog [blog.gitee.com](https://blog.gitee.com) 33 | 3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) 34 | 4. The most valuable open source project [GVP](https://gitee.com/gvp) 35 | 5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) 36 | 6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) 37 | -------------------------------------------------------------------------------- /app/model/member_level.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // MemberLevel is the golang structure for table ums_member_level. 12 | type MemberLevel internal.MemberLevel 13 | 14 | // Fill with you ideas below. 15 | 16 | // 查询会员等级 17 | type MemberLevelPageReq struct { 18 | Name string `p:"name"` // 等级名称 19 | Page int `p:"page"` // 页码 20 | Limit int `p:"limit"` // 每页数 21 | } 22 | 23 | // 添加会员等级 24 | type MemberLevelAddReq struct { 25 | Name string `p:"name" v:"name"` // 级别名称 26 | Sort int `p:"sort" v:"sort"` // 排序号 27 | } 28 | 29 | // 更新会员等级 30 | type MemberLevelUpdateReq struct { 31 | Id int `p:"id" v:"required#主键ID不能为空"` 32 | Name string `p:"name" v:"required#会员等级名称不能为空"` // 级别名称 33 | Sort int `p:"sort" v:"required#会员排序号不能为空"` // 排序号 34 | } 35 | 36 | // 删除会员等级 37 | type MemberLevelDeleteReq struct { 38 | Ids string `p:"ids" v:"required#请选择要删除的数据记录"` 39 | } 40 | -------------------------------------------------------------------------------- /app/model/internal/dict.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Dict is the golang structure for table sys_dict. 12 | type Dict struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | Name string `orm:"name" json:"name"` // 字典名称 15 | Code string `orm:"code" json:"code"` // 字典值 16 | Sort int `orm:"sort" json:"sort"` // 显示顺序 17 | Note string `orm:"note" json:"note"` // 字典备注 18 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 19 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 20 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 21 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 22 | Mark int `orm:"mark" json:"mark"` // 有效标识 23 | } -------------------------------------------------------------------------------- /app/model/internal/level.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Level is the golang structure for table sys_level. 12 | type Level struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | Name string `orm:"name" json:"name"` // 职级名称 15 | Status int `orm:"status" json:"status"` // 状态:1正常 2停用 16 | Sort int `orm:"sort" json:"sort"` // 显示顺序 17 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 18 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 创建时间 19 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 20 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 21 | Mark int `orm:"mark" json:"mark"` // 有效标识 22 | } -------------------------------------------------------------------------------- /app/model/internal/example_2.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Example2 is the golang structure for table sys_example2. 12 | type Example2 struct { 13 | Id int `orm:"id,primary" json:"id"` // 唯一性标识 14 | Name string `orm:"name" json:"name"` // 测试名称 15 | Status int `orm:"status" json:"status"` // 状态:1正常 2停用 16 | Sort int `orm:"sort" json:"sort"` // 排序号 17 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 18 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 19 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 20 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 21 | Mark int `orm:"mark" json:"mark"` // 有效标识 22 | } -------------------------------------------------------------------------------- /app/model/internal/position.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Position is the golang structure for table sys_position. 12 | type Position struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | Name string `orm:"name" json:"name"` // 岗位名称 15 | Status int `orm:"status" json:"status"` // 状态:1正常 2停用 16 | Sort int `orm:"sort" json:"sort"` // 显示顺序 17 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 18 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 19 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 20 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 21 | Mark int `orm:"mark" json:"mark"` // 有效标识 22 | } -------------------------------------------------------------------------------- /app/model/dict.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // Dict is the golang structure for table sys_dict. 12 | type Dict internal.Dict 13 | 14 | // Fill with you ideas below. 15 | 16 | // 字典查询条件 17 | type DictQueryReq struct { 18 | Name string `p:"name"` // 字典名称 19 | } 20 | 21 | // 添加字典 22 | type DictAddReq struct { 23 | Name string `p:"name" v:"required#字典名称不能为空"` // 字典名称 24 | Code string `p:"code" v:"required#字典编码不能为空"` // 字典值 25 | Sort int `p:"sort" v:"required#字典排序不能为空"` // 显示顺序 26 | Note string `p:"note"` // 字典备注 27 | } 28 | 29 | // 修改字典 30 | type DictUpdateReq struct { 31 | Id int `p:"id" v:"required#主键ID不能为空"` // 主键ID 32 | Name string `p:"name" v:"required#字典名称不能为空"` // 字典名称 33 | Code string `p:"code" v:"required#字典编码不能为空"` // 字典值 34 | Sort int `p:"sort" v:"required#字典排序不能为空"` // 显示顺序 35 | Note string `p:"note"` // 字典备注 36 | } 37 | 38 | // 删除字典 39 | type DictDeleteReq struct { 40 | Ids string `p:"ids" v:"required#请选择需要删除的数据记录"` 41 | } 42 | -------------------------------------------------------------------------------- /app/model/position.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // Position is the golang structure for table sys_position. 12 | type Position internal.Position 13 | 14 | // Fill with you ideas below. 15 | 16 | // 列表查询条件 17 | type PositionQueryReq struct { 18 | Name string `p:"name"` // 岗位名称 19 | Page int `p:"page"` // 页码 20 | Limit int `p:"limit"` // 每页数 21 | } 22 | 23 | type PositionAddReq struct { 24 | Name string `p:"name" v:"required#岗位名称不能为空"` 25 | Status int `p:"status" v:"required#岗位状态不能为空"` 26 | Sort int `p:"sort" v:"required#岗位排序不能为空"` 27 | } 28 | 29 | type PositionUpdateReq struct { 30 | Id int `p:"id" v:"required#主键ID不能为空"` 31 | Name string `p:"name" v:"required#岗位名称不能为空"` 32 | Status int `p:"status" v:"required#岗位状态不能为空"` 33 | Sort int `p:"sort" v:"required#岗位排序不能为空"` 34 | } 35 | 36 | type PositionDeleteReq struct { 37 | Ids string `p:"ids" v:"required#请选择需要删除的数据记录"` 38 | } 39 | 40 | // 设置状态 41 | type PositionStatusReq struct { 42 | Id int `p:"id" v:"required#主键ID不能为空"` 43 | Status int `p:"status" v:"required#状态不能为空"` 44 | } 45 | -------------------------------------------------------------------------------- /app/model/level.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // Level is the golang structure for table sys_level. 12 | type Level internal.Level 13 | 14 | // Fill with you ideas below. 15 | 16 | // 分页查询条件 17 | type LevelQueryReq struct { 18 | Name string `p:"name"` // 职级名称 19 | Page int `p:"page"` // 页码 20 | Limit int `p:"limit"` // 每页数 21 | } 22 | 23 | // 添加职级 24 | type LevelAddReq struct { 25 | Name string `p:"name" v:"required#职级名称不能为空"` 26 | Status int `p:"status" v:"required#职级状态不能为空"` 27 | Sort int `p:"sort" v:"required#显示顺序不能为空"` 28 | } 29 | 30 | // 更新职级 31 | type LevelUpdateReq struct { 32 | Id int `p:"id" v:"required#主键ID不能为空"` 33 | Name string `p:"name" v:"required#职级名称不能为空"` 34 | Status int `p:"status" v:"required#职级状态不能为空"` 35 | Sort int `p:"sort" v:"required#显示顺序不能为空"` 36 | } 37 | 38 | // 删除职级 39 | type LevelDeleteReq struct { 40 | Ids string `p:"ids" v:"required#请选择要删除的数据记录"` 41 | } 42 | 43 | // 设置状态 44 | type LevelStatusReq struct { 45 | Id int `p:"id" v:"required#主键ID不能为空"` 46 | Status int `p:"status" v:"required#状态不能为空"` 47 | } 48 | -------------------------------------------------------------------------------- /app/model/internal/role.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Role is the golang structure for table sys_role. 12 | type Role struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | Name string `orm:"name" json:"name"` // 角色名称 15 | Code string `orm:"code" json:"code"` // 角色标签 16 | Note string `orm:"note" json:"note"` // 备注 17 | Sort int `orm:"sort" json:"sort"` // 排序 18 | Status int `orm:"status" json:"status"` // 状态:1正常 2停用 19 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 20 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 21 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 22 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 23 | Mark int `orm:"mark" json:"mark"` // 有效标识(1正常 0删除) 24 | } -------------------------------------------------------------------------------- /app/model/role.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // Role is the golang structure for table sys_role. 12 | type Role internal.Role 13 | 14 | // Fill with you ideas below. 15 | 16 | type RolePageReq struct { 17 | Name string `p:"name"` // 角色名称 18 | Page int `p:"page"` // 页码 19 | Limit int `p:"limit"` // 每页数 20 | } 21 | 22 | type RoleAddReq struct { 23 | Name string `p:"name" v:"required#角色名称不能为空"` 24 | Code string `p:"code" v:"required#角色编码不能为空"` 25 | Status int `p:"status" v:"required#角色状态不能为空"` 26 | Sort int `p:"sort" v:"required#角色排序不能为空"` 27 | Note string `p:"note"` // 备注 28 | } 29 | 30 | type RoleUpdateReq struct { 31 | Id int `p:"id" v:"required#主键ID不能为空"` 32 | Name string `p:"name" v:"required#角色名称不能为空"` 33 | Code string `p:"code" v:"required#角色编码不能为空"` 34 | Status int `p:"status" v:"required#角色状态不能为空"` 35 | Sort int `p:"sort" v:"required#角色排序不能为空"` 36 | Note string `p:"note"` // 备注 37 | } 38 | 39 | type RoleDeleteReq struct { 40 | Ids string `p:"ids" v:"required#请选择需要删除的数据记录"` 41 | } 42 | 43 | type RoleStatusReq struct { 44 | Id int `p:"id" v:"required#主键ID不能为空"` 45 | Status int `p:"status" v:"required#角色状态不能为空"` 46 | } 47 | -------------------------------------------------------------------------------- /app/model/internal/dict_data.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // DictData is the golang structure for table sys_dict_data. 12 | type DictData struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | Name string `orm:"name,unique" json:"name"` // 字典项名称 15 | Code string `orm:"code" json:"code"` // 字典项值 16 | DictId int `orm:"dict_id" json:"dictId"` // 字典类型ID 17 | Status int `orm:"status" json:"status"` // 状态:1在用 2停用 18 | Note string `orm:"note" json:"note"` // 备注 19 | Sort int `orm:"sort" json:"sort"` // 显示顺序 20 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 21 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 22 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 23 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 24 | Mark int `orm:"mark" json:"mark"` // 有效标记 25 | } -------------------------------------------------------------------------------- /middleware/cros.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | package middleware 25 | 26 | import ( 27 | "fmt" 28 | "github.com/gogf/gf/net/ghttp" 29 | ) 30 | 31 | //跨域处理中间件 32 | func CORS(r *ghttp.Request) { 33 | fmt.Println("跨域处理中间件") 34 | r.Response.CORSDefault() 35 | // 前置中间件 36 | r.Middleware.Next() 37 | } 38 | -------------------------------------------------------------------------------- /app/model/internal/notice.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Notice is the golang structure for table sys_notice. 12 | type Notice struct { 13 | Id int `orm:"id,primary" json:"id"` // 通知ID 14 | Title string `orm:"title" json:"title"` // 通知标题 15 | Content string `orm:"content" json:"content"` // 通知内容 16 | Source int `orm:"source" json:"source"` // 来源:1内部通知 2外部通知 17 | IsTop int `orm:"is_top" json:"isTop"` // 是否置顶:1是 2否 18 | Browse int `orm:"browse" json:"browse"` // 阅读量 19 | Status int `orm:"status" json:"status"` // 状态:1已发布 2待发布 20 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 21 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 22 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 23 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 24 | Mark int `orm:"mark" json:"mark"` // 有效标识 25 | } -------------------------------------------------------------------------------- /main.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | package main 25 | 26 | import ( 27 | _ "easygoadmin/boot" 28 | _ "easygoadmin/router" 29 | "github.com/gogf/gf/frame/g" 30 | ) 31 | 32 | // @title EasyGoAdmin前后端分离旗舰版框架 33 | // @version 1.0 34 | // @description asyGoAdmin前后端分离旗舰版框架 35 | // @schemes http 36 | func main() { 37 | g.Server().Run() 38 | } 39 | -------------------------------------------------------------------------------- /boot/boot.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | package boot 25 | 26 | import ( 27 | _ "easygoadmin/packed" 28 | "github.com/gogf/gf/frame/g" 29 | "github.com/gogf/gf/os/gview" 30 | "github.com/gogf/swagger" 31 | ) 32 | 33 | // 用于应用初始化。 34 | func init() { 35 | s := g.Server() 36 | s.Plugin(&swagger.Swagger{}) 37 | 38 | gview.Instance().BindFuncMap(gview.FuncMap{}) 39 | } 40 | -------------------------------------------------------------------------------- /app/model/dept.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // Dept is the golang structure for table sys_dept. 12 | type Dept internal.Dept 13 | 14 | // Fill with you ideas below. 15 | 16 | type DeptPageReq struct { 17 | Name string `p:"name"` // 部门名称 18 | } 19 | 20 | // 添加部门 21 | type DeptAddReq struct { 22 | Name string `p:"name" v:"required#部门名称不能为空"` 23 | Code string `p:"code" v:"required#部门编码不能为空"` 24 | Fullname string `p:"fullname" v:"required#部门全称不能为空"` 25 | Type int `p:"type" v:"required#请选择部门类型"` 26 | Pid int `p:"pid"` // 上级ID 27 | Sort int `p:"sort" v:"required#部门排序不能为空"` 28 | Note string 29 | } 30 | 31 | // 部门编辑 32 | type DeptUpdateReq struct { 33 | Id int `p:"id" v:"required#主键ID不能为空"` 34 | Name string `p:"name" v:"required#部门名称不能为空"` 35 | Code string `p:"code" v:"required#部门编码不能为空"` 36 | Fullname string `p:"fullname" v:"required#部门全称不能为空"` 37 | Type int `p:"type" v:"required#请选择部门类型"` 38 | Pid int `p:"pid"` // 上级ID 39 | Sort int `p:"sort" v:"required#排序号不能为空"` 40 | Note string 41 | } 42 | 43 | // 部门删除 44 | type DeptDeleteReq struct { 45 | Ids string `p:"ids" v:"required#请选择需要删除的数据记录"` 46 | } 47 | 48 | // 部门树结构 49 | type DeptTreeNode struct { 50 | Dept 51 | Children []*DeptTreeNode `json:"children"` // 子栏目 52 | } 53 | -------------------------------------------------------------------------------- /app/model/internal/item.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Item is the golang structure for table sys_item. 12 | type Item struct { 13 | Id int `orm:"id,primary" json:"id"` // 唯一性标识 14 | Name string `orm:"name" json:"name"` // 站点名称 15 | Type int `orm:"type" json:"type"` // 站点类型:1普通站点 2其他 16 | Url string `orm:"url" json:"url"` // 站点地址 17 | Image string `orm:"image" json:"image"` // 站点图片 18 | Status int `orm:"status" json:"status"` // 状态:1在用 2停用 19 | Note string `orm:"note" json:"note"` // 站点备注 20 | Sort int `orm:"sort" json:"sort"` // 显示顺序 21 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 22 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 23 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 24 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 25 | Mark int `orm:"mark" json:"mark"` // 有效标识(1正常 0删除) 26 | } -------------------------------------------------------------------------------- /app/model/dict_data.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // DictData is the golang structure for table sys_dict_data. 12 | type DictData internal.DictData 13 | 14 | // Fill with you ideas below. 15 | 16 | // 字典项列表查询条件 17 | type DictDataPageReq struct { 18 | DictId int `p:"dictId"` // 字典ID 19 | Name string `p:"name"` // 字典项名称 20 | Page int `p:"page"` // 页码 21 | Limit int `p:"limit"` // 每页数 22 | } 23 | 24 | // 添加字典项 25 | type DictDataAddReq struct { 26 | Name string `p:"name,unique" v:"required#字典项名称不能为空"` // 字典项名称 27 | Code string `p:"code" v:"required#字典项编码不能为空"` // 字典项值 28 | DictId int `p:"dict_id" v:"required#字典ID不能为空"` // 字典类型ID 29 | Note string `p:"note"` // 备注 30 | Sort int `p:"sort" v:"required#排序号不能为空"` // 显示顺序 31 | } 32 | 33 | // 更新字典项 34 | type DictDataUpdateReq struct { 35 | Id int `p:"id" v:"required#主键ID不能为空"` 36 | Name string `p:"name,unique" v:"required#字典项名称不能为空"` // 字典项名称 37 | Code string `p:"code" v:"required#字典项编码不能为空"` // 字典项值 38 | DictId int `p:"dict_id" v:"required#字典ID不能为空"` // 字典类型ID 39 | Note string `p:"note"` // 备注 40 | Sort int `p:"sort" v:"required#排序号不能为空"` // 显示顺序 41 | } 42 | 43 | // 删除字典项 44 | type DictDataDeleteReq struct { 45 | Ids string `p:"ids" v:"required#请选择需要删除的数据记录"` 46 | } 47 | -------------------------------------------------------------------------------- /app/controller/analysis.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 统计分析-控制器 26 | * @author 半城风雨 27 | * @since 2021/7/24 28 | * @File : ad_sort 29 | */ 30 | package controller 31 | 32 | import ( 33 | "easygoadmin/app/utils/response" 34 | "github.com/gogf/gf/net/ghttp" 35 | ) 36 | 37 | var Analysis = new(analysisCtl) 38 | 39 | type analysisCtl struct{} 40 | 41 | func (c *analysisCtl) Index(r *ghttp.Request) { 42 | // 渲染模板 43 | response.BuildTpl(r, "analysis/index.html").WriteTpl() 44 | } 45 | -------------------------------------------------------------------------------- /app/model/internal/dept.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Dept is the golang structure for table sys_dept. 12 | type Dept struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | Name string `orm:"name" json:"name"` // 部门名称 15 | Code string `orm:"code" json:"code"` // 部门编码 16 | Fullname string `orm:"fullname" json:"fullname"` // 部门全称 17 | Type int `orm:"type" json:"type"` // 类型:1公司 2子公司 3部门 4小组 18 | Pid int `orm:"pid" json:"pid"` // 上级ID 19 | Sort int `orm:"sort" json:"sort"` // 排序 20 | Note string `orm:"note" json:"note"` // 备注说明 21 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 22 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 创建时间 23 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 24 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 25 | Mark int `orm:"mark" json:"mark"` // 有效标识 26 | } -------------------------------------------------------------------------------- /app/model/internal/example.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Example is the golang structure for table sys_example. 12 | type Example struct { 13 | Id int `orm:"id,primary" json:"id"` // 唯一性标识 14 | Name string `orm:"name" json:"name"` // 测试名称 15 | Avatar string `orm:"avatar" json:"avatar"` // 头像 16 | Content string `orm:"content" json:"content"` // 内容 17 | Status int `orm:"status" json:"status"` // 状态:1正常 2停用 18 | Type int `orm:"type" json:"type"` // 类型:1京东 2淘宝 3拼多多 4唯品会 19 | IsVip int `orm:"is_vip" json:"isVip"` // 是否VIP:1是 2否 20 | Sort int `orm:"sort" json:"sort"` // 排序号 21 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 22 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 23 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 24 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 25 | Mark int `orm:"mark" json:"mark"` // 有效标识 26 | } -------------------------------------------------------------------------------- /app/model/internal/config_data.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // ConfigData is the golang structure for table sys_config_data. 12 | type ConfigData struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | Title string `orm:"title" json:"title"` // 配置标题 15 | Code string `orm:"code" json:"code"` // 配置编码 16 | Value string `orm:"value" json:"value"` // 配置值 17 | Options string `orm:"options" json:"options"` // 配置项 18 | ConfigId int `orm:"config_id" json:"configId"` // 配置ID 19 | Type string `orm:"type" json:"type"` // 配置类型 20 | Status int `orm:"status" json:"status"` // 状态:1正常 2停用 21 | Sort int `orm:"sort" json:"sort"` // 排序 22 | Note string `orm:"note" json:"note"` // 配置说明 23 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 24 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 25 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 26 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 27 | Mark int `orm:"mark" json:"mark"` // 有效标识:1正常 0删除 28 | } -------------------------------------------------------------------------------- /app/model/internal/ad_sort.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // AdSort is the golang structure for table sys_ad_sort. 12 | type AdSort struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | Description string `orm:"description" json:"description"` // 广告位描述 15 | ItemId int `orm:"item_id" json:"itemId"` // 站点ID 16 | CateId int `orm:"cate_id" json:"cateId"` // 栏目ID 17 | LocId int `orm:"loc_id" json:"locId"` // 广告页面位置 18 | Platform int `orm:"platform" json:"platform"` // 站点类型:1PC网站 2WAP手机站 3微信小程序 4APP移动端 19 | Sort int `orm:"sort" json:"sort"` // 广告位排序 20 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 21 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 22 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 23 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 24 | Mark int `orm:"mark" json:"mark"` // 有效标识(1正常 0删除) 25 | } -------------------------------------------------------------------------------- /app/model/internal/item_cate.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // ItemCate is the golang structure for table sys_item_cate. 12 | type ItemCate struct { 13 | Id int `orm:"id,primary" json:"id"` // ID 14 | Name string `orm:"name" json:"name"` // 栏目名称 15 | Pid int `orm:"pid" json:"pid"` // 父级ID 16 | ItemId uint `orm:"item_id" json:"itemId"` // 站点ID 17 | Pinyin string `orm:"pinyin" json:"pinyin"` // 拼音(全) 18 | Code string `orm:"code" json:"code"` // 拼音(简) 19 | IsCover int `orm:"is_cover" json:"isCover"` // 是否有封面:1是 2否 20 | Cover string `orm:"cover" json:"cover"` // 封面 21 | Status int `orm:"status" json:"status"` // 状态:1启用 2停用 22 | Note string `orm:"note" json:"note"` // 备注 23 | Sort uint `orm:"sort" json:"sort"` // 排序 24 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 25 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 26 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 27 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 28 | Mark int `orm:"mark" json:"mark"` // 有效标识(1正常 0删除) 29 | } -------------------------------------------------------------------------------- /app/model/example2.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // Example2 is the golang structure for table sys_example2. 12 | type Example2 internal.Example2 13 | 14 | // Fill with you ideas below. 15 | 16 | // 列表查询条件 17 | type Example2QueryReq struct { 18 | 19 | 20 | Name string `p:"name"` // 演示名称 21 | 22 | 23 | 24 | Status int `p:status` // 状态:1正常 2停用 25 | 26 | 27 | Page int `p:page` // 页码 28 | Limit int `p:limit` // 每页数 29 | } 30 | 31 | // 添加演示二 32 | type Example2AddReq struct { 33 | 34 | 35 | Name string `p:"name" v:"required#演示名称不能为空"` // 演示名称 36 | 37 | 38 | 39 | Status int `p:"status" v:"required#请选择状态"` // 状态:1正常 2停用 40 | 41 | 42 | 43 | Sort int `p:"sort" v:"required#排序号不能为空"` // 排序号 44 | 45 | 46 | } 47 | 48 | // 更新演示二 49 | type Example2UpdateReq struct { 50 | Id int `p:id v:"required#主键ID不能为空"` 51 | 52 | 53 | Name string `p:"name" v:"required#演示名称不能为空"` // 演示名称 54 | 55 | 56 | 57 | Status int `p:"status" v:"required#请选择状态"` // 状态:1正常 2停用 58 | 59 | 60 | 61 | Sort int `p:"sort" v:"required#排序号不能为空"` // 排序号 62 | 63 | 64 | } 65 | 66 | // 删除演示二 67 | type Example2DeleteReq struct { 68 | Ids string `p:ids v:"required#请选择需要删除的数据记录"` 69 | } 70 | 71 | 72 | 73 | 74 | 75 | // 设置状态 76 | type Example2StatusReq struct { 77 | Id int `p:"id" v:"required#主键ID不能为空"` 78 | Status int `p:"status" v:"required#状态不能为空"` 79 | } 80 | 81 | 82 | 83 | 84 | 85 | // 演示二信息Vo 86 | type Example2InfoVo struct { 87 | Example2 88 | 89 | 90 | 91 | 92 | StatusName int `json:"statusName"` // 状态名称 93 | 94 | 95 | 96 | 97 | } 98 | -------------------------------------------------------------------------------- /app/model/notice.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // Notice is the golang structure for table sys_notice. 12 | type Notice internal.Notice 13 | 14 | // Fill with you ideas below. 15 | 16 | // 分页查询 17 | type NoticePageReq struct { 18 | Title string `p:"title"` // 通知标题 19 | Source int `p:"source"` // 通知来源 20 | Page int `p:"page"` // 页码 21 | Limit int `p:"limit"` // 每页数 22 | } 23 | 24 | // 添加通知公告 25 | type NoticeAddReq struct { 26 | Title string `p:"title" v:"required#通知标题不能为空"` // 通知标题 27 | Content string `p:"content" v:"required#通知内容不能为空"` // 通知内容 28 | Source int `p:"source" v:"required#通知来源不能为空"` // 来源:1内部通知 2外部新闻 29 | IsTop int `p:"is_top" v:"required#请选择是否置顶"` // 是否置顶:1是 2否 30 | Status int `p:"status" v:"required#请选择通知状态"` // 状态:1已发布 2待发布 31 | } 32 | 33 | // 更新通知公告 34 | type NoticeUpdateReq struct { 35 | Id int `p:"id" v:"required#主键ID不能为空"` 36 | Title string `p:"title" v:"required#通知标题不能为空"` // 通知标题 37 | Content string `p:"content" v:"required#通知内容不能为空"` // 通知内容 38 | Source int `p:"source" v:"required#通知来源不能为空"` // 来源:1内部通知 2外部新闻 39 | IsTop int `p:"is_top" v:"required#请选择是否置顶"` // 是否置顶:1是 2否 40 | Status int `p:"status" v:"required#请选择通知状态"` // 状态:1已发布 2待发布 41 | } 42 | 43 | // 删除通知公告 44 | type NoticeDeleteReq struct { 45 | Ids string `p:"ids" v:"required#请选择要删除的数据记录"` 46 | } 47 | 48 | // 设置状态 49 | type NoticeStatusReq struct { 50 | Id int `p:"id" v:"required#主键ID不能为空"` 51 | Status int `p:"status" v:"required#状态不能为空"` 52 | } 53 | 54 | // 通知公告Vo 55 | type NoticeInfoVo struct { 56 | Notice 57 | SourceName string `json:"sourceName"` // 通知来源 58 | } 59 | -------------------------------------------------------------------------------- /router/example2.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | package router 25 | 26 | import ( 27 | "easygoadmin/app/controller" 28 | "github.com/gogf/gf/frame/g" 29 | "github.com/gogf/gf/net/ghttp" 30 | ) 31 | 32 | /** 33 | * 演示二-路由 34 | * @author 半城风雨 35 | * @since 2022/05/17 36 | * @File : example2 37 | */ 38 | func init() { 39 | s := g.Server() 40 | 41 | /* 案例演示 */ 42 | s.Group("example2", func(group *ghttp.RouterGroup) { 43 | group.GET("/list", controller.Example2.List) 44 | group.POST("/add", controller.Example2.Add) 45 | group.PUT("/update", controller.Example2.Update) 46 | group.DELETE("/delete/:ids", controller.Example2.Delete) 47 | 48 | 49 | 50 | 51 | group.PUT("/status", controller.Example2.Status) 52 | 53 | 54 | 55 | 56 | }) 57 | } -------------------------------------------------------------------------------- /app/service/user_role.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 用户角色-服务类 26 | * @author 半城风雨 27 | * @since 2021/7/27 28 | * @File : user 29 | */ 30 | package service 31 | 32 | import ( 33 | "easygoadmin/app/dao" 34 | "easygoadmin/app/model" 35 | ) 36 | 37 | var UserRole = new(userRoleService) 38 | 39 | type userRoleService struct{} 40 | 41 | // 获取用户角色列表 42 | func (s *userRoleService) GetUserRoleList(userId int) []model.Role { 43 | query := dao.Role.As("r").Clone() 44 | // 内联查询 45 | query = query.InnerJoin("sys_user_role as ur", "r.id=ur.role_id") 46 | query = query.Where("ur.user_id=? AND r.mark=1", userId) 47 | // 获取字段 48 | query.Fields("r.*") 49 | // 排序 50 | query = query.Order("r.sort asc") 51 | // 数据转换 52 | var list []model.Role 53 | query.Structs(&list) 54 | return list 55 | } 56 | -------------------------------------------------------------------------------- /router/example.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | package router 25 | 26 | import ( 27 | "easygoadmin/app/controller" 28 | "github.com/gogf/gf/frame/g" 29 | "github.com/gogf/gf/net/ghttp" 30 | ) 31 | 32 | /** 33 | * 演示一-路由 34 | * @author 半城风雨 35 | * @since 2022/05/17 36 | * @File : example 37 | */ 38 | func init() { 39 | s := g.Server() 40 | 41 | /* 案例演示 */ 42 | s.Group("example", func(group *ghttp.RouterGroup) { 43 | group.GET("/list", controller.Example.List) 44 | group.POST("/add", controller.Example.Add) 45 | group.PUT("/update", controller.Example.Update) 46 | group.DELETE("/delete/:ids", controller.Example.Delete) 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | group.PUT("/status", controller.Example.Status) 56 | 57 | 58 | 59 | 60 | 61 | group.PUT("/isVip", controller.Example.IsVip) 62 | 63 | 64 | 65 | 66 | }) 67 | } -------------------------------------------------------------------------------- /app/model/generate.go: -------------------------------------------------------------------------------- 1 | /** 2 | * 代码生成器 3 | * @author 半城风雨 4 | * @since 2021/8/2 5 | * @File : generate 6 | */ 7 | package model 8 | 9 | import "github.com/gogf/gf/os/gtime" 10 | 11 | // 数据库信息 12 | type GenerateInfo struct { 13 | Name string `json:"name"` // 表名 14 | Engine string `json:"engine"` // 引擎 15 | Version string `json:"version"` // 版本 16 | Collation string `json:"collation"` // 编码 17 | Rows int `json:"rows"` // 记录数 18 | DataLength int `json:"data_length"` // 大小 19 | AutoIncrement int `json:"auto_increment"` // 自增索引 20 | Comment string `json:"comment"` // 表备注 21 | CreateTime *gtime.Time `json:"createTime"` // 添加时间 22 | UpdateTime *gtime.Time `json:"updateTime"` // 更新时间 23 | } 24 | 25 | // 分页查询条件 26 | type GeneratePageReq struct { 27 | Name string `p:"name"` // 表名称 28 | Comment string `p:"comment"` // 表描述 29 | Page int `p:"page"` // 页码 30 | Limit int `p:"limit"` // 每页数 31 | } 32 | 33 | // 生成文件 34 | type GenerateFileReq struct { 35 | Name string `p:"name" v:"required#数据表名称不能为空"` // 表名称 36 | Comment string `p:"comment" v:"required#数据表描述不能为空"` // 表描述 37 | } 38 | 39 | // 批量生成文件 40 | type BatchGenerateFileReq struct { 41 | Tables string `p:"tables" v:"required#数据表不能为空"` // 表名称 42 | } 43 | 44 | //// 数据表字段信息 45 | //type GenerateTableColumnInfo struct { 46 | // ColumnName string `json:"columnName"` // 列名字 47 | // Engine string `json:"engine"` // 引擎 48 | // Version string `json:"version"` // 版本 49 | // Collation string `json:"collation"` // 编码 50 | // Rows int `json:"rows"` // 记录数 51 | // DataLength int `json:"data_length"` // 大小 52 | // AutoIncrement int `json:"auto_increment"` // 自增索引 53 | // Comment string `json:"comment"` // 表备注 54 | // CreateTime *gtime.Time `json:"createTime"` // 添加时间 55 | // UpdateTime *gtime.Time `json:"updateTime"` // 更新时间 56 | //} 57 | -------------------------------------------------------------------------------- /app/model/ad_sort.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // AdSort is the golang structure for table sys_ad_sort. 12 | type AdSort internal.AdSort 13 | 14 | // Fill with you ideas below. 15 | 16 | // 列表查询条件 17 | type AdSortPageReq struct { 18 | Description string `p:"name"` // 广告位描述 19 | Page int `p:"page"` // 页码 20 | Limit int `p:"limit"` // 每页数 21 | } 22 | 23 | // 添加广告位 24 | type AdSortAddReq struct { 25 | Description string `p:"description" v:"required#广告位描述不能为空"` // 广告位描述 26 | ItemId int `p:"item_id" v:"required#请选择站点"` // 站点ID 27 | CateId int `p:"cate_id" v:"required#请选择栏目"` // 栏目ID 28 | LocId int `p:"loc_id" v:"required#广告位置不能为空"` // 广告页面位置 29 | Platform int `p:"platform" v:"required#投放平台不能为空"` // 站点类型:1PC网站 2WAP手机站 3微信小程序 4APP移动端 30 | Sort int `p:"sort" v:"required#排序号不能为空"` // 广告位排序 31 | } 32 | 33 | // 更新广告位 34 | type AdSortUpdateReq struct { 35 | Id int `p:"id" v:"required#主键ID不能为空"` 36 | Description string `p:"description" v:"required#广告位描述不能为空"` // 广告位描述 37 | ItemId int `p:"item_id" v:"required#请选择站点"` // 站点ID 38 | CateId int `p:"cate_id" v:"required#请选择栏目"` // 栏目ID 39 | LocId int `p:"loc_id" v:"required#广告位置不能为空"` // 广告页面位置 40 | Platform int `p:"platform" v:"required#投放平台不能为空"` // 站点类型:1PC网站 2WAP手机站 3微信小程序 4APP移动端 41 | Sort int `p:"sort" v:"required#排序号不能为空"` // 广告位排序 42 | } 43 | 44 | type AdSortDeleteReq struct { 45 | Ids string `p:"ids" v:"required#请选择需要删除的数据记录"` 46 | } 47 | 48 | // 广告位信息 49 | type AdSortInfoVo struct { 50 | AdSort 51 | ItemName string `json:"itemName"` // 站点名称 52 | CateName string `json:"cateName"` // 栏目名称 53 | PlatformName string `json:"platformName"` // 所属平台 54 | } 55 | -------------------------------------------------------------------------------- /library/response/response.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | package response 25 | 26 | import ( 27 | "github.com/gogf/gf/net/ghttp" 28 | ) 29 | 30 | // 数据返回通用JSON数据结构 31 | type JsonResponse struct { 32 | Code int `json:"code"` // 错误码((0:成功, 1:失败, >1:错误码)) 33 | Message string `json:"message"` // 提示信息 34 | Data interface{} `json:"data"` // 返回数据(业务接口定义具体数据结构) 35 | } 36 | 37 | // 标准返回结果数据结构封装。 38 | func Json(r *ghttp.Request, code int, message string, data ...interface{}) { 39 | responseData := interface{}(nil) 40 | if len(data) > 0 { 41 | responseData = data[0] 42 | } 43 | r.Response.WriteJson(JsonResponse{ 44 | Code: code, 45 | Message: message, 46 | Data: responseData, 47 | }) 48 | } 49 | 50 | // 返回JSON数据并退出当前HTTP执行函数。 51 | func JsonExit(r *ghttp.Request, err int, msg string, data ...interface{}) { 52 | Json(r, err, msg, data...) 53 | r.Exit() 54 | } 55 | -------------------------------------------------------------------------------- /app/model/item.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // Item is the golang structure for table sys_item. 12 | type Item internal.Item 13 | 14 | // Fill with you ideas below. 15 | 16 | // 分页查询条件 17 | type ItemPageReq struct { 18 | Name string `p:"name"` // 站点名称 19 | Type int `p:"type"` // 站点类型 20 | Page int `p:"page"` // 页码 21 | Limit int `p:"limit"` // 每页数 22 | } 23 | 24 | // 站点信息Vo 25 | type ItemInfoVo struct { 26 | Item 27 | TypeName string `json:"typeName"` // 站点类型 28 | } 29 | 30 | // 添加站点 31 | type ItemAddReq struct { 32 | Name string `p:"name" v:"required#站点名称不能为空"` // 站点名称 33 | Type int `p:"type" v:"required#请选择站点类型"` // 站点类型:1普通站点 2其他 34 | Url string `p:"url" v:"required#站点地址不能为空"` // 站点地址 35 | Image string `p:"image"` // 站点图片 36 | Status int `p:"status" v:"required#请选择站点状态"` // 状态:1在用 2停用 37 | Note string `p:"note"` // 站点备注 38 | Sort int `p:"sort" v:"required#站点排序号不能为空"` // 显示顺序 39 | } 40 | 41 | // 更新站点 42 | type ItemUpdateReq struct { 43 | Id int `p:"id" v:"required#主键ID不能为空"` 44 | Name string `p:"name" v:"required#站点名称不能为空"` // 站点名称 45 | Type int `p:"type" v:"required#请选择站点类型"` // 站点类型:1普通站点 2其他 46 | Url string `p:"url" v:"required#站点地址不能为空"` // 站点地址 47 | Image string `p:"image"` // 站点图片 48 | Status int `p:"status" v:"required#请选择站点状态"` // 状态:1在用 2停用 49 | Note string `p:"note"` // 站点备注 50 | Sort int `p:"sort" v:"required#站点排序号不能为空"` // 显示顺序 51 | } 52 | 53 | // 删除站点 54 | type ItemDeleteReq struct { 55 | Ids string `p:"ids" v:"required#请选择要删除的数据记录"` 56 | } 57 | 58 | // 设置状态 59 | type ItemStatusReq struct { 60 | Id int `p:"id" v:"required#主键ID不能为空"` 61 | Status int `p:"status" v:"required#状态不能为空"` 62 | } 63 | -------------------------------------------------------------------------------- /app/model/internal/city.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // City is the golang structure for table sys_city. 12 | type City struct { 13 | Id int `orm:"id,primary" json:"id"` // 编号 14 | Pid int `orm:"pid" json:"pid"` // 父级编号 15 | Level int `orm:"level" json:"level"` // 城市级别:1省 2市 3区 16 | Name string `orm:"name" json:"name"` // 城市名称 17 | Citycode string `orm:"citycode" json:"citycode"` // 城市编号(区号) 18 | PAdcode string `orm:"p_adcode" json:"pAdcode"` // 父级地理编号 19 | Adcode string `orm:"adcode" json:"adcode"` // 地理编号 20 | Lng uint `orm:"lng" json:"lng"` // 城市坐标中心点经度(* 1e6):如果是中国,此值是 1e7 21 | Lat uint `orm:"lat" json:"lat"` // 城市坐标中心点纬度(* 1e6) 22 | Sort int `orm:"sort" json:"sort"` // 排序号 23 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 24 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 25 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 26 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 27 | Mark int `orm:"mark" json:"mark"` // 有效标记 28 | } -------------------------------------------------------------------------------- /app/model/internal/link.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Link is the golang structure for table sys_link. 12 | type Link struct { 13 | Id int `orm:"id,primary" json:"id"` // 唯一性标识 14 | Name string `orm:"name" json:"name"` // 友链名称 15 | Type int `orm:"type" json:"type"` // 类型:1友情链接 2合作伙伴 16 | Url string `orm:"url" json:"url"` // 友链地址 17 | ItemId int `orm:"item_id" json:"itemId"` // 站点ID 18 | CateId int `orm:"cate_id" json:"cateId"` // 栏目ID 19 | Platform int `orm:"platform" json:"platform"` // 平台:1PC站 2WAP站 3微信小程序 4APP应用 20 | Form int `orm:"form" json:"form"` // 友链形式:1文字链接 2图片链接 21 | Image string `orm:"image" json:"image"` // 友链图片 22 | Status int `orm:"status" json:"status"` // 状态:1在用 2停用 23 | Sort int `orm:"sort" json:"sort"` // 显示顺序 24 | Note string `orm:"note" json:"note"` // 备注 25 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 26 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 27 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 28 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 29 | Mark int `orm:"mark" json:"mark"` // 有效标识(1正常 0删除) 30 | } -------------------------------------------------------------------------------- /app/model/internal/menu.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Menu is the golang structure for table sys_menu. 12 | type Menu struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | ParentId int `orm:"parent_id" json:"parentId"` // 父级ID 15 | Title string `orm:"title" json:"title"` // 菜单标题 16 | Icon string `orm:"icon" json:"icon"` // 图标 17 | Path string `orm:"path" json:"path"` // 菜单路径 18 | Component string `orm:"component" json:"component"` // 菜单组件 19 | Target string `orm:"target" json:"target"` // 打开方式:0组件 1内链 2外链 20 | Permission string `orm:"permission" json:"permission"` // 权限标识 21 | Type int `orm:"type" json:"type"` // 类型:0菜单 1节点 22 | Method string `orm:"method" json:"method"` // 请求方式 23 | Status int `orm:"status" json:"status"` // 状态:1正常 2禁用 24 | Hide int `orm:"hide" json:"hide"` // 是否可见:1是 2否 25 | Note string `orm:"note" json:"note"` // 备注 26 | Sort int `orm:"sort" json:"sort"` // 显示顺序 27 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 28 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 创建时间 29 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 30 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 31 | Mark int `orm:"mark" json:"mark"` // 有效标识 32 | } -------------------------------------------------------------------------------- /app/controller/oper_log.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 操作日志-控制器 26 | * @author 半城风雨 27 | * @since 2021/8/14 28 | * @File : oper_log 29 | */ 30 | package controller 31 | 32 | import ( 33 | "easygoadmin/app/model" 34 | "easygoadmin/app/service" 35 | "easygoadmin/app/utils/common" 36 | "github.com/gogf/gf/net/ghttp" 37 | ) 38 | 39 | // 控制器管理对象 40 | var OperLog = new(operLogCtl) 41 | 42 | type operLogCtl struct{} 43 | 44 | func (c *operLogCtl) List(r *ghttp.Request) { 45 | // 参数验证 46 | var req *model.OperLogPageReq 47 | if err := r.Parse(&req); err != nil { 48 | r.Response.WriteJsonExit(common.JsonResult{ 49 | Code: -1, 50 | Msg: err.Error(), 51 | }) 52 | } 53 | 54 | // 调用获取列表方法 55 | list, count, err := service.OperLog.GetList(req) 56 | if err != nil { 57 | r.Response.WriteJsonExit(common.JsonResult{ 58 | Code: 0 - 1, 59 | Msg: err.Error(), 60 | }) 61 | } 62 | 63 | // 返回结果 64 | r.Response.WriteJsonExit(common.JsonResult{ 65 | Code: 0, 66 | Msg: "查询成功", 67 | Data: list, 68 | Count: count, 69 | }) 70 | } 71 | -------------------------------------------------------------------------------- /app/controller/upload.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 文件上传-控制器 26 | * @author 半城风雨 27 | * @since 2021/7/23 28 | * @File : upload 29 | */ 30 | package controller 31 | 32 | import ( 33 | "easygoadmin/app/service" 34 | "easygoadmin/app/utils" 35 | "easygoadmin/app/utils/common" 36 | "github.com/gogf/gf/net/ghttp" 37 | ) 38 | 39 | // 控制器管理对象 40 | var Upload = new(uploadCtl) 41 | 42 | type uploadCtl struct{} 43 | 44 | func (c *uploadCtl) UploadImage(r *ghttp.Request) { 45 | // 上传文件 46 | upFile := r.GetUploadFile("file") 47 | if upFile == nil { 48 | r.Response.WriteJsonExit(common.JsonResult{ 49 | Code: -1, 50 | Msg: "上传文件不能为空", 51 | }) 52 | } 53 | // 调用上传方法 54 | result, err := service.Upload.UpdImg(upFile) 55 | if err != nil { 56 | r.Response.WriteJsonExit(common.JsonResult{ 57 | Code: -1, 58 | Msg: err.Error(), 59 | }) 60 | } 61 | 62 | // 拼接图片地址 63 | result.FileUrl = utils.GetImageUrl(result.FileUrl) 64 | 65 | // 返回结果 66 | r.Response.WriteJsonExit(common.JsonResult{ 67 | Code: 0, 68 | Msg: "上传成功", 69 | Data: result, 70 | }) 71 | } 72 | -------------------------------------------------------------------------------- /packed/swagger.go: -------------------------------------------------------------------------------- 1 | package packed 2 | 3 | import "github.com/gogf/gf/os/gres" 4 | 5 | func init() { 6 | if err := gres.Add("H4sIAAAAAAAC/3yUe1TSCRbHf5JEmc4qvvIV1mo01qhDoWiaKVO+FS0l0nRKTMq0xNTxmaZgCfIwwC0ZLMvKQSclTXyEm6mpEYTkI8xQNKypxsxXo4Z73N05dc7O2e8f95577r3f8/3rg/Ffo20ErAPWAYGEwhDgKxkB64HktKNxcbFEh/92+5PJpxPDDoIBLRVcEv0Od+S03MdUNIk9lKOkbKkL/HGKWFiQ2hlVs5fgkCobaIBXba4rjhPk6pcMk6B+CiMZ505ot9PnQ/VlrEpbxo3ZRwyzYewyie2h2vpmKAkKvXg2M6RzZ5zEsnyGO8mdfuH6wFH3oVeOzg0AHyOWzue6o0iMdgW9NLjp2GDTD6Dbp6hHpVRvXNpBlgphEZNo9asRMBEW4lmxAycwVD5WVkXqBIyWGrvfGbtCTv6bbw6n+r58A3vxEQSfskn6Sqr5ibfj1OgLV1yT98e35fVmaZAIODQEOqSATp/WZpTAFQNOG2YEBahNuPCRRPOgIjeGNQGm0bv9FDk3+9Oz9Ng0XhhqFzhCad8enLRtix9IKEMcDd4KuCK6MVnHAqRj7eXCQ47OWPHyy8nDJpNRl+CwOS/Sqckeyhq3TFNTj6y+4x/UuriIziX6h8/p2SfK8L34uQZNfdFCqcegQC3O+IxeO8hJqjrOUpovnRsTfxPFHWxMpaq8s9sI6gWx6bl6V/lOv5DYzU8awaJ9oDyLbQhSqO9893JskVeHLYiV7mAVZBZwK5SbcUllr2i5DdgJtLVuLCpNXAyLF4MQLGvmUsT+PXwsjNkQ1st5ididLdzbf8+yuWpIn+xjXNkRAt+lSTwQR6Pdo1nuQeYPe27X9lGFXk1rVTk/zrim2turR9ZDQKJMsrCNxX3kmdcXXEDl8bgSXEeyw7QKxPt5wTFjo0wG3KbHkYsOSmU5UZpmzyyrAK/LbX6eO/jdjpa0wPeXk85MwR3TZQN4y2omSe96/djBTdxMwkn53En2ix7mKytE9OyDV1d/nDBTDz0kTweag5DtwVqaX2w+YlsCZiTru771C51weZzH3I7htN8/UJtvniK2GxmbRf5xoToeP5XHV/XwRA3jqHhdB/ZvU8iKBCY2fSZl3oaNQfENPffONdpbv1XUwhiBCbXx95wIly3cByj43GpCvIiz9rcn1t8bR/pT7PSHNuY/27XuMrt+oy61URRJ+tymo+K8XNmnrW9qK1NA9puT6StA7JvzS442aldxECkfwwzTySw+mWreUobCag4L5HVOAakZTLf9z83Kat9ROppstA3/zv1lS8ExL9B5qzYDyQHutwx2m0VKVYGpc9IfsPtXkoM46IQIuuk/jcJolB6DKRmVhJDUCFsPK2zalDWwiZ6zJ3yERKf5kb6IARgrVACUjJdaYwovwig8wsTEOe1FnenxHanCbncdq8LUzfb8qmRL1eLvG1+/hUzqRl7pjw4sTOlKwRmTX1MxoxbABqtLD4v3+RAzOujI31WNw+oSk++Rekr+p5m+3LqzRS5WMa3+uQbe4YddTCpprSNdd597sptTHZ+XmVUi0tFLzW++iz/jxGBcANHrvokJ7vVyLhzJ0xo8IZbYVfSXHTEy7LN9BRIOeBBX+BY/e2ffHdb0C8MTEDc6c8JZ+hhbSQKfjs+5HsiE3wFE968JBNFadtDs8w8+2o3qf2JfvwRBrwdL3B7166QvS7Ja3xoW0Uy3sI5TjUlPt6KWz2gib73/TmpL8DZQaETOYN4PC7DaTGLBlHdIcMWSuiUO/U5UvxsNslDydH23e5Va20rTenqDyq3n/IdvVrxD86NRvrvRd8dbZgvuRjWszb8Jq4lbxFi4cs/yKkup4cSbdpVYtoOuQZRJ+87Sptln29izWHlMjOwfyehE5FPhh66hEVTncgltfxv4VgxvyFfxRFu+U64zsN6puqbrATRHpH7hRu9XejxMTl841vypWjO2RxTx65QH8eb7+dEg74gjkEIEEmw9AR1z9ydSMq5BP7Fr0q7yzmiUGmcAWFnB+EPWSSq3BeDBAFCxFQD+xDXwP7iGfMH1vwk9DpdEr35/fYPx1wIZrfmC+6+dV3H/p1byVuv/hf8Xq7+O8h/pAyued8DAXwQDr13dgwAQcBEAgPfg1elfAQAA///Qp1w6jAYAAA=="); err != nil { 7 | panic("add binary content to resource manager failed: " + err.Error()) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /app/service/oper_log.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 操作日志-服务类 26 | * @author 半城风雨 27 | * @since 2021/8/14 28 | * @File : oper_log 29 | */ 30 | package service 31 | 32 | import ( 33 | "easygoadmin/app/dao" 34 | "easygoadmin/app/model" 35 | ) 36 | 37 | // 中间件管理服务 38 | var OperLog = new(operLogService) 39 | 40 | type operLogService struct{} 41 | 42 | func (s *operLogService) GetList(req *model.OperLogPageReq) ([]model.OperLog, int, error) { 43 | // 实例化查询条件 44 | query := dao.OperLog.Clone() 45 | query = query.Where("mark=1") 46 | // 查询条件 47 | if req != nil { 48 | // 操作用户 49 | if req.Username != "" { 50 | query = query.Where("username=?", req.Username) 51 | } 52 | // 操作模块 53 | if req.Model != "" { 54 | query = query.Where("model like ?", "%"+req.Model+"%") 55 | } 56 | } 57 | // 查询记录总数 58 | count, err := query.Count() 59 | if err != nil { 60 | return nil, 0, err 61 | } 62 | // 排除 63 | query = query.Order("id desc") 64 | // 分页 65 | query = query.Page(req.Page, req.Limit) 66 | // 对象转换 67 | var list []model.OperLog 68 | query.Structs(&list) 69 | return list, count, nil 70 | } 71 | -------------------------------------------------------------------------------- /middleware/checklogin.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 登录验证中间件 26 | * @author 半城风雨 27 | * @since 2021/8/13 28 | * @File : checklogin 29 | */ 30 | package middleware 31 | 32 | import ( 33 | "easygoadmin/app/utils" 34 | "easygoadmin/app/utils/common" 35 | "fmt" 36 | "github.com/gogf/gf/net/ghttp" 37 | "github.com/gogf/gf/text/gstr" 38 | "time" 39 | ) 40 | 41 | func CheckLogin(r *ghttp.Request) { 42 | fmt.Println("登录验证中间件") 43 | // 放行设置 44 | urlItem := []string{"/captcha", "/login"} 45 | if !utils.InStringArray(r.RequestURI, urlItem) { 46 | // 从请求头中获取Token 47 | token := r.GetHeader("Authorization") 48 | // 字符串替换 49 | token = gstr.Replace(token, "Bearer ", "") 50 | claim, err := utils.ParseToken(token) 51 | if err != nil { 52 | fmt.Println("解析token出现错误:", err) 53 | r.Response.WriteJsonExit(common.JsonResult{ 54 | Code: 401, 55 | Msg: "Token已过期", 56 | }) 57 | } else if time.Now().Unix() > claim.ExpiresAt { 58 | fmt.Println("时间超时") 59 | r.Response.WriteJsonExit(common.JsonResult{ 60 | Code: 401, 61 | Msg: "时间超时", 62 | }) 63 | } 64 | } 65 | // 前置中间件 66 | r.Middleware.Next() 67 | } 68 | -------------------------------------------------------------------------------- /app/model/city.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // City is the golang structure for table sys_city. 12 | type City internal.City 13 | 14 | // Fill with you ideas below. 15 | 16 | type CityInfoVo struct { 17 | City 18 | HaveChild bool `json:"haveChild"` 19 | } 20 | 21 | // 列表查询条件 22 | type CityQueryReq struct { 23 | Name string `p:"name"` // 城市名称 24 | Pid int `p:"pid"` // 上级ID 25 | } 26 | 27 | // 添加城市 28 | type CityAddReq struct { 29 | Pid int `p:"pid"` // 父级编号 30 | Level int `p:"level" v:"required#请选择城市等级"` // 城市级别:1省 2市 3区 31 | Name string `p:"name" v:"required#城市名称不能为空"` // 城市名称 32 | Citycode string `p:"citycode"` // 城市编号(区号) 33 | PAdcode string `p:"p_adcode"` // 父级地理编号 34 | Adcode string `p:"adcode"` // 地理编号 35 | Lng uint `p:"lng"` // 城市坐标中心点经度(* 1e6):如果是中国,此值是 1e7 36 | Lat uint `p:"lat"` // 城市坐标中心点纬度(* 1e6) 37 | Sort int `p:"sort" v:"required#排序号不能为空"` // 排序号 38 | } 39 | 40 | // 编辑城市 41 | type CityUpdateReq struct { 42 | Id int `p:"id" v:"required#主键ID不能为空"` // 主键ID 43 | Pid int `p:"pid"` // 父级编号 44 | Level int `p:"level" v:"required#请选择城市等级"` // 城市级别:1省 2市 3区 45 | Name string `p:"name" v:"required#城市名称不能为空"` // 城市名称 46 | Citycode string `p:"citycode"` // 城市编号(区号) 47 | PAdcode string `p:"p_adcode"` // 父级地理编号 48 | Adcode string `p:"adcode"` // 地理编号 49 | Lng uint `p:"lng"` // 城市坐标中心点经度(* 1e6):如果是中国,此值是 1e7 50 | Lat uint `p:"lat"` // 城市坐标中心点纬度(* 1e6) 51 | Sort int `p:"sort" v:"required#排序号不能为空"` // 排序号 52 | } 53 | 54 | // 删除城市 55 | type CityDeleteReq struct { 56 | Ids string `p:"ids" v:"required#请选择需要删除的数据记录"` 57 | } 58 | 59 | // 获取子级城市 60 | type CityChildReq struct { 61 | CityCode string `p:"id" v:"required#上级城市编码不能为空"` 62 | } 63 | -------------------------------------------------------------------------------- /app/model/config_data.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // ConfigData is the golang structure for table sys_config_data. 12 | type ConfigData internal.ConfigData 13 | 14 | // Fill with you ideas below. 15 | 16 | // 字典项列表查询条件 17 | type ConfigDataPageReq struct { 18 | ConfigId int `p:"configId"` // 字典ID 19 | Title string `p:"name"` // 配置标题 20 | Page int `p:"page"` // 页码 21 | Limit int `p:"limit"` // 每页数 22 | } 23 | 24 | // 添加字典项 25 | type ConfigDataAddReq struct { 26 | Title string `p:"title" v:"required#配置项标题不能为空"` // 配置标题 27 | Code string `p:"code" v:"required#配置项编码不能为空"` // 配置编码 28 | Value string `p:"value"` // 配置值 29 | Options string `p:"options"` // 配置项 30 | ConfigId int `p:"config_id" v:"required#配置ID不能为空"` // 配置ID 31 | Type string `p:"type" v:"required#请选择配置项类型"` // 配置类型 32 | Sort int `p:"sort" v:"required#配置项排序号不能为空"` // 排序 33 | Note string `p:"note"` // 配置说明 34 | } 35 | 36 | // 更新字典项 37 | type ConfigDataUpdateReq struct { 38 | Id int `p:"id" v:"required#主键ID不能为空"` 39 | Title string `p:"title" v:"required#配置项标题不能为空"` // 配置标题 40 | Code string `p:"code" v:"required#配置项编码不能为空"` // 配置编码 41 | Value string `p:"value"` // 配置值 42 | Options string `p:"options"` // 配置项 43 | ConfigId int `p:"config_id" v:"required#配置ID不能为空"` // 配置ID 44 | Type string `p:"type" v:"required#请选择配置项类型"` // 配置类型 45 | Sort int `p:"sort" v:"required#配置项排序号不能为空"` // 排序 46 | Note string `p:"note"` // 配置说明 47 | } 48 | 49 | // 删除字典项 50 | type ConfigDataDeleteReq struct { 51 | Ids string `p:"ids" v:"required#请选择需要删除的数据记录"` 52 | } 53 | 54 | // 设置状态 55 | type ConfigDataStatusReq struct { 56 | Id int `p:"id" v:"required#主键ID不能为空"` 57 | Status int `p:"status" v:"required#状态不能为空"` 58 | } 59 | 60 | // 配置数据列表 61 | type ConfigDataVo struct { 62 | ConfigData 63 | TypeName string `json:"typeName"` 64 | } 65 | -------------------------------------------------------------------------------- /app/model/internal/ad.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Ad is the golang structure for table sys_ad. 12 | type Ad struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | Title string `orm:"title" json:"title"` // 广告标题 15 | AdSortId int `orm:"ad_sort_id" json:"adSortId"` // 广告位ID 16 | Cover string `orm:"cover" json:"cover"` // 广告图片 17 | Type int `orm:"type" json:"type"` // 广告格式:1图片 2文字 3视频 4推荐 18 | Description string `orm:"description" json:"description"` // 广告描述 19 | Content string `orm:"content" json:"content"` // 广告内容 20 | Url string `orm:"url" json:"url"` // 广告链接 21 | Width int `orm:"width" json:"width"` // 广告宽度 22 | Height int `orm:"height" json:"height"` // 广告高度 23 | StartTime *gtime.Time `orm:"start_time" json:"startTime"` // 开始时间 24 | EndTime *gtime.Time `orm:"end_time" json:"endTime"` // 结束时间 25 | ViewNum int `orm:"view_num" json:"viewNum"` // 点击率 26 | Status int `orm:"status" json:"status"` // 状态:1在用 2停用 27 | Sort int `orm:"sort" json:"sort"` // 排序 28 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 29 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 添加时间 30 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 31 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 32 | Mark int `orm:"mark" json:"mark"` // 有效标识(1正常 0删除) 33 | } -------------------------------------------------------------------------------- /app/model/item_cate.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // ItemCate is the golang structure for table sys_item_cate. 12 | type ItemCate internal.ItemCate 13 | 14 | // Fill with you ideas below. 15 | 16 | // 栏目查询条件 17 | type ItemCateQueryReq struct { 18 | Name string `p:"name"` // 栏目名称 19 | ItemId int `p:"item_id"` // 站点ID 20 | } 21 | 22 | // 添加站点 23 | type ItemCateAddReq struct { 24 | Name string `p:"name" v:"required#栏目名称不能为空"` // 栏目名称 25 | Pid int `p:"pid"` // 父级ID 26 | ItemId uint `p:"item_id" v:"required#请选择所属站点"` // 站点ID 27 | Pinyin string `p:"pinyin" v:"required#栏目拼音(全拼)不能为空"` // 拼音(全) 28 | Code string `p:"code" v:"required#栏目拼音(简拼)不能为空"` // 拼音(简) 29 | IsCover int `p:"is_cover" v:"required#请选择是否有封面"` // 是否有封面:1是 2否 30 | Cover string `p:"cover"` // 封面 31 | Status int `p:"status" v:"required#请选择栏目状态"` // 状态:1启用 2停用 32 | Note string `p:"note"` // 备注 33 | Sort uint `p:"sort" v:"required#排序号不能为空"` // 排序 34 | } 35 | 36 | // 修改 37 | type ItemCateUpdateReq struct { 38 | Id int `p:"id" v:"required#主键ID不能为空"` 39 | Name string `p:"name" v:"required#栏目名称不能为空"` // 栏目名称 40 | Pid int `p:"pid"` // 父级ID 41 | ItemId uint `p:"item_id" v:"required#请选择所属站点"` // 站点ID 42 | Pinyin string `p:"pinyin" v:"required#栏目拼音(全拼)不能为空"` // 拼音(全) 43 | Code string `p:"code" v:"required#栏目拼音(简拼)不能为空"` // 拼音(简) 44 | IsCover int `p:"is_cover" v:"required#请选择是否有封面"` // 是否有封面:1是 2否 45 | Cover string `p:"cover"` // 封面 46 | Status int `p:"status" v:"required#请选择栏目状态"` // 状态:1启用 2停用 47 | Note string `p:"note"` // 备注 48 | Sort uint `p:"sort" v:"required#排序号不能为空"` // 排序 49 | } 50 | 51 | // 删除栏目 52 | type ItemCateDeleteReq struct { 53 | Ids string `p:"ids" v:"required#请选择要删除的数据记录"` 54 | } 55 | 56 | // 栏目信息 57 | type ItemCateInfoVo struct { 58 | ItemCate 59 | ItemName string `json:"itemName"` // 栏目名称 60 | } 61 | 62 | // 栏目树结构 63 | type CateTreeNode struct { 64 | ItemCate 65 | Children []*CateTreeNode `json:"children"` // 子栏目 66 | } 67 | -------------------------------------------------------------------------------- /app/service/login_log.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 登录日志-服务类 26 | * @author 半城风雨 27 | * @since 2021/8/14 28 | * @File : login_log 29 | */ 30 | package service 31 | 32 | import ( 33 | "easygoadmin/app/dao" 34 | "easygoadmin/app/model" 35 | "easygoadmin/app/utils" 36 | "easygoadmin/app/utils/convert" 37 | "github.com/gogf/gf/errors/gerror" 38 | ) 39 | 40 | // 中间件管理服务 41 | var LoginLog = new(loginLogService) 42 | 43 | type loginLogService struct{} 44 | 45 | func (s *loginLogService) GetList(req *model.LoginLogPageReq) ([]model.LoginLog, int, error) { 46 | // 实例化查询条件 47 | query := dao.LoginLog.Clone() 48 | query = query.Where("mark=1") 49 | // 查询条件 50 | if req != nil { 51 | // 操作用户 52 | if req.Username != "" { 53 | query = query.Where("username=?", req.Username) 54 | } 55 | } 56 | // 查询记录总数 57 | count, err := query.Count() 58 | if err != nil { 59 | return nil, 0, err 60 | } 61 | // 排除 62 | query = query.Order("id desc") 63 | // 分页 64 | query = query.Page(req.Page, req.Limit) 65 | // 对象转换 66 | var list []model.LoginLog 67 | query.Structs(&list) 68 | return list, count, nil 69 | } 70 | 71 | // 删除 72 | func (s *loginLogService) Delete(Ids string) (int64, error) { 73 | if utils.AppDebug() { 74 | return 0, gerror.New("演示环境,暂无权限操作") 75 | } 76 | idsArr := convert.ToInt64Array(Ids, ",") 77 | result, err := dao.LoginLog.Delete("id in (?)", idsArr) 78 | if err != nil { 79 | return 0, err 80 | } 81 | // 获取受影响行数 82 | rows, err := result.RowsAffected() 83 | return rows, nil 84 | } 85 | -------------------------------------------------------------------------------- /app/controller/role_menu.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 角色菜单-控制器 26 | * @author 半城风雨 27 | * @since 2021/7/15 28 | * @File : rolemenu 29 | */ 30 | package controller 31 | 32 | import ( 33 | "easygoadmin/app/model" 34 | "easygoadmin/app/service" 35 | "easygoadmin/app/utils/common" 36 | "github.com/gogf/gf/net/ghttp" 37 | ) 38 | 39 | // 控制器管理对象 40 | var RoleMenu = new(roleMenuCtl) 41 | 42 | type roleMenuCtl struct{} 43 | 44 | func (c *roleMenuCtl) Index(r *ghttp.Request) { 45 | // 角色ID 46 | roleId := r.GetQueryInt64("roleId") 47 | if roleId <= 0 { 48 | r.Response.WriteJsonExit(common.JsonResult{ 49 | Code: -1, 50 | Msg: "角色ID不能为空", 51 | }) 52 | } 53 | 54 | // 获取角色菜单权限列表 55 | list, err := service.RoleMenu.GetRoleMenuList(roleId) 56 | if err != nil { 57 | r.Response.WriteJsonExit(common.JsonResult{ 58 | Code: -1, 59 | Msg: err.Error(), 60 | }) 61 | } 62 | r.Response.WriteJsonExit(common.JsonResult{ 63 | Code: 0, 64 | Data: list, 65 | Msg: "操作成功", 66 | }) 67 | } 68 | 69 | func (c *roleMenuCtl) Save(r *ghttp.Request) { 70 | var req *model.RoleMenuSaveReq 71 | if err := r.Parse(&req); err != nil { 72 | r.Response.WriteJsonExit(common.JsonResult{ 73 | Code: -1, 74 | Msg: err.Error(), 75 | }) 76 | } 77 | 78 | // 调用保存方法 79 | err := service.RoleMenu.Save(req) 80 | if err != nil { 81 | r.Response.WriteJsonExit(common.JsonResult{ 82 | Code: -1, 83 | Msg: err.Error(), 84 | }) 85 | } 86 | r.Response.WriteJsonExit(common.JsonResult{ 87 | Code: 0, 88 | Msg: "保存成功", 89 | }) 90 | } 91 | -------------------------------------------------------------------------------- /app/model/internal/login_log.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // LoginLog is the golang structure for table sys_login_log. 12 | type LoginLog struct { 13 | Id int64 `orm:"id,primary" json:"id"` // 主键ID 14 | Username string `orm:"username" json:"username"` // 操作账号 15 | Method string `orm:"method" json:"method"` // 操作方法 16 | OperUrl string `orm:"oper_url" json:"operUrl"` // 请求URL 17 | OperIp string `orm:"oper_ip" json:"operIp"` // 主机地址 18 | OperLocation string `orm:"oper_location" json:"operLocation"` // 操作地点 19 | Os string `orm:"os" json:"os"` // 操作系统 20 | RequestParam string `orm:"request_param" json:"requestParam"` // 请求参数 21 | Browser string `orm:"browser" json:"browser"` // 浏览器 22 | Result string `orm:"result" json:"result"` // 返回参数 23 | Status uint `orm:"status" json:"status"` // 操作状态:0操作成功 1操作失败 24 | Type uint `orm:"type" json:"type"` // 操作类型:1登录成功 2登录失败 3注销成功 2注销失败 25 | UserAgent string `orm:"user_agent" json:"userAgent"` // 代理信息 26 | Note string `orm:"note" json:"note"` // 备注 27 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 28 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 操作时间 29 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 30 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 31 | Mark int `orm:"mark" json:"mark"` // 有效标识 32 | } -------------------------------------------------------------------------------- /app/controller/login_log.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 登录日志-控制器 26 | * @author 半城风雨 27 | * @since 2021/8/14 28 | * @File : loginlog 29 | */ 30 | package controller 31 | 32 | import ( 33 | "easygoadmin/app/model" 34 | "easygoadmin/app/service" 35 | "easygoadmin/app/utils/common" 36 | "github.com/gogf/gf/net/ghttp" 37 | ) 38 | 39 | // 控制器管理对象 40 | var LoginLog = new(loginLogCtl) 41 | 42 | type loginLogCtl struct{} 43 | 44 | func (c *loginLogCtl) List(r *ghttp.Request) { 45 | // 参数验证 46 | var req *model.LoginLogPageReq 47 | if err := r.Parse(&req); err != nil { 48 | r.Response.WriteJsonExit(common.JsonResult{ 49 | Code: -1, 50 | Msg: err.Error(), 51 | }) 52 | } 53 | 54 | // 调用查询列表方法 55 | list, count, err := service.LoginLog.GetList(req) 56 | if err != nil { 57 | r.Response.WriteJsonExit(common.JsonResult{ 58 | Code: -1, 59 | Msg: err.Error(), 60 | }) 61 | } 62 | 63 | // 返回结果 64 | r.Response.WriteJsonExit(common.JsonResult{ 65 | Code: 0, 66 | Msg: "查询成功", 67 | Data: list, 68 | Count: count, 69 | }) 70 | } 71 | 72 | func (c *loginLogCtl) Delete(r *ghttp.Request) { 73 | var req *model.LoginLogDeleteReq 74 | if err := r.Parse(&req); err != nil { 75 | r.Response.WriteJsonExit(common.JsonResult{ 76 | Code: -1, 77 | Msg: err.Error(), 78 | }) 79 | } 80 | 81 | // 调用删除方法 82 | rows, err := service.LoginLog.Delete(req.Ids) 83 | if err != nil || rows == 0 { 84 | r.Response.WriteJsonExit(common.JsonResult{ 85 | Code: -1, 86 | Msg: err.Error(), 87 | }) 88 | } 89 | 90 | // 返回结果 91 | r.Response.WriteJsonExit(common.JsonResult{ 92 | Code: 0, 93 | Msg: "删除成功", 94 | }) 95 | } 96 | -------------------------------------------------------------------------------- /app/model/link.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // Link is the golang structure for table sys_link. 12 | type Link internal.Link 13 | 14 | // Fill with you ideas below. 15 | 16 | // 分页查询条件 17 | type LinkPageReq struct { 18 | Name string `p:"name"` // 友链名称 19 | Type int `p:"type"` // 友链类型 20 | Platform int `p:"platform"` // 投放平台 21 | Page int `p:"page"` // 页码 22 | Limit int `p:"limit"` // 每页数 23 | } 24 | 25 | // 添加友链 26 | type LinkAddReq struct { 27 | Name string `p:"name" v:"required#友链名称不能为空"` // 友链名称 28 | Type int `p:"type" v:"required#请选择友链类型"` // 类型:1友情链接 2合作伙伴 29 | Url string `p:"url"` // 友链地址 30 | ItemId int `p:"item_id"` // 站点ID 31 | CateId int `p:"cate_id"` // 栏目ID 32 | Platform int `p:"platform" v:"required#请选择投放平台"` // 平台:1PC站 2WAP站 3微信小程序 4APP应用 33 | Form int `p:"form" v:"required#请选择友链形式"` // 友链形式:1文字链接 2图片链接 34 | Image string `p:"image"` // 友链图片 35 | Status int `p:"status" v:"required#请选择友链状态"` // 状态:1在用 2停用 36 | Sort int `p:"sort" v:"required#排序号不能为空"` // 显示顺序 37 | Note string `p:"note"` // 备注 38 | } 39 | 40 | // 修改友链 41 | type LinkUpdateReq struct { 42 | Id int `p:"id" v:"required#主键ID不能为空"` 43 | Name string `p:"name" v:"required#友链名称不能为空"` // 友链名称 44 | Type int `p:"type" v:"required#请选择友链类型"` // 类型:1友情链接 2合作伙伴 45 | Url string `p:"url"` // 友链地址 46 | ItemId int `p:"item_id"` // 站点ID 47 | CateId int `p:"cate_id"` // 栏目ID 48 | Platform int `p:"platform" v:"required#请选择投放平台"` // 平台:1PC站 2WAP站 3微信小程序 4APP应用 49 | Form int `p:"form" v:"required#请选择友链形式"` // 友链形式:1文字链接 2图片链接 50 | Image string `p:"image"` // 友链图片 51 | Status int `p:"status" v:"required#请选择友链状态"` // 状态:1在用 2停用 52 | Sort int `p:"sort" v:"required#排序号不能为空"` // 显示顺序 53 | Note string `p:"note"` // 备注 54 | } 55 | 56 | // 删除友链 57 | type LinkDeleteReq struct { 58 | Ids string `p:"ids" v:"required#请选择要删除的数据记录"` 59 | } 60 | 61 | // 设置状态 62 | type LinkStatusReq struct { 63 | Id int `p:"id" v:"required#主键ID不能为空"` 64 | Status int `p:"status" v:"required#状态不能为空"` 65 | } 66 | 67 | // 友链信息 68 | type LinkInfoVo struct { 69 | Link 70 | TypeName string `json:"typeName"` // 友链类型 71 | FormName string `json:"formName"` // 友链形式 72 | PlatformName string `json:"platformName"` // 投放平台 73 | } 74 | -------------------------------------------------------------------------------- /middleware/loginlog.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 登录日志 26 | * @author 半城风雨 27 | * @since 2021/8/14 28 | * @File : loginlog 29 | */ 30 | package middleware 31 | 32 | import ( 33 | "easygoadmin/app/dao" 34 | "easygoadmin/app/model" 35 | "easygoadmin/app/utils" 36 | "encoding/json" 37 | "fmt" 38 | "github.com/gogf/gf/net/ghttp" 39 | "github.com/gogf/gf/os/gtime" 40 | "github.com/mssola/user_agent" 41 | ) 42 | 43 | func LoginLog(r *ghttp.Request) { 44 | // 后置中间件 45 | r.Middleware.Next() 46 | // 中间件处理逻辑 47 | fmt.Println("登录日志中间件") 48 | 49 | // 记录登录、退出日志 50 | urlItem := []string{"/login", "/logout"} 51 | if utils.InStringArray(r.RequestURI, urlItem) { 52 | 53 | // 获取浏览器信息 54 | userAgent := r.Header.Get("User-Agent") 55 | ua := user_agent.New(userAgent) 56 | 57 | // 实例化对象 58 | var entity model.LoginLog 59 | entity.Method = r.Method 60 | entity.OperUrl = r.URL.String() 61 | entity.OperIp = r.GetClientIp() 62 | entity.OperLocation = utils.GetIpCity(entity.OperIp) 63 | entity.RequestParam = string(r.GetBody()) 64 | entity.Status = 0 65 | // 操作系统 66 | entity.Os = ua.OS() 67 | entity.Browser, _ = ua.Browser() 68 | entity.UserAgent = r.UserAgent() 69 | entity.CreateTime = gtime.Now() 70 | entity.Mark = 1 71 | if r.RequestURI == "/login" { 72 | // 登录成功 73 | var jsonObj map[string]interface{} 74 | json.Unmarshal(r.GetBody(), &jsonObj) 75 | // 获取用户信息 76 | user, err := dao.User.Where("username=?", jsonObj["username"]).FindOne() 77 | if err != nil { 78 | return 79 | } 80 | entity.Type = 1 81 | entity.Username = user.Username 82 | entity.CreateUser = user.Id 83 | } else if r.RequestURI == "/logout" { 84 | // 注销成功 85 | entity.Type = 3 86 | entity.Username = utils.UInfo(r).Username 87 | entity.CreateUser = utils.Uid(r) 88 | } 89 | // 插入记录 90 | dao.LoginLog.Insert(entity) 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /app/model/menu.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // Menu is the golang structure for table sys_menu. 12 | type Menu internal.Menu 13 | 14 | // Fill with you ideas below. 15 | 16 | // 菜单Vo 17 | type TreeNode struct { 18 | Menu 19 | Children []*TreeNode `json:"children"` // 子菜单 20 | } 21 | 22 | // 列表查询条件 23 | type MenuQueryReq struct { 24 | Title string `p:"name"` // 菜单标题 25 | } 26 | 27 | // 添加菜单 28 | type MenuAddReq struct { 29 | ParentId int `p:"parent_id"` // 上级ID 30 | Title string `p:"title" v:"required#菜单名称不能为空"` // 菜单标题 31 | Icon string `p:"icon" v:"required#菜单图标不能为空"` // 图标 32 | Path string `p:"path" v:"required#菜单路径不能为空"` // URL地址 33 | Component string `p:"component"` // 菜单组件 34 | Target string `p:"target"` // 打开方式:0组件 1内链 2外链 35 | Permission string `p:"permission"` // 权限标识 36 | Type int `p:"type" v:"required#请选择菜单类型"` // 类型:1模块 2导航 3菜单 4节点 37 | Status int `p:"status" v:"required#请选择菜单状态"` // 状态:1正常 2禁用 38 | Hide int `p:"hide"` // 是否可见:1是 2否 39 | Note string `p:"note"` // 菜单备注 40 | Sort int `p:"sort" v:"required#请输入菜单排序号"` // 显示顺序 41 | CheckedList []int `p:"checkedList"` // 权限节点 42 | } 43 | 44 | // 更新菜单 45 | type MenuUpdateReq struct { 46 | Id int `p:"id" v:"required#主键ID不能为空"` 47 | ParentId int `p:"parent_id"` // 上级ID 48 | Title string `p:"title" v:"required#菜单名称不能为空"` // 菜单标题 49 | Icon string `p:"icon" v:"required#菜单图标不能为空"` // 图标 50 | Path string `p:"path" v:"required#菜单路径不能为空"` // URL地址 51 | Component string `p:"component"` // 菜单组件 52 | Target string `p:"target"` // 打开方式:0组件 1内链 2外链 53 | Permission string `p:"permission"` // 权限标识 54 | Type int `p:"type" v:"required#请选择菜单类型"` // 类型:1模块 2导航 3菜单 4节点 55 | Status int `p:"status" v:"required#请选择菜单状态"` // 是否显示:1显示 2不显示 56 | Hide int `p:"hide"` // 是否可见:1是 2否 57 | Note string `p:"note"` // 菜单备注 58 | Sort int `p:"sort" v:"required#请输入菜单排序号"` // 显示顺序 59 | CheckedList []int `p:"checkedList"` // 权限节点 60 | } 61 | 62 | type MenuDeleteReq struct { 63 | Ids string `p:"ids" v:"require#请选择需要删除的数据记录"` 64 | } 65 | 66 | // 菜单信息 67 | type MenuInfoVo struct { 68 | Menu 69 | CheckedList []interface{} `json:"checkedList"` // 权限节点列表 70 | } 71 | 72 | // 菜单树结构 73 | type MenuTreeNode struct { 74 | Menu 75 | Children []*MenuTreeNode `json:"children"` // 子菜单 76 | } 77 | -------------------------------------------------------------------------------- /app/service/login.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 登录-服务类 26 | * @author 半城风雨 27 | * @since 2021/3/3 28 | * @File : user 29 | */ 30 | package service 31 | 32 | import ( 33 | "easygoadmin/app/dao" 34 | "easygoadmin/app/model" 35 | "easygoadmin/app/utils" 36 | jwt "easygoadmin/app/utils" 37 | "errors" 38 | "github.com/gogf/gf/container/gmap" 39 | "github.com/gogf/gf/frame/g" 40 | "github.com/gogf/gf/net/ghttp" 41 | "github.com/gogf/gf/os/gtime" 42 | "github.com/gogf/gf/text/gstr" 43 | ) 44 | 45 | // 中间件管理服务 46 | var Login = new(loginService) 47 | 48 | type loginService struct{} 49 | 50 | var SessionList = gmap.New(true) 51 | 52 | // 系统登录 53 | func (s *loginService) UserLogin(username, password string, r *ghttp.Request) (string, error) { 54 | // 获取用户信息 55 | user, err := dao.User.FindOne("username=? and mark=1", username) 56 | if err != nil { 57 | return "", err 58 | } 59 | if user == nil { 60 | return "", errors.New("用户名或者密码不正确") 61 | } 62 | // 密码校验 63 | pwd, _ := utils.Md5(password + user.Username) 64 | if user.Password != pwd { 65 | return "", errors.New("密码不正确") 66 | } 67 | // 判断当前用户状态 68 | if user.Status != 1 { 69 | return "", errors.New("您的账号已被禁用,请联系管理员") 70 | } 71 | 72 | // 更新登录时间、登录IP 73 | dao.User.Data(g.Map{ 74 | "login_time": gtime.Now(), 75 | "login_ip": utils.GetClientIp(r), 76 | "update_time": gtime.Now(), 77 | }) 78 | 79 | // 生成Token 80 | token, _ := jwt.GenerateToken(user.Id, user.Username, user.Password) 81 | 82 | // 设置SESSION信息 83 | r.Session.Set("userId", user.Id) 84 | r.Session.Set("userInfo", user) 85 | sessionId := r.Session.Id() 86 | SessionList.Set(sessionId, r.Session) 87 | return token, nil 88 | } 89 | 90 | // 获取个人信息 91 | func (s *loginService) GetProfile(session *ghttp.Session) (u *model.User) { 92 | _ = session.GetStruct("userInfo", &u) 93 | // 头像 94 | if u.Avatar != "" && !gstr.Contains(u.Avatar, utils.ImgUrl()) { 95 | u.Avatar = utils.GetImageUrl(u.Avatar) 96 | } 97 | return 98 | } 99 | -------------------------------------------------------------------------------- /app/service/role_menu.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 角色菜单-服务类 26 | * @author 半城风雨 27 | * @since 2021/7/15 28 | * @File : rolemenu 29 | */ 30 | package service 31 | 32 | import ( 33 | "easygoadmin/app/dao" 34 | "easygoadmin/app/model" 35 | "easygoadmin/app/utils" 36 | "easygoadmin/app/utils/function" 37 | "github.com/gogf/gf/errors/gerror" 38 | "github.com/gogf/gf/util/gconv" 39 | "github.com/gogf/gf/util/gutil" 40 | ) 41 | 42 | var RoleMenu = new(roleMenuService) 43 | 44 | type roleMenuService struct{} 45 | 46 | func (s *roleMenuService) GetRoleMenuList(roleId int64) ([]model.RoleMenuInfo, error) { 47 | // 获取全部菜单列表 48 | var menuList []model.Menu 49 | dao.Menu.Where("status=1").Where("mark=1").Order("sort asc").Structs(&menuList) 50 | if len(menuList) == 0 { 51 | return nil, gerror.New("菜单列表不存在") 52 | } 53 | // 获取角色菜单权限列表 54 | var roleMenuList []model.RoleMenu 55 | dao.RoleMenu.Where("role_id=?", roleId).Structs(&roleMenuList) 56 | idList := gutil.ListItemValuesUnique(&roleMenuList, "MenuId") 57 | 58 | // 对象处理 59 | var list []model.RoleMenuInfo 60 | if len(menuList) > 0 { 61 | for _, m := range menuList { 62 | var info model.RoleMenuInfo 63 | info.Id = m.Id 64 | info.Title = m.Title 65 | info.Open = true 66 | info.ParentId = m.ParentId 67 | // 节点选中值 68 | if function.InArray(gconv.String(m.Id), idList) { 69 | info.Checked = true 70 | } 71 | list = append(list, info) 72 | } 73 | } 74 | return list, nil 75 | } 76 | 77 | func (s *roleMenuService) Save(req *model.RoleMenuSaveReq) error { 78 | if utils.AppDebug() { 79 | return gerror.New("演示环境,暂无权限操作") 80 | } 81 | itemArr := req.MenuIds 82 | if len(itemArr) == 0 { 83 | return gerror.New("请选择权限节点") 84 | } 85 | // 删除现有的角色权限数据 86 | dao.RoleMenu.Delete("role_id=?", req.RoleId) 87 | // 遍历创建新角色权限数据 88 | for _, v := range itemArr { 89 | var entity model.RoleMenu 90 | entity.RoleId = req.RoleId 91 | entity.MenuId = v 92 | dao.RoleMenu.Insert(entity) 93 | } 94 | // 批量插入 95 | //dao.RoleMenu.Data(list).Batch(2).Insert() 96 | return nil 97 | } 98 | -------------------------------------------------------------------------------- /app/model/ad.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | "github.com/gogf/gf/os/gtime" 10 | ) 11 | 12 | // Ad is the golang structure for table sys_ad. 13 | type Ad internal.Ad 14 | 15 | // Fill with you ideas below. 16 | 17 | // 列表查询 18 | type AdPageReq struct { 19 | Title string `p:"title"` // 广告标题 20 | Page int `p:"page"` // 页码 21 | Limit int `p:"limit"` // 每页数 22 | } 23 | 24 | // 添加广告 25 | type AdAddReq struct { 26 | Title string `p:"title" v:"required#广告标题不能为空"` // 广告标题 27 | AdSortId int `p:"ad_sort_id" v:"required#广告位描述ID不能为空"` // 广告位ID 28 | Cover string `p:"cover"` // 广告图片 29 | Type int `p:"type" v:"required#请选择广告类型"` // 广告格式:1图片 2文字 3视频 4推荐 30 | Description string `p:"description" v:"required#广告描述不能为空"` // 广告描述 31 | Content string `p:"content"` // 广告内容 32 | Url string `p:"url" v:"required#广告连接不能为空"` // 广告链接 33 | Width int `p:"width"` // 广告宽度 34 | Height int `p:"height"` // 广告高度 35 | StartTime *gtime.Time `p:"start_time" v:"required#广告开始时间不能为空"` // 开始时间 36 | EndTime *gtime.Time `p:"end_time" v:"required#广告结束时间不能为空"` // 结束时间 37 | Status int `p:"status" v:"required#请选择广告状态"` // 状态:1在用 2停用 38 | Sort int `p:"sort" v:"required#排序号不能为空"` // 排序 39 | } 40 | 41 | // 更新广告 42 | type AdUpdateReq struct { 43 | Id int `p:"id" v:"required#主键ID不能为空"` 44 | Title string `p:"title" v:"required#广告标题不能为空"` // 广告标题 45 | AdSortId int `p:"ad_sort_id" v:"required#广告位描述ID不能为空"` // 广告位ID 46 | Cover string `p:"cover"` // 广告图片 47 | Type int `p:"type" v:"required#请选择广告类型"` // 广告格式:1图片 2文字 3视频 4推荐 48 | Description string `p:"description" v:"required#广告描述不能为空"` // 广告描述 49 | Content string `p:"content"` // 广告内容 50 | Url string `p:"url" v:"required#广告连接不能为空"` // 广告链接 51 | Width int `p:"width"` // 广告宽度 52 | Height int `p:"height"` // 广告高度 53 | StartTime *gtime.Time `p:"start_time" v:"required#广告开始时间不能为空"` // 开始时间 54 | EndTime *gtime.Time `p:"end_time" v:"required#广告结束时间不能为空"` // 结束时间 55 | Status int `p:"status" v:"required#请选择广告状态"` // 状态:1在用 2停用 56 | Sort int `p:"sort" v:"required#排序号不能为空"` // 排序 57 | } 58 | 59 | // 删除广告 60 | type AdDeleteReq struct { 61 | Ids string `p:"ids" v:"required#请选择需要删除的数据记录"` 62 | } 63 | 64 | // 设置状态 65 | type AdStatusReq struct { 66 | Id int `p:"id" v:"required#主键ID不能为空"` 67 | Status int `p:"status" v:"required#广告状态不能为空"` 68 | } 69 | 70 | // 广告信息Vo 71 | type AdInfoVo struct { 72 | Ad 73 | TypeName string `json:"typeName"` // 广告类型 74 | AdSortDesc string `json:"adSortDesc"` // 广告位描述 75 | } 76 | -------------------------------------------------------------------------------- /app/model/example.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | ) 10 | 11 | // Example is the golang structure for table sys_example. 12 | type Example internal.Example 13 | 14 | // Fill with you ideas below. 15 | 16 | // 列表查询条件 17 | type ExampleQueryReq struct { 18 | 19 | 20 | Name string `p:"name"` // 测试名称 21 | 22 | 23 | 24 | Status int `p:status` // 状态:1正常 2停用 25 | 26 | 27 | 28 | Type int `p:type` // 类型:1京东 2淘宝 3拼多多 4唯品会 29 | 30 | 31 | 32 | IsVip int `p:is_vip` // 是否VIP:1是 2否 33 | 34 | 35 | Page int `p:page` // 页码 36 | Limit int `p:limit` // 每页数 37 | } 38 | 39 | // 添加演示一 40 | type ExampleAddReq struct { 41 | 42 | 43 | Name string `p:"name" v:"required#测试名称不能为空"` // 测试名称 44 | 45 | 46 | 47 | Avatar string `p:"avatar" v:"required#请上传头像"` // 头像 48 | 49 | 50 | 51 | Content string `p:"content" v:"required#内容不能为空"` // 内容 52 | 53 | 54 | 55 | Status int `p:"status" v:"required#请选择状态"` // 状态:1正常 2停用 56 | 57 | 58 | 59 | Type int `p:"type" v:"required#请选择类型"` // 类型:1京东 2淘宝 3拼多多 4唯品会 60 | 61 | 62 | 63 | IsVip int `p:"is_vip" v:"required#请选择是否VIP"` // 是否VIP:1是 2否 64 | 65 | 66 | 67 | Sort int `p:"sort" v:"required#排序号不能为空"` // 排序号 68 | 69 | 70 | } 71 | 72 | // 更新演示一 73 | type ExampleUpdateReq struct { 74 | Id int `p:id v:"required#主键ID不能为空"` 75 | 76 | 77 | Name string `p:"name" v:"required#测试名称不能为空"` // 测试名称 78 | 79 | 80 | 81 | Avatar string `p:"avatar" v:"required#请上传头像"` // 头像 82 | 83 | 84 | 85 | Content string `p:"content" v:"required#内容不能为空"` // 内容 86 | 87 | 88 | 89 | Status int `p:"status" v:"required#请选择状态"` // 状态:1正常 2停用 90 | 91 | 92 | 93 | Type int `p:"type" v:"required#请选择类型"` // 类型:1京东 2淘宝 3拼多多 4唯品会 94 | 95 | 96 | 97 | IsVip int `p:"is_vip" v:"required#请选择是否VIP"` // 是否VIP:1是 2否 98 | 99 | 100 | 101 | Sort int `p:"sort" v:"required#排序号不能为空"` // 排序号 102 | 103 | 104 | } 105 | 106 | // 删除演示一 107 | type ExampleDeleteReq struct { 108 | Ids string `p:ids v:"required#请选择需要删除的数据记录"` 109 | } 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | // 设置状态 120 | type ExampleStatusReq struct { 121 | Id int `p:"id" v:"required#主键ID不能为空"` 122 | Status int `p:"status" v:"required#状态不能为空"` 123 | } 124 | 125 | 126 | 127 | 128 | 129 | // 设置是否VIP 130 | type ExampleIsVipReq struct { 131 | Id int `p:"id" v:"required#主键ID不能为空"` 132 | IsVip int `p:"is_vip" v:"required#是否VIP不能为空"` 133 | } 134 | 135 | 136 | 137 | 138 | 139 | // 演示一信息Vo 140 | type ExampleInfoVo struct { 141 | Example 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | StatusName int `json:"statusName"` // 状态名称 151 | 152 | 153 | 154 | TypeName int `json:"typeName"` // 类型名称 155 | 156 | 157 | 158 | IsVipName int `json:"isVipName"` // 是否VIP名称 159 | 160 | 161 | 162 | 163 | } 164 | -------------------------------------------------------------------------------- /app/model/internal/oper_log.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // OperLog is the golang structure for table sys_oper_log. 12 | type OperLog struct { 13 | Id int64 `orm:"id,primary" json:"id"` // 主键ID 14 | Model string `orm:"model" json:"model"` // 操作模块 15 | OperType int `orm:"oper_type" json:"operType"` // 操作类型:0其它 1新增 2修改 3删除 4查询 5设置状态 6导入 7导出 8设置权限 9设置密码 16 | OperMethod string `orm:"oper_method" json:"operMethod"` // 操作方法 17 | Username string `orm:"username" json:"username"` // 操作账号 18 | OperName string `orm:"oper_name" json:"operName"` // 操作用户 19 | OperUrl string `orm:"oper_url" json:"operUrl"` // 请求URL 20 | OperIp string `orm:"oper_ip" json:"operIp"` // 主机地址 21 | OperLocation string `orm:"oper_location" json:"operLocation"` // 操作地点 22 | RequestParam string `orm:"request_param" json:"requestParam"` // 请求参数 23 | Result string `orm:"result" json:"result"` // 返回参数 24 | Status int `orm:"status" json:"status"` // 日志状态:0正常日志 1错误日志 25 | UserAgent string `orm:"user_agent" json:"userAgent"` // 代理信息 26 | Note string `orm:"note" json:"note"` // 备注 27 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 28 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 操作时间 29 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 30 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 31 | Mark int `orm:"mark" json:"mark"` // 有效标识 32 | } -------------------------------------------------------------------------------- /app/model/internal/user.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // User is the golang structure for table sys_user. 12 | type User struct { 13 | Id int `orm:"id,primary" json:"id"` // 主键ID 14 | Realname string `orm:"realname" json:"realname"` // 真实姓名 15 | Nickname string `orm:"nickname" json:"nickname"` // 昵称 16 | Gender int `orm:"gender" json:"gender"` // 性别:1男 2女 3保密 17 | Avatar string `orm:"avatar" json:"avatar"` // 头像 18 | Mobile string `orm:"mobile" json:"mobile"` // 手机号码 19 | Email string `orm:"email" json:"email"` // 邮箱地址 20 | Birthday *gtime.Time `orm:"birthday" json:"birthday"` // 出生日期 21 | DeptId int `orm:"dept_id" json:"deptId"` // 部门ID 22 | LevelId int `orm:"level_id" json:"levelId"` // 职级ID 23 | PositionId int `orm:"position_id" json:"positionId"` // 岗位ID 24 | ProvinceCode string `orm:"province_code" json:"provinceCode"` // 省份编号 25 | CityCode string `orm:"city_code" json:"cityCode"` // 市区编号 26 | DistrictCode string `orm:"district_code" json:"districtCode"` // 区县编号 27 | Address string `orm:"address" json:"address"` // 详细地址 28 | CityName string `orm:"city_name" json:"cityName"` // 所属城市 29 | Username string `orm:"username" json:"username"` // 登录用户名 30 | Password string `orm:"password" json:"password"` // 登录密码 31 | Salt string `orm:"salt" json:"salt"` // 盐加密 32 | Intro string `orm:"intro" json:"intro"` // 个人简介 33 | Status int `orm:"status" json:"status"` // 状态:1正常 2禁用 34 | Note string `orm:"note" json:"note"` // 备注 35 | Sort int `orm:"sort" json:"sort"` // 排序号 36 | LoginNum int `orm:"login_num" json:"loginNum"` // 登录次数 37 | LoginIp string `orm:"login_ip" json:"loginIp"` // 最近登录IP 38 | LoginTime *gtime.Time `orm:"login_time" json:"loginTime"` // 最近登录时间 39 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 40 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 创建时间 41 | UpdateUser int `orm:"update_user" json:"updateUser"` // 更新人 42 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 43 | Mark int `orm:"mark" json:"mark"` // 有效标识(1正常 0删除) 44 | } -------------------------------------------------------------------------------- /middleware/operlog.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 操作日志 26 | * @author 半城风雨 27 | * @since 2021/8/13 28 | * @File : operlog 29 | */ 30 | package middleware 31 | 32 | import ( 33 | "easygoadmin/app/dao" 34 | "easygoadmin/app/model" 35 | "easygoadmin/app/utils" 36 | "fmt" 37 | "github.com/gogf/gf/net/ghttp" 38 | "github.com/gogf/gf/os/gtime" 39 | "github.com/gogf/gf/text/gstr" 40 | ) 41 | 42 | func OperLog(r *ghttp.Request) { 43 | // 后置中间件 44 | r.Middleware.Next() 45 | // 中间件处理逻辑 46 | fmt.Println("操作日志中间件") 47 | 48 | // 分析请求URL地址 49 | urlArr := gstr.Split(r.URL.String(), "?") 50 | urlItem := gstr.Split(urlArr[0], "/") 51 | if len(urlItem) < 3 { 52 | return 53 | } 54 | // 拼接节点 55 | permission := "sys:" + urlItem[1] + ":" + urlItem[2] 56 | // 查询节点信息 57 | info, err := dao.Menu.Where("permission=?", permission).FindOne() 58 | if err != nil || info == nil { 59 | return 60 | } 61 | 62 | // 创建日志对象 63 | var entity model.OperLog 64 | entity.Model = info.Title 65 | if urlItem[2] == "add" || urlItem[2] == "addz" { 66 | // 新增 67 | entity.OperType = 1 68 | } else if urlItem[2] == "update" { 69 | // 修改 70 | entity.OperType = 2 71 | } else if urlItem[2] == "delete" || urlItem[2] == "dall" { 72 | // 删除 73 | entity.OperType = 3 74 | } else if urlItem[2] == "list" { 75 | // 查询 76 | entity.OperType = 4 77 | } else if urlItem[2] == "status" { 78 | // 设置状态 79 | entity.OperType = 5 80 | } else if urlItem[2] == "import" { 81 | // 导入 82 | entity.OperType = 6 83 | } else if urlItem[2] == "export" { 84 | // 导出 85 | entity.OperType = 7 86 | } else if urlItem[2] == "permission" { 87 | // 设置权限 88 | entity.OperType = 8 89 | } else if urlItem[2] == "resetPwd" { 90 | // 设置密码 91 | entity.OperType = 9 92 | } else { 93 | // 其他 94 | entity.OperType = 0 95 | } 96 | entity.OperMethod = r.Method 97 | entity.OperName = utils.UInfo(r).Realname 98 | entity.Username = utils.UInfo(r).Username 99 | entity.OperUrl = r.URL.String() 100 | entity.OperIp = r.GetClientIp() 101 | entity.OperLocation = utils.GetIpCity(entity.OperIp) 102 | entity.RequestParam = string(r.GetBody()) 103 | entity.Status = 0 104 | entity.UserAgent = r.UserAgent() 105 | entity.CreateUser = utils.Uid(r) 106 | entity.CreateTime = gtime.Now() 107 | entity.Mark = 1 108 | dao.OperLog.Insert(entity) 109 | } 110 | -------------------------------------------------------------------------------- /app/controller/generate.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 代码生成器-控制器 26 | * @author 半城风雨 27 | * @since 2021/8/2 28 | * @File : generate 29 | */ 30 | package controller 31 | 32 | import ( 33 | "easygoadmin/app/model" 34 | "easygoadmin/app/service" 35 | "easygoadmin/app/utils/common" 36 | "github.com/gogf/gf/net/ghttp" 37 | "github.com/gogf/gf/util/gconv" 38 | "strings" 39 | ) 40 | 41 | // 控制器管理对象 42 | var Generate = new(generateCtl) 43 | 44 | type generateCtl struct{} 45 | 46 | func (c *generateCtl) List(r *ghttp.Request) { 47 | // 参数验证 48 | var req *model.GeneratePageReq 49 | if err := r.Parse(&req); err != nil { 50 | r.Response.WriteJsonExit(common.JsonResult{ 51 | Code: -1, 52 | Msg: err.Error(), 53 | }) 54 | } 55 | 56 | // 调用查询列表方法 57 | list, err := service.Generate.GetList(req) 58 | if err != nil { 59 | r.Response.WriteJsonExit(common.JsonResult{ 60 | Code: -1, 61 | Msg: err.Error(), 62 | }) 63 | } 64 | 65 | // 返回结果 66 | r.Response.WriteJsonExit(common.JsonResult{ 67 | Code: 0, 68 | Msg: "查询成功", 69 | Data: list, 70 | Count: len(list), 71 | }) 72 | } 73 | 74 | func (c *generateCtl) Generate(r *ghttp.Request) { 75 | // 生成对象 76 | var req model.GenerateFileReq 77 | // 参数绑定 78 | if err := r.Parse(&req); err != nil { 79 | r.Response.WriteJsonExit(common.JsonResult{ 80 | Code: -1, 81 | Msg: err.Error(), 82 | }) 83 | } 84 | // 调用生成方法 85 | err := service.Generate.Generate(req, r) 86 | if err != nil { 87 | r.Response.WriteJsonExit(common.JsonResult{ 88 | Code: -1, 89 | Msg: err.Error(), 90 | }) 91 | } 92 | // 返回结果 93 | r.Response.WriteJsonExit(common.JsonResult{ 94 | Code: 0, 95 | Msg: "生成成功", 96 | }) 97 | } 98 | 99 | func (c *generateCtl) BatchGenerate(r *ghttp.Request) { 100 | // 生成对象 101 | var req *model.BatchGenerateFileReq 102 | // 参数绑定 103 | if err := r.Parse(&req); err != nil { 104 | r.Response.WriteJsonExit(common.JsonResult{ 105 | Code: -1, 106 | Msg: err.Error(), 107 | }) 108 | } 109 | // 参数分析 110 | tableList := strings.Split(req.Tables, ",") 111 | count := 0 112 | for _, item := range tableList { 113 | itemList := strings.Split(item, "|") 114 | // 组装参数对象 115 | var param model.GenerateFileReq 116 | param.Name = itemList[0] 117 | param.Comment = itemList[1] 118 | // 调用生成方法 119 | err := service.Generate.Generate(param, r) 120 | if err != nil { 121 | continue 122 | } 123 | count++ 124 | } 125 | // 返回结果 126 | r.Response.WriteJsonExit(common.JsonResult{ 127 | Code: 0, 128 | Msg: "本次共生成【" + gconv.String(count) + "】个模块", 129 | }) 130 | } 131 | -------------------------------------------------------------------------------- /app/controller/dict.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 字典管理-控制器 26 | * @author 半城风雨 27 | * @since 2021/7/21 28 | * @File : dict 29 | */ 30 | package controller 31 | 32 | import ( 33 | "easygoadmin/app/model" 34 | "easygoadmin/app/service" 35 | "easygoadmin/app/utils" 36 | "easygoadmin/app/utils/common" 37 | "github.com/gogf/gf/net/ghttp" 38 | ) 39 | 40 | // 控制器管理对象 41 | var Dict = new(dictCtl) 42 | 43 | type dictCtl struct{} 44 | 45 | func (c *dictCtl) List(r *ghttp.Request) { 46 | // 参数验证 47 | var req *model.DictQueryReq 48 | if err := r.Parse(&req); err != nil { 49 | r.Response.WriteJsonExit(common.JsonResult{ 50 | Code: -1, 51 | Msg: err.Error(), 52 | }) 53 | } 54 | 55 | // 调用查询列表方法 56 | list := service.Dict.GetList(req) 57 | 58 | // 返回结果 59 | r.Response.WriteJsonExit(common.JsonResult{ 60 | Code: 0, 61 | Data: list, 62 | Msg: "操作成功", 63 | }) 64 | } 65 | 66 | func (c *dictCtl) Add(r *ghttp.Request) { 67 | // 参数验证 68 | var req *model.DictAddReq 69 | if err := r.Parse(&req); err != nil { 70 | r.Response.WriteJsonExit(common.JsonResult{ 71 | Code: -1, 72 | Msg: err.Error(), 73 | }) 74 | } 75 | 76 | // 调用添加方法 77 | id, err := service.Dict.Add(req, utils.Uid(r)) 78 | if err != nil || id == 0 { 79 | r.Response.WriteJsonExit(common.JsonResult{ 80 | Code: -1, 81 | Msg: err.Error(), 82 | }) 83 | } 84 | r.Response.WriteJsonExit(common.JsonResult{ 85 | Code: 0, 86 | Msg: "添加成功", 87 | }) 88 | } 89 | 90 | func (c *dictCtl) Update(r *ghttp.Request) { 91 | // 参数验证 92 | var req *model.DictUpdateReq 93 | if err := r.Parse(&req); err != nil { 94 | r.Response.WriteJsonExit(common.JsonResult{ 95 | Code: -1, 96 | Msg: err.Error(), 97 | }) 98 | } 99 | 100 | // 调用修改方法 101 | rows, err := service.Dict.Update(req, utils.Uid(r)) 102 | if err != nil || rows == 0 { 103 | r.Response.WriteJsonExit(common.JsonResult{ 104 | Code: -1, 105 | Msg: err.Error(), 106 | }) 107 | } 108 | r.Response.WriteJsonExit(common.JsonResult{ 109 | Code: 0, 110 | Msg: "更新成功", 111 | }) 112 | } 113 | 114 | func (c *dictCtl) Delete(r *ghttp.Request) { 115 | // 参数验证 116 | var req *model.DictDeleteReq 117 | if err := r.Parse(&req); err != nil { 118 | r.Response.WriteJsonExit(common.JsonResult{ 119 | Code: -1, 120 | Msg: err.Error(), 121 | }) 122 | } 123 | 124 | // 调用删除方法 125 | rows, err := service.Dict.Delete(req.Ids) 126 | if err != nil || rows == 0 { 127 | r.Response.WriteJsonExit(common.JsonResult{ 128 | Code: -1, 129 | Msg: err.Error(), 130 | }) 131 | } 132 | 133 | // 返回结果 134 | r.Response.WriteJsonExit(common.JsonResult{ 135 | Code: 0, 136 | Msg: "删除成功", 137 | }) 138 | } 139 | -------------------------------------------------------------------------------- /app/controller/config.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 配置管理-控制器 26 | * @author 半城风雨 27 | * @since 2021/7/21 28 | * @File : config 29 | */ 30 | package controller 31 | 32 | import ( 33 | "easygoadmin/app/model" 34 | "easygoadmin/app/service" 35 | "easygoadmin/app/utils" 36 | "easygoadmin/app/utils/common" 37 | "github.com/gogf/gf/net/ghttp" 38 | ) 39 | 40 | // 控制器管理对象 41 | var Config = new(configCtl) 42 | 43 | type configCtl struct{} 44 | 45 | func (c *configCtl) List(r *ghttp.Request) { 46 | // 参数验证 47 | var req *model.ConfigQueryReq 48 | if err := r.Parse(&req); err != nil { 49 | r.Response.WriteJsonExit(common.JsonResult{ 50 | Code: -1, 51 | Msg: err.Error(), 52 | }) 53 | } 54 | 55 | // 调用查询列表方法 56 | list := service.Config.GetList(req) 57 | 58 | // 返回结果 59 | r.Response.WriteJsonExit(common.JsonResult{ 60 | Code: 0, 61 | Data: list, 62 | Msg: "操作成功", 63 | }) 64 | } 65 | 66 | func (c *configCtl) Add(r *ghttp.Request) { 67 | // 参数验证 68 | var req *model.ConfigAddReq 69 | if err := r.Parse(&req); err != nil { 70 | r.Response.WriteJsonExit(common.JsonResult{ 71 | Code: -1, 72 | Msg: err.Error(), 73 | }) 74 | } 75 | 76 | // 调用添加方法 77 | id, err := service.Config.Add(req, utils.Uid(r)) 78 | if err != nil || id == 0 { 79 | r.Response.WriteJsonExit(common.JsonResult{ 80 | Code: -1, 81 | Msg: err.Error(), 82 | }) 83 | } 84 | r.Response.WriteJsonExit(common.JsonResult{ 85 | Code: 0, 86 | Msg: "添加成功", 87 | }) 88 | } 89 | 90 | func (c *configCtl) Update(r *ghttp.Request) { 91 | // 参数验证 92 | var req *model.ConfigUpdateReq 93 | if err := r.Parse(&req); err != nil { 94 | r.Response.WriteJsonExit(common.JsonResult{ 95 | Code: -1, 96 | Msg: err.Error(), 97 | }) 98 | } 99 | 100 | // 调用修改方法 101 | rows, err := service.Config.Update(req, utils.Uid(r)) 102 | if err != nil || rows == 0 { 103 | r.Response.WriteJsonExit(common.JsonResult{ 104 | Code: -1, 105 | Msg: err.Error(), 106 | }) 107 | } 108 | r.Response.WriteJsonExit(common.JsonResult{ 109 | Code: 0, 110 | Msg: "更新成功", 111 | }) 112 | } 113 | 114 | func (c *configCtl) Delete(r *ghttp.Request) { 115 | // 参数验证 116 | var req *model.ConfigDeleteReq 117 | if err := r.Parse(&req); err != nil { 118 | r.Response.WriteJsonExit(common.JsonResult{ 119 | Code: -1, 120 | Msg: err.Error(), 121 | }) 122 | } 123 | 124 | // 调用删除方法 125 | rows, err := service.Config.Delete(req.Ids) 126 | if err != nil || rows == 0 { 127 | r.Response.WriteJsonExit(common.JsonResult{ 128 | Code: -1, 129 | Msg: err.Error(), 130 | }) 131 | } 132 | 133 | // 返回结果 134 | r.Response.WriteJsonExit(common.JsonResult{ 135 | Code: 0, 136 | Msg: "删除成功", 137 | }) 138 | } 139 | -------------------------------------------------------------------------------- /app/model/member.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. Fill this file as you wish. 3 | // ========================================================================== 4 | 5 | package model 6 | 7 | import ( 8 | "easygoadmin/app/model/internal" 9 | "github.com/gogf/gf/os/gtime" 10 | ) 11 | 12 | // Member is the golang structure for table ums_member. 13 | type Member internal.Member 14 | 15 | // Fill with you ideas below. 16 | 17 | // 分页查询条件 18 | type MemberPageReq struct { 19 | Username string `p:"username"` // 用户名 20 | Gender int `p:"gender"` // 性别(1男 2女 3未知) 21 | Page int `p:"page"` // 页码 22 | Limit int `p:"limit"` // 每页数 23 | } 24 | 25 | // 添加会员 26 | type MemberAddReq struct { 27 | Username string `p:"username,unique" v:"required#用户名不能为空"` // 用户名 28 | Password string `p:"password" v:"required#登录密码不能为空"` // 登录密码 29 | MemberLevel int `p:"member_level" v:"required#会员等级不能为空"` // 会员等级 30 | Realname string `p:"realname" v:"required#真实姓名不能为空"` // 真实姓名 31 | Nickname string `p:"nickname" v:"required#会员昵称不能为空"` // 用户昵称 32 | Gender int `p:"gender" v:"required#会员性别不能为空"` // 性别(1男 2女 3未知) 33 | Avatar string `p:"avatar" v:"required#会员头像不能为空"` // 用户头像 34 | Birthday *gtime.Time `p:"birthday" v:"required#会员出生日期不能为空"` // 出生日期 35 | City []string `p:"city" v:"required#请选择省市区"` // 省市区 36 | Address string `p:"address" v:"required#详细地址不能为空"` // 详细地址 37 | Intro string `p:"intro"` // 个人简介 38 | Signature string `p:"signature"` // 个性签名 39 | Device int `p:"device" v:"required#请选择设备类型"` // 设备类型:1苹果 2安卓 3WAP站 4PC站 5后台添加 40 | Source int `p:"source" v:"required#请选择会员来源"` // 来源:1、APP注册;2、后台添加; 41 | Status int `p:"status" v:"required#请选择会员状态"` // 是否启用 1、启用 2、停用 42 | } 43 | 44 | // 更新会员 45 | type MemberUpdateReq struct { 46 | Id int `p:"id" v:"required#主键ID不能为空"` 47 | Username string `p:"username,unique" v:"required#用户名不能为空"` // 用户名 48 | Password string `p:"password" v:"required#登录密码不能为空"` // 登录密码 49 | MemberLevel int `p:"member_level" v:"required#会员等级不能为空"` // 会员等级 50 | Realname string `p:"realname" v:"required#真实姓名不能为空"` // 真实姓名 51 | Nickname string `p:"nickname" v:"required#会员昵称不能为空"` // 用户昵称 52 | Gender int `p:"gender" v:"required#会员性别不能为空"` // 性别(1男 2女 3未知) 53 | Avatar string `p:"avatar" v:"required#会员头像不能为空"` // 用户头像 54 | Birthday *gtime.Time `p:"birthday" v:"required#会员出生日期不能为空"` // 出生日期 55 | City []string `p:"city" v:"required#请选择省市区"` // 省市区 56 | Address string `p:"address" v:"required#详细地址不能为空"` // 详细地址 57 | Intro string `p:"intro"` // 个人简介 58 | Signature string `p:"signature"` // 个性签名 59 | Device int `p:"device" v:"required#请选择设备类型"` // 设备类型:1苹果 2安卓 3WAP站 4PC站 5后台添加 60 | Source int `p:"source" v:"required#请选择会员来源"` // 来源:1、APP注册;2、后台添加; 61 | Status int `p:"status" v:"required#请选择会员状态"` // 是否启用 1、启用 2、停用 62 | } 63 | 64 | // 删除会员 65 | type MemberDeleteReq struct { 66 | Ids string `p:"ids" v:"required#请选择要删除的数据记录"` 67 | } 68 | 69 | // 设置状态 70 | type MemberStatusReq struct { 71 | Id int `p:"id" v:"required#主键ID不能为空"` 72 | Status int `p:"status" v:"required#状态不能为空"` 73 | } 74 | 75 | // 会员信息Vo 76 | type MemberInfoVo struct { 77 | Member 78 | GenderName string `json:"genderName"` // 性别 79 | DeviceName string `json:"deviceName"` // 设备类型 80 | SourceName string `json:"sourceName"` // 会员来源 81 | City interface{} `json:"city"` // 省市区 82 | CityName string `json:"cityName"` // 城市名称 83 | } 84 | -------------------------------------------------------------------------------- /app/service/config.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 配置管理-服务类 26 | * @author 半城风雨 27 | * @since 2021/7/21 28 | * @File : config 29 | */ 30 | package service 31 | 32 | import ( 33 | "easygoadmin/app/dao" 34 | "easygoadmin/app/model" 35 | "easygoadmin/app/utils" 36 | "easygoadmin/app/utils/convert" 37 | "github.com/gogf/gf/errors/gerror" 38 | "github.com/gogf/gf/os/gtime" 39 | ) 40 | 41 | // 中间件管理服务 42 | var Config = new(configService) 43 | 44 | type configService struct{} 45 | 46 | func (s *configService) GetList(req *model.ConfigQueryReq) []model.Config { 47 | // 创建查询对象 48 | query := dao.Config.Where("mark=1") 49 | // 查询条件 50 | if req != nil { 51 | // 字典名称 52 | if req.Name != "" { 53 | query = query.Where("name like ?", req.Name) 54 | } 55 | } 56 | // 排序 57 | query = query.Order("sort asc") 58 | // 对象转换 59 | var list []model.Config 60 | query.Structs(&list) 61 | return list 62 | } 63 | 64 | func (s *configService) Add(req *model.ConfigAddReq, userId int) (int64, error) { 65 | if utils.AppDebug() { 66 | return 0, gerror.New("演示环境,暂无权限操作") 67 | } 68 | // 实例化对象 69 | var entity model.Config 70 | entity.Name = req.Name 71 | entity.Sort = req.Sort 72 | entity.CreateUser = userId 73 | entity.CreateTime = gtime.Now() 74 | entity.Mark = 1 75 | 76 | // 插入记录 77 | result, err := dao.Config.Insert(entity) 78 | if err != nil { 79 | return 0, err 80 | } 81 | 82 | // 获取插入ID 83 | id, err := result.LastInsertId() 84 | if err != nil { 85 | return 0, err 86 | } 87 | 88 | return id, nil 89 | } 90 | 91 | func (s *configService) Update(req *model.ConfigUpdateReq, userId int) (int64, error) { 92 | if utils.AppDebug() { 93 | return 0, gerror.New("演示环境,暂无权限操作") 94 | } 95 | // 查询记录 96 | info, err := dao.Config.FindOne("id=?", req.Id) 97 | if err != nil { 98 | return 0, err 99 | } 100 | if info == nil { 101 | return 0, gerror.New("记录不存在") 102 | } 103 | 104 | // 设置对象 105 | info.Name = req.Name 106 | info.Sort = req.Sort 107 | info.UpdateUser = userId 108 | info.UpdateTime = gtime.Now() 109 | 110 | // 更新数据 111 | result, err := dao.Config.Save(info) 112 | if err != nil { 113 | return 0, err 114 | } 115 | 116 | // 获取受影响行数 117 | rows, err := result.RowsAffected() 118 | if err != nil { 119 | return 0, err 120 | } 121 | return rows, nil 122 | } 123 | 124 | func (s *configService) Delete(ids string) (int64, error) { 125 | if utils.AppDebug() { 126 | return 0, gerror.New("演示环境,暂无权限操作") 127 | } 128 | // 记录ID 129 | idsArr := convert.ToInt64Array(ids, ",") 130 | // 删除记录 131 | result, err := dao.Config.Delete("id in (?)", idsArr) 132 | if err != nil { 133 | return 0, err 134 | } 135 | // 获取受影响行数 136 | rows, err := result.RowsAffected() 137 | if err != nil { 138 | return 0, err 139 | } 140 | return rows, nil 141 | } 142 | -------------------------------------------------------------------------------- /app/controller/login.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 登录-控制器 26 | * @author 半城风雨 27 | * @since 2021/5/18 28 | * @File : login 29 | */ 30 | package controller 31 | 32 | import ( 33 | "easygoadmin/app/service" 34 | "easygoadmin/app/utils/common" 35 | "github.com/gogf/gf/frame/g" 36 | "github.com/gogf/gf/net/ghttp" 37 | "github.com/mojocn/base64Captcha" 38 | ) 39 | 40 | // 用户控制器管理对象 41 | var Login = new(loginCtl) 42 | 43 | type loginCtl struct{} 44 | 45 | type LoginReq struct { 46 | UserName string `p:"username" v:"required|length:5,30#请输入登录账号|账号长度为:min-max位"` 47 | Password string `p:"password" v:"required|length:5,12#请输入密码|密码长度为:min-max位"` 48 | Captcha string `p:"captcha" v:"required|length:4,6#请输入验证码|验证码长度不够"` 49 | IdKey string `p:"idKey" v:"required#验证码KEY不能为空"` 50 | } 51 | 52 | // 系统登录 53 | func (c *loginCtl) Login(r *ghttp.Request) { 54 | if r.Method == "POST" { 55 | var req *LoginReq 56 | 57 | // 获取参数并验证 58 | if err := r.Parse(&req); err != nil { 59 | // 返回错误信息 60 | r.Response.WriteJsonExit(common.JsonResult{ 61 | Code: -1, 62 | Msg: err.Error(), 63 | }) 64 | } 65 | 66 | // 校验验证码 67 | verifyRes := base64Captcha.VerifyCaptcha(req.IdKey, req.Captcha) 68 | if !verifyRes { 69 | r.Response.WriteJsonExit(common.JsonResult{ 70 | Code: -1, 71 | Msg: "验证码不正确", 72 | }) 73 | } 74 | 75 | // 系统登录 76 | if token, err := service.Login.UserLogin(req.UserName, req.Password, r); err != nil { 77 | // 登录错误 78 | r.Response.WriteJsonExit(common.JsonResult{ 79 | Code: -1, 80 | Msg: err.Error(), 81 | }) 82 | } else { 83 | // 登录成功 84 | r.Response.WriteJsonExit(common.JsonResult{ 85 | Code: 0, 86 | Msg: "登录成功", 87 | Data: g.Map{ 88 | "access_token": token, 89 | }, 90 | }) 91 | } 92 | } 93 | } 94 | 95 | // 验证码 96 | func (c *loginCtl) Captcha(r *ghttp.Request) { 97 | // 验证码参数配置:字符,公式,验证码配置 98 | var configC = base64Captcha.ConfigCharacter{ 99 | Height: 60, 100 | Width: 240, 101 | //const CaptchaModeNumber:数字,CaptchaModeAlphabet:字母,CaptchaModeArithmetic:算术,CaptchaModeNumberAlphabet:数字字母混合. 102 | Mode: base64Captcha.CaptchaModeAlphabet, 103 | ComplexOfNoiseText: base64Captcha.CaptchaComplexLower, 104 | ComplexOfNoiseDot: base64Captcha.CaptchaComplexLower, 105 | IsShowHollowLine: false, 106 | IsShowNoiseDot: false, 107 | IsShowNoiseText: false, 108 | IsShowSlimeLine: false, 109 | IsShowSineLine: false, 110 | CaptchaLen: 6, 111 | } 112 | ///create a characters captcha. 113 | idKeyC, capC := base64Captcha.GenerateCaptcha("", configC) 114 | //以base64编码 115 | base64stringC := base64Captcha.CaptchaWriteToBase64Encoding(capC) 116 | 117 | // 返回结果集 118 | r.Response.WriteJsonExit(common.CaptchaRes{ 119 | Code: 0, 120 | IdKey: idKeyC, 121 | Data: base64stringC, 122 | Msg: "操作成功", 123 | }) 124 | } 125 | -------------------------------------------------------------------------------- /app/service/dict.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 字典管理-服务类 26 | * @author 半城风雨 27 | * @since 2021/7/21 28 | * @File : dict 29 | */ 30 | package service 31 | 32 | import ( 33 | "easygoadmin/app/dao" 34 | "easygoadmin/app/model" 35 | "easygoadmin/app/utils" 36 | "easygoadmin/app/utils/convert" 37 | "github.com/gogf/gf/errors/gerror" 38 | "github.com/gogf/gf/os/gtime" 39 | ) 40 | 41 | // 中间件管理服务 42 | var Dict = new(dictService) 43 | 44 | type dictService struct{} 45 | 46 | func (s *dictService) GetList(req *model.DictQueryReq) []model.Dict { 47 | // 创建查询对象 48 | query := dao.Dict.Where("mark=1") 49 | // 查询条件 50 | if req != nil { 51 | // 字典名称 52 | if req.Name != "" { 53 | query = query.Where("name like ?", "%"+req.Name+"%") 54 | } 55 | } 56 | // 排序 57 | query = query.Order("sort asc") 58 | // 对象转换 59 | var list []model.Dict 60 | query.Structs(&list) 61 | return list 62 | } 63 | 64 | func (s *dictService) Add(req *model.DictAddReq, userId int) (int64, error) { 65 | if utils.AppDebug() { 66 | return 0, gerror.New("演示环境,暂无权限操作") 67 | } 68 | // 实例化对象 69 | var entity model.Dict 70 | entity.Name = req.Name 71 | entity.Code = req.Code 72 | entity.Sort = req.Sort 73 | entity.Note = req.Note 74 | entity.CreateUser = userId 75 | entity.CreateTime = gtime.Now() 76 | entity.Mark = 1 77 | 78 | // 插入记录 79 | result, err := dao.Dict.Insert(entity) 80 | if err != nil { 81 | return 0, err 82 | } 83 | 84 | // 获取插入ID 85 | id, err := result.LastInsertId() 86 | if err != nil { 87 | return 0, err 88 | } 89 | 90 | return id, nil 91 | } 92 | 93 | func (s *dictService) Update(req *model.DictUpdateReq, userId int) (int64, error) { 94 | if utils.AppDebug() { 95 | return 0, gerror.New("演示环境,暂无权限操作") 96 | } 97 | // 查询记录 98 | info, err := dao.Dict.FindOne("id=?", req.Id) 99 | if err != nil { 100 | return 0, err 101 | } 102 | if info == nil { 103 | return 0, gerror.New("记录不存在") 104 | } 105 | 106 | // 设置对象 107 | info.Name = req.Name 108 | info.Code = req.Code 109 | info.Sort = req.Sort 110 | info.Note = req.Note 111 | info.UpdateUser = userId 112 | info.UpdateTime = gtime.Now() 113 | 114 | // 更新数据 115 | result, err := dao.Dict.Save(info) 116 | if err != nil { 117 | return 0, err 118 | } 119 | 120 | // 获取受影响行数 121 | rows, err := result.RowsAffected() 122 | if err != nil { 123 | return 0, err 124 | } 125 | return rows, nil 126 | } 127 | 128 | func (s *dictService) Delete(ids string) (int64, error) { 129 | if utils.AppDebug() { 130 | return 0, gerror.New("演示环境,暂无权限操作") 131 | } 132 | // 记录ID 133 | idsArr := convert.ToInt64Array(ids, ",") 134 | // 删除记录 135 | result, err := dao.Dict.Delete("id in (?)", idsArr) 136 | if err != nil { 137 | return 0, err 138 | } 139 | // 获取受影响行数 140 | rows, err := result.RowsAffected() 141 | if err != nil { 142 | return 0, err 143 | } 144 | return rows, nil 145 | } 146 | -------------------------------------------------------------------------------- /app/model/internal/member.go: -------------------------------------------------------------------------------- 1 | // ========================================================================== 2 | // This is auto-generated by gf cli tool. DO NOT EDIT THIS FILE MANUALLY. 3 | // ========================================================================== 4 | 5 | package internal 6 | 7 | import ( 8 | "github.com/gogf/gf/os/gtime" 9 | ) 10 | 11 | // Member is the golang structure for table ums_member. 12 | type Member struct { 13 | Id int `orm:"id,primary" json:"id"` // 14 | Openid string `orm:"openid" json:"openid"` // 用户唯一标识 15 | Username string `orm:"username,unique" json:"username"` // 用户名 16 | Password string `orm:"password" json:"password"` // 密码 17 | MemberLevel int `orm:"member_level" json:"memberLevel"` // 会员等级 18 | Realname string `orm:"realname" json:"realname"` // 真实姓名 19 | Nickname string `orm:"nickname" json:"nickname"` // 用户昵称 20 | Gender int `orm:"gender" json:"gender"` // 性别(1男 2女 3未知) 21 | Avatar string `orm:"avatar" json:"avatar"` // 用户头像 22 | Birthday *gtime.Time `orm:"birthday" json:"birthday"` // 出生日期 23 | ProvinceCode string `orm:"province_code" json:"provinceCode"` // 户籍省份编号 24 | CityCode string `orm:"city_code" json:"cityCode"` // 户籍城市编号 25 | DistrictCode string `orm:"district_code" json:"districtCode"` // 户籍区/县编号 26 | Address string `orm:"address" json:"address"` // 详细地址 27 | Intro string `orm:"intro" json:"intro"` // 个人简介 28 | Signature string `orm:"signature" json:"signature"` // 个性签名 29 | Device int `orm:"device" json:"device"` // 设备类型:1苹果 2安卓 3WAP站 4PC站 5后台添加 30 | DeviceCode string `orm:"device_code" json:"deviceCode"` // 推送的别名 31 | PushAlias string `orm:"push_alias" json:"pushAlias"` // 推送的别名 32 | Source int `orm:"source" json:"source"` // 来源:1、APP注册;2、后台添加; 33 | Status int `orm:"status" json:"status"` // 是否启用 1、启用 2、停用 34 | AppVersion string `orm:"app_version" json:"appVersion"` // 客户端版本号 35 | Code string `orm:"code" json:"code"` // 我的推广码 36 | LoginIp string `orm:"login_ip" json:"loginIp"` // 最近登录IP 37 | LoginTime *gtime.Time `orm:"login_time" json:"loginTime"` // 登录时间 38 | LoginRegion string `orm:"login_region" json:"loginRegion"` // 上次登录地点 39 | LoginCount uint `orm:"login_count" json:"loginCount"` // 登录总次数 40 | CreateUser int `orm:"create_user" json:"createUser"` // 添加人 41 | CreateTime *gtime.Time `orm:"create_time" json:"createTime"` // 创建时间 42 | UpdateUser int `orm:"update_user" json:"updateUser"` // 修改人 43 | UpdateTime *gtime.Time `orm:"update_time" json:"updateTime"` // 更新时间 44 | Mark int `orm:"mark" json:"mark"` // 有效标识:1正常 0删除 45 | } -------------------------------------------------------------------------------- /app/controller/dict_data.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 字典数据-控制器 26 | * @author 半城风雨 27 | * @since 2021/7/21 28 | * @File : dict_data 29 | */ 30 | package controller 31 | 32 | import ( 33 | "easygoadmin/app/model" 34 | "easygoadmin/app/service" 35 | "easygoadmin/app/utils" 36 | "easygoadmin/app/utils/common" 37 | "github.com/gogf/gf/net/ghttp" 38 | ) 39 | 40 | // 控制器管理对象 41 | var DictData = new(dictDataCtl) 42 | 43 | type dictDataCtl struct{} 44 | 45 | func (c *dictDataCtl) List(r *ghttp.Request) { 46 | // 参数验证 47 | var req *model.DictDataPageReq 48 | if err := r.Parse(&req); err != nil { 49 | r.Response.WriteJsonExit(common.JsonResult{ 50 | Code: -1, 51 | Msg: err.Error(), 52 | }) 53 | } 54 | 55 | // 调用查询方法 56 | list, count, err := service.DictData.GetList(req) 57 | if err != nil { 58 | r.Response.WriteJsonExit(common.JsonResult{ 59 | Code: -1, 60 | Msg: err.Error(), 61 | }) 62 | } 63 | 64 | // 返回结果 65 | r.Response.WriteJsonExit(common.JsonResult{ 66 | Code: 0, 67 | Data: list, 68 | Msg: "操作成功", 69 | Count: count, 70 | }) 71 | } 72 | 73 | func (c *dictDataCtl) Add(r *ghttp.Request) { 74 | // 参数验证 75 | var req *model.DictDataAddReq 76 | if err := r.Parse(&req); err != nil { 77 | r.Response.WriteJsonExit(common.JsonResult{ 78 | Code: -1, 79 | Msg: err.Error(), 80 | }) 81 | } 82 | 83 | // 调用添加方法 84 | id, err := service.DictData.Add(req, utils.Uid(r)) 85 | if err != nil || id == 0 { 86 | r.Response.WriteJsonExit(common.JsonResult{ 87 | Code: -1, 88 | Msg: err.Error(), 89 | }) 90 | } 91 | 92 | // 返回结果 93 | r.Response.WriteJsonExit(common.JsonResult{ 94 | Code: 0, 95 | Msg: "添加成功", 96 | }) 97 | } 98 | 99 | func (c *dictDataCtl) Update(r *ghttp.Request) { 100 | // 参数验证 101 | var req *model.DictDataUpdateReq 102 | if err := r.Parse(&req); err != nil { 103 | r.Response.WriteJsonExit(common.JsonResult{ 104 | Code: -1, 105 | Msg: err.Error(), 106 | }) 107 | } 108 | 109 | // 调用更新方法 110 | rows, err := service.DictData.Update(req, utils.Uid(r)) 111 | if err != nil || rows == 0 { 112 | r.Response.WriteJsonExit(common.JsonResult{ 113 | Code: -1, 114 | Msg: err.Error(), 115 | }) 116 | } 117 | 118 | // 返回结果 119 | r.Response.WriteJsonExit(common.JsonResult{ 120 | Code: 0, 121 | Msg: "更新成功", 122 | }) 123 | } 124 | 125 | func (c *dictDataCtl) Delete(r *ghttp.Request) { 126 | // 参数验证 127 | var req *model.DictDataDeleteReq 128 | if err := r.Parse(&req); err != nil { 129 | r.Response.WriteJsonExit(common.JsonResult{ 130 | Code: -1, 131 | Msg: err.Error(), 132 | }) 133 | } 134 | 135 | // 调用删除方法 136 | rows, err := service.DictData.Delete(req.Ids) 137 | if err != nil || rows == 0 { 138 | r.Response.WriteJsonExit(common.JsonResult{ 139 | Code: -1, 140 | Msg: err.Error(), 141 | }) 142 | } 143 | 144 | // 返回结果 145 | r.Response.WriteJsonExit(common.JsonResult{ 146 | Code: 0, 147 | Msg: "删除成功", 148 | }) 149 | } 150 | -------------------------------------------------------------------------------- /app/controller/dept.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 部门管理-控制器 26 | * @author 半城风雨 27 | * @since 2021/7/16 28 | * @File : dept 29 | */ 30 | package controller 31 | 32 | import ( 33 | "easygoadmin/app/dao" 34 | "easygoadmin/app/model" 35 | "easygoadmin/app/service" 36 | "easygoadmin/app/utils" 37 | "easygoadmin/app/utils/common" 38 | "fmt" 39 | "github.com/gogf/gf/net/ghttp" 40 | ) 41 | 42 | // 控制器管理对象 43 | var Dept = new(deptCtl) 44 | 45 | type deptCtl struct{} 46 | 47 | func (c *deptCtl) List(r *ghttp.Request) { 48 | // 参数验证 49 | var req *model.DeptPageReq 50 | if err := r.Parse(&req); err != nil { 51 | r.Response.WriteJsonExit(common.JsonResult{ 52 | Code: -1, 53 | Msg: err.Error(), 54 | }) 55 | } 56 | 57 | // 调用获取部门列表方法 58 | list := service.Dept.GetList(req) 59 | // 返回结果 60 | r.Response.WriteJsonExit(common.JsonResult{ 61 | Code: 0, 62 | Data: list, 63 | Msg: "操作成功", 64 | }) 65 | } 66 | 67 | func (c *deptCtl) Add(r *ghttp.Request) { 68 | // 参数验证 69 | var req *model.DeptAddReq 70 | if err := r.Parse(&req); err != nil { 71 | r.Response.WriteJsonExit(common.JsonResult{ 72 | Code: -1, 73 | Msg: err.Error(), 74 | }) 75 | } 76 | 77 | // 调用添加方法 78 | id, err := service.Dept.Add(req, utils.Uid(r)) 79 | if err != nil || id == 0 { 80 | r.Response.WriteJsonExit(common.JsonResult{ 81 | Code: -1, 82 | Msg: err.Error(), 83 | }) 84 | } 85 | r.Response.WriteJsonExit(common.JsonResult{ 86 | Code: 0, 87 | Msg: "添加成功", 88 | }) 89 | } 90 | 91 | func (c *deptCtl) Update(r *ghttp.Request) { 92 | // 参数验证 93 | var req *model.DeptUpdateReq 94 | if err := r.Parse(&req); err != nil { 95 | r.Response.WriteJsonExit(common.JsonResult{ 96 | Code: -1, 97 | Msg: err.Error(), 98 | }) 99 | } 100 | fmt.Println(req) 101 | 102 | // 调用编辑方法 103 | result, err := service.Dept.Update(req, utils.Uid(r)) 104 | if err != nil || result == 0 { 105 | r.Response.WriteJsonExit(common.JsonResult{ 106 | Code: -1, 107 | Msg: err.Error(), 108 | }) 109 | } 110 | 111 | // 返回结果 112 | r.Response.WriteJsonExit(common.JsonResult{ 113 | Code: 0, 114 | Msg: "更新成功", 115 | }) 116 | } 117 | 118 | func (c *deptCtl) Delete(r *ghttp.Request) { 119 | // 参数验证 120 | var req *model.DeptDeleteReq 121 | if err := r.Parse(&req); err != nil { 122 | r.Response.WriteJsonExit(common.JsonResult{ 123 | Code: -1, 124 | Msg: err.Error(), 125 | }) 126 | } 127 | 128 | // 调用删除方法 129 | rows, err := service.Dept.Delete(req.Ids) 130 | if err != nil || rows == 0 { 131 | r.Response.WriteJsonExit(common.JsonResult{ 132 | Code: -1, 133 | Msg: err.Error(), 134 | }) 135 | } 136 | 137 | // 返回结果 138 | r.Response.WriteJsonExit(common.JsonResult{ 139 | Code: 0, 140 | Msg: "删除成功", 141 | }) 142 | } 143 | 144 | func (c *deptCtl) GetDeptList(r *ghttp.Request) { 145 | // 查询部门列表 146 | list, _ := dao.Dept.Where("mark=1").Order("sort asc").All() 147 | // 返回结果 148 | r.Response.WriteJsonExit(common.JsonResult{ 149 | Code: 0, 150 | Msg: "查询成功", 151 | Data: list, 152 | }) 153 | } 154 | -------------------------------------------------------------------------------- /app/service/member_level.go: -------------------------------------------------------------------------------- 1 | // +---------------------------------------------------------------------- 2 | // | EasyGoAdmin敏捷开发框架 [ 赋能开发者,助力企业发展 ] 3 | // +---------------------------------------------------------------------- 4 | // | 版权所有 2019~2022 深圳EasyGoAdmin研发中心 5 | // +---------------------------------------------------------------------- 6 | // | Licensed LGPL-3.0 EasyGoAdmin并不是自由软件,未经许可禁止去掉相关版权 7 | // +---------------------------------------------------------------------- 8 | // | 官方网站: http://www.easygoadmin.vip 9 | // +---------------------------------------------------------------------- 10 | // | Author: @半城风雨 团队荣誉出品 11 | // +---------------------------------------------------------------------- 12 | // | 版权和免责声明: 13 | // | 本团队对该软件框架产品拥有知识产权(包括但不限于商标权、专利权、著作权、商业秘密等) 14 | // | 均受到相关法律法规的保护,任何个人、组织和单位不得在未经本团队书面授权的情况下对所授权 15 | // | 软件框架产品本身申请相关的知识产权,禁止用于任何违法、侵害他人合法权益等恶意的行为,禁 16 | // | 止用于任何违反我国法律法规的一切项目研发,任何个人、组织和单位用于项目研发而产生的任何 17 | // | 意外、疏忽、合约毁坏、诽谤、版权或知识产权侵犯及其造成的损失 (包括但不限于直接、间接、 18 | // | 附带或衍生的损失等),本团队不承担任何法律责任,本软件框架禁止任何单位和个人、组织用于 19 | // | 任何违法、侵害他人合法利益等恶意的行为,如有发现违规、违法的犯罪行为,本团队将无条件配 20 | // | 合公安机关调查取证同时保留一切以法律手段起诉的权利,本软件框架只能用于公司和个人内部的 21 | // | 法律所允许的合法合规的软件产品研发,详细声明内容请阅读《框架免责声明》附件; 22 | // +---------------------------------------------------------------------- 23 | 24 | /** 25 | * 会员等级-服务类 26 | * @author 半城风雨 27 | * @since 2021/7/29 28 | * @File : member_level 29 | */ 30 | package service 31 | 32 | import ( 33 | "easygoadmin/app/dao" 34 | "easygoadmin/app/model" 35 | "easygoadmin/app/utils" 36 | "easygoadmin/app/utils/convert" 37 | "github.com/gogf/gf/errors/gerror" 38 | "github.com/gogf/gf/os/gtime" 39 | ) 40 | 41 | // 中间件管理服务 42 | var MemberLevel = new(memberLevelService) 43 | 44 | type memberLevelService struct{} 45 | 46 | func (s *memberLevelService) GetList(req *model.MemberLevelPageReq) ([]model.MemberLevel, int, error) { 47 | // 创建查询实例 48 | query := dao.MemberLevel.Where("mark=1") 49 | // 查询条件 50 | if req != nil { 51 | // 等级名称 52 | if req.Name != "" { 53 | query = query.Where("name like ?", "%"+req.Name+"%") 54 | } 55 | } 56 | // 查询记录总数 57 | count, err := query.Count() 58 | if err != nil { 59 | return nil, 0, err 60 | } 61 | // 排序 62 | query = query.Order("sort asc") 63 | // 分页 64 | query = query.Page(req.Page, req.Limit) 65 | // 对象转换 66 | var list []model.MemberLevel 67 | query.Structs(&list) 68 | return list, count, err 69 | } 70 | 71 | func (s *memberLevelService) Add(req *model.MemberLevelAddReq, userId int) (int64, error) { 72 | if utils.AppDebug() { 73 | return 0, gerror.New("演示环境,暂无权限操作") 74 | } 75 | // 实例化对象 76 | var entity model.MemberLevel 77 | entity.Name = req.Name 78 | entity.Sort = req.Sort 79 | entity.CreateUser = userId 80 | entity.CreateTime = gtime.Now() 81 | entity.Mark = 1 82 | 83 | // 插入数据 84 | result, err := dao.MemberLevel.Insert(entity) 85 | if err != nil { 86 | return 0, err 87 | } 88 | 89 | // 获取插入ID 90 | id, err := result.LastInsertId() 91 | if err != nil { 92 | return 0, err 93 | } 94 | return id, nil 95 | } 96 | 97 | func (s *memberLevelService) Update(req *model.MemberLevelUpdateReq, userId int) (int64, error) { 98 | if utils.AppDebug() { 99 | return 0, gerror.New("演示环境,暂无权限操作") 100 | } 101 | // 查询记录 102 | info, err := dao.MemberLevel.FindOne("id=?", req.Id) 103 | if err != nil { 104 | return 0, err 105 | } 106 | if info == nil { 107 | return 0, gerror.New("记录不存在") 108 | } 109 | 110 | // 设置参数 111 | info.Name = req.Name 112 | info.Sort = req.Sort 113 | info.UpdateUser = userId 114 | info.UpdateTime = gtime.Now() 115 | 116 | // 更新记录 117 | result, err := dao.MemberLevel.Save(info) 118 | if err != nil { 119 | return 0, err 120 | } 121 | 122 | // 获取受影响行数 123 | rows, err := result.RowsAffected() 124 | if err != nil { 125 | return 0, err 126 | } 127 | return rows, nil 128 | } 129 | 130 | func (s *memberLevelService) Delete(ids string) (int64, error) { 131 | if utils.AppDebug() { 132 | return 0, gerror.New("演示环境,暂无权限操作") 133 | } 134 | // 记录ID 135 | idsArr := convert.ToInt64Array(ids, ",") 136 | // 删除记录 137 | result, err := dao.MemberLevel.Delete("id in (?)", idsArr) 138 | if err != nil { 139 | return 0, err 140 | } 141 | // 获取受影响行数 142 | rows, err := result.RowsAffected() 143 | if err != nil { 144 | return 0, err 145 | } 146 | return rows, nil 147 | } 148 | --------------------------------------------------------------------------------