|
@@ -34,7 +34,6 @@ func (repo *SummaryEvaluationValueRepository) TransformToDomain(d *models.Summar |
|
@@ -34,7 +34,6 @@ func (repo *SummaryEvaluationValueRepository) TransformToDomain(d *models.Summar |
34
|
Rating: d.Rating,
|
34
|
Rating: d.Rating,
|
35
|
CreatedAt: d.CreatedAt,
|
35
|
CreatedAt: d.CreatedAt,
|
36
|
UpdatedAt: d.UpdatedAt,
|
36
|
UpdatedAt: d.UpdatedAt,
|
37
|
- DeletedAt: d.DeletedAt,
|
|
|
38
|
}
|
37
|
}
|
39
|
}
|
38
|
}
|
40
|
|
39
|
|
|
@@ -51,7 +50,6 @@ func (repo *SummaryEvaluationValueRepository) Save(param *domain.SummaryEvaluati |
|
@@ -51,7 +50,6 @@ func (repo *SummaryEvaluationValueRepository) Save(param *domain.SummaryEvaluati |
51
|
Remark: param.Remark,
|
50
|
Remark: param.Remark,
|
52
|
CreatedAt: param.CreatedAt,
|
51
|
CreatedAt: param.CreatedAt,
|
53
|
UpdatedAt: param.UpdatedAt,
|
52
|
UpdatedAt: param.UpdatedAt,
|
54
|
- DeletedAt: param.DeletedAt,
|
|
|
55
|
}
|
53
|
}
|
56
|
db := repo.transactionContext.PgTx
|
54
|
db := repo.transactionContext.PgTx
|
57
|
if m.Id == 0 {
|
55
|
if m.Id == 0 {
|
|
@@ -74,11 +72,8 @@ func (repo *SummaryEvaluationValueRepository) Save(param *domain.SummaryEvaluati |
|
@@ -74,11 +72,8 @@ func (repo *SummaryEvaluationValueRepository) Save(param *domain.SummaryEvaluati |
74
|
|
72
|
|
75
|
func (repo *SummaryEvaluationValueRepository) Remove(id int) error {
|
73
|
func (repo *SummaryEvaluationValueRepository) Remove(id int) error {
|
76
|
tx := repo.transactionContext.PgTx
|
74
|
tx := repo.transactionContext.PgTx
|
77
|
- nowTime := time.Now()
|
|
|
78
|
_, err := tx.Model(&models.SummaryEvaluationValue{}).
|
75
|
_, err := tx.Model(&models.SummaryEvaluationValue{}).
|
79
|
- Where("id=?", id).
|
|
|
80
|
- Set("deleted_at=?", nowTime).
|
|
|
81
|
- Update()
|
76
|
+ Where("id=?", id).Delete()
|
82
|
return err
|
77
|
return err
|
83
|
}
|
78
|
}
|
84
|
|
79
|
|
|
@@ -104,8 +99,7 @@ func (repo *SummaryEvaluationValueRepository) FindOne(queryOptions map[string]in |
|
@@ -104,8 +99,7 @@ func (repo *SummaryEvaluationValueRepository) FindOne(queryOptions map[string]in |
104
|
func (repo *SummaryEvaluationValueRepository) Find(queryOptions map[string]interface{}) (int, []*domain.SummaryEvaluationValue, error) {
|
99
|
func (repo *SummaryEvaluationValueRepository) Find(queryOptions map[string]interface{}) (int, []*domain.SummaryEvaluationValue, error) {
|
105
|
tx := repo.transactionContext.PgTx
|
100
|
tx := repo.transactionContext.PgTx
|
106
|
var m []*models.SummaryEvaluationValue
|
101
|
var m []*models.SummaryEvaluationValue
|
107
|
- query := tx.Model(&m).
|
|
|
108
|
- Where("deleted_at isnull")
|
102
|
+ query := tx.Model(&m)
|
109
|
if v, ok := queryOptions["limit"].(int); ok {
|
103
|
if v, ok := queryOptions["limit"].(int); ok {
|
110
|
query.Limit(v)
|
104
|
query.Limit(v)
|
111
|
}
|
105
|
}
|