切换导航条
此项目
正在载入...
登录
allied-creation
/
performance
·
提交
转到一个项目
GitLab
转到群组
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
tangxvhui
2 years ago
提交
6a6444d17b31cb1eaf642e294a40f73c683ef8fb
1 个父辈
c5e74b0a
调整model 的结构
隐藏空白字符变更
内嵌
并排对比
正在显示
4 个修改的文件
包含
3 行增加
和
12 行删除
pkg/application/summary_evaluation/service/service.go
pkg/domain/summary_evaluation_value.go
pkg/infrastructure/pg/models/summary_evaluation_value.go
pkg/infrastructure/repository/pg_summary_evaluation_value_repository.go
pkg/application/summary_evaluation/service/service.go
查看文件 @
6a6444d
...
...
@@ -442,7 +442,6 @@ func (srv *SummaryEvaluationService) EditEvaluationSelf(param *command.EditEvalu
}
if
evaluationData
.
Executor
.
UserId
!=
param
.
ExecutorId
{
return
nil
,
application
.
ThrowError
(
application
.
INTERNAL_SERVER_ERROR
,
"没有操作权限"
)
}
...
...
pkg/domain/summary_evaluation_value.go
查看文件 @
6a6444d
...
...
@@ -16,10 +16,9 @@ type SummaryEvaluationValue struct {
Types
EvaluationType
`json:"types"`
//评估类型
Remark
string
`json:"remark"`
//填写的内容反馈
Weight
float64
`json:"weight"`
//"权重"
Rating
RatingLevel
`json:"rating"
`
//评级时的填写值
Rating
RatingLevel
`json:"rating"
`
//评级时的填写值
CreatedAt
time
.
Time
`json:"createdAt"`
//数据创建时间
UpdatedAt
time
.
Time
`json:"updatedAt"`
//数据更新时间
DeletedAt
*
time
.
Time
`json:"deletedAt"`
//数据删除时间
}
type
SummaryEvaluationValueRepository
interface
{
...
...
pkg/infrastructure/pg/models/summary_evaluation_value.go
查看文件 @
6a6444d
...
...
@@ -20,5 +20,4 @@ type SummaryEvaluationValue struct {
Remark
string
//填写的内容反馈
CreatedAt
time
.
Time
//数据创建时间
UpdatedAt
time
.
Time
//数据更新时间
DeletedAt
*
time
.
Time
//数据删除时间
}
...
...
pkg/infrastructure/repository/pg_summary_evaluation_value_repository.go
查看文件 @
6a6444d
...
...
@@ -34,7 +34,6 @@ func (repo *SummaryEvaluationValueRepository) TransformToDomain(d *models.Summar
Rating
:
d
.
Rating
,
CreatedAt
:
d
.
CreatedAt
,
UpdatedAt
:
d
.
UpdatedAt
,
DeletedAt
:
d
.
DeletedAt
,
}
}
...
...
@@ -51,7 +50,6 @@ func (repo *SummaryEvaluationValueRepository) Save(param *domain.SummaryEvaluati
Remark
:
param
.
Remark
,
CreatedAt
:
param
.
CreatedAt
,
UpdatedAt
:
param
.
UpdatedAt
,
DeletedAt
:
param
.
DeletedAt
,
}
db
:=
repo
.
transactionContext
.
PgTx
if
m
.
Id
==
0
{
...
...
@@ -74,11 +72,8 @@ func (repo *SummaryEvaluationValueRepository) Save(param *domain.SummaryEvaluati
func
(
repo
*
SummaryEvaluationValueRepository
)
Remove
(
id
int
)
error
{
tx
:=
repo
.
transactionContext
.
PgTx
nowTime
:=
time
.
Now
()
_
,
err
:=
tx
.
Model
(
&
models
.
SummaryEvaluationValue
{})
.
Where
(
"id=?"
,
id
)
.
Set
(
"deleted_at=?"
,
nowTime
)
.
Update
()
Where
(
"id=?"
,
id
)
.
Delete
()
return
err
}
...
...
@@ -104,8 +99,7 @@ func (repo *SummaryEvaluationValueRepository) FindOne(queryOptions map[string]in
func
(
repo
*
SummaryEvaluationValueRepository
)
Find
(
queryOptions
map
[
string
]
interface
{})
(
int
,
[]
*
domain
.
SummaryEvaluationValue
,
error
)
{
tx
:=
repo
.
transactionContext
.
PgTx
var
m
[]
*
models
.
SummaryEvaluationValue
query
:=
tx
.
Model
(
&
m
)
.
Where
(
"deleted_at isnull"
)
query
:=
tx
.
Model
(
&
m
)
if
v
,
ok
:=
queryOptions
[
"limit"
]
.
(
int
);
ok
{
query
.
Limit
(
v
)
}
...
...
请
注册
或
登录
后发表评论