Prechádzať zdrojové kódy

feat:修改协议文件

wangchuanjin 3 rokov pred
rodič
commit
7153fe9882

+ 11 - 11
api/internal/logic/surplusdetaillogic.go

@@ -27,25 +27,25 @@ func NewSurplusDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Sur
 //资源剩余详情
 func (l *SurplusDetailLogic) SurplusDetail(req *types.SurplusReq) (resp *types.Reply, err error) {
 	resp = &types.Reply{}
-	if req.Appid == "" {
-		resp.Err_msg = "无效的参数appid"
-		l.Error(fmt.Sprintf("%+v", req), resp.Err_msg)
+	if req.AppId == "" {
+		resp.Error_msg = "无效的参数appid"
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
 		return resp, nil
 	} else if req.Function_code == "" {
-		resp.Err_msg = "无效的参数function_code"
-		l.Error(fmt.Sprintf("%+v", req), resp.Err_msg)
+		resp.Error_msg = "无效的参数function_code"
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
 		return resp, nil
 	} else if req.User_id == 0 && req.Ent_id == 0 && req.Ent_user_id == 0 {
-		resp.Err_msg = "无效的参数user_id、ent_id、ent_user_id"
-		l.Error(fmt.Sprintf("%+v", req), resp.Err_msg)
+		resp.Error_msg = "无效的参数user_id、ent_id、ent_user_id"
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
 		return resp, nil
 	}
-	status, total, surplus, err := Surplus(req.Appid, req.Function_code, req.User_id, req.Ent_id, req.Ent_user_id)
+	status, total, surplus, err := Surplus(req.AppId, req.Function_code, req.User_id, req.Ent_id, req.Ent_user_id)
 	if err != nil {
-		resp.Err_msg = err.Error()
-		l.Error(fmt.Sprintf("%+v", req), resp.Err_msg)
+		resp.Error_msg = err.Error()
+		l.Error(fmt.Sprintf("%+v", req), resp.Error_msg)
 	}
-	resp.Err_code = status
+	resp.Error_code = status
 	resp.Data = &types.SurplusData{
 		Total:   total,
 		Surplus: surplus,

+ 4 - 4
api/internal/types/types.go

@@ -2,7 +2,7 @@
 package types
 
 type SurplusReq struct {
-	Appid         string `json:"appid,default=10000"`
+	AppId         string `json:"appId,default=10000"`
 	Function_code string `json:"functionCode,default=xxfb_gyxx_add"`
 	Muser_id      string `json:"userId,optional"`
 	User_id       int64  `json:"newUserId,optional"`
@@ -11,9 +11,9 @@ type SurplusReq struct {
 }
 
 type Reply struct {
-	Err_code int64       `json:"err_code"`
-	Err_msg  string      `json:"err_msg"`
-	Data     interface{} `json:"data"`
+	Error_code int64       `json:"error_code"`
+	Error_msg  string      `json:"error_msg"`
+	Data       interface{} `json:"data"`
 }
 
 type SurplusData struct {

+ 4 - 4
api/resource.api

@@ -8,7 +8,7 @@ info(
 
 type (
 	surplusReq {
-		Appid         string `json:"appid,default=10000"`
+		AppId         string `json:"appId,default=10000"`
 		Function_code string `json:"functionCode,default=xxfb_gyxx_add"`
 		Muser_id      string `json:"userId,optional"`
 		User_id       int64  `json:"newUserId,optional"`
@@ -17,9 +17,9 @@ type (
 	}
 
 	Reply {
-		Err_code int64       `json:"err_code"`
-		Err_msg  string      `json:"err_msg"`
-		Data     interface{} `json:"data"`
+		Error_code int64       `json:"error_code"`
+		Error_msg  string      `json:"error_msg"`
+		Data       interface{} `json:"data"`
 	}
 
 	surplusData {