Bläddra i källkod

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

李哲 4 år sedan
förälder
incheckning
75349a086f
36 ändrade filer med 228 tillägg och 169 borttagningar
  1. 7 5
      api/integral.api
  2. 3 3
      api/integral.go
  3. 3 3
      api/internal/handler/integralbalancecheckhandler.go
  4. 3 3
      api/internal/handler/integralconsumehandler.go
  5. 3 3
      api/internal/handler/integraldetailedcheckhandler.go
  6. 3 3
      api/internal/handler/integralexpirecheckhandler.go
  7. 3 3
      api/internal/handler/integralguardhandler.go
  8. 3 3
      api/internal/handler/integralharvesthandler.go
  9. 1 1
      api/internal/handler/routes.go
  10. 3 3
      api/internal/logic/integralbalancechecklogic.go
  11. 3 3
      api/internal/logic/integralconsumelogic.go
  12. 6 4
      api/internal/logic/integraldetailedchecklogic.go
  13. 3 3
      api/internal/logic/integralexpirechecklogic.go
  14. 3 3
      api/internal/logic/integralguardlogic.go
  15. 3 4
      api/internal/logic/integralharvestlogic.go
  16. 2 2
      api/internal/svc/servicecontext.go
  17. 7 5
      api/internal/types/types.go
  18. 5 1
      entity/integral.go
  19. 5 2
      go.mod
  20. 17 0
      go.sum
  21. 1 1
      rpc/etc/integral.yaml
  22. 7 10
      rpc/integral.go
  23. 3 0
      rpc/integral.proto
  24. 79 58
      rpc/integral/integral.pb.go
  25. 1 1
      rpc/integralclient/integral.go
  26. 2 2
      rpc/internal/logic/integralbalancechecklogic.go
  27. 4 4
      rpc/internal/logic/integralconsumelogic.go
  28. 5 3
      rpc/internal/logic/integraldetailedchecklogic.go
  29. 3 3
      rpc/internal/logic/integralexpirechecklogic.go
  30. 3 3
      rpc/internal/logic/integralguardlogic.go
  31. 3 3
      rpc/internal/logic/integralharvestlogic.go
  32. 3 3
      rpc/internal/server/integralserver.go
  33. 1 1
      rpc/internal/svc/servicecontext.go
  34. 12 13
      rpc/test/consume_test.go
  35. 3 3
      rpc/test/test1_test.go
  36. 12 4
      service/integralService.go

+ 7 - 5
api/integral.api

@@ -2,11 +2,13 @@ syntax = "v1"
 //查询当月积分明细入参
 //查询当月积分明细入参
 type DetailedReq {
 type DetailedReq {
 	// TODO: add members here and delete this comment
 	// TODO: add members here and delete this comment
-	UserId   string `form:"userId"`
-	AppId    int64  `form:"appId"`
-	EndDate  string `form:"endDate"`
-	Page     int64  `form:"page"`
-	PageSize int64  `form:"pageSize"`
+	UserId     string `form:"userId"`
+	AppId      int64  `form:"appId"`
+	EndDate    string `form:"endDate"`
+	StartDate  string `form:"startDate"`
+	SearchType int64  `form:"searchType"`
+	Page       int64  `form:"page"`
+	PageSize   int64  `form:"pageSize"`
 }
 }
 
 
 //查询当月积分明细
 //查询当月积分明细

+ 3 - 3
api/integral.go

@@ -4,9 +4,9 @@ import (
 	"flag"
 	"flag"
 	"fmt"
 	"fmt"
 
 
-	"points_service/api/internal/config"
-	"points_service/api/internal/handler"
-	"points_service/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/config"
+	"app.yhyue.com/moapp/jyPoints/api/internal/handler"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
 
 
 	"github.com/tal-tech/go-zero/core/conf"
 	"github.com/tal-tech/go-zero/core/conf"
 	"github.com/tal-tech/go-zero/rest"
 	"github.com/tal-tech/go-zero/rest"

+ 3 - 3
api/internal/handler/integralbalancecheckhandler.go

@@ -3,9 +3,9 @@ package handler
 import (
 import (
 	"net/http"
 	"net/http"
 
 
-	"points_service/api/internal/logic"
-	"points_service/api/internal/svc"
-	"points_service/api/internal/types"
+	"app.yhyue.com/moapp/jyPoints/api/internal/logic"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/types"
 
 
 	"github.com/tal-tech/go-zero/rest/httpx"
 	"github.com/tal-tech/go-zero/rest/httpx"
 )
 )

+ 3 - 3
api/internal/handler/integralconsumehandler.go

@@ -3,9 +3,9 @@ package handler
 import (
 import (
 	"net/http"
 	"net/http"
 
 
-	"points_service/api/internal/logic"
-	"points_service/api/internal/svc"
-	"points_service/api/internal/types"
+	"app.yhyue.com/moapp/jyPoints/api/internal/logic"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/types"
 
 
 	"github.com/tal-tech/go-zero/rest/httpx"
 	"github.com/tal-tech/go-zero/rest/httpx"
 )
 )

+ 3 - 3
api/internal/handler/integraldetailedcheckhandler.go

@@ -3,9 +3,9 @@ package handler
 import (
 import (
 	"net/http"
 	"net/http"
 
 
-	"points_service/api/internal/logic"
-	"points_service/api/internal/svc"
-	"points_service/api/internal/types"
+	"app.yhyue.com/moapp/jyPoints/api/internal/logic"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/types"
 
 
 	"github.com/tal-tech/go-zero/rest/httpx"
 	"github.com/tal-tech/go-zero/rest/httpx"
 )
 )

+ 3 - 3
api/internal/handler/integralexpirecheckhandler.go

@@ -3,9 +3,9 @@ package handler
 import (
 import (
 	"net/http"
 	"net/http"
 
 
-	"points_service/api/internal/logic"
-	"points_service/api/internal/svc"
-	"points_service/api/internal/types"
+	"app.yhyue.com/moapp/jyPoints/api/internal/logic"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/types"
 
 
 	"github.com/tal-tech/go-zero/rest/httpx"
 	"github.com/tal-tech/go-zero/rest/httpx"
 )
 )

+ 3 - 3
api/internal/handler/integralguardhandler.go

@@ -3,9 +3,9 @@ package handler
 import (
 import (
 	"net/http"
 	"net/http"
 
 
-	"points_service/api/internal/logic"
-	"points_service/api/internal/svc"
-	"points_service/api/internal/types"
+	"app.yhyue.com/moapp/jyPoints/api/internal/logic"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/types"
 
 
 	"github.com/tal-tech/go-zero/rest/httpx"
 	"github.com/tal-tech/go-zero/rest/httpx"
 )
 )

+ 3 - 3
api/internal/handler/integralharvesthandler.go

@@ -3,9 +3,9 @@ package handler
 import (
 import (
 	"net/http"
 	"net/http"
 
 
-	"points_service/api/internal/logic"
-	"points_service/api/internal/svc"
-	"points_service/api/internal/types"
+	"app.yhyue.com/moapp/jyPoints/api/internal/logic"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/types"
 
 
 	"github.com/tal-tech/go-zero/rest/httpx"
 	"github.com/tal-tech/go-zero/rest/httpx"
 )
 )

+ 1 - 1
api/internal/handler/routes.go

@@ -4,7 +4,7 @@ package handler
 import (
 import (
 	"net/http"
 	"net/http"
 
 
-	"points_service/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
 
 
 	"github.com/tal-tech/go-zero/rest"
 	"github.com/tal-tech/go-zero/rest"
 )
 )

+ 3 - 3
api/internal/logic/integralbalancechecklogic.go

@@ -2,10 +2,10 @@ package logic
 
 
 import (
 import (
 	"context"
 	"context"
-	"points_service/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
 
 
-	"points_service/api/internal/svc"
-	"points_service/api/internal/types"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/types"
 
 
 	"github.com/tal-tech/go-zero/core/logx"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 )

+ 3 - 3
api/internal/logic/integralconsumelogic.go

@@ -2,10 +2,10 @@ package logic
 
 
 import (
 import (
 	"context"
 	"context"
-	"points_service/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
 
 
-	"points_service/api/internal/svc"
-	"points_service/api/internal/types"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/types"
 
 
 	"github.com/tal-tech/go-zero/core/logx"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 )

+ 6 - 4
api/internal/logic/integraldetailedchecklogic.go

@@ -2,10 +2,10 @@ package logic
 
 
 import (
 import (
 	"context"
 	"context"
-	"points_service/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
 
 
-	"points_service/api/internal/svc"
-	"points_service/api/internal/types"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/types"
 
 
 	"github.com/tal-tech/go-zero/core/logx"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 )
@@ -24,7 +24,7 @@ func NewIntegralDetailedCheckLogic(ctx context.Context, svcCtx *svc.ServiceConte
 	}
 	}
 }
 }
 
 
-//当月积分明细
+//按月查询积分明细
 func (l *IntegralDetailedCheckLogic) IntegralDetailedCheck(req types.DetailedReq) (*types.RespList, error) {
 func (l *IntegralDetailedCheckLogic) IntegralDetailedCheck(req types.DetailedReq) (*types.RespList, error) {
 	// todo: add your logic here and delete this line
 	// todo: add your logic here and delete this line
 	result := &types.RespList{}
 	result := &types.RespList{}
@@ -35,6 +35,8 @@ func (l *IntegralDetailedCheckLogic) IntegralDetailedCheck(req types.DetailedReq
 		PageSize: req.PageSize,
 		PageSize: req.PageSize,
 		Page:     req.Page,
 		Page:     req.Page,
 		EndDate:  req.EndDate,
 		EndDate:  req.EndDate,
+		StartDate:req.StartDate,
+		SearchType:req.SearchType,
 	})
 	})
 	if err != nil {
 	if err != nil {
 		return nil, err
 		return nil, err

+ 3 - 3
api/internal/logic/integralexpirechecklogic.go

@@ -2,10 +2,10 @@ package logic
 
 
 import (
 import (
 	"context"
 	"context"
-	"points_service/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
 
 
-	"points_service/api/internal/svc"
-	"points_service/api/internal/types"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/types"
 
 
 	"github.com/tal-tech/go-zero/core/logx"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 )

+ 3 - 3
api/internal/logic/integralguardlogic.go

@@ -2,10 +2,10 @@ package logic
 
 
 import (
 import (
 	"context"
 	"context"
-	"points_service/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
 
 
-	"points_service/api/internal/svc"
-	"points_service/api/internal/types"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/types"
 
 
 	"github.com/tal-tech/go-zero/core/logx"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 )

+ 3 - 4
api/internal/logic/integralharvestlogic.go

@@ -2,10 +2,9 @@ package logic
 
 
 import (
 import (
 	"context"
 	"context"
-	"points_service/rpc/integral"
-
-	"points_service/api/internal/svc"
-	"points_service/api/internal/types"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/api/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/api/internal/types"
 
 
 	"github.com/tal-tech/go-zero/core/logx"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 )

+ 2 - 2
api/internal/svc/servicecontext.go

@@ -2,8 +2,8 @@ package svc
 
 
 import (
 import (
 	"github.com/tal-tech/go-zero/zrpc"
 	"github.com/tal-tech/go-zero/zrpc"
-	"points_service/api/internal/config"
-	"points_service/rpc/integralclient"
+	"app.yhyue.com/moapp/jyPoints/api/internal/config"
+	"app.yhyue.com/moapp/jyPoints/rpc/integralclient"
 )
 )
 
 
 type ServiceContext struct {
 type ServiceContext struct {

+ 7 - 5
api/internal/types/types.go

@@ -2,11 +2,13 @@
 package types
 package types
 
 
 type DetailedReq struct {
 type DetailedReq struct {
-	UserId   string `form:"userId"`
-	AppId    int64  `form:"appId"`
-	EndDate  string `form:"endDate"`
-	Page     int64  `form:"page"`
-	PageSize int64  `form:"pageSize"`
+	UserId     string `form:"userId"`
+	AppId      int64  `form:"appId"`
+	EndDate    string `form:"endDate"`
+	StartDate  string `form:"startDate"`
+	SearchType int64  `form:"searchType"`
+	Page       int64  `form:"page"`
+	PageSize   int64  `form:"pageSize"`
 }
 }
 
 
 type RespList struct {
 type RespList struct {

+ 5 - 1
entity/integral.go

@@ -1,6 +1,8 @@
 package entity
 package entity
 
 
-import "github.com/go-xorm/xorm"
+import (
+	"github.com/go-xorm/xorm"
+)
 
 
 //定义orm引擎
 //定义orm引擎
 var Engine *xorm.Engine
 var Engine *xorm.Engine
@@ -80,11 +82,13 @@ type FlowJSON struct {
 	BusinessType   string `xorm:"businessType" form:"businessType" json:"businessType"`       //业务类型
 	BusinessType   string `xorm:"businessType" form:"businessType" json:"businessType"`       //业务类型
 	Point          int64  `xorm:"point" form:"point" json:"point"`                            //积分
 	Point          int64  `xorm:"point" form:"point" json:"point"`                            //积分
 	EndDate        string `xorm:"endDate" form:"endDate" json:"endDate"`                      //截止时间
 	EndDate        string `xorm:"endDate" form:"endDate" json:"endDate"`                      //截止时间
+	StartDate      string `xorm:"startDate" form:"startDate" json:"startDate"`                //开始时间
 	AppId          int64  `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
 	AppId          int64  `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
 	OperationType  bool   `xorm:"operationType" form:"operationType" json:"operationType"`    //永久:true、时效:false
 	OperationType  bool   `xorm:"operationType" form:"operationType" json:"operationType"`    //永久:true、时效:false
 	Sort           int64  `xorm:"sort" form:"sort" json:"sort"`                               //操作类型1加-1减
 	Sort           int64  `xorm:"sort" form:"sort" json:"sort"`                               //操作类型1加-1减
 	Page           int64  `xorm:"page" form:"page" json:"page"`                               //当前页数
 	Page           int64  `xorm:"page" form:"page" json:"page"`                               //当前页数
 	PageSize       int64  `xorm:"pageSize" form:"pageSize" json:"pageSize"`                   //每页数量
 	PageSize       int64  `xorm:"pageSize" form:"pageSize" json:"pageSize"`                   //每页数量
+	SearchType     int64  `xorm:"searchType" form:"searchType" json:"searchType"`             //searchType 0全部 1新增 -1消耗
 }
 }
 
 
 //到期积分查询
 //到期积分查询

+ 5 - 2
go.mod

@@ -1,12 +1,15 @@
-module points_service
+module app.yhyue.com/moapp/jyPoints
 
 
 go 1.13
 go 1.13
 
 
 require (
 require (
+	github.com/antlr/antlr4 v0.0.0-20210311224141-c2f104cd0810 // indirect
 	github.com/go-sql-driver/mysql v1.5.0
 	github.com/go-sql-driver/mysql v1.5.0
 	github.com/go-xorm/xorm v0.7.9
 	github.com/go-xorm/xorm v0.7.9
-	github.com/golang/protobuf v1.4.2
+	github.com/golang/protobuf v1.4.3
+	github.com/iancoleman/strcase v0.1.3 // indirect
 	github.com/tal-tech/go-zero v1.1.5
 	github.com/tal-tech/go-zero v1.1.5
+	go.uber.org/automaxprocs v1.4.0 // indirect
 	google.golang.org/grpc v1.29.1
 	google.golang.org/grpc v1.29.1
 	google.golang.org/protobuf v1.25.0
 	google.golang.org/protobuf v1.25.0
 
 

+ 17 - 0
go.sum

@@ -18,7 +18,10 @@ github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGn
 github.com/alicebob/miniredis/v2 v2.14.1 h1:GjlbSeoJ24bzdLRs13HoMEeaRZx9kg5nHoRW7QV/nCs=
 github.com/alicebob/miniredis/v2 v2.14.1 h1:GjlbSeoJ24bzdLRs13HoMEeaRZx9kg5nHoRW7QV/nCs=
 github.com/alicebob/miniredis/v2 v2.14.1/go.mod h1:uS970Sw5Gs9/iK3yBg0l9Uj9s25wXxSpQUE9EaJ/Blg=
 github.com/alicebob/miniredis/v2 v2.14.1/go.mod h1:uS970Sw5Gs9/iK3yBg0l9Uj9s25wXxSpQUE9EaJ/Blg=
 github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
 github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q=
+github.com/antlr/antlr4 v0.0.0-20210105212045-464bcbc32de2 h1:rL2miklL5rhxUaZO7hntBcy/VHaiyuPQ4EJoy/NMwaM=
 github.com/antlr/antlr4 v0.0.0-20210105212045-464bcbc32de2/go.mod h1:T7PbCXFs94rrTttyxjbyT5+/1V8T2TYDejxUfHJjw1Y=
 github.com/antlr/antlr4 v0.0.0-20210105212045-464bcbc32de2/go.mod h1:T7PbCXFs94rrTttyxjbyT5+/1V8T2TYDejxUfHJjw1Y=
+github.com/antlr/antlr4 v0.0.0-20210311224141-c2f104cd0810 h1:iMdMSccAX8Q3nt1yKAbtbKYL0gPO7jpnxEPefGujrO4=
+github.com/antlr/antlr4 v0.0.0-20210311224141-c2f104cd0810/go.mod h1:T7PbCXFs94rrTttyxjbyT5+/1V8T2TYDejxUfHJjw1Y=
 github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
 github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
 github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
 github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8=
@@ -43,6 +46,7 @@ github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3Ee
 github.com/coreos/go-systemd/v22 v22.0.0 h1:XJIw/+VlJ+87J+doOxznsAWIdmWuViOVhkQamW5YV28=
 github.com/coreos/go-systemd/v22 v22.0.0 h1:XJIw/+VlJ+87J+doOxznsAWIdmWuViOVhkQamW5YV28=
 github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
 github.com/coreos/go-systemd/v22 v22.0.0/go.mod h1:xO0FLkIi5MaZafQlIrOotqXZ90ih+1atmu1JpKERPPk=
 github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
 github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
+github.com/cpuguy83/go-md2man/v2 v2.0.0 h1:EoUDS0afbrsXAZ9YQ9jdu/mZ2sXgT1/2yyNng4PGlyM=
 github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
 github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU=
 github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
 github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
@@ -57,6 +61,7 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb
 github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
 github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
 github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
 github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
 github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
+github.com/emicklei/proto v1.9.0 h1:l0QiNT6Qs7Yj0Mb4X6dnWBQer4ebei2BFcgQLbGqUDc=
 github.com/emicklei/proto v1.9.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
 github.com/emicklei/proto v1.9.0/go.mod h1:rn1FgRS/FANiZdD2djyH7TMA9jdRDcYQ9IEN9yvjX0A=
 github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
 github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
@@ -64,6 +69,7 @@ github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1m
 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
 github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
 github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
 github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU=
+github.com/fatih/structtag v1.2.0 h1:/OdNE99OxoI/PqaW/SuSK9uxxT3f/tcSZgon/ssNSx4=
 github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
 github.com/fatih/structtag v1.2.0/go.mod h1:mBJUNpUnHmRKrKlQQlmCrh5PuhftFbNv8Ys4/aAZl94=
 github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o=
 github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o=
 github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
 github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
@@ -115,6 +121,8 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq
 github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
 github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
 github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
 github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
 github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
+github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM=
+github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
 github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
 github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
 github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
 github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
 github.com/google/btree v1.0.0 h1:0udJVsspx3VBr5FwtLhQQtuAsVc79tTq0ocGIPAU6qo=
@@ -150,7 +158,10 @@ github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplb
 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
 github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
 github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/iancoleman/strcase v0.1.2 h1:gnomlvw9tnV3ITTAxzKSgTF+8kFWcU/f+TgttpXGz1U=
 github.com/iancoleman/strcase v0.1.2/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
 github.com/iancoleman/strcase v0.1.2/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
+github.com/iancoleman/strcase v0.1.3 h1:dJBk1m2/qjL1twPLf68JND55vvivMupZ4wIzE8CTdBw=
+github.com/iancoleman/strcase v0.1.3/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE=
 github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
 github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
 github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ=
 github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ=
 github.com/jackc/pgx v3.6.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I=
 github.com/jackc/pgx v3.6.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I=
@@ -181,6 +192,7 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
 github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU=
 github.com/lib/pq v1.3.0 h1:/qkRGz8zljWiDcFvgpwUpwIAPu3r07TDvs3Rws+o/pU=
 github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
 github.com/lib/pq v1.3.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
+github.com/logrusorgru/aurora v2.0.3+incompatible h1:tOpm7WcpBTn4fjmVfgpQq0EfczGlG91VSDkswnjF5A8=
 github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
 github.com/logrusorgru/aurora v2.0.3+incompatible/go.mod h1:7rIyQOR62GCctdiQpZ/zOJlFyk6y+94wXzv6RNZgaR4=
 github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
 github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
 github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
 github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE=
@@ -248,6 +260,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So
 github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
 github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
+github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf35Ld67mk=
 github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
 github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
 github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
 github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
 github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=
@@ -274,9 +287,11 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20170815181823-89b8d40f7ca8/go.mod h1
 github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6 h1:lYIiVDtZnyTWlNwiAxLj0bbpTcx1BWCFhXjfsvmPdNc=
 github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6 h1:lYIiVDtZnyTWlNwiAxLj0bbpTcx1BWCFhXjfsvmPdNc=
 github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
 github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
 github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
 github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA=
+github.com/urfave/cli v1.22.5 h1:lNq9sAHXK2qfdI8W+GRItjCEkI+2oR4d+MEHy1CKXoU=
 github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
 github.com/urfave/cli v1.22.5/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8=
 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
 github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
+github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2 h1:zzrxE1FKn5ryBNl9eKOeqQ58Y/Qpo3Q9QNxKHX5uzzQ=
 github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY=
 github.com/xwb1989/sqlparser v0.0.0-20180606152119-120387863bf2/go.mod h1:hzfGeIUDq/j97IG+FhNqkowIyEcD88LrW6fyU3K3WqY=
 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
 github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0=
 github.com/yuin/gopher-lua v0.0.0-20191220021717-ab39c6098bdb h1:ZkM6LRnq40pR1Ox0hTHlnpkcOTuFIDQpZ1IN8rKKhX0=
@@ -292,6 +307,8 @@ go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
 go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
 go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
 go.uber.org/automaxprocs v1.3.0 h1:II28aZoGdaglS5vVNnspf28lnZpXScxtIozx1lAjdb0=
 go.uber.org/automaxprocs v1.3.0 h1:II28aZoGdaglS5vVNnspf28lnZpXScxtIozx1lAjdb0=
 go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA=
 go.uber.org/automaxprocs v1.3.0/go.mod h1:9CWT6lKIep8U41DDaPiH6eFscnTyjfTANNQNx6LrIcA=
+go.uber.org/automaxprocs v1.4.0 h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0=
+go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q=
 go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
 go.uber.org/multierr v1.5.0 h1:KCa4XfM8CWFCpxXRGok+Q0SS/0XBhMDbHHGABQLvD2A=
 go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
 go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU=
 go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=
 go.uber.org/tools v0.0.0-20190618225709-2cfd321de3ee h1:0mgffUl7nfd+FpvXMVz4IDEaUSmT1ysygQC7qYo7sG4=

+ 1 - 1
rpc/etc/integral.yaml

@@ -4,7 +4,7 @@ Etcd:
   Hosts:
   Hosts:
     - 127.0.0.1:2379
     - 127.0.0.1:2379
   Key: integral.rpc
   Key: integral.rpc
-DataSource: root:root@tcp(127.0.0.1:3306)/jyintegral?charset=utf8
+DataSource: admin:123456@tcp(192.168.3.14:3306)/jyintegral?charset=utf8
 Cache:
 Cache:
   - Host: localhost:6379
   - Host: localhost:6379
 FileSystemConf:
 FileSystemConf:

+ 7 - 10
rpc/integral.go

@@ -1,21 +1,20 @@
 package main
 package main
 
 
 import (
 import (
+	"app.yhyue.com/moapp/jyPoints/entity"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/config"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/server"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/service"
 	"flag"
 	"flag"
 	"fmt"
 	"fmt"
 	_ "github.com/go-sql-driver/mysql"
 	_ "github.com/go-sql-driver/mysql"
 	"github.com/go-xorm/xorm"
 	"github.com/go-xorm/xorm"
-	"log"
-	"points_service/entity"
-	"points_service/service"
-	"points_service/rpc/integral"
-	"points_service/rpc/internal/config"
-	"points_service/rpc/internal/server"
-	"points_service/rpc/internal/svc"
-
 	"github.com/tal-tech/go-zero/core/conf"
 	"github.com/tal-tech/go-zero/core/conf"
 	"github.com/tal-tech/go-zero/zrpc"
 	"github.com/tal-tech/go-zero/zrpc"
 	"google.golang.org/grpc"
 	"google.golang.org/grpc"
+	"log"
 )
 )
 
 
 var configFile = flag.String("f", "etc/integral.yaml", "the config file")
 var configFile = flag.String("f", "etc/integral.yaml", "the config file")
@@ -29,12 +28,10 @@ func main() {
 	conf.MustLoad(*configFile, &c)
 	conf.MustLoad(*configFile, &c)
 	ctx := svc.NewServiceContext(c)
 	ctx := svc.NewServiceContext(c)
 	srv := server.NewIntegralServer(ctx)
 	srv := server.NewIntegralServer(ctx)
-
 	s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
 	s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
 		integral.RegisterIntegralServer(grpcServer, srv)
 		integral.RegisterIntegralServer(grpcServer, srv)
 	})
 	})
 	defer s.Stop()
 	defer s.Stop()
-
 	fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)
 	fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)
 	s.Start()
 	s.Start()
 }
 }

+ 3 - 0
rpc/integral.proto

@@ -13,6 +13,9 @@ message Req {
   int64 page = 8;
   int64 page = 8;
   int64 pageSize = 9;
   int64 pageSize = 9;
   bool operationType = 10;
   bool operationType = 10;
+  int64 SearchType=11;
+  string startDate = 12;
+
 }
 }
 
 
 message Resp {
 message Resp {

+ 79 - 58
rpc/integral/integral.pb.go

@@ -1,21 +1,21 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
 // versions:
 // 	protoc-gen-go v1.25.0
 // 	protoc-gen-go v1.25.0
-// 	protoc        v3.15.3
+// 	protoc        v3.15.1
 // source: integral.proto
 // source: integral.proto
 
 
 package integral
 package integral
 
 
 import (
 import (
-	"context"
-	"github.com/golang/protobuf/proto"
-	"google.golang.org/grpc"
-	"google.golang.org/grpc/codes"
-	"google.golang.org/grpc/status"
-	"google.golang.org/protobuf/reflect/protoreflect"
-	"google.golang.org/protobuf/runtime/protoimpl"
-	"reflect"
-	"sync"
+	context "context"
+	proto "github.com/golang/protobuf/proto"
+	grpc "google.golang.org/grpc"
+	codes "google.golang.org/grpc/codes"
+	status "google.golang.org/grpc/status"
+	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+	reflect "reflect"
+	sync "sync"
 )
 )
 
 
 const (
 const (
@@ -44,6 +44,8 @@ type Req struct {
 	Page           int64  `protobuf:"varint,8,opt,name=page,proto3" json:"page,omitempty"`
 	Page           int64  `protobuf:"varint,8,opt,name=page,proto3" json:"page,omitempty"`
 	PageSize       int64  `protobuf:"varint,9,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
 	PageSize       int64  `protobuf:"varint,9,opt,name=pageSize,proto3" json:"pageSize,omitempty"`
 	OperationType  bool   `protobuf:"varint,10,opt,name=operationType,proto3" json:"operationType,omitempty"`
 	OperationType  bool   `protobuf:"varint,10,opt,name=operationType,proto3" json:"operationType,omitempty"`
+	SearchType     int64  `protobuf:"varint,11,opt,name=SearchType,proto3" json:"SearchType,omitempty"`
+	StartDate      string `protobuf:"bytes,12,opt,name=startDate,proto3" json:"startDate,omitempty"`
 }
 }
 
 
 func (x *Req) Reset() {
 func (x *Req) Reset() {
@@ -148,6 +150,20 @@ func (x *Req) GetOperationType() bool {
 	return false
 	return false
 }
 }
 
 
+func (x *Req) GetSearchType() int64 {
+	if x != nil {
+		return x.SearchType
+	}
+	return 0
+}
+
+func (x *Req) GetStartDate() string {
+	if x != nil {
+		return x.StartDate
+	}
+	return ""
+}
+
 type Resp struct {
 type Resp struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
@@ -286,6 +302,7 @@ type Point struct {
 	state         protoimpl.MessageState
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 	unknownFields protoimpl.UnknownFields
+
 	Id             int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
 	Id             int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
 	UserId         string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"`
 	UserId         string `protobuf:"bytes,2,opt,name=userId,proto3" json:"userId,omitempty"`
 	PointType      int64  `protobuf:"varint,3,opt,name=pointType,proto3" json:"pointType,omitempty"`
 	PointType      int64  `protobuf:"varint,3,opt,name=pointType,proto3" json:"pointType,omitempty"`
@@ -412,7 +429,7 @@ var File_integral_proto protoreflect.FileDescriptor
 
 
 var file_integral_proto_rawDesc = []byte{
 var file_integral_proto_rawDesc = []byte{
 	0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
 	0x0a, 0x0e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
-	0x12, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x22, 0xa3, 0x02, 0x0a, 0x03, 0x52,
+	0x12, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x22, 0xe1, 0x02, 0x0a, 0x03, 0x52,
 	0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
 	0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
 	0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70,
 	0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70,
 	0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64,
 	0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64,
@@ -431,58 +448,62 @@ var file_integral_proto_rawDesc = []byte{
 	0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6f, 0x70,
 	0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12, 0x24, 0x0a, 0x0d, 0x6f, 0x70,
 	0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28,
 	0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28,
 	0x08, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65,
 	0x08, 0x52, 0x0d, 0x6f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x79, 0x70, 0x65,
-	0x22, 0x48, 0x0a, 0x04, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65,
-	0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07,
-	0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d,
-	0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x73, 0x0a, 0x08, 0x52, 0x65,
-	0x73, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01,
+	0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65, 0x18, 0x0b,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, 0x79, 0x70, 0x65,
+	0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, 0x18, 0x0c, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x44, 0x61, 0x74, 0x65, 0x22, 0x48,
+	0x0a, 0x04, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01,
 	0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65,
 	0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65,
 	0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73,
 	0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73,
-	0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61,
-	0x74, 0x61, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67,
-	0x72, 0x61, 0x6c, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22,
-	0xa7, 0x02, 0x0a, 0x05, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18,
-	0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65,
-	0x72, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
-	0x64, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12,
-	0x26, 0x0a, 0x0e, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x49,
-	0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73,
-	0x73, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x75, 0x73, 0x69, 0x6e,
-	0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62,
-	0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70,
-	0x6f, 0x69, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x6f, 0x69, 0x6e,
-	0x74, 0x12, 0x1e, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18,
-	0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d,
-	0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61,
-	0x70, 0x70, 0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49,
-	0x64, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0xc7, 0x02, 0x0a, 0x08, 0x49, 0x6e,
-	0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x12, 0x30, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72,
-	0x61, 0x6c, 0x48, 0x61, 0x72, 0x76, 0x65, 0x73, 0x74, 0x12, 0x0d, 0x2e, 0x69, 0x6e, 0x74, 0x65,
+	0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x73, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x70,
+	0x4c, 0x69, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73,
+	0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
+	0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
+	0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61,
+	0x6c, 0x2e, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0xa7, 0x02,
+	0x0a, 0x05, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
+	0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12,
+	0x1c, 0x0a, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x26, 0x0a,
+	0x0e, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x49, 0x64, 0x18,
+	0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0e, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73, 0x73, 0x54,
+	0x79, 0x70, 0x65, 0x49, 0x64, 0x12, 0x22, 0x0a, 0x0c, 0x62, 0x75, 0x73, 0x69, 0x6e, 0x65, 0x73,
+	0x73, 0x54, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x62, 0x75, 0x73,
+	0x69, 0x6e, 0x65, 0x73, 0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x69,
+	0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12,
+	0x1e, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x07, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x12,
+	0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70,
+	0x49, 0x64, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x12,
+	0x12, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x53,
+	0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x32, 0xc7, 0x02, 0x0a, 0x08, 0x49, 0x6e, 0x74, 0x65,
+	0x67, 0x72, 0x61, 0x6c, 0x12, 0x30, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c,
+	0x48, 0x61, 0x72, 0x76, 0x65, 0x73, 0x74, 0x12, 0x0d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72,
+	0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61,
+	0x6c, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72,
+	0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x0d, 0x2e, 0x69, 0x6e, 0x74, 0x65,
 	0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67,
 	0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67,
-	0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65,
-	0x67, 0x72, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x0d, 0x2e, 0x69, 0x6e,
-	0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x69, 0x6e, 0x74,
-	0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x35, 0x0a, 0x14, 0x69, 0x6e,
-	0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65,
+	0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x35, 0x0a, 0x14, 0x69, 0x6e, 0x74, 0x65,
+	0x67, 0x72, 0x61, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b,
+	0x12, 0x0d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x1a,
+	0x0e, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x3a, 0x0a, 0x15, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x44, 0x65, 0x74, 0x61, 0x69,
+	0x6c, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x0d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67,
+	0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72,
+	0x61, 0x6c, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x0d, 0x69,
+	0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x47, 0x75, 0x61, 0x72, 0x64, 0x12, 0x0d, 0x2e, 0x69,
+	0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x69, 0x6e,
+	0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x13, 0x69,
+	0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x43, 0x68, 0x65,
 	0x63, 0x6b, 0x12, 0x0d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65,
 	0x63, 0x6b, 0x12, 0x0d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65,
 	0x71, 0x1a, 0x0e, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x73,
 	0x71, 0x1a, 0x0e, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x73,
-	0x70, 0x12, 0x3a, 0x0a, 0x15, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x44, 0x65, 0x74,
-	0x61, 0x69, 0x6c, 0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x0d, 0x2e, 0x69, 0x6e, 0x74,
-	0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x69, 0x6e, 0x74, 0x65,
-	0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x2e, 0x0a,
-	0x0d, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x47, 0x75, 0x61, 0x72, 0x64, 0x12, 0x0d,
-	0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e,
-	0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a,
-	0x13, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x43,
-	0x68, 0x65, 0x63, 0x6b, 0x12, 0x0d, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e,
-	0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52,
-	0x65, 0x73, 0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
 }
 }
 
 
 var (
 var (

+ 1 - 1
rpc/integralclient/integral.go

@@ -8,7 +8,7 @@ package integralclient
 import (
 import (
 	"context"
 	"context"
 
 
-	"points_service/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
 
 
 	"github.com/tal-tech/go-zero/zrpc"
 	"github.com/tal-tech/go-zero/zrpc"
 )
 )

+ 2 - 2
rpc/internal/logic/integralbalancechecklogic.go

@@ -2,8 +2,8 @@ package logic
 
 
 import (
 import (
 	"context"
 	"context"
-	"points_service/rpc/integral"
-	"points_service/rpc/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/svc"
 
 
 	"github.com/tal-tech/go-zero/core/logx"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 )

+ 4 - 4
rpc/internal/logic/integralconsumelogic.go

@@ -2,11 +2,11 @@ package logic
 
 
 import (
 import (
 	"context"
 	"context"
-	"points_service/entity"
-	"points_service/service"
+	"app.yhyue.com/moapp/jyPoints/entity"
+	"app.yhyue.com/moapp/jyPoints/service"
 
 
-	"points_service/rpc/integral"
-	"points_service/rpc/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/svc"
 
 
 	"github.com/tal-tech/go-zero/core/logx"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 )

+ 5 - 3
rpc/internal/logic/integraldetailedchecklogic.go

@@ -3,10 +3,10 @@ package logic
 import (
 import (
 	"context"
 	"context"
 	"fmt"
 	"fmt"
-	"points_service/entity"
+	"app.yhyue.com/moapp/jyPoints/entity"
 
 
-	"points_service/rpc/integral"
-	"points_service/rpc/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/svc"
 
 
 	"github.com/tal-tech/go-zero/core/logx"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 )
@@ -35,6 +35,8 @@ func (l *IntegralDetailedCheckLogic) IntegralDetailedCheck(in *integral.Req) (*i
 	dat.Page = in.Page
 	dat.Page = in.Page
 	dat.PageSize = in.PageSize
 	dat.PageSize = in.PageSize
 	dat.UserId=in.UserId
 	dat.UserId=in.UserId
+	dat.SearchType=in.SearchType
+	dat.StartDate=in.StartDate
 	data, count := integralService.IntegralDetailedCheck(dat)
 	data, count := integralService.IntegralDetailedCheck(dat)
 	fmt.Println(count, data)
 	fmt.Println(count, data)
 	result.Code = entity.SuccessCode
 	result.Code = entity.SuccessCode

+ 3 - 3
rpc/internal/logic/integralexpirechecklogic.go

@@ -2,10 +2,10 @@ package logic
 
 
 import (
 import (
 	"context"
 	"context"
-	"points_service/entity"
+	"app.yhyue.com/moapp/jyPoints/entity"
 
 
-	"points_service/rpc/integral"
-	"points_service/rpc/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/svc"
 
 
 	"github.com/tal-tech/go-zero/core/logx"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 )

+ 3 - 3
rpc/internal/logic/integralguardlogic.go

@@ -2,10 +2,10 @@ package logic
 
 
 import (
 import (
 	"context"
 	"context"
-	"points_service/entity"
+	"app.yhyue.com/moapp/jyPoints/entity"
 
 
-	"points_service/rpc/integral"
-	"points_service/rpc/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/svc"
 
 
 	"github.com/tal-tech/go-zero/core/logx"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 )

+ 3 - 3
rpc/internal/logic/integralharvestlogic.go

@@ -3,9 +3,9 @@ package logic
 import (
 import (
 	"context"
 	"context"
 	"fmt"
 	"fmt"
-	"points_service/entity"
-	"points_service/rpc/integral"
-	"points_service/rpc/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/entity"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/svc"
 
 
 	"github.com/tal-tech/go-zero/core/logx"
 	"github.com/tal-tech/go-zero/core/logx"
 )
 )

+ 3 - 3
rpc/internal/server/integralserver.go

@@ -6,9 +6,9 @@ package server
 import (
 import (
 	"context"
 	"context"
 
 
-	"points_service/rpc/integral"
-	"points_service/rpc/internal/logic"
-	"points_service/rpc/internal/svc"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/logic"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/svc"
 )
 )
 
 
 type IntegralServer struct {
 type IntegralServer struct {

+ 1 - 1
rpc/internal/svc/servicecontext.go

@@ -1,6 +1,6 @@
 package svc
 package svc
 
 
-import "points_service/rpc/internal/config"
+import "app.yhyue.com/moapp/jyPoints/rpc/internal/config"
 
 
 type ServiceContext struct {
 type ServiceContext struct {
 	Config config.Config
 	Config config.Config

+ 12 - 13
rpc/test/consume_test.go

@@ -1,6 +1,12 @@
 package test
 package test
 
 
 import (
 import (
+	"app.yhyue.com/moapp/jyPoints/entity"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/integralclient"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/config"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/server"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/svc"
 	"context"
 	"context"
 	"fmt"
 	"fmt"
 	_ "github.com/go-sql-driver/mysql"
 	_ "github.com/go-sql-driver/mysql"
@@ -8,12 +14,6 @@ import (
 	"github.com/tal-tech/go-zero/core/conf"
 	"github.com/tal-tech/go-zero/core/conf"
 	"github.com/tal-tech/go-zero/zrpc"
 	"github.com/tal-tech/go-zero/zrpc"
 	"log"
 	"log"
-	"points_service/entity"
-	"points_service/rpc/integral"
-	"points_service/rpc/integralclient"
-	"points_service/rpc/internal/config"
-	"points_service/rpc/internal/server"
-	"points_service/rpc/internal/svc"
 	"testing"
 	"testing"
 	"time"
 	"time"
 )
 )
@@ -28,35 +28,34 @@ func init() {
 	}
 	}
 	fmt.Println(c.DataSource+"链接成功")
 	fmt.Println(c.DataSource+"链接成功")
 }
 }
+//消耗积分
 func  Test_Consume(t *testing.T)  {
 func  Test_Consume(t *testing.T)  {
 	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
 	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
-	req := &integral.Req{UserId: "ABC",PointType:2003,BusinessTypeId:1,BusinessType:"1", Point: 24,EndDate:"2021-03-11",AppId: 10000}
+	req := &integral.Req{UserId: "111111",PointType:2003,BusinessTypeId:1,BusinessType:"1", Point: 110,EndDate:"2021-03-11",AppId: 10000}
 	res, err := FileSystem.IntegralConsume(ctx, req)
 	res, err := FileSystem.IntegralConsume(ctx, req)
 	log.Println("err ", err)
 	log.Println("err ", err)
 	log.Println("req ", res)
 	log.Println("req ", res)
 }
 }
-
+//新增积分
 func  Test_Add(t *testing.T)  {
 func  Test_Add(t *testing.T)  {
 	ctx, _ := context.WithTimeout(context.Background(), 500*time.Second)
 	ctx, _ := context.WithTimeout(context.Background(), 500*time.Second)
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
-	req := &integral.Req{UserId: "xzh", Point: 123}
+	req := &integral.Req{UserId: "111111",PointType:1002,BusinessTypeId:1,BusinessType:"1", Point: 60,EndDate:"2021-03-11",AppId: 10000,OperationType:false}
 	res, err := FileSystem.IntegralHarvest(ctx, req)
 	res, err := FileSystem.IntegralHarvest(ctx, req)
 	log.Println("err ", err)
 	log.Println("err ", err)
 	log.Println("req ", res)
 	log.Println("req ", res)
 }
 }
 
 
 func  Test_serach(t *testing.T)  {
 func  Test_serach(t *testing.T)  {
-	ctx, _ := context.WithTimeout(context.Background(), 500*time.Second)
+	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
-	req := &integral.Req{UserId: "xzh10", Point: 123}
+	req := &integral.Req{UserId: "111111", Page:1,PageSize:2,AppId:10000,EndDate:"2021-03",}
 	res, err := FileSystem.IntegralDetailedCheck(ctx, req)
 	res, err := FileSystem.IntegralDetailedCheck(ctx, req)
 	log.Println("err ", err)
 	log.Println("err ", err)
 	log.Println("req ", res)
 	log.Println("req ", res)
 }
 }
 
 
-
-
 func  Test_Ad(t *testing.T)  {
 func  Test_Ad(t *testing.T)  {
 	var c config.Config
 	var c config.Config
 	conf.MustLoad(*configFile, &c)
 	conf.MustLoad(*configFile, &c)

+ 3 - 3
rpc/test/test1_test.go

@@ -6,9 +6,9 @@ import (
 	"github.com/tal-tech/go-zero/core/conf"
 	"github.com/tal-tech/go-zero/core/conf"
 	"github.com/tal-tech/go-zero/zrpc"
 	"github.com/tal-tech/go-zero/zrpc"
 	"log"
 	"log"
-	"points_service/rpc/integral"
-	"points_service/rpc/integralclient"
-	"points_service/rpc/internal/config"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/rpc/integralclient"
+	"app.yhyue.com/moapp/jyPoints/rpc/internal/config"
 	"testing"
 	"testing"
 	"time"
 	"time"
 )
 )

+ 12 - 4
service/integralService.go

@@ -3,8 +3,8 @@ package service
 import (
 import (
 	"fmt"
 	"fmt"
 	"log"
 	"log"
-	"points_service/entity"
-	"points_service/rpc/integral"
+	"app.yhyue.com/moapp/jyPoints/entity"
+	"app.yhyue.com/moapp/jyPoints/rpc/integral"
 	"time"
 	"time"
 )
 )
 
 
@@ -478,12 +478,20 @@ func (service *IntegralService) IntegralBalanceCheckService(userId string, appId
 //按月查询积分使用情况
 //按月查询积分使用情况
 func (service *IntegralService) IntegralDetailedCheck(data entity.FlowJSON) ([]*integral.Point, int64) {
 func (service *IntegralService) IntegralDetailedCheck(data entity.FlowJSON) ([]*integral.Point, int64) {
 	orm := entity.Engine.NewSession()
 	orm := entity.Engine.NewSession()
-
+	//查询时间范围内的
+	//查询新增消耗的积分和消耗积分 searchType 0全部 1新增 -1消耗
+	searchCode :="1=1"
+	if data.SearchType==1{
+		searchCode="   flow.Sort=1"
+	}else if data.SearchType==-1{
+		searchCode="   flow.Sort=-1"
+	}
 	var flowList []*entity.FlowReq
 	var flowList []*entity.FlowReq
 	numb, err := orm.Table("integral_flow").Alias("flow").
 	numb, err := orm.Table("integral_flow").Alias("flow").
 		Select("flow.*,pt.name").
 		Select("flow.*,pt.name").
 		Join("left", "point_type pt", "flow.pointType=pt.code").
 		Join("left", "point_type pt", "flow.pointType=pt.code").
-		Where("flow.userId = ? AND flow.appId = ? AND DATE_FORMAT(flow.createTime,'%Y-%m')=? ", data.UserId, data.AppId, data.EndDate).
+		Where("flow.userId = ? AND flow.appId = ? AND DATE_FORMAT(flow.createTime,'%Y-%m') >= ? AND DATE_FORMAT(flow.createTime,'%Y-%m')<=  ? ", data.UserId, data.AppId, data.StartDate,data.EndDate).
+		And(searchCode).
 		Desc("flow.createTime").
 		Desc("flow.createTime").
 		Limit(int(data.PageSize), (int(data.Page-1))*int(data.PageSize)).
 		Limit(int(data.PageSize), (int(data.Page-1))*int(data.PageSize)).
 		FindAndCount(&flowList)
 		FindAndCount(&flowList)