Kaynağa Gözat

音频列表增加状态搜索

zhangqian 2 yıl önce
ebeveyn
işleme
bcdc840ba9
5 değiştirilmiş dosya ile 57 ekleme ve 8 silme
  1. 1 0
      controllers/audio.go
  2. 17 0
      docs/docs.go
  3. 17 0
      docs/swagger.json
  4. 13 0
      docs/swagger.yaml
  5. 9 8
      request/audio.go

+ 1 - 0
controllers/audio.go

@@ -181,6 +181,7 @@ func (slf AudioCtl) List(c *gin.Context) {
 		SetBeginTime(params.BeginTime).
 		SetEndTime(params.EndTime).
 		SetIsFollowed(params.IsFollowed).
+		SetAudioStatusList(params.StatusList).
 		Find()
 
 	if err != nil {

+ 17 - 0
docs/docs.go

@@ -302,6 +302,23 @@ const docTemplate = `{
                         "name": "stationNumber",
                         "in": "query"
                     },
+                    {
+                        "type": "array",
+                        "items": {
+                            "enum": [
+                                0,
+                                1,
+                                2,
+                                3,
+                                4
+                            ],
+                            "type": "integer"
+                        },
+                        "collectionFormat": "csv",
+                        "description": "音频状态数组",
+                        "name": "statusList",
+                        "in": "query"
+                    },
                     {
                         "type": "string",
                         "description": "车次",

+ 17 - 0
docs/swagger.json

@@ -290,6 +290,23 @@
                         "name": "stationNumber",
                         "in": "query"
                     },
+                    {
+                        "type": "array",
+                        "items": {
+                            "enum": [
+                                0,
+                                1,
+                                2,
+                                3,
+                                4
+                            ],
+                            "type": "integer"
+                        },
+                        "collectionFormat": "csv",
+                        "description": "音频状态数组",
+                        "name": "statusList",
+                        "in": "query"
+                    },
                     {
                         "type": "string",
                         "description": "车次",

+ 13 - 0
docs/swagger.yaml

@@ -380,6 +380,19 @@ paths:
         in: query
         name: stationNumber
         type: string
+      - collectionFormat: csv
+        description: 音频状态数组
+        in: query
+        items:
+          enum:
+          - 0
+          - 1
+          - 2
+          - 3
+          - 4
+          type: integer
+        name: statusList
+        type: array
       - description: 车次
         in: query
         name: trainNumber

+ 9 - 8
request/audio.go

@@ -7,14 +7,15 @@ import (
 
 type GetAudioList struct {
 	PageInfo
-	Keyword          string            `form:"keyword"`                                                                         // 关键字
-	LocomotiveNumber string            `gorm:"index;type:varchar(255);not null;default:'';comment:机车号" form:"locomotiveNumber"` // 机车号
-	TrainNumber      string            `gorm:"index;type:varchar(255);not null;default:'';comment:车次" form:"trainNumber"`       // 车次
-	DriverNumber     string            `gorm:"index;type:varchar(255);not null;default:'';comment:司机号" form:"driverNumber"`     // 司机号
-	StationNumber    string            `gorm:"index;type:varchar(255);not null;default:'';comment:车站号" form:"stationNumber"`    // 车站号
-	BeginTime        time.Time         `form:"beginTime"`                                                                       //开始时间
-	EndTime          time.Time         `form:"endTime"`                                                                         //结束时间
-	IsFollowed       constvar.BoolType `form:"isFollowed"`                                                                      //是否关注 1关注 2未关注
+	Keyword          string                 `form:"keyword"`                                                                            // 关键字
+	LocomotiveNumber string                 `gorm:"index;type:varchar(255);not null;default:'';comment:机车号" form:"locomotiveNumber"` // 机车号
+	TrainNumber      string                 `gorm:"index;type:varchar(255);not null;default:'';comment:车次" form:"trainNumber"`        // 车次
+	DriverNumber     string                 `gorm:"index;type:varchar(255);not null;default:'';comment:司机号" form:"driverNumber"`     // 司机号
+	StationNumber    string                 `gorm:"index;type:varchar(255);not null;default:'';comment:车站号" form:"stationNumber"`    // 车站号
+	BeginTime        time.Time              `form:"beginTime"`                                                                          //开始时间
+	EndTime          time.Time              `form:"endTime"`                                                                            //结束时间
+	IsFollowed       constvar.BoolType      `form:"isFollowed"`                                                                         //是否关注 1关注 2未关注
+	StatusList       []constvar.AudioStatus `form:"statusList"`                                                                         //音频状态数组
 }
 
 type ProcessAudio struct {