This commit is contained in:
谢宇宁
2026-09-29 15:30:33 +07:00
parent 0fbdba5ccf
commit 9abe0b1b76
181 changed files with 608 additions and 18501 deletions
+23 -5
View File
@@ -1,7 +1,7 @@
package feedbackser
import (
"videoweb/app/service/authser"
"io"
"videoweb/app/service/upstream"
"github.com/gin-gonic/gin"
@@ -11,9 +11,11 @@ const addPath = "/api/app/feedback/add"
const contactUsAddPath = "/api/app/contactus/add"
const uploadPath = "/api/app/upload/image"
// Add 调用上游提交意见反馈。
func Add(c *gin.Context, req FeedbackReq) (*authser.APIEnvelope, error) {
var env authser.APIEnvelope
func Add(c *gin.Context, req FeedbackReq) (*APIEnvelope, error) {
var env APIEnvelope
if _, err := upstream.PostJSON(c, addPath, req, &env); err != nil {
return nil, err
}
@@ -21,10 +23,26 @@ func Add(c *gin.Context, req FeedbackReq) (*authser.APIEnvelope, error) {
}
// AddContactUs 调用上游联系我们接口。
func AddContactUs(c *gin.Context, req ContactUsAddReq) (*authser.APIEnvelope, error) {
var env authser.APIEnvelope
func AddContactUs(c *gin.Context, req ContactUsAddReq) (*APIEnvelope, error) {
var env APIEnvelope
if _, err := upstream.PostJSON(c, contactUsAddPath, req, &env); err != nil {
return nil, err
}
return &env, nil
}
// UploadImage 上传反馈截图;不加水印。
func UploadImage(c *gin.Context, fileName string, r io.Reader) (*ImageUploadResp, error) {
var resp ImageUploadResp
_, err := upstream.PostMultipart(c, uploadPath, map[string]string{
"watermark": "0",
}, &upstream.MultipartFile{
FieldName: "file",
FileName: fileName,
Reader: r,
}, &resp)
if err != nil {
return nil, err
}
return &resp, nil
}