Skip to content

Commit d772842

Browse files
committed
feat(feedback): switch GetFeedback to GET and update routes
1 parent 6c343f0 commit d772842

3 files changed

Lines changed: 6 additions & 8 deletions

File tree

api/rpc/oa.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package rpc
1818

1919
import (
2020
"context"
21+
"fmt"
2122

2223
"github.com/west2-online/fzuhelper-server/config"
2324
"github.com/west2-online/fzuhelper-server/kitex_gen/model"
@@ -45,7 +46,7 @@ func CreateFeedbackRPC(ctx context.Context, req *oa.CreateFeedbackRequest) error
4546
return errno.InternalServiceError.WithError(err)
4647
}
4748
if !utils.IsSuccess(resp.Base) {
48-
return errno.BizError.WithMessage("创建反馈表单失败:" + resp.Base.Msg)
49+
return errno.BizError.WithMessage(fmt.Sprintf("创建反馈表单失败:%s", resp.Base.Msg))
4950
}
5051
return nil
5152
}
@@ -57,7 +58,7 @@ func GetFeedbackRPC(ctx context.Context, req *oa.GetFeedbackRequest) (*model.Fee
5758
return nil, errno.InternalServiceError.WithError(err)
5859
}
5960
if !utils.IsSuccess(resp.Base) {
60-
return nil, errno.BizError.WithMessage("获取反馈表单失败:" + resp.Base.Msg)
61+
return nil, errno.BizError.WithMessage(fmt.Sprintf("创建反馈表单失败:%s", resp.Base.Msg))
6162
}
6263
return resp.Data, nil
6364
}

cmd/api/kitex_info.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

pkg/utils/json.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func JSONEncode(v interface{}) (string, error) {
3030
return string(data), nil
3131
}
3232

33-
// 确保传入字符串是“合法的 JSON”且用于表示“数组”场景
33+
// EnsureJSONArray 确保传入字符串是“合法的 JSON”且用于表示“数组”场景
3434
func EnsureJSONArray(s string) string {
3535
if s == "" {
3636
return "[]"
@@ -41,7 +41,7 @@ func EnsureJSONArray(s string) string {
4141
return "[]"
4242
}
4343

44-
// 确保传入字符串是“合法的 JSON”且用于表示“对象”场景
44+
// EnsureJSONObject 确保传入字符串是“合法的 JSON”且用于表示“对象”场景
4545
func EnsureJSONObject(s string) string {
4646
if s == "" {
4747
return "{}"
@@ -52,7 +52,7 @@ func EnsureJSONObject(s string) string {
5252
return "{}"
5353
}
5454

55-
// 确保传入字符串是“合法的 JSON”(不限定必须为数组或对象)
55+
// EnsureJSON 确保传入字符串是“合法的 JSON”(不限定必须为数组或对象)
5656
func EnsureJSON(s string) string {
5757
if s == "" {
5858
return "[]"

0 commit comments

Comments
 (0)