正在显示
10 个修改的文件
包含
110 行增加
和
46 行删除
@@ -13,9 +13,9 @@ type CreateColumnSettingCommand struct { | @@ -13,9 +13,9 @@ type CreateColumnSettingCommand struct { | ||
13 | // 用户uid | 13 | // 用户uid |
14 | Uid int64 `json:"uid"` | 14 | Uid int64 `json:"uid"` |
15 | // 栏目设置描述 | 15 | // 栏目设置描述 |
16 | - Description string `json:"description" valid:"Required"` | 16 | + Description string `json:"description"` |
17 | // 栏目设置关联用户名称 | 17 | // 栏目设置关联用户名称 |
18 | - UserName string `json:"userName" valid:"Required"` | 18 | + UserName string `json:"userName"` |
19 | // 默认栏目设置 | 19 | // 默认栏目设置 |
20 | Value []domain.Column `json:"value"` | 20 | Value []domain.Column `json:"value"` |
21 | // 无效栏目设置爱 | 21 | // 无效栏目设置爱 |
@@ -24,9 +24,9 @@ type CreateColumnSettingCommand struct { | @@ -24,9 +24,9 @@ type CreateColumnSettingCommand struct { | ||
24 | Key string `json:"key"` | 24 | Key string `json:"key"` |
25 | } | 25 | } |
26 | 26 | ||
27 | -func (createColumnSettingCommand *CreateColumnSettingCommand) Valid(validation *validation.Validation) { | ||
28 | - _ = validation.SetError("CustomValid", "未实现的自定义认证") | ||
29 | -} | 27 | +//func (createColumnSettingCommand *CreateColumnSettingCommand) Valid(validation *validation.Validation) { |
28 | +// _ = validation.SetError("CustomValid", "未实现的自定义认证") | ||
29 | +//} | ||
30 | 30 | ||
31 | func (createColumnSettingCommand *CreateColumnSettingCommand) ValidateCommand() error { | 31 | func (createColumnSettingCommand *CreateColumnSettingCommand) ValidateCommand() error { |
32 | valid := validation.Validation{} | 32 | valid := validation.Validation{} |
@@ -8,16 +8,16 @@ import ( | @@ -8,16 +8,16 @@ import ( | ||
8 | 8 | ||
9 | type RemoveColumnSettingCommand struct { | 9 | type RemoveColumnSettingCommand struct { |
10 | // 栏目设置id | 10 | // 栏目设置id |
11 | - ColumnSettingId int64 `json:"columnSettingId" valid:"Required"` | 11 | + ColumnSettingId int64 `json:"columnSettingId"` |
12 | // 用户uid | 12 | // 用户uid |
13 | Uid int64 `json:"uid"` | 13 | Uid int64 `json:"uid"` |
14 | // 公司id | 14 | // 公司id |
15 | CompanyId int `json:"companyId"` | 15 | CompanyId int `json:"companyId"` |
16 | } | 16 | } |
17 | 17 | ||
18 | -func (removeColumnSettingCommand *RemoveColumnSettingCommand) Valid(validation *validation.Validation) { | ||
19 | - validation.SetError("CustomValid", "未实现的自定义认证") | ||
20 | -} | 18 | +//func (removeColumnSettingCommand *RemoveColumnSettingCommand) Valid(validation *validation.Validation) { |
19 | +// validation.SetError("CustomValid", "未实现的自定义认证") | ||
20 | +//} | ||
21 | 21 | ||
22 | func (removeColumnSettingCommand *RemoveColumnSettingCommand) ValidateCommand() error { | 22 | func (removeColumnSettingCommand *RemoveColumnSettingCommand) ValidateCommand() error { |
23 | valid := validation.Validation{} | 23 | valid := validation.Validation{} |
@@ -18,9 +18,9 @@ type ResetColumnCommand struct { | @@ -18,9 +18,9 @@ type ResetColumnCommand struct { | ||
18 | InvalidValue []domain.Column `json:"invalidValue"` | 18 | InvalidValue []domain.Column `json:"invalidValue"` |
19 | } | 19 | } |
20 | 20 | ||
21 | -func (resetColumnCommand *ResetColumnCommand) Valid(validation *validation.Validation) { | ||
22 | - _ = validation.SetError("CustomValid", "未实现的自定义认证") | ||
23 | -} | 21 | +//func (resetColumnCommand *ResetColumnCommand) Valid(validation *validation.Validation) { |
22 | +// _ = validation.SetError("CustomValid", "未实现的自定义认证") | ||
23 | +//} | ||
24 | 24 | ||
25 | func (resetColumnCommand *ResetColumnCommand) ValidateCommand() error { | 25 | func (resetColumnCommand *ResetColumnCommand) ValidateCommand() error { |
26 | valid := validation.Validation{} | 26 | valid := validation.Validation{} |
@@ -22,12 +22,21 @@ type UpdateColumnSettingCommand struct { | @@ -22,12 +22,21 @@ type UpdateColumnSettingCommand struct { | ||
22 | Value []domain.Column `json:"value"` | 22 | Value []domain.Column `json:"value"` |
23 | // 无效栏目设置 | 23 | // 无效栏目设置 |
24 | InvalidValue []domain.Column `json:"invalidValue"` | 24 | InvalidValue []domain.Column `json:"invalidValue"` |
25 | + // 栏目 | ||
26 | + OrderBaseColumns OrderBaseColumns `json:"orderBaseColumns"` | ||
25 | } | 27 | } |
26 | 28 | ||
27 | -func (updateColumnSettingCommand *UpdateColumnSettingCommand) Valid(validation *validation.Validation) { | ||
28 | - _ = validation.SetError("CustomValid", "未实现的自定义认证") | 29 | +type OrderBaseColumns struct { |
30 | + // 选中的栏目 | ||
31 | + Selected []domain.Column `json:"selected"` | ||
32 | + // 未选中的栏目 | ||
33 | + UnSelected []domain.Column `json:"unselected"` | ||
29 | } | 34 | } |
30 | 35 | ||
36 | +//func (updateColumnSettingCommand *UpdateColumnSettingCommand) Valid(validation *validation.Validation) { | ||
37 | +// _ = validation.SetError("CustomValid", "未实现的自定义认证") | ||
38 | +//} | ||
39 | + | ||
31 | func (updateColumnSettingCommand *UpdateColumnSettingCommand) ValidateCommand() error { | 40 | func (updateColumnSettingCommand *UpdateColumnSettingCommand) ValidateCommand() error { |
32 | valid := validation.Validation{} | 41 | valid := validation.Validation{} |
33 | b, err := valid.Valid(updateColumnSettingCommand) | 42 | b, err := valid.Valid(updateColumnSettingCommand) |
@@ -15,9 +15,9 @@ type GetColumnSettingQuery struct { | @@ -15,9 +15,9 @@ type GetColumnSettingQuery struct { | ||
15 | Uid int64 `json:"uid"` | 15 | Uid int64 `json:"uid"` |
16 | } | 16 | } |
17 | 17 | ||
18 | -func (getColumnSettingQuery *GetColumnSettingQuery) Valid(validation *validation.Validation) { | ||
19 | - validation.SetError("CustomValid", "未实现的自定义认证") | ||
20 | -} | 18 | +//func (getColumnSettingQuery *GetColumnSettingQuery) Valid(validation *validation.Validation) { |
19 | +// _ = validation.SetError("CustomValid", "未实现的自定义认证") | ||
20 | +//} | ||
21 | 21 | ||
22 | func (getColumnSettingQuery *GetColumnSettingQuery) ValidateQuery() error { | 22 | func (getColumnSettingQuery *GetColumnSettingQuery) ValidateQuery() error { |
23 | valid := validation.Validation{} | 23 | valid := validation.Validation{} |
@@ -13,9 +13,9 @@ type ListColumnSettingQuery struct { | @@ -13,9 +13,9 @@ type ListColumnSettingQuery struct { | ||
13 | Limit int `json:"limit" valid:"Required"` | 13 | Limit int `json:"limit" valid:"Required"` |
14 | } | 14 | } |
15 | 15 | ||
16 | -func (listColumnSettingQuery *ListColumnSettingQuery) Valid(validation *validation.Validation) { | ||
17 | - _ = validation.SetError("CustomValid", "未实现的自定义认证") | ||
18 | -} | 16 | +//func (listColumnSettingQuery *ListColumnSettingQuery) Valid(validation *validation.Validation) { |
17 | +// _ = validation.SetError("CustomValid", "未实现的自定义认证") | ||
18 | +//} | ||
19 | 19 | ||
20 | func (listColumnSettingQuery *ListColumnSettingQuery) ValidateQuery() error { | 20 | func (listColumnSettingQuery *ListColumnSettingQuery) ValidateQuery() error { |
21 | valid := validation.Validation{} | 21 | valid := validation.Validation{} |
1 | package factory | 1 | package factory |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | - "github.com/linmadan/egglib-go/transaction/pg" | ||
5 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain" | 4 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain" |
6 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction" | 5 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction" |
7 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/repository" | 6 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/repository" |
@@ -107,9 +106,9 @@ func CreateOrderLogRepository(options map[string]interface{}) (domain.OrderLogRe | @@ -107,9 +106,9 @@ func CreateOrderLogRepository(options map[string]interface{}) (domain.OrderLogRe | ||
107 | } | 106 | } |
108 | 107 | ||
109 | func CreateColumnSettingRepository(options map[string]interface{}) (domain.ColumnSettingRepository, error) { | 108 | func CreateColumnSettingRepository(options map[string]interface{}) (domain.ColumnSettingRepository, error) { |
110 | - var transactionContext *pg.TransactionContext | 109 | + var transactionContext *transaction.TransactionContext |
111 | if value, ok := options["transactionContext"]; ok { | 110 | if value, ok := options["transactionContext"]; ok { |
112 | - transactionContext = value.(*pg.TransactionContext) | 111 | + transactionContext = value.(*transaction.TransactionContext) |
113 | } | 112 | } |
114 | return repository.NewColumnSettingRepository(transactionContext) | 113 | return repository.NewColumnSettingRepository(transactionContext) |
115 | } | 114 | } |
@@ -5,37 +5,61 @@ import ( | @@ -5,37 +5,61 @@ import ( | ||
5 | "github.com/go-pg/pg" | 5 | "github.com/go-pg/pg" |
6 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain" | 6 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain" |
7 | 7 | ||
8 | - pgTransaction "github.com/linmadan/egglib-go/transaction/pg" | ||
9 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/models" | 8 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/models" |
9 | + "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/infrastructure/pg/transaction" | ||
10 | ) | 10 | ) |
11 | 11 | ||
12 | type ColumnSettingRepository struct { | 12 | type ColumnSettingRepository struct { |
13 | - transactionContext *pgTransaction.TransactionContext | 13 | + transactionContext *transaction.TransactionContext |
14 | } | 14 | } |
15 | 15 | ||
16 | -func (repository *ColumnSettingRepository) nextIdentify() (int64, error) { | ||
17 | - return 0, nil | ||
18 | -} | 16 | +//func (repository *ColumnSettingRepository) nextIdentify() (int64, error) { |
17 | +// return 0, nil | ||
18 | +//} | ||
19 | 19 | ||
20 | func (repository *ColumnSettingRepository) Save(columnSetting *domain.ColumnSetting) (*domain.ColumnSetting, error) { | 20 | func (repository *ColumnSettingRepository) Save(columnSetting *domain.ColumnSetting) (*domain.ColumnSetting, error) { |
21 | tx := repository.transactionContext.PgTx | 21 | tx := repository.transactionContext.PgTx |
22 | + | ||
23 | + columnSettingModel := &models.ColumnSetting{ | ||
24 | + Id: columnSetting.Id, | ||
25 | + CompanyId: columnSetting.CompanyId, | ||
26 | + CreatedAt: columnSetting.CreatedAt, | ||
27 | + Description: columnSetting.Description, | ||
28 | + Key: columnSetting.Key, | ||
29 | + Uid: columnSetting.Uid, | ||
30 | + UpdatedAt: columnSetting.UpdatedAt, | ||
31 | + UserName: columnSetting.UserName, | ||
32 | + Value: columnSetting.Value, | ||
33 | + InvalidValue: columnSetting.InvalidValue, | ||
34 | + } | ||
35 | + | ||
22 | if columnSetting.Identify() == nil { | 36 | if columnSetting.Identify() == nil { |
23 | - _, err := repository.nextIdentify() | 37 | + _, err := tx.Model(columnSettingModel).Insert() |
24 | if err != nil { | 38 | if err != nil { |
25 | - return columnSetting, err | ||
26 | - } | ||
27 | - if _, errInsert := tx.QueryOne( | ||
28 | - pg.Scan(&columnSetting.Id, &columnSetting.CompanyId, &columnSetting.CreatedAt, &columnSetting.Description, &columnSetting.Key, &columnSetting.Uid, &columnSetting.UpdatedAt, &columnSetting.UserName, pg.Array(&columnSetting.Value), pg.Array(&columnSetting.InvalidValue)), | ||
29 | - "INSERT INTO column_settings (column_setting_id, company_id, created_at, description, key, uid, updated_at, user_name, value, invalid_value) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING column_setting_id, company_id, created_at, description, key, uid, updated_at, user_name, value, invalid_value", | ||
30 | - columnSetting.Id, columnSetting.CompanyId, columnSetting.CreatedAt, columnSetting.Description, columnSetting.Key, columnSetting.Uid, columnSetting.UpdatedAt, columnSetting.UserName, pg.Array(columnSetting.Value), pg.Array(columnSetting.InvalidValue)); errInsert != nil { | ||
31 | - return columnSetting, errInsert | 39 | + return nil, err |
32 | } | 40 | } |
41 | + return nil, err | ||
42 | + //_, err := repository.nextIdentify() | ||
43 | + //if err != nil { | ||
44 | + // return columnSetting, err | ||
45 | + //} | ||
46 | + //if _, errInsert := tx.QueryOne( | ||
47 | + // pg.Scan(&columnSetting.Id, &columnSetting.CompanyId, &columnSetting.CreatedAt, &columnSetting.Description, &columnSetting.Key, &columnSetting.Uid, &columnSetting.UpdatedAt, &columnSetting.UserName, pg.Array(&columnSetting.Value), pg.Array(&columnSetting.InvalidValue)), | ||
48 | + // "INSERT INTO column_settings (company_id, created_at, description, key, uid, updated_at, user_name, value, invalid_value) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) RETURNING id, company_id, created_at, description, key, uid, updated_at, user_name, value, invalid_value", | ||
49 | + // columnSetting.CompanyId, columnSetting.CreatedAt, columnSetting.Description, columnSetting.Key, columnSetting.Uid, columnSetting.UpdatedAt, columnSetting.UserName, pg.Array(columnSetting.Value), pg.Array(columnSetting.InvalidValue)); errInsert != nil { | ||
50 | + // return columnSetting, errInsert | ||
51 | + //} | ||
33 | } else { | 52 | } else { |
34 | - if _, errUpdate := tx.QueryOne( | ||
35 | - pg.Scan(&columnSetting.Id, &columnSetting.CompanyId, &columnSetting.CreatedAt, &columnSetting.Description, &columnSetting.Key, &columnSetting.Uid, &columnSetting.UpdatedAt, &columnSetting.UserName, pg.Array(&columnSetting.Value), pg.Array(&columnSetting.InvalidValue)), | ||
36 | - "UPDATE column_settings SET column_setting_id=?, company_id=?, created_at=?, description=?, key=?, uid=?, updated_at=?, user_name=?, value=?, invalid_value=? WHERE id=? RETURNING column_setting_id, company_id, created_at, description, key, uid, updated_at, user_name, value, invalid_value", | ||
37 | - columnSetting.Id, columnSetting.CompanyId, columnSetting.CreatedAt, columnSetting.Description, columnSetting.Key, columnSetting.Uid, columnSetting.UpdatedAt, columnSetting.UserName, pg.Array(columnSetting.Value), pg.Array(columnSetting.InvalidValue), columnSetting.Identify()); errUpdate != nil { | ||
38 | - return columnSetting, errUpdate | 53 | + //if _, errUpdate := tx.QueryOne( |
54 | + // pg.Scan(&columnSetting.Id, &columnSetting.CompanyId, &columnSetting.CreatedAt, &columnSetting.Description, &columnSetting.Key, &columnSetting.Uid, &columnSetting.UpdatedAt, &columnSetting.UserName, pg.Array(&columnSetting.Value), pg.Array(&columnSetting.InvalidValue)), | ||
55 | + // "UPDATE column_settings SET company_id=?, created_at=?, description=?, key=?, uid=?, updated_at=?, user_name=?, value=?, invalid_value=? WHERE id=? RETURNING id, company_id, created_at, description, key, uid, updated_at, user_name, value, invalid_value", | ||
56 | + // columnSetting.CompanyId, columnSetting.CreatedAt, columnSetting.Description, columnSetting.Key, columnSetting.Uid, columnSetting.UpdatedAt, columnSetting.UserName, pg.Array(columnSetting.Value), pg.Array(columnSetting.InvalidValue), columnSetting.Identify()); errUpdate != nil { | ||
57 | + // return columnSetting, errUpdate | ||
58 | + //} | ||
59 | + _, err := tx.Model(columnSettingModel).WherePK(). | ||
60 | + Column("company_id", "created_at", "description", "key", "uid", "updated_at", "user_name", "value", "invalid_value").Update() | ||
61 | + if err != nil { | ||
62 | + return nil, err | ||
39 | } | 63 | } |
40 | } | 64 | } |
41 | return columnSetting, nil | 65 | return columnSetting, nil |
@@ -150,7 +174,7 @@ func (repository *ColumnSettingRepository) transformPgModelToDomainModel(columnS | @@ -150,7 +174,7 @@ func (repository *ColumnSettingRepository) transformPgModelToDomainModel(columnS | ||
150 | }, nil | 174 | }, nil |
151 | } | 175 | } |
152 | 176 | ||
153 | -func NewColumnSettingRepository(transactionContext *pgTransaction.TransactionContext) (*ColumnSettingRepository, error) { | 177 | +func NewColumnSettingRepository(transactionContext *transaction.TransactionContext) (*ColumnSettingRepository, error) { |
154 | if transactionContext == nil { | 178 | if transactionContext == nil { |
155 | return nil, fmt.Errorf("transactionContext参数不能为nil") | 179 | return nil, fmt.Errorf("transactionContext参数不能为nil") |
156 | } else { | 180 | } else { |
@@ -2,8 +2,11 @@ package controllers | @@ -2,8 +2,11 @@ package controllers | ||
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | "encoding/json" | 4 | "encoding/json" |
5 | + "errors" | ||
5 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain" | 6 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/domain" |
6 | 7 | ||
8 | + "github.com/astaxie/beego/logs" | ||
9 | + | ||
7 | "github.com/linmadan/egglib-go/web/beego/utils" | 10 | "github.com/linmadan/egglib-go/web/beego/utils" |
8 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/columnSetting/command" | 11 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/columnSetting/command" |
9 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/columnSetting/query" | 12 | "gitlab.fjmaimaimai.com/mmm-go/partnermg/pkg/application/columnSetting/query" |
@@ -14,10 +17,30 @@ type ColumnSettingController struct { | @@ -14,10 +17,30 @@ type ColumnSettingController struct { | ||
14 | BaseController | 17 | BaseController |
15 | } | 18 | } |
16 | 19 | ||
20 | +////Prepare 重写 BaseController 的Prepare方法 | ||
21 | +func (controller *ColumnSettingController) Prepare() { | ||
22 | + controller.BaseController.Prepare() | ||
23 | + if ok := controller.ValidJWTToken(); !ok { | ||
24 | + return | ||
25 | + } | ||
26 | + if ok := controller.ValidAdminPermission(domain.PERMINSSION_PARTNER); !ok { | ||
27 | + return | ||
28 | + } | ||
29 | +} | ||
30 | + | ||
17 | func (controller *ColumnSettingController) CreateColumnSetting() { | 31 | func (controller *ColumnSettingController) CreateColumnSetting() { |
18 | columnSettingService := service.NewColumnSettingService(nil) | 32 | columnSettingService := service.NewColumnSettingService(nil) |
19 | createColumnSettingCommand := &command.CreateColumnSettingCommand{} | 33 | createColumnSettingCommand := &command.CreateColumnSettingCommand{} |
20 | - json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), createColumnSettingCommand) | 34 | + //_ = json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), createColumnSettingCommand) |
35 | + if err := controller.BindJsonData(&createColumnSettingCommand); err != nil { | ||
36 | + logs.Error(err) | ||
37 | + controller.ResponseError(errors.New("json数据解析失败")) | ||
38 | + return | ||
39 | + } | ||
40 | + companyId := controller.GetUserCompany() | ||
41 | + uid := controller.GetUserId() | ||
42 | + createColumnSettingCommand.CompanyId = int(companyId) | ||
43 | + createColumnSettingCommand.Uid = uid | ||
21 | data, err := columnSettingService.CreateColumnSetting(createColumnSettingCommand) | 44 | data, err := columnSettingService.CreateColumnSetting(createColumnSettingCommand) |
22 | var response utils.JsonResponse | 45 | var response utils.JsonResponse |
23 | if err != nil { | 46 | if err != nil { |
@@ -39,13 +62,20 @@ func (controller *ColumnSettingController) CreateColumnSetting() { | @@ -39,13 +62,20 @@ func (controller *ColumnSettingController) CreateColumnSetting() { | ||
39 | func (controller *ColumnSettingController) UpdateColumnSetting() { | 62 | func (controller *ColumnSettingController) UpdateColumnSetting() { |
40 | columnSettingService := service.NewColumnSettingService(nil) | 63 | columnSettingService := service.NewColumnSettingService(nil) |
41 | updateColumnSettingCommand := &command.UpdateColumnSettingCommand{} | 64 | updateColumnSettingCommand := &command.UpdateColumnSettingCommand{} |
42 | - _ = json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), updateColumnSettingCommand) | 65 | + //_ = json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), updateColumnSettingCommand) |
66 | + if err := controller.BindJsonData(&updateColumnSettingCommand); err != nil { | ||
67 | + logs.Error(err) | ||
68 | + controller.ResponseError(errors.New("json数据解析失败")) | ||
69 | + return | ||
70 | + } | ||
43 | //columnSettingId, _ := controller.GetInt64(":columnSettingId") | 71 | //columnSettingId, _ := controller.GetInt64(":columnSettingId") |
44 | companyId := controller.GetUserCompany() | 72 | companyId := controller.GetUserCompany() |
45 | uid := controller.GetUserId() | 73 | uid := controller.GetUserId() |
46 | //updateColumnSettingCommand.ColumnSettingId = columnSettingId | 74 | //updateColumnSettingCommand.ColumnSettingId = columnSettingId |
47 | updateColumnSettingCommand.CompanyId = int(companyId) | 75 | updateColumnSettingCommand.CompanyId = int(companyId) |
48 | updateColumnSettingCommand.Uid = uid | 76 | updateColumnSettingCommand.Uid = uid |
77 | + updateColumnSettingCommand.Selected = updateColumnSettingCommand.OrderBaseColumns.Selected | ||
78 | + updateColumnSettingCommand.UnSelected = updateColumnSettingCommand.OrderBaseColumns.UnSelected | ||
49 | data, err := columnSettingService.UpdateColumnSetting(updateColumnSettingCommand) | 79 | data, err := columnSettingService.UpdateColumnSetting(updateColumnSettingCommand) |
50 | var response utils.JsonResponse | 80 | var response utils.JsonResponse |
51 | if err != nil { | 81 | if err != nil { |
@@ -116,7 +146,8 @@ func (controller *ColumnSettingController) ResetColumn() { | @@ -116,7 +146,8 @@ func (controller *ColumnSettingController) ResetColumn() { | ||
116 | //_ = json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), resetColumnCommand) | 146 | //_ = json.Unmarshal(controller.Ctx.Input.GetData("requestBody").([]byte), resetColumnCommand) |
117 | resetColumnCommand.CompanyId = int(companyId) | 147 | resetColumnCommand.CompanyId = int(companyId) |
118 | resetColumnCommand.Uid = uid | 148 | resetColumnCommand.Uid = uid |
119 | - resetColumnCommand.Value = domain.DefaultColumns // 还原默认栏目设置 | 149 | + resetColumnCommand.Value = domain.DefaultColumns // 还原默认栏目设置 |
150 | + resetColumnCommand.InvalidValue = domain.DefaultInvalidColumns // 还原默认无效栏目 | ||
120 | data, err := columnSettingService.ResetColumn(resetColumnCommand) | 151 | data, err := columnSettingService.ResetColumn(resetColumnCommand) |
121 | var response utils.JsonResponse | 152 | var response utils.JsonResponse |
122 | if err != nil { | 153 | if err != nil { |
@@ -45,7 +45,8 @@ func init() { | @@ -45,7 +45,8 @@ func init() { | ||
45 | beego.NSRouter("/fileImport", &controllers.OrderInfoController{}, "POST:ImportOrderFromExcel"), // 导入订单数据 | 45 | beego.NSRouter("/fileImport", &controllers.OrderInfoController{}, "POST:ImportOrderFromExcel"), // 导入订单数据 |
46 | beego.NSRouter("/actual/listColumn", &controllers.ColumnSettingController{}, "POST:GetColumnSetting"), // 返回栏目设置列表 | 46 | beego.NSRouter("/actual/listColumn", &controllers.ColumnSettingController{}, "POST:GetColumnSetting"), // 返回栏目设置列表 |
47 | beego.NSRouter("/actual/updateColumn", &controllers.ColumnSettingController{}, "POST:UpdateColumnSetting"), // 更新栏目设置 | 47 | beego.NSRouter("/actual/updateColumn", &controllers.ColumnSettingController{}, "POST:UpdateColumnSetting"), // 更新栏目设置 |
48 | - beego.NSRouter("/actual/resetColumn", &controllers.ColumnSettingController{}, "Post:ResetColumn"), // 重置栏目设置 | 48 | + beego.NSRouter("/actual/resetColumn", &controllers.ColumnSettingController{}, "POST:ResetColumn"), // 重置栏目设置 |
49 | + beego.NSRouter("/actual/createColumn", &controllers.ColumnSettingController{}, "POST:CreateColumnSetting"), // 创建栏目设置,测试用 | ||
49 | ), | 50 | ), |
50 | beego.NSNamespace("/common", | 51 | beego.NSNamespace("/common", |
51 | beego.NSRouter("/partner", &controllers.CommonController{}, "POST:GetPartnerList"), | 52 | beego.NSRouter("/partner", &controllers.CommonController{}, "POST:GetPartnerList"), |
-
请 注册 或 登录 后发表评论