Skip to content

Commit e21905f

Browse files
authored
feat: 增加多模块儿设计 (#7)
* feat: 将项目调整为多模块儿形式 * 🎉 feat: 完善示例模块儿,优化初始化数据
1 parent 288946c commit e21905f

File tree

100 files changed

+1999
-1460
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1999
-1460
lines changed

controller/a_enter.go

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package controller
2+
3+
import (
4+
"net/http"
5+
6+
"github.com/eryajf/xirang/controller/example"
7+
"github.com/eryajf/xirang/controller/system"
8+
"github.com/eryajf/xirang/public/tools"
9+
10+
"github.com/gin-gonic/gin"
11+
)
12+
13+
type ControllerGroup struct {
14+
SystemControllerGroup system.ControllerGroup
15+
ExampleControllerGroup example.ControllerGroup
16+
}
17+
18+
var ControllerGroupApp = new(ControllerGroup)
19+
20+
func Demo(c *gin.Context) {
21+
CodeDebug()
22+
c.JSON(http.StatusOK, tools.H{"code": 200, "msg": "ok", "data": "pong"})
23+
}
24+
25+
func CodeDebug() {
26+
}

controller/api_controller.go

-50
This file was deleted.

controller/base_controller.go

-26
This file was deleted.

controller/example/a_enter.go

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package example
2+
3+
import "github.com/eryajf/xirang/logic"
4+
5+
type ControllerGroup struct {
6+
CloudAccountController
7+
}
8+
9+
var (
10+
CloudAccountLogic = logic.LogicGroupApp.ExampleLogicGroup.CloudAccountLogic
11+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package example
2+
3+
import (
4+
exampleReq "github.com/eryajf/xirang/model/example/request"
5+
"github.com/eryajf/xirang/public/tools"
6+
"github.com/gin-gonic/gin"
7+
)
8+
9+
type CloudAccountController struct{}
10+
11+
// List 记录列表
12+
func (m *CloudAccountController) List(c *gin.Context) {
13+
req := new(exampleReq.CloudAccountListReq)
14+
tools.Run(c, req, func() (interface{}, interface{}) {
15+
return CloudAccountLogic.List(c, req)
16+
})
17+
}
18+
19+
// Add 新建记录
20+
func (m *CloudAccountController) Add(c *gin.Context) {
21+
req := new(exampleReq.CloudAccountAddReq)
22+
tools.Run(c, req, func() (interface{}, interface{}) {
23+
return CloudAccountLogic.Add(c, req)
24+
})
25+
}
26+
27+
// Update 更新记录
28+
func (m *CloudAccountController) Update(c *gin.Context) {
29+
req := new(exampleReq.CloudAccountUpdateReq)
30+
tools.Run(c, req, func() (interface{}, interface{}) {
31+
return CloudAccountLogic.Update(c, req)
32+
})
33+
}
34+
35+
// Delete 删除记录
36+
func (m *CloudAccountController) Delete(c *gin.Context) {
37+
req := new(exampleReq.CloudAccountDeleteReq)
38+
tools.Run(c, req, func() (interface{}, interface{}) {
39+
return CloudAccountLogic.Delete(c, req)
40+
})
41+
}

controller/group_controller.go

-82
This file was deleted.

controller/menu_controller.go

-50
This file was deleted.

controller/operation_log_controller.go

-26
This file was deleted.

controller/role_controller.go

-74
This file was deleted.

0 commit comments

Comments
 (0)