| | |
| | | web: |
| | | port: 8102 |
| | | port: 8203 |
| | | host: 192.168.20.119 |
| | | db: |
| | | dsn: root:c++java123@tcp(192.168.20.119:3306)/speech_analysis?charset=utf8&parseTime=True&loc=Local |
| | |
| | | util.ResponseFormat(c, code.UpdateSuccess, "成功") |
| | | } |
| | | |
| | | // AudioInfo |
| | | // @Tags 音频 |
| | | // @Summary 音频详情,含解析结果 |
| | | // @Produce application/json |
| | | // @Param object query request.ProcessAudio true "参数" |
| | | // @Success 200 {object} util.Response{data=models.Audio} "成功" |
| | | // @Router /api-sa/v1/audio/info [get] |
| | | func (slf AudioCtl) AudioInfo(c *gin.Context) { |
| | | var params request.ProcessAudio |
| | | if err := c.ShouldBindQuery(¶ms); err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, err.Error()) |
| | | return |
| | | } |
| | | |
| | | audio, err := models.NewAudioSearch().SetID(params.ID).First() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.InternalError, "请求失败") |
| | | return |
| | | } |
| | | audioText, err := models.NewAudioTextSearch().SetAudioID(audio.ID).First() |
| | | if err == nil { |
| | | audio.AudioText = audioText.AudioText |
| | | } |
| | | |
| | | util.ResponseFormat(c, code.UpdateSuccess, audio) |
| | | } |
| | | |
| | | // BatchProcess |
| | | // @Tags 音频 |
| | | // @Summary 批量处理音频 |
| | |
| | | return |
| | | } |
| | | |
| | | text := models.Text{ |
| | | text := models.Word{ |
| | | Content: req.Content, |
| | | LocomotiveNumber: req.LocomotiveNumber, |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | if err := models.NewTextSearch().Create(&text); err != nil { |
| | | if err := models.NewWordSearch().Create(&text); err != nil { |
| | | util.ResponseFormat(c, code.SaveFail, "添加失败,请检查是否重复") |
| | | return |
| | | } |
| | |
| | | util.ResponseFormat(c, code.Success, "添加成功") |
| | | } |
| | | |
| | | func (slf TextCtl) paramsCheck(text models.Text) (err error) { |
| | | func (slf TextCtl) paramsCheck(text models.Word) (err error) { |
| | | if text.Content == "" || text.LocomotiveNumber == "" { |
| | | return errors.New("参数缺失") |
| | | } |
| | | _, err = models.NewTextSearch().SetLocomotiveNumber(text.LocomotiveNumber).SetContent(text.Content).First() |
| | | _, err = models.NewWordSearch().SetLocomotiveNumber(text.LocomotiveNumber).SetContent(text.Content).First() |
| | | if err == nil { |
| | | return errors.New("文字重复") |
| | | } |
| | |
| | | // @Summary 文字库列表 |
| | | // @Produce application/json |
| | | // @Param object query request.GetTextList true "参数" |
| | | // @Success 200 {object} util.ResponseList{data=[]models.Text} "成功" |
| | | // @Success 200 {object} util.ResponseList{data=[]models.Word} "成功" |
| | | // @Router /api-sa/v1/text/list [get] |
| | | func (slf TextCtl) List(c *gin.Context) { |
| | | var params request.GetTextList |
| | |
| | | return |
| | | } |
| | | |
| | | list, total, err := models.NewTextSearch(). |
| | | list, total, err := models.NewWordSearch(). |
| | | SetPage(params.Page, params.PageSize). |
| | | SetKeyword(params.Keyword). |
| | | Find() |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-sa/v1/audio/info": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "音频" |
| | | ], |
| | | "summary": "音频详情,含解析结果", |
| | | "parameters": [ |
| | | { |
| | | "type": "integer", |
| | | "name": "id", |
| | | "in": "query", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/models.Audio" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-sa/v1/audio/list": { |
| | | "get": { |
| | | "produces": [ |
| | |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.Text" |
| | | "$ref": "#/definitions/models.Word" |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | ] |
| | | }, |
| | | "audioText": { |
| | | "description": "解析出的文本", |
| | | "type": "string" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | }, |
| | | "words": { |
| | | "description": "匹配到的文字数组", |
| | | "type": "array", |
| | | "items": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "models.Text": { |
| | | "type": "object", |
| | | "properties": { |
| | | "content": { |
| | | "description": "音频名称", |
| | | "type": "string" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "$ref": "#/definitions/gorm.DeletedAt" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "locomotiveNumber": { |
| | | "description": "机车号", |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "class": { |
| | | "description": "分类", |
| | | "description": "分类 1 机车 2车次 3 车站", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.Class" |
| | |
| | | "parentID": { |
| | | "description": "上级id", |
| | | "type": "integer" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "models.Word": { |
| | | "type": "object", |
| | | "properties": { |
| | | "content": { |
| | | "description": "文字", |
| | | "type": "string" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "$ref": "#/definitions/gorm.DeletedAt" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "locomotiveNumber": { |
| | | "description": "机车号", |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "followStatus": { |
| | | "description": "1 已关注 2未关注", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.BoolType" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | "util.Response": { |
| | |
| | | } |
| | | } |
| | | }, |
| | | "/api-sa/v1/audio/info": { |
| | | "get": { |
| | | "produces": [ |
| | | "application/json" |
| | | ], |
| | | "tags": [ |
| | | "音频" |
| | | ], |
| | | "summary": "音频详情,含解析结果", |
| | | "parameters": [ |
| | | { |
| | | "type": "integer", |
| | | "name": "id", |
| | | "in": "query", |
| | | "required": true |
| | | } |
| | | ], |
| | | "responses": { |
| | | "200": { |
| | | "description": "成功", |
| | | "schema": { |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/util.Response" |
| | | }, |
| | | { |
| | | "type": "object", |
| | | "properties": { |
| | | "data": { |
| | | "$ref": "#/definitions/models.Audio" |
| | | } |
| | | } |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "/api-sa/v1/audio/list": { |
| | | "get": { |
| | | "produces": [ |
| | |
| | | "data": { |
| | | "type": "array", |
| | | "items": { |
| | | "$ref": "#/definitions/models.Text" |
| | | "$ref": "#/definitions/models.Word" |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | ] |
| | | }, |
| | | "audioText": { |
| | | "description": "解析出的文本", |
| | | "type": "string" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | }, |
| | | "words": { |
| | | "description": "匹配到的文字数组", |
| | | "type": "array", |
| | | "items": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "models.Text": { |
| | | "type": "object", |
| | | "properties": { |
| | | "content": { |
| | | "description": "音频名称", |
| | | "type": "string" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "$ref": "#/definitions/gorm.DeletedAt" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "locomotiveNumber": { |
| | | "description": "机车号", |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "class": { |
| | | "description": "分类", |
| | | "description": "分类 1 机车 2车次 3 车站", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.Class" |
| | |
| | | "parentID": { |
| | | "description": "上级id", |
| | | "type": "integer" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | | } |
| | | } |
| | | }, |
| | | "models.Word": { |
| | | "type": "object", |
| | | "properties": { |
| | | "content": { |
| | | "description": "文字", |
| | | "type": "string" |
| | | }, |
| | | "createdAt": { |
| | | "type": "string" |
| | | }, |
| | | "deletedAt": { |
| | | "$ref": "#/definitions/gorm.DeletedAt" |
| | | }, |
| | | "id": { |
| | | "type": "integer" |
| | | }, |
| | | "locomotiveNumber": { |
| | | "description": "机车号", |
| | | "type": "string" |
| | | }, |
| | | "updatedAt": { |
| | | "type": "string" |
| | |
| | | "type": "object", |
| | | "properties": { |
| | | "followStatus": { |
| | | "description": "1 已关注 2未关注", |
| | | "allOf": [ |
| | | { |
| | | "$ref": "#/definitions/constvar.BoolType" |
| | | } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | "util.Response": { |
| | |
| | | allOf: |
| | | - $ref: '#/definitions/constvar.AudioStatus' |
| | | description: 音频状态 |
| | | audioText: |
| | | description: 解析出的文本 |
| | | type: string |
| | | createdAt: |
| | | type: string |
| | | deletedAt: |
| | |
| | | type: string |
| | | updatedAt: |
| | | type: string |
| | | type: object |
| | | models.Text: |
| | | properties: |
| | | content: |
| | | description: 音频名称 |
| | | words: |
| | | description: 匹配到的文字数组 |
| | | items: |
| | | type: string |
| | | createdAt: |
| | | type: string |
| | | deletedAt: |
| | | $ref: '#/definitions/gorm.DeletedAt' |
| | | id: |
| | | type: integer |
| | | locomotiveNumber: |
| | | description: 机车号 |
| | | type: string |
| | | updatedAt: |
| | | type: string |
| | | type: array |
| | | type: object |
| | | models.TrainInfo: |
| | | properties: |
| | | class: |
| | | allOf: |
| | | - $ref: '#/definitions/constvar.Class' |
| | | description: 分类 |
| | | description: 分类 1 机车 2车次 3 车站 |
| | | createdAt: |
| | | type: string |
| | | deletedAt: |
| | |
| | | parentID: |
| | | description: 上级id |
| | | type: integer |
| | | updatedAt: |
| | | type: string |
| | | type: object |
| | | models.Word: |
| | | properties: |
| | | content: |
| | | description: 文字 |
| | | type: string |
| | | createdAt: |
| | | type: string |
| | | deletedAt: |
| | | $ref: '#/definitions/gorm.DeletedAt' |
| | | id: |
| | | type: integer |
| | | locomotiveNumber: |
| | | description: 机车号 |
| | | type: string |
| | | updatedAt: |
| | | type: string |
| | | type: object |
| | |
| | | response.FollowResp: |
| | | properties: |
| | | followStatus: |
| | | $ref: '#/definitions/constvar.BoolType' |
| | | allOf: |
| | | - $ref: '#/definitions/constvar.BoolType' |
| | | description: 1 已关注 2未关注 |
| | | type: object |
| | | util.Response: |
| | | properties: |
| | |
| | | $ref: '#/definitions/response.FollowResp' |
| | | type: object |
| | | summary: 关注/取消关注 |
| | | tags: |
| | | - 音频 |
| | | /api-sa/v1/audio/info: |
| | | get: |
| | | parameters: |
| | | - in: query |
| | | name: id |
| | | required: true |
| | | type: integer |
| | | produces: |
| | | - application/json |
| | | responses: |
| | | "200": |
| | | description: 成功 |
| | | schema: |
| | | allOf: |
| | | - $ref: '#/definitions/util.Response' |
| | | - properties: |
| | | data: |
| | | $ref: '#/definitions/models.Audio' |
| | | type: object |
| | | summary: 音频详情,含解析结果 |
| | | tags: |
| | | - 音频 |
| | | /api-sa/v1/audio/list: |
| | |
| | | - properties: |
| | | data: |
| | | items: |
| | | $ref: '#/definitions/models.Text' |
| | | $ref: '#/definitions/models.Word' |
| | | type: array |
| | | type: object |
| | | summary: 文字库列表 |
| | |
| | | OccurrenceTime string `json:"occurrenceTime" gorm:"-"` |
| | | IsFollowed constvar.BoolType `gorm:"type:tinyint;not null;default:2;comment:是否关注"` //是否关注 1关注 2未关注 |
| | | Score float64 `json:"score"` // 置信度 |
| | | Words []string `json:"words" gorm:"-"` //匹配到的文字数组 |
| | | AudioText string `json:"audioText" gorm:"-"` //解析出的文本 |
| | | } |
| | | |
| | | AudioSearch struct { |
| | |
| | | err := db.AutoMigrate( |
| | | Audio{}, |
| | | AudioText{}, |
| | | Text{}, |
| | | Word{}, |
| | | TrainInfo{}, |
| | | ) |
| | | return err |
| | |
| | | ) |
| | | |
| | | type ( |
| | | // Text 文字 |
| | | Text struct { |
| | | // Word 文字 |
| | | Word struct { |
| | | gorm.Model |
| | | Content string `gorm:"uniqueIndex:locomotive_number_text;type:varchar(255);not null;default:'';comment:音频名称" json:"content"` // 音频名称 |
| | | LocomotiveNumber string `gorm:"uniqueIndex:locomotive_number_text;type:varchar(255);not null;default:'';comment:机车号" json:"locomotiveNumber"` // 机车号 |
| | | Content string `gorm:"uniqueIndex:locomotive_number_Word;type:varchar(255);not null;default:'';comment:音频名称" json:"content"` // 文字 |
| | | LocomotiveNumber string `gorm:"uniqueIndex:locomotive_number_Word;type:varchar(255);not null;default:'';comment:机车号" json:"locomotiveNumber"` // 机车号 |
| | | } |
| | | |
| | | TextSearch struct { |
| | | Text |
| | | WordSearch struct { |
| | | Word |
| | | Order string |
| | | PageNum int |
| | | PageSize int |
| | |
| | | } |
| | | ) |
| | | |
| | | func (slf *Text) TableName() string { |
| | | return "text" |
| | | func (slf *Word) TableName() string { |
| | | return "word" |
| | | } |
| | | |
| | | func NewTextSearch() *TextSearch { |
| | | return &TextSearch{Orm: mysqlx.GetDB()} |
| | | func NewWordSearch() *WordSearch { |
| | | return &WordSearch{Orm: mysqlx.GetDB()} |
| | | } |
| | | |
| | | func (slf *TextSearch) SetOrm(tx *gorm.DB) *TextSearch { |
| | | func (slf *WordSearch) SetOrm(tx *gorm.DB) *WordSearch { |
| | | slf.Orm = tx |
| | | return slf |
| | | } |
| | | |
| | | func (slf *TextSearch) SetPage(page, size int) *TextSearch { |
| | | func (slf *WordSearch) SetPage(page, size int) *WordSearch { |
| | | slf.PageNum, slf.PageSize = page, size |
| | | return slf |
| | | } |
| | | |
| | | func (slf *TextSearch) SetOrder(order string) *TextSearch { |
| | | func (slf *WordSearch) SetOrder(order string) *WordSearch { |
| | | slf.Order = order |
| | | return slf |
| | | } |
| | | |
| | | func (slf *TextSearch) SetID(id uint) *TextSearch { |
| | | func (slf *WordSearch) SetID(id uint) *WordSearch { |
| | | slf.ID = id |
| | | return slf |
| | | } |
| | | |
| | | func (slf *TextSearch) SetIDs(ids []uint) *TextSearch { |
| | | func (slf *WordSearch) SetIDs(ids []uint) *WordSearch { |
| | | slf.IDs = ids |
| | | return slf |
| | | } |
| | | |
| | | func (slf *TextSearch) SetKeyword(kw string) *TextSearch { |
| | | func (slf *WordSearch) SetKeyword(kw string) *WordSearch { |
| | | slf.Keyword = kw |
| | | return slf |
| | | } |
| | | |
| | | func (slf *TextSearch) SetLocomotiveNumber(number string) *TextSearch { |
| | | func (slf *WordSearch) SetLocomotiveNumber(number string) *WordSearch { |
| | | slf.LocomotiveNumber = number |
| | | return slf |
| | | } |
| | | |
| | | func (slf *TextSearch) SetContent(content string) *TextSearch { |
| | | func (slf *WordSearch) SetContent(content string) *WordSearch { |
| | | slf.Content = content |
| | | return slf |
| | | } |
| | | |
| | | func (slf *TextSearch) build() *gorm.DB { |
| | | func (slf *WordSearch) build() *gorm.DB { |
| | | var db = slf.Orm.Table(slf.TableName()) |
| | | |
| | | if slf.ID != 0 { |
| | |
| | | } |
| | | |
| | | // Create 单条插入 |
| | | func (slf *TextSearch) Create(record *Text) error { |
| | | func (slf *WordSearch) Create(record *Word) error { |
| | | var db = slf.build() |
| | | |
| | | if err := db.Create(record).Error; err != nil { |
| | |
| | | } |
| | | |
| | | // CreateBatch 批量插入 |
| | | func (slf *TextSearch) CreateBatch(records []*Text) error { |
| | | func (slf *WordSearch) CreateBatch(records []*Word) error { |
| | | var db = slf.build() |
| | | |
| | | if err := db.Create(&records).Error; err != nil { |
| | |
| | | return nil |
| | | } |
| | | |
| | | func (slf *TextSearch) Save(record *Text) error { |
| | | func (slf *WordSearch) Save(record *Word) error { |
| | | var db = slf.build() |
| | | |
| | | if err := db.Omit("CreatedAt").Save(record).Error; err != nil { |
| | |
| | | return nil |
| | | } |
| | | |
| | | func (slf *TextSearch) UpdateByMap(upMap map[string]interface{}) error { |
| | | func (slf *WordSearch) UpdateByMap(upMap map[string]interface{}) error { |
| | | var ( |
| | | db = slf.build() |
| | | ) |
| | |
| | | return nil |
| | | } |
| | | |
| | | func (slf *TextSearch) UpdateByQuery(query string, args []interface{}, upMap map[string]interface{}) error { |
| | | func (slf *WordSearch) UpdateByQuery(query string, args []interface{}, upMap map[string]interface{}) error { |
| | | var ( |
| | | db = slf.Orm.Table(slf.TableName()).Where(query, args...) |
| | | ) |
| | |
| | | return nil |
| | | } |
| | | |
| | | func (slf *TextSearch) Delete() error { |
| | | func (slf *WordSearch) Delete() error { |
| | | var db = slf.build() |
| | | |
| | | if err := db.Delete(&Text{}).Error; err != nil { |
| | | if err := db.Delete(&Word{}).Error; err != nil { |
| | | return err |
| | | } |
| | | |
| | | return nil |
| | | } |
| | | |
| | | func (slf *TextSearch) First() (*Text, error) { |
| | | func (slf *WordSearch) First() (*Word, error) { |
| | | var ( |
| | | record = new(Text) |
| | | record = new(Word) |
| | | db = slf.build() |
| | | ) |
| | | |
| | |
| | | return record, nil |
| | | } |
| | | |
| | | func (slf *TextSearch) Find() ([]*Text, int, error) { |
| | | func (slf *WordSearch) Find() ([]*Word, int, error) { |
| | | var ( |
| | | records = make([]*Text, 0) |
| | | records = make([]*Word, 0) |
| | | total int64 |
| | | db = slf.build() |
| | | ) |
| | |
| | | return records, int(total), nil |
| | | } |
| | | |
| | | func (slf *TextSearch) FindNotTotal() ([]*Text, error) { |
| | | func (slf *WordSearch) FindNotTotal() ([]*Word, error) { |
| | | var ( |
| | | records = make([]*Text, 0) |
| | | records = make([]*Word, 0) |
| | | db = slf.build() |
| | | ) |
| | | |
| | |
| | | } |
| | | |
| | | // FindByQuery 指定条件查询. |
| | | func (slf *TextSearch) FindByQuery(query string, args []interface{}) ([]*Text, int64, error) { |
| | | func (slf *WordSearch) FindByQuery(query string, args []interface{}) ([]*Word, int64, error) { |
| | | var ( |
| | | records = make([]*Text, 0) |
| | | records = make([]*Word, 0) |
| | | total int64 |
| | | db = slf.Orm.Table(slf.TableName()).Where(query, args...) |
| | | ) |
| | |
| | | } |
| | | |
| | | // FindAll 指定条件查询&不分页. |
| | | func (slf *TextSearch) FindAll(query string, args []interface{}) ([]*Text, error) { |
| | | func (slf *WordSearch) FindAll(query string, args []interface{}) ([]*Word, error) { |
| | | var ( |
| | | records = make([]*Text, 0) |
| | | records = make([]*Word, 0) |
| | | db = slf.Orm.Table(slf.TableName()).Where(query, args...) |
| | | ) |
| | | |
| | |
| | | } |
| | | |
| | | //// InitDefaultData 初始化数据 |
| | | //func (slf *TextSearch) InitDefaultData() error { |
| | | //func (slf *WordSearch) InitDefaultData() error { |
| | | // var ( |
| | | // db = slf.Orm.Table(slf.TableName()) |
| | | // total int64 = 0 |
| | |
| | | // if total != 0 { |
| | | // return nil |
| | | // } |
| | | // Texts := make([]*Text, 0, 3) |
| | | // Texts = append(Texts, &Text{Name: "财务部", Number: "cwb"}) |
| | | // return slf.CreateBatch(Texts) |
| | | // Words := make([]*Word, 0, 3) |
| | | // Words = append(Words, &Word{Name: "财务部", Number: "cwb"}) |
| | | // return slf.CreateBatch(Words) |
| | | //} |
| | |
| | | TrainInfo struct { |
| | | gorm.Model |
| | | Name string `gorm:"type:varchar(255);not null;default:'';comment:名称" json:"name"` //名称 |
| | | Class constvar.Class `gorm:"type:tinyint;not null;default:0;comment:分类" json:"class"` //分类 |
| | | Class constvar.Class `gorm:"type:tinyint;not null;default:0;comment:分类" json:"class"` //分类 1 机车 2车次 3 车站 |
| | | ParentID uint `gorm:"type:int;not null;default 0; comment:上级id" json:"parentID"` //上级id |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | type ProcessAudio struct { |
| | | ID uint `json:"id" binding:"required"` |
| | | ID uint `json:"id" form:"id" binding:"required"` |
| | | } |
| | | |
| | | type BatchProcessAudio struct { |
| | |
| | | import "speechAnalysis/constvar" |
| | | |
| | | type FollowResp struct { |
| | | FollowStatus constvar.BoolType `json:"followStatus"` |
| | | FollowStatus constvar.BoolType `json:"followStatus"` //1 已关注 2未关注 |
| | | } |
| | |
| | | { |
| | | audioAPi.POST("upload", audioCtl.Upload) // 上传音频 |
| | | audioAPi.GET("list", audioCtl.List) // 音频检索 |
| | | audioAPi.GET("info", audioCtl.AudioInfo) // 音频详情 |
| | | audioAPi.GET("trainInfoList", audioCtl.TrainInfoList) // 火车信息列表 |
| | | audioAPi.POST("process", audioCtl.Process) // 音频处理 |
| | | audioAPi.POST("batchProcess", audioCtl.BatchProcess) // 音频批量处理 |