Bläddra i källkod

Merge branch 'master' of https://app.yhyue.com:8443/moapp/jyResourcesCenter

WH01243 4 år sedan
förälder
incheckning
29f5b6bab8

+ 32 - 1
api/integral.api

@@ -39,11 +39,42 @@ type previewRes {
 	RepeatNumb    int64  `form:"repeatNumb"`
 	DeductionNumb int64  `form:"deductionNumb"`
 }
+
+//流水账请求参数返回参数
+type recordReq {
+	AccountId string `form:"accountId,optional"` //企业标识
+	UserId    string `form:"userId,optional"`    //用户标识
+	Page      int    `form:"page,optional"`
+	PageSize  int    `form:"pageSize,optional"`
+}
+
+type recordRes {
+	Code    int64  `json:"code"`
+	Message string `json:"message"`
+}
+
+//查询用户资源权限
+type authReq {
+	AccountId string `form:"accountId,optional"` //企业标识
+	UserId    string `form:"userId,optional"`    //用户标识
+}
+
+type authRes {
+	Code    int64  `json:"code"`
+	Message string `json:"message"`
+}
+
 service integral-api {
 	//资源操作
 	@handler UpdateUserBalanceHandler // TODO: set handler name and delete this comment
 	post /resources/updateUserBalance (resourcesReq) returns(resourcesRes)
 	//预览信息
 	@handler FindPreviewHandler // TODO: set handler name and delete this comment
-	post /resources/findPreview (previewReq) returns(previewRes)
+	post /findPreview (previewReq) returns(previewRes)
+	//流水账
+	@handler FindRecordHandler // TODO: set handler name and delete this comment
+	post /findRecord (recordReq) returns(recordRes)
+	//查询账户资源权限
+	@handler FindAuthHandler // TODO: set handler name and delete this comment
+	post /findAuth (authReq) returns(recordRes)
 }

+ 29 - 0
api/internal/handler/findauthhandler.go

@@ -0,0 +1,29 @@
+package handler
+
+import (
+	"net/http"
+
+	"app.yhyue.com/moapp/jyResourcesCenter/api/internal/logic"
+	"app.yhyue.com/moapp/jyResourcesCenter/api/internal/svc"
+	"app.yhyue.com/moapp/jyResourcesCenter/api/internal/types"
+
+	"github.com/tal-tech/go-zero/rest/httpx"
+)
+
+func FindAuthHandler(ctx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.AuthReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewFindAuthLogic(r.Context(), ctx)
+		resp, err := l.FindAuth(req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 29 - 0
api/internal/handler/findrecordhandler.go

@@ -0,0 +1,29 @@
+package handler
+
+import (
+	"net/http"
+
+	"app.yhyue.com/moapp/jyResourcesCenter/api/internal/logic"
+	"app.yhyue.com/moapp/jyResourcesCenter/api/internal/svc"
+	"app.yhyue.com/moapp/jyResourcesCenter/api/internal/types"
+
+	"github.com/tal-tech/go-zero/rest/httpx"
+)
+
+func FindRecordHandler(ctx *svc.ServiceContext) http.HandlerFunc {
+	return func(w http.ResponseWriter, r *http.Request) {
+		var req types.RecordReq
+		if err := httpx.Parse(r, &req); err != nil {
+			httpx.Error(w, err)
+			return
+		}
+
+		l := logic.NewFindRecordLogic(r.Context(), ctx)
+		resp, err := l.FindRecord(req)
+		if err != nil {
+			httpx.Error(w, err)
+		} else {
+			httpx.OkJson(w, resp)
+		}
+	}
+}

+ 10 - 0
api/internal/handler/routes.go

@@ -22,6 +22,16 @@ func RegisterHandlers(engine *rest.Server, serverCtx *svc.ServiceContext) {
 				Path:    "/resources/findPreview",
 				Handler: FindPreviewHandler(serverCtx),
 			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/findRecord",
+				Handler: FindRecordHandler(serverCtx),
+			},
+			{
+				Method:  http.MethodPost,
+				Path:    "/findAuth",
+				Handler: FindAuthHandler(serverCtx),
+			},
 		},
 	)
 }

+ 30 - 0
api/internal/logic/findauthlogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"app.yhyue.com/moapp/jyResourcesCenter/api/internal/svc"
+	"app.yhyue.com/moapp/jyResourcesCenter/api/internal/types"
+
+	"github.com/tal-tech/go-zero/core/logx"
+)
+
+type FindAuthLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewFindAuthLogic(ctx context.Context, svcCtx *svc.ServiceContext) FindAuthLogic {
+	return FindAuthLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *FindAuthLogic) FindAuth(req types.AuthReq) (*types.RecordRes, error) {
+	// todo: add your logic here and delete this line
+
+	return &types.RecordRes{}, nil
+}

+ 30 - 0
api/internal/logic/findrecordlogic.go

@@ -0,0 +1,30 @@
+package logic
+
+import (
+	"context"
+
+	"app.yhyue.com/moapp/jyResourcesCenter/api/internal/svc"
+	"app.yhyue.com/moapp/jyResourcesCenter/api/internal/types"
+
+	"github.com/tal-tech/go-zero/core/logx"
+)
+
+type FindRecordLogic struct {
+	logx.Logger
+	ctx    context.Context
+	svcCtx *svc.ServiceContext
+}
+
+func NewFindRecordLogic(ctx context.Context, svcCtx *svc.ServiceContext) FindRecordLogic {
+	return FindRecordLogic{
+		Logger: logx.WithContext(ctx),
+		ctx:    ctx,
+		svcCtx: svcCtx,
+	}
+}
+
+func (l *FindRecordLogic) FindRecord(req types.RecordReq) (*types.RecordRes, error) {
+	// todo: add your logic here and delete this line
+
+	return &types.RecordRes{}, nil
+}

+ 22 - 0
api/internal/types/types.go

@@ -39,3 +39,25 @@ type PreviewRes struct {
 	RepeatNumb    int64  `form:"repeatNumb"`
 	DeductionNumb int64  `form:"deductionNumb"`
 }
+
+type RecordReq struct {
+	AccountId string `form:"accountId,optional"` //企业标识
+	UserId    string `form:"userId,optional"`    //用户标识
+	Page      int    `form:"page,optional"`
+	PageSize  int    `form:"pageSize,optional"`
+}
+
+type RecordRes struct {
+	Code    int64  `json:"code"`
+	Message string `json:"message"`
+}
+
+type AuthReq struct {
+	AccountId string `form:"accountId,optional"` //企业标识
+	UserId    string `form:"userId,optional"`    //用户标识
+}
+
+type AuthRes struct {
+	Code    int64  `json:"code"`
+	Message string `json:"message"`
+}