|
@@ -11,6 +11,15 @@ type UsersController struct { |
|
@@ -11,6 +11,15 @@ type UsersController struct { |
|
11
|
beego.BaseController
|
11
|
beego.BaseController
|
|
12
|
}
|
12
|
}
|
|
13
|
|
13
|
|
|
|
|
14
|
+func (controller *UsersController) returnPageListData(count int64, data interface{}, err error, pageNumber int) {
|
|
|
|
15
|
+ dataMap := map[string]interface{}{
|
|
|
|
16
|
+ "totalRow": count,
|
|
|
|
17
|
+ "pageNumber": pageNumber,
|
|
|
|
18
|
+ "list": data,
|
|
|
|
19
|
+ }
|
|
|
|
20
|
+ controller.Response(dataMap, err)
|
|
|
|
21
|
+}
|
|
|
|
22
|
+
|
|
14
|
func (controller *UsersController) CompanyUserAdd() {
|
23
|
func (controller *UsersController) CompanyUserAdd() {
|
|
15
|
usersService := service.NewUsersService(nil)
|
24
|
usersService := service.NewUsersService(nil)
|
|
16
|
companyUserAddCommand := &command.CompanyUserAddCommand{}
|
25
|
companyUserAddCommand := &command.CompanyUserAddCommand{}
|
|
@@ -30,9 +39,9 @@ func (controller *UsersController) CompanyUserUpdate() { |
|
@@ -30,9 +39,9 @@ func (controller *UsersController) CompanyUserUpdate() { |
|
30
|
func (controller *UsersController) CompanyUserList() {
|
39
|
func (controller *UsersController) CompanyUserList() {
|
|
31
|
usersService := service.NewUsersService(nil)
|
40
|
usersService := service.NewUsersService(nil)
|
|
32
|
companyUserListQuery := &query.CompanyUserListQuery{}
|
41
|
companyUserListQuery := &query.CompanyUserListQuery{}
|
|
|
|
42
|
+ controller.Unmarshal(companyUserListQuery)
|
|
33
|
cnt, data, err := usersService.CompanyUserList(companyUserListQuery)
|
43
|
cnt, data, err := usersService.CompanyUserList(companyUserListQuery)
|
|
34
|
- _ = cnt
|
|
|
|
35
|
- controller.Response(data, err)
|
44
|
+ controller.returnPageListData(cnt, data, err, companyUserListQuery.PageNumber)
|
|
36
|
}
|
45
|
}
|
|
37
|
|
46
|
|
|
38
|
func (controller *UsersController) CompanyUserGet() {
|
47
|
func (controller *UsersController) CompanyUserGet() {
|
|
@@ -79,9 +88,9 @@ func (controller *UsersController) CooperationUserUpdate() { |
|
@@ -79,9 +88,9 @@ func (controller *UsersController) CooperationUserUpdate() { |
|
79
|
func (controller *UsersController) CooperationUserList() {
|
88
|
func (controller *UsersController) CooperationUserList() {
|
|
80
|
usersService := service.NewUsersService(nil)
|
89
|
usersService := service.NewUsersService(nil)
|
|
81
|
cooperationUserListQuery := &query.CooperationUserListQuery{}
|
90
|
cooperationUserListQuery := &query.CooperationUserListQuery{}
|
|
|
|
91
|
+ controller.Unmarshal(cooperationUserListQuery)
|
|
82
|
cnt, data, err := usersService.CooperationUserList(cooperationUserListQuery)
|
92
|
cnt, data, err := usersService.CooperationUserList(cooperationUserListQuery)
|
|
83
|
- _ = cnt
|
|
|
|
84
|
- controller.Response(data, err)
|
93
|
+ controller.returnPageListData(cnt, data, err, cooperationUserListQuery.PageNumber)
|
|
85
|
}
|
94
|
}
|
|
86
|
|
95
|
|
|
87
|
func (controller *UsersController) CooperationUserGet() {
|
96
|
func (controller *UsersController) CooperationUserGet() {
|