Browse Source

fix: 解决计划任务时区显示不一致的问题 (#5230)

Refs  #5211
pull/5237/head
ssongliu 6 months ago committed by GitHub
parent
commit
bf7a4f3254
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      backend/app/dto/cronjob.go
  2. 1
      backend/app/service/cornjob.go
  3. 3
      cmd/server/docs/docs.go
  4. 3
      cmd/server/docs/swagger.json
  5. 2
      cmd/server/docs/swagger.yaml
  6. 3
      frontend/src/api/interface/cronjob.ts
  7. 2
      frontend/src/views/cronjob/record/index.vue

16
backend/app/dto/cronjob.go

@ -98,12 +98,12 @@ type SearchRecord struct {
}
type Record struct {
ID uint `json:"id"`
StartTime time.Time `json:"startTime"`
Records string `json:"records"`
Status string `json:"status"`
Message string `json:"message"`
TargetPath string `json:"targetPath"`
Interval int `json:"interval"`
File string `json:"file"`
ID uint `json:"id"`
StartTime string `json:"startTime"`
Records string `json:"records"`
Status string `json:"status"`
Message string `json:"message"`
TargetPath string `json:"targetPath"`
Interval int `json:"interval"`
File string `json:"file"`
}

1
backend/app/service/cornjob.go

@ -71,6 +71,7 @@ func (u *CronjobService) SearchRecords(search dto.SearchRecord) (int64, interfac
if err := copier.Copy(&item, &record); err != nil {
return 0, nil, errors.WithMessage(constant.ErrStructTransform, err.Error())
}
item.StartTime = record.StartTime.Format("2006-01-02 15:04:05")
dtoCronjobs = append(dtoCronjobs, item)
}
return total, dtoCronjobs, err

3
cmd/server/docs/docs.go

@ -19488,6 +19488,9 @@ const docTemplate = `{
"pageSize": {
"type": "integer"
},
"sync": {
"type": "boolean"
},
"tags": {
"type": "array",
"items": {

3
cmd/server/docs/swagger.json

@ -19481,6 +19481,9 @@
"pageSize": {
"type": "integer"
},
"sync": {
"type": "boolean"
},
"tags": {
"type": "array",
"items": {

2
cmd/server/docs/swagger.yaml

@ -3323,6 +3323,8 @@ definitions:
type: integer
pageSize:
type: integer
sync:
type: boolean
tags:
items:
type: string

3
frontend/src/api/interface/cronjob.ts

@ -90,8 +90,7 @@ export namespace Cronjob {
export interface Record {
id: number;
file: string;
startTime: Date;
endTime: Date;
startTime: string;
records: string;
status: string;
message: string;

2
frontend/src/views/cronjob/record/index.vue

@ -108,7 +108,7 @@
{{ $t('commons.status.failed') }}
</el-tag>
<span>
{{ dateFormat(0, 0, row.startTime) }}
{{ row.startTime }}
</span>
</template>
</el-table-column>

Loading…
Cancel
Save