Sfoglia il codice sorgente

培训视频管理

xyxie 1 mese fa
parent
commit
172d9c6ec2
2 ha cambiato i file con 191 aggiunte e 0 eliminazioni
  1. 56 0
      controllers/resource.go
  2. 135 0
      routers/commentsRouter.go

+ 56 - 0
controllers/resource.go

@@ -109,3 +109,59 @@ func (this *ResourceController) ImageUpload() {
 	br.Data = resp
 	return
 }
+
+// @Title 获取STSToken
+// @Description 获取STSToken
+// @Success 200 获取成功
+// @router /oss/get_sts_token [get]
+func (this *ResourceController) OssSTSToken() {
+	br := new(models.BaseResponse).Init()
+	defer func() {
+		this.Data["json"] = br
+		this.ServeJSON()
+	}()
+
+	ossClient := services.NewOssClient()
+	if ossClient == nil {
+		br.Msg = "上传失败"
+		br.ErrMsg = "初始化OSS服务失败"
+		return
+	}
+	resp, e := ossClient.GetUploadToken()
+	if e != nil {
+		br.Msg = "获取失败"
+		br.ErrMsg = "获取OSS上传Token失败, Err: " + e.Error()
+		return
+	}
+
+	br.Data = resp
+	br.Msg = "获取成功"
+	br.Ret = 200
+	br.Success = true
+
+	//source, _ := this.GetInt("StorageSource")
+	//
+	//if source == utils.STORAGESOURCE_OSS {
+	//	resp, err := services.GetOssSTSToken()
+	//	if err != nil {
+	//		br.Msg = "获取失败"
+	//		br.ErrMsg = "获取STSToken失败, Err: " + err.Error()
+	//		return
+	//	}
+	//	br.Data = resp
+	//	br.Msg = "获取成功"
+	//	br.Ret = 200
+	//	br.Success = true
+	//} else if source == utils.STORAGESOURCE_MINIO {
+	//	resp, err := services.GetMinIOSTSToken()
+	//	if err != nil {
+	//		br.Msg = "获取失败"
+	//		br.ErrMsg = "获取STSToken失败, Err: " + err.Error()
+	//		return
+	//	}
+	//	br.Data = resp
+	//	br.Msg = "获取成功"
+	//	br.Ret = 200
+	//	br.Success = true
+	//}
+}

+ 135 - 0
routers/commentsRouter.go

@@ -295,6 +295,132 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoClassifyController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoClassifyController"],
+        beego.ControllerComments{
+            Method: "Add",
+            Router: `/classify/add`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoClassifyController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoClassifyController"],
+        beego.ControllerComments{
+            Method: "Edit",
+            Router: `/classify/edit`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoClassifyController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoClassifyController"],
+        beego.ControllerComments{
+            Method: "Remove",
+            Router: `/classify/remove`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoClassifyController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoClassifyController"],
+        beego.ControllerComments{
+            Method: "Tree",
+            Router: `/classify/tree`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoController"],
+        beego.ControllerComments{
+            Method: "Add",
+            Router: `/add`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoController"],
+        beego.ControllerComments{
+            Method: "Detail",
+            Router: `/detail`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoController"],
+        beego.ControllerComments{
+            Method: "Edit",
+            Router: `/edit`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoController"],
+        beego.ControllerComments{
+            Method: "PageList",
+            Router: `/page_list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoController"],
+        beego.ControllerComments{
+            Method: "Publish",
+            Router: `/publish`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoController"],
+        beego.ControllerComments{
+            Method: "Remove",
+            Router: `/remove`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoTagController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoTagController"],
+        beego.ControllerComments{
+            Method: "Add",
+            Router: `/tag/add`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoTagController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoTagController"],
+        beego.ControllerComments{
+            Method: "Edit",
+            Router: `/tag/edit`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoTagController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoTagController"],
+        beego.ControllerComments{
+            Method: "PageList",
+            Router: `/tag/page_list`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoTagController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/eta_training_video:EtaTrainingVideoTagController"],
+        beego.ControllerComments{
+            Method: "Remove",
+            Router: `/tag/remove`,
+            AllowHTTPMethods: []string{"post"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/help_doc:HelpDocClassifyController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers/help_doc:HelpDocClassifyController"],
         beego.ControllerComments{
             Method: "AddClassify",
@@ -808,6 +934,15 @@ func init() {
             Filters: nil,
             Params: nil})
 
+    beego.GlobalControllerRouter["eta/eta_forum_admin/controllers:ResourceController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers:ResourceController"],
+        beego.ControllerComments{
+            Method: "OssSTSToken",
+            Router: `/oss/get_sts_token`,
+            AllowHTTPMethods: []string{"get"},
+            MethodParams: param.Make(),
+            Filters: nil,
+            Params: nil})
+
     beego.GlobalControllerRouter["eta/eta_forum_admin/controllers:SysRoleController"] = append(beego.GlobalControllerRouter["eta/eta_forum_admin/controllers:SysRoleController"],
         beego.ControllerComments{
             Method: "SysMenuButtons",