|
@@ -11,6 +11,7 @@ import (
|
|
|
"speechAnalysis/models"
|
|
"speechAnalysis/models"
|
|
|
"speechAnalysis/pkg/logx"
|
|
"speechAnalysis/pkg/logx"
|
|
|
"speechAnalysis/request"
|
|
"speechAnalysis/request"
|
|
|
|
|
+ "speechAnalysis/response"
|
|
|
"speechAnalysis/service"
|
|
"speechAnalysis/service"
|
|
|
"speechAnalysis/utils/upload"
|
|
"speechAnalysis/utils/upload"
|
|
|
"strings"
|
|
"strings"
|
|
@@ -97,7 +98,7 @@ func (slf AudioCtl) ParamsCheck(filename string) (err error) {
|
|
|
// @Tags 音频
|
|
// @Tags 音频
|
|
|
// @Summary 音频分析检索
|
|
// @Summary 音频分析检索
|
|
|
// @Produce application/json
|
|
// @Produce application/json
|
|
|
-// @Param object query request.GetAudioList true "查询参数"
|
|
|
|
|
|
|
+// @Param object query request.GetAudioList true "参数"
|
|
|
// @Success 200 {object} util.ResponseList{data=[]models.Audio} "成功"
|
|
// @Success 200 {object} util.ResponseList{data=[]models.Audio} "成功"
|
|
|
// @Router /api-sa/v1/audio/list [get]
|
|
// @Router /api-sa/v1/audio/list [get]
|
|
|
func (slf AudioCtl) List(c *gin.Context) {
|
|
func (slf AudioCtl) List(c *gin.Context) {
|
|
@@ -133,7 +134,7 @@ func (slf AudioCtl) List(c *gin.Context) {
|
|
|
// @Tags 音频
|
|
// @Tags 音频
|
|
|
// @Summary 处理音频
|
|
// @Summary 处理音频
|
|
|
// @Produce application/json
|
|
// @Produce application/json
|
|
|
-// @Param object body request.ProcessAudio true "音频信息"
|
|
|
|
|
|
|
+// @Param object body request.ProcessAudio true "参数"
|
|
|
// @Success 200 {object} util.Response "成功"
|
|
// @Success 200 {object} util.Response "成功"
|
|
|
// @Router /api-sa/v1/audio/process [post]
|
|
// @Router /api-sa/v1/audio/process [post]
|
|
|
func (slf AudioCtl) Process(c *gin.Context) {
|
|
func (slf AudioCtl) Process(c *gin.Context) {
|
|
@@ -156,7 +157,7 @@ func (slf AudioCtl) Process(c *gin.Context) {
|
|
|
// @Tags 音频
|
|
// @Tags 音频
|
|
|
// @Summary 批量处理音频
|
|
// @Summary 批量处理音频
|
|
|
// @Produce application/json
|
|
// @Produce application/json
|
|
|
-// @Param object body request.BatchProcessAudio true "音频信息"
|
|
|
|
|
|
|
+// @Param object body request.BatchProcessAudio true "参数"
|
|
|
// @Success 200 {object} util.Response "成功"
|
|
// @Success 200 {object} util.Response "成功"
|
|
|
// @Router /api-sa/v1/audio/batchProcess [post]
|
|
// @Router /api-sa/v1/audio/batchProcess [post]
|
|
|
func (slf AudioCtl) BatchProcess(c *gin.Context) {
|
|
func (slf AudioCtl) BatchProcess(c *gin.Context) {
|
|
@@ -192,7 +193,7 @@ func (slf AudioCtl) BatchProcess(c *gin.Context) {
|
|
|
// @Tags 音频
|
|
// @Tags 音频
|
|
|
// @Summary 删除音频
|
|
// @Summary 删除音频
|
|
|
// @Produce application/json
|
|
// @Produce application/json
|
|
|
-// @Param object body request.ProcessAudio true "音频信息"
|
|
|
|
|
|
|
+// @Param object body request.ProcessAudio true "参数"
|
|
|
// @Success 200 {object} util.Response "成功"
|
|
// @Success 200 {object} util.Response "成功"
|
|
|
// @Router /api-sa/v1/audio/delete [post]
|
|
// @Router /api-sa/v1/audio/delete [post]
|
|
|
func (slf AudioCtl) Delete(c *gin.Context) {
|
|
func (slf AudioCtl) Delete(c *gin.Context) {
|
|
@@ -215,7 +216,7 @@ func (slf AudioCtl) Delete(c *gin.Context) {
|
|
|
// @Tags 音频
|
|
// @Tags 音频
|
|
|
// @Summary 批量删除音频
|
|
// @Summary 批量删除音频
|
|
|
// @Produce application/json
|
|
// @Produce application/json
|
|
|
-// @Param object body request.BatchProcessAudio true "音频信息"
|
|
|
|
|
|
|
+// @Param object body request.BatchProcessAudio true "参数"
|
|
|
// @Success 200 {object} util.Response "成功"
|
|
// @Success 200 {object} util.Response "成功"
|
|
|
// @Router /api-sa/v1/audio/batchDelete [post]
|
|
// @Router /api-sa/v1/audio/batchDelete [post]
|
|
|
func (slf AudioCtl) BatchDelete(c *gin.Context) {
|
|
func (slf AudioCtl) BatchDelete(c *gin.Context) {
|
|
@@ -233,3 +234,27 @@ func (slf AudioCtl) BatchDelete(c *gin.Context) {
|
|
|
|
|
|
|
|
util.ResponseFormat(c, code.DeleteSuccess, "成功")
|
|
util.ResponseFormat(c, code.DeleteSuccess, "成功")
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+// Follow
|
|
|
|
|
+// @Tags 音频
|
|
|
|
|
+// @Summary 关注/取消关注
|
|
|
|
|
+// @Produce application/json
|
|
|
|
|
+// @Param object body request.FollowReq true "参数"
|
|
|
|
|
+// @Success 200 {object} util.Response{data=response.FollowResp} "成功"
|
|
|
|
|
+// @Router /api-sa/v1/audio/follow [post]
|
|
|
|
|
+func (slf AudioCtl) Follow(c *gin.Context) {
|
|
|
|
|
+ var params request.ProcessAudio
|
|
|
|
|
+ if err := c.ShouldBind(¶ms); err != nil {
|
|
|
|
|
+ util.ResponseFormat(c, code.RequestParamError, err.Error())
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ followStatus, err := service.Follow(params.ID)
|
|
|
|
|
+ if err != nil {
|
|
|
|
|
+ util.ResponseFormat(c, code.InternalError, err.Error())
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ resp := response.FollowResp{FollowStatus: followStatus}
|
|
|
|
|
+
|
|
|
|
|
+ util.ResponseFormat(c, code.UpdateSuccess, resp)
|
|
|
|
|
+}
|