李哲 4 жил өмнө
parent
commit
58415d5b0a

+ 25 - 25
entity/integral.go

@@ -7,14 +7,14 @@ var Engine *xorm.Engine
 
 //定义返回状态
 const (
-	SuccessCode = 1
-	ErrorCode   = 0
+	SuccessCode int64 = 1
+	ErrorCode  int64 = 0
 )
 
 //流水类型1加-1减
 const (
-	AddCode    = 1
-	ReduceCode = -1
+	AddCode  int64  = 1
+	ReduceCode int64 = -1
 )
 
 //积分余额
@@ -22,14 +22,14 @@ type Balance struct {
 	Id          int64  `xorm:"pk autoincr id" form:"id" json:"id"`
 	UserId      string `xorm:"userId" form:"userId" json:"userId"`                //用户标识
 	CountPoints int64  `xorm:"countPoints" form:"countPoints" json:"countPoints"` //合计
-	AppId       int    `xorm:"appId" form:"appId" json:"appId"`                   //剑鱼标识
+	AppId       int64    `xorm:"appId" form:"appId" json:"appId"`                   //剑鱼标识
 }
 
 //积分余额
 type BalanceUpdate struct {
 	UserId      string `xorm:"userId" form:"userId" json:"userId"`                //用户标识
 	CountPoints int64  `xorm:"countPoints" form:"countPoints" json:"countPoints"` //合计
-	AppId       int    `xorm:"appId" form:"appId" json:"appId"`                   //剑鱼标识
+	AppId       int64    `xorm:"appId" form:"appId" json:"appId"`                   //剑鱼标识
 	Change      bool   `xorm:"change" form:"change" json:"change"`                //修改方式true新增 false消耗
 }
 
@@ -37,28 +37,28 @@ type BalanceUpdate struct {
 type Flow struct {
 	Id             int64  `xorm:"pk autoincr id" form:"id" json:"id"`
 	UserId         string `xorm:"userId" form:"userId" json:"userId"`                         //用户标识
-	PointType      int    `xorm:"pointType" form:"pointType" json:"pointType"`                //积分类型
-	BusinessTypeId int    `xorm:"businessTypeId" form:"businessTypeId" json:"businessTypeId"` //业务单据标识
+	PointType      int64    `xorm:"pointType" form:"pointType" json:"pointType"`                //积分类型
+	BusinessTypeId int64    `xorm:"businessTypeId" form:"businessTypeId" json:"businessTypeId"` //业务单据标识
 	BusinessType   string `xorm:"businessType" form:"businessType" json:"businessType"`       //业务类型
 	Point          int64  `xorm:"point" form:"point" json:"point"`                            //积分
 	CreateTime     string `xorm:"createTime" form:"createTime" json:"createTime"`             //创建时间
 	EndDate        string `xorm:"endDate" form:"endDate" json:"endDate"`                      //截止时间
-	AppId          int    `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
-	Sort           int    `xorm:"sort" form:"sort" json:"sort"`                               //操作类型1加-1减
+	AppId          int64    `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
+	Sort           int64    `xorm:"sort" form:"sort" json:"sort"`                               //操作类型1加-1减
 }
 
 //积分流水
 type FlowReq struct {
 	Id             int64  `xorm:"pk autoincr id" form:"id" json:"id"`
 	UserId         string `xorm:"userId" form:"userId" json:"userId"`                         //用户标识
-	PointType      int    `xorm:"pointType" form:"pointType" json:"pointType"`                //积分类型
-	BusinessTypeId int    `xorm:"businessTypeId" form:"businessTypeId" json:"businessTypeId"` //业务单据标识
+	PointType      int64    `xorm:"pointType" form:"pointType" json:"pointType"`                //积分类型
+	BusinessTypeId int64    `xorm:"businessTypeId" form:"businessTypeId" json:"businessTypeId"` //业务单据标识
 	BusinessType   string `xorm:"businessType" form:"businessType" json:"businessType"`       //业务类型
 	Point          int64  `xorm:"point" form:"point" json:"point"`                            //积分
 	CreateTime     string `xorm:"createTime" form:"createTime" json:"createTime"`             //创建时间
 	EndDate        string `xorm:"endDate" form:"endDate" json:"endDate"`                      //截止时间
-	AppId          int    `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
-	Sort           int    `xorm:"sort" form:"sort" json:"sort"`                               //操作类型1加-1减
+	AppId          int64    `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
+	Sort           int64    `xorm:"sort" form:"sort" json:"sort"`                               //操作类型1加-1减
 	Name           string `xorm:"name" form:"name" json:"name"`                               //积分类型名称
 }
 
@@ -69,29 +69,29 @@ type Solde struct {
 	UserId          string `xorm:"userId" form:"userId" json:"userId"`                            //用户标识
 	TimePoints      int64  `xorm:"timePoints" form:"timePoints" json:"timePoints"`                //时效积分
 	EndDate         string `xorm:"endDate" form:"endDate" json:"endDate"`                         //有效期止
-	AppId           int    `xorm:"appId" form:"appId" json:"appId"`                               //剑鱼标识
+	AppId           int64    `xorm:"appId" form:"appId" json:"appId"`                               //剑鱼标识
 }
 
 //积分流水
 type FlowJSON struct {
 	UserId         string `xorm:"userId" form:"userId" json:"userId"`                         //用户标识
-	PointType      int    `xorm:"pointType" form:"pointType" json:"pointType"`                //积分类型
-	BusinessTypeId int    `xorm:"businessTypeId" form:"businessTypeId" json:"businessTypeId"` //业务单据标识
+	PointType      int64    `xorm:"pointType" form:"pointType" json:"pointType"`                //积分类型
+	BusinessTypeId int64    `xorm:"businessTypeId" form:"businessTypeId" json:"businessTypeId"` //业务单据标识
 	BusinessType   string `xorm:"businessType" form:"businessType" json:"businessType"`       //业务类型
 	Point          int64  `xorm:"point" form:"point" json:"point"`                            //积分
 	EndDate        string `xorm:"endDate" form:"endDate" json:"endDate"`                      //截止时间
-	AppId          int    `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
+	AppId          int64    `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
 	OperationType  bool   `xorm:"operationType" form:"operationType" json:"operationType"`    //永久:true、时效:false
-	Sort           int    `xorm:"sort" form:"sort" json:"sort"`                               //操作类型1加-1减
-	Page           int    `xorm:"page" form:"page" json:"page"`                               //当前页数
-	PageSize       int    `xorm:"pageSize" form:"pageSize" json:"pageSize"`                   //每页数量
+	Sort           int64    `xorm:"sort" form:"sort" json:"sort"`                               //操作类型1加-1减
+	Page           int64    `xorm:"page" form:"page" json:"page"`                               //当前页数
+	PageSize       int64    `xorm:"pageSize" form:"pageSize" json:"pageSize"`                   //每页数量
 }
 
 //到期积分查询
 type ExpireJSON struct {
 	UserId    string `xorm:"userId" form:"userId" json:"userId"`          //用户标识
 	EndDate   string `xorm:"endDate" form:"endDate" json:"endDate"`       //截止时间
-	AppId     int    `xorm:"appId" form:"appId" json:"appId"`             //剑鱼标识
+	AppId     int64    `xorm:"appId" form:"appId" json:"appId"`             //剑鱼标识
 }
 
 //积分结存修改
@@ -101,13 +101,13 @@ type SoldeUpdate struct {
 	UserId     string `xorm:"userId" form:"userId" json:"userId"`             //用户标识
 	Points     int64  `xorm:"points" form:"points" json:"points"`             //积分
 	EndDate    string `xorm:"endDate" form:"endDate" json:"endDate"`          //有效期止
-	AppId      int    `xorm:"appId" form:"appId" json:"appId"`                //剑鱼标识
+	AppId      int64    `xorm:"appId" form:"appId" json:"appId"`                //剑鱼标识
 }
 
 //积分守护
 type GuardJSON struct {
 	UserId    string `xorm:"userId" form:"userId" json:"userId"`          //用户标识
-	PointType int    `xorm:"pointType" form:"pointType" json:"pointType"` //积分类型
+	PointType int64    `xorm:"pointType" form:"pointType" json:"pointType"` //积分类型
 	EndDate   string `xorm:"endDate" form:"endDate" json:"endDate"`       //截止时间
-	AppId     int    `xorm:"appId" form:"appId" json:"appId"`             //剑鱼标识
+	AppId     int64    `xorm:"appId" form:"appId" json:"appId"`             //剑鱼标识
 }

+ 37 - 14
rpc/integral.proto

@@ -2,36 +2,59 @@ syntax = "proto3";
 
 package integral;
 
-message addReq {
+message Req {
   string userId = 1;
-  int64 countPoints = 2;
+  int64 appId = 2;
+  int64 pointType = 3;
+  int64 businessTypeId = 4;
+  string businessType = 5;
+  int64 point = 6;
+  string endDate = 7;
+  int64 page = 8;
+  int64 pageSize = 9;
+  bool operationType = 10;
 }
 
-message addResp {
-  bool status = 1;
+message Resp {
+  int64 code =1;    //响应代码
+  string message=2; //响应消息
+  int64 data = 3;   //响应内容
 }
 
-message checkReq {
-  string userId = 1;
+message RespList {
+  int64 code =1;    //响应代码
+  string message=2; //响应消息
+  int64 count = 3;  //总数
+  repeated Point data=4; //列表
 }
 
-message checkResp {
-  int64 countPoints = 1;
+message Point {
+    int64 id=1;
+    string userId = 2;
+    int64 pointType = 3;
+    int64 businessTypeId = 4;
+    string businessType = 5;
+    int64 point = 6;
+    string CreateTime = 7;
+    string endDate = 8;
+    int64 appId = 9;
+    int64 Sort = 10;
+    string name=11;
 }
 
 service Integral {
   //收获积分
-  rpc  integralHarvest(addReq) returns(addResp);
+  rpc  integralHarvest(Req) returns(Resp);
   //消耗积分
-  rpc  integralConsume(addReq) returns(addResp);
+  rpc  integralConsume(Req) returns(Resp);
   //积分余额查询
-  rpc integralBalanceCheck(addReq) returns(addResp);
+  rpc integralBalanceCheck(Req) returns(Resp);
   //积分明细查询
-  rpc integralDetailedCheck(addReq) returns(addResp);
+  rpc integralDetailedCheck(Req) returns(RespList);
 
   //积分守护
-  rpc  integralGuard(addReq) returns(addResp);
+  rpc  integralGuard(Req) returns(Resp);
   //到期积分查询
-  rpc  integralExpireCheck(addReq) returns(addResp);
+  rpc  integralExpireCheck(Req) returns(Resp);
 }
 

+ 380 - 166
rpc/integral/integral.pb.go

@@ -7,15 +7,15 @@
 package integral
 
 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 (
@@ -29,18 +29,25 @@ const (
 // of the legacy proto package is being used.
 const _ = proto.ProtoPackageIsVersion4
 
-type AddReq struct {
+type Req struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
-	msg           protoimpl.MessageInfo
 
-	UserId      string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`
-	CountPoints int64  `protobuf:"varint,2,opt,name=countPoints,proto3" json:"countPoints,omitempty"`
+	UserId         string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`
+	AppId          int64  `protobuf:"varint,2,opt,name=appId,proto3" json:"appId,omitempty"`
+	PointType      int64  `protobuf:"varint,3,opt,name=pointType,proto3" json:"pointType,omitempty"`
+	BusinessTypeId int64  `protobuf:"varint,4,opt,name=businessTypeId,proto3" json:"businessTypeId,omitempty"`
+	BusinessType   string `protobuf:"bytes,5,opt,name=businessType,proto3" json:"businessType,omitempty"`
+	Point          int64  `protobuf:"varint,6,opt,name=point,proto3" json:"point,omitempty"`
+	EndDate        string `protobuf:"bytes,7,opt,name=endDate,proto3" json:"endDate,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"`
+	OperationType  bool   `protobuf:"varint,10,opt,name=operationType,proto3" json:"operationType,omitempty"`
 }
 
-func (x *AddReq) Reset() {
-	*x = AddReq{}
+func (x *Req) Reset() {
+	*x = Req{}
 	if protoimpl.UnsafeEnabled {
 		mi := &file_integral_proto_msgTypes[0]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -48,13 +55,13 @@ func (x *AddReq) Reset() {
 	}
 }
 
-func (x *AddReq) String() string {
+func (x *Req) String() string {
 	return protoimpl.X.MessageStringOf(x)
 }
 
-func (*AddReq) ProtoMessage() {}
+func (*Req) ProtoMessage() {}
 
-func (x *AddReq) ProtoReflect() protoreflect.Message {
+func (x *Req) ProtoReflect() protoreflect.Message {
 	mi := &file_integral_proto_msgTypes[0]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -66,35 +73,93 @@ func (x *AddReq) ProtoReflect() protoreflect.Message {
 	return mi.MessageOf(x)
 }
 
-// Deprecated: Use AddReq.ProtoReflect.Descriptor instead.
-func (*AddReq) Descriptor() ([]byte, []int) {
+// Deprecated: Use Req.ProtoReflect.Descriptor instead.
+func (*Req) Descriptor() ([]byte, []int) {
 	return file_integral_proto_rawDescGZIP(), []int{0}
 }
 
-func (x *AddReq) GetUserId() string {
+func (x *Req) GetUserId() string {
 	if x != nil {
 		return x.UserId
 	}
 	return ""
 }
 
-func (x *AddReq) GetCountPoints() int64 {
+func (x *Req) GetAppId() int64 {
 	if x != nil {
-		return x.CountPoints
+		return x.AppId
 	}
 	return 0
 }
 
-type AddResp struct {
+func (x *Req) GetPointType() int64 {
+	if x != nil {
+		return x.PointType
+	}
+	return 0
+}
+
+func (x *Req) GetBusinessTypeId() int64 {
+	if x != nil {
+		return x.BusinessTypeId
+	}
+	return 0
+}
+
+func (x *Req) GetBusinessType() string {
+	if x != nil {
+		return x.BusinessType
+	}
+	return ""
+}
+
+func (x *Req) GetPoint() int64 {
+	if x != nil {
+		return x.Point
+	}
+	return 0
+}
+
+func (x *Req) GetEndDate() string {
+	if x != nil {
+		return x.EndDate
+	}
+	return ""
+}
+
+func (x *Req) GetPage() int64 {
+	if x != nil {
+		return x.Page
+	}
+	return 0
+}
+
+func (x *Req) GetPageSize() int64 {
+	if x != nil {
+		return x.PageSize
+	}
+	return 0
+}
+
+func (x *Req) GetOperationType() bool {
+	if x != nil {
+		return x.OperationType
+	}
+	return false
+}
+
+type Resp struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
-	Msg           string `protobuf:"varint,1,opt,name=msg,proto3" json:"msg,omitempty"`
-	Status        bool   `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
+
+	Code    int64  `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`      //响应代码
+	Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` //响应消息
+	Data    int64  `protobuf:"varint,3,opt,name=data,proto3" json:"data,omitempty"`      //响应内容
 }
 
-func (x *AddResp) Reset() {
-	*x = AddResp{}
+func (x *Resp) Reset() {
+	*x = Resp{}
 	if protoimpl.UnsafeEnabled {
 		mi := &file_integral_proto_msgTypes[1]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -102,13 +167,13 @@ func (x *AddResp) Reset() {
 	}
 }
 
-func (x *AddResp) String() string {
+func (x *Resp) String() string {
 	return protoimpl.X.MessageStringOf(x)
 }
 
-func (*AddResp) ProtoMessage() {}
+func (*Resp) ProtoMessage() {}
 
-func (x *AddResp) ProtoReflect() protoreflect.Message {
+func (x *Resp) ProtoReflect() protoreflect.Message {
 	mi := &file_integral_proto_msgTypes[1]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -120,33 +185,45 @@ func (x *AddResp) ProtoReflect() protoreflect.Message {
 	return mi.MessageOf(x)
 }
 
-// Deprecated: Use AddResp.ProtoReflect.Descriptor instead.
-func (*AddResp) Descriptor() ([]byte, []int) {
+// Deprecated: Use Resp.ProtoReflect.Descriptor instead.
+func (*Resp) Descriptor() ([]byte, []int) {
 	return file_integral_proto_rawDescGZIP(), []int{1}
 }
 
-func (x *AddResp) GetStatus() bool {
+func (x *Resp) GetCode() int64 {
 	if x != nil {
-		return x.Status
+		return x.Code
 	}
-	return false
+	return 0
+}
+
+func (x *Resp) GetMessage() string {
+	if x != nil {
+		return x.Message
+	}
+	return ""
 }
-func (x *AddResp) GetMsg() string {
+
+func (x *Resp) GetData() int64 {
 	if x != nil {
-		return x.Msg
+		return x.Data
 	}
-	return x.Msg
+	return 0
 }
-type CheckReq struct {
+
+type RespList struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	UserId string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`
+	Code    int64    `protobuf:"varint,1,opt,name=code,proto3" json:"code,omitempty"`      //响应代码
+	Message string   `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` //响应消息
+	Count   int64    `protobuf:"varint,3,opt,name=count,proto3" json:"count,omitempty"`    //总数
+	Data    []*Point `protobuf:"bytes,4,rep,name=data,proto3" json:"data,omitempty"`       //列表
 }
 
-func (x *CheckReq) Reset() {
-	*x = CheckReq{}
+func (x *RespList) Reset() {
+	*x = RespList{}
 	if protoimpl.UnsafeEnabled {
 		mi := &file_integral_proto_msgTypes[2]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -154,13 +231,13 @@ func (x *CheckReq) Reset() {
 	}
 }
 
-func (x *CheckReq) String() string {
+func (x *RespList) String() string {
 	return protoimpl.X.MessageStringOf(x)
 }
 
-func (*CheckReq) ProtoMessage() {}
+func (*RespList) ProtoMessage() {}
 
-func (x *CheckReq) ProtoReflect() protoreflect.Message {
+func (x *RespList) ProtoReflect() protoreflect.Message {
 	mi := &file_integral_proto_msgTypes[2]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -172,28 +249,59 @@ func (x *CheckReq) ProtoReflect() protoreflect.Message {
 	return mi.MessageOf(x)
 }
 
-// Deprecated: Use CheckReq.ProtoReflect.Descriptor instead.
-func (*CheckReq) Descriptor() ([]byte, []int) {
+// Deprecated: Use RespList.ProtoReflect.Descriptor instead.
+func (*RespList) Descriptor() ([]byte, []int) {
 	return file_integral_proto_rawDescGZIP(), []int{2}
 }
 
-func (x *CheckReq) GetUserId() string {
+func (x *RespList) GetCode() int64 {
 	if x != nil {
-		return x.UserId
+		return x.Code
+	}
+	return 0
+}
+
+func (x *RespList) GetMessage() string {
+	if x != nil {
+		return x.Message
 	}
 	return ""
 }
 
-type CheckResp struct {
+func (x *RespList) GetCount() int64 {
+	if x != nil {
+		return x.Count
+	}
+	return 0
+}
+
+func (x *RespList) GetData() []*Point {
+	if x != nil {
+		return x.Data
+	}
+	return nil
+}
+
+type Point struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	CountPoints int64 `protobuf:"varint,1,opt,name=countPoints,proto3" json:"countPoints,omitempty"`
-}
-
-func (x *CheckResp) Reset() {
-	*x = CheckResp{}
+	Id             int64  `protobuf:"varint,1,opt,name=id,proto3" json:"id,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"`
+	BusinessTypeId int64  `protobuf:"varint,4,opt,name=businessTypeId,proto3" json:"businessTypeId,omitempty"`
+	BusinessType   string `protobuf:"bytes,5,opt,name=businessType,proto3" json:"businessType,omitempty"`
+	Point          int64  `protobuf:"varint,6,opt,name=point,proto3" json:"point,omitempty"`
+	CreateTime     string `protobuf:"bytes,7,opt,name=CreateTime,proto3" json:"CreateTime,omitempty"`
+	EndDate        string `protobuf:"bytes,8,opt,name=endDate,proto3" json:"endDate,omitempty"`
+	AppId          int64  `protobuf:"varint,9,opt,name=appId,proto3" json:"appId,omitempty"`
+	Sort           int64  `protobuf:"varint,10,opt,name=Sort,proto3" json:"Sort,omitempty"`
+	Name           string `protobuf:"bytes,11,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *Point) Reset() {
+	*x = Point{}
 	if protoimpl.UnsafeEnabled {
 		mi := &file_integral_proto_msgTypes[3]
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -201,13 +309,13 @@ func (x *CheckResp) Reset() {
 	}
 }
 
-func (x *CheckResp) String() string {
+func (x *Point) String() string {
 	return protoimpl.X.MessageStringOf(x)
 }
 
-func (*CheckResp) ProtoMessage() {}
+func (*Point) ProtoMessage() {}
 
-func (x *CheckResp) ProtoReflect() protoreflect.Message {
+func (x *Point) ProtoReflect() protoreflect.Message {
 	mi := &file_integral_proto_msgTypes[3]
 	if protoimpl.UnsafeEnabled && x != nil {
 		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -219,58 +327,163 @@ func (x *CheckResp) ProtoReflect() protoreflect.Message {
 	return mi.MessageOf(x)
 }
 
-// Deprecated: Use CheckResp.ProtoReflect.Descriptor instead.
-func (*CheckResp) Descriptor() ([]byte, []int) {
+// Deprecated: Use Point.ProtoReflect.Descriptor instead.
+func (*Point) Descriptor() ([]byte, []int) {
 	return file_integral_proto_rawDescGZIP(), []int{3}
 }
 
-func (x *CheckResp) GetCountPoints() int64 {
+func (x *Point) GetId() int64 {
+	if x != nil {
+		return x.Id
+	}
+	return 0
+}
+
+func (x *Point) GetUserId() string {
+	if x != nil {
+		return x.UserId
+	}
+	return ""
+}
+
+func (x *Point) GetPointType() int64 {
 	if x != nil {
-		return x.CountPoints
+		return x.PointType
 	}
 	return 0
 }
 
+func (x *Point) GetBusinessTypeId() int64 {
+	if x != nil {
+		return x.BusinessTypeId
+	}
+	return 0
+}
+
+func (x *Point) GetBusinessType() string {
+	if x != nil {
+		return x.BusinessType
+	}
+	return ""
+}
+
+func (x *Point) GetPoint() int64 {
+	if x != nil {
+		return x.Point
+	}
+	return 0
+}
+
+func (x *Point) GetCreateTime() string {
+	if x != nil {
+		return x.CreateTime
+	}
+	return ""
+}
+
+func (x *Point) GetEndDate() string {
+	if x != nil {
+		return x.EndDate
+	}
+	return ""
+}
+
+func (x *Point) GetAppId() int64 {
+	if x != nil {
+		return x.AppId
+	}
+	return 0
+}
+
+func (x *Point) GetSort() int64 {
+	if x != nil {
+		return x.Sort
+	}
+	return 0
+}
+
+func (x *Point) GetName() string {
+	if x != nil {
+		return x.Name
+	}
+	return ""
+}
+
 var File_integral_proto protoreflect.FileDescriptor
 
 var file_integral_proto_rawDesc = []byte{
 	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, 0x42, 0x0a, 0x06, 0x61, 0x64,
-	0x64, 0x52, 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, 0x20, 0x0a, 0x0b,
-	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x22, 0x21,
-	0x0a, 0x07, 0x61, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61,
-	0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75,
-	0x73, 0x22, 0x22, 0x0a, 0x08, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 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, 0x22, 0x2d, 0x0a, 0x09, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65,
-	0x73, 0x70, 0x12, 0x20, 0x0a, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f, 0x69, 0x6e, 0x74,
-	0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x6f,
-	0x69, 0x6e, 0x74, 0x73, 0x32, 0xe7, 0x02, 0x0a, 0x08, 0x49, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61,
-	0x6c, 0x12, 0x36, 0x0a, 0x0f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x48, 0x61, 0x72,
-	0x76, 0x65, 0x73, 0x74, 0x12, 0x10, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e,
-	0x61, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61,
-	0x6c, 0x2e, 0x61, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x36, 0x0a, 0x0f, 0x69, 0x6e, 0x74,
-	0x65, 0x67, 0x72, 0x61, 0x6c, 0x43, 0x6f, 0x6e, 0x73, 0x75, 0x6d, 0x65, 0x12, 0x10, 0x2e, 0x69,
-	0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x61, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x11,
-	0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x61, 0x64, 0x64, 0x52, 0x65, 0x73,
-	0x70, 0x12, 0x3b, 0x0a, 0x14, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x42, 0x61, 0x6c,
-	0x61, 0x6e, 0x63, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x10, 0x2e, 0x69, 0x6e, 0x74, 0x65,
-	0x67, 0x72, 0x61, 0x6c, 0x2e, 0x61, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x69, 0x6e,
-	0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x61, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3c,
-	0x0a, 0x15, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c,
-	0x65, 0x64, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x10, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72,
-	0x61, 0x6c, 0x2e, 0x61, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x69, 0x6e, 0x74, 0x65,
-	0x67, 0x72, 0x61, 0x6c, 0x2e, 0x61, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x34, 0x0a, 0x0d,
-	0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x47, 0x75, 0x61, 0x72, 0x64, 0x12, 0x10, 0x2e,
-	0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x61, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a,
-	0x11, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x61, 0x64, 0x64, 0x52, 0x65,
-	0x73, 0x70, 0x12, 0x3a, 0x0a, 0x13, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x45, 0x78,
-	0x70, 0x69, 0x72, 0x65, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x10, 0x2e, 0x69, 0x6e, 0x74, 0x65,
-	0x67, 0x72, 0x61, 0x6c, 0x2e, 0x61, 0x64, 0x64, 0x52, 0x65, 0x71, 0x1a, 0x11, 0x2e, 0x69, 0x6e,
-	0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x61, 0x64, 0x64, 0x52, 0x65, 0x73, 0x70, 0x62, 0x06,
-	0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x12, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x22, 0xa3, 0x02, 0x0a, 0x03, 0x52,
+	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,
+	0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x61, 0x70, 0x70, 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, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61,
+	0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1a,
+	0x0a, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03,
+	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,
+	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,
+	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, 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, 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,
 }
 
 var (
@@ -287,29 +500,30 @@ func file_integral_proto_rawDescGZIP() []byte {
 
 var file_integral_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
 var file_integral_proto_goTypes = []interface{}{
-	(*AddReq)(nil),    // 0: integral.addReq
-	(*AddResp)(nil),   // 1: integral.addResp
-	(*CheckReq)(nil),  // 2: integral.checkReq
-	(*CheckResp)(nil), // 3: integral.checkResp
+	(*Req)(nil),      // 0: integral.Req
+	(*Resp)(nil),     // 1: integral.Resp
+	(*RespList)(nil), // 2: integral.RespList
+	(*Point)(nil),    // 3: integral.Point
 }
 var file_integral_proto_depIdxs = []int32{
-	0, // 0: integral.Integral.integralHarvest:input_type -> integral.addReq
-	0, // 1: integral.Integral.integralConsume:input_type -> integral.addReq
-	0, // 2: integral.Integral.integralBalanceCheck:input_type -> integral.addReq
-	0, // 3: integral.Integral.integralDetailedCheck:input_type -> integral.addReq
-	0, // 4: integral.Integral.integralGuard:input_type -> integral.addReq
-	0, // 5: integral.Integral.integralExpireCheck:input_type -> integral.addReq
-	1, // 6: integral.Integral.integralHarvest:output_type -> integral.addResp
-	1, // 7: integral.Integral.integralConsume:output_type -> integral.addResp
-	1, // 8: integral.Integral.integralBalanceCheck:output_type -> integral.addResp
-	1, // 9: integral.Integral.integralDetailedCheck:output_type -> integral.addResp
-	1, // 10: integral.Integral.integralGuard:output_type -> integral.addResp
-	1, // 11: integral.Integral.integralExpireCheck:output_type -> integral.addResp
-	6, // [6:12] is the sub-list for method output_type
-	0, // [0:6] is the sub-list for method input_type
-	0, // [0:0] is the sub-list for extension type_name
-	0, // [0:0] is the sub-list for extension extendee
-	0, // [0:0] is the sub-list for field type_name
+	3, // 0: integral.RespList.data:type_name -> integral.Point
+	0, // 1: integral.Integral.integralHarvest:input_type -> integral.Req
+	0, // 2: integral.Integral.integralConsume:input_type -> integral.Req
+	0, // 3: integral.Integral.integralBalanceCheck:input_type -> integral.Req
+	0, // 4: integral.Integral.integralDetailedCheck:input_type -> integral.Req
+	0, // 5: integral.Integral.integralGuard:input_type -> integral.Req
+	0, // 6: integral.Integral.integralExpireCheck:input_type -> integral.Req
+	1, // 7: integral.Integral.integralHarvest:output_type -> integral.Resp
+	1, // 8: integral.Integral.integralConsume:output_type -> integral.Resp
+	1, // 9: integral.Integral.integralBalanceCheck:output_type -> integral.Resp
+	2, // 10: integral.Integral.integralDetailedCheck:output_type -> integral.RespList
+	1, // 11: integral.Integral.integralGuard:output_type -> integral.Resp
+	1, // 12: integral.Integral.integralExpireCheck:output_type -> integral.Resp
+	7, // [7:13] is the sub-list for method output_type
+	1, // [1:7] is the sub-list for method input_type
+	1, // [1:1] is the sub-list for extension type_name
+	1, // [1:1] is the sub-list for extension extendee
+	0, // [0:1] is the sub-list for field type_name
 }
 
 func init() { file_integral_proto_init() }
@@ -319,7 +533,7 @@ func file_integral_proto_init() {
 	}
 	if !protoimpl.UnsafeEnabled {
 		file_integral_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*AddReq); i {
+			switch v := v.(*Req); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -331,7 +545,7 @@ func file_integral_proto_init() {
 			}
 		}
 		file_integral_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*AddResp); i {
+			switch v := v.(*Resp); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -343,7 +557,7 @@ func file_integral_proto_init() {
 			}
 		}
 		file_integral_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*CheckReq); i {
+			switch v := v.(*RespList); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -355,7 +569,7 @@ func file_integral_proto_init() {
 			}
 		}
 		file_integral_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
-			switch v := v.(*CheckResp); i {
+			switch v := v.(*Point); i {
 			case 0:
 				return &v.state
 			case 1:
@@ -400,17 +614,17 @@ const _ = grpc.SupportPackageIsVersion6
 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
 type IntegralClient interface {
 	//收获积分
-	IntegralHarvest(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error)
+	IntegralHarvest(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
 	//消耗积分
-	IntegralConsume(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error)
+	IntegralConsume(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
 	//积分余额查询
-	IntegralBalanceCheck(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error)
+	IntegralBalanceCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
 	//积分明细查询
-	IntegralDetailedCheck(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error)
+	IntegralDetailedCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*RespList, error)
 	//积分守护
-	IntegralGuard(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error)
+	IntegralGuard(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
 	//到期积分查询
-	IntegralExpireCheck(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error)
+	IntegralExpireCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
 }
 
 type integralClient struct {
@@ -421,8 +635,8 @@ func NewIntegralClient(cc grpc.ClientConnInterface) IntegralClient {
 	return &integralClient{cc}
 }
 
-func (c *integralClient) IntegralHarvest(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error) {
-	out := new(AddResp)
+func (c *integralClient) IntegralHarvest(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
 	err := c.cc.Invoke(ctx, "/integral.Integral/integralHarvest", in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -430,8 +644,8 @@ func (c *integralClient) IntegralHarvest(ctx context.Context, in *AddReq, opts .
 	return out, nil
 }
 
-func (c *integralClient) IntegralConsume(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error) {
-	out := new(AddResp)
+func (c *integralClient) IntegralConsume(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
 	err := c.cc.Invoke(ctx, "/integral.Integral/integralConsume", in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -439,8 +653,8 @@ func (c *integralClient) IntegralConsume(ctx context.Context, in *AddReq, opts .
 	return out, nil
 }
 
-func (c *integralClient) IntegralBalanceCheck(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error) {
-	out := new(AddResp)
+func (c *integralClient) IntegralBalanceCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
 	err := c.cc.Invoke(ctx, "/integral.Integral/integralBalanceCheck", in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -448,8 +662,8 @@ func (c *integralClient) IntegralBalanceCheck(ctx context.Context, in *AddReq, o
 	return out, nil
 }
 
-func (c *integralClient) IntegralDetailedCheck(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error) {
-	out := new(AddResp)
+func (c *integralClient) IntegralDetailedCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*RespList, error) {
+	out := new(RespList)
 	err := c.cc.Invoke(ctx, "/integral.Integral/integralDetailedCheck", in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -457,8 +671,8 @@ func (c *integralClient) IntegralDetailedCheck(ctx context.Context, in *AddReq,
 	return out, nil
 }
 
-func (c *integralClient) IntegralGuard(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error) {
-	out := new(AddResp)
+func (c *integralClient) IntegralGuard(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
 	err := c.cc.Invoke(ctx, "/integral.Integral/integralGuard", in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -466,8 +680,8 @@ func (c *integralClient) IntegralGuard(ctx context.Context, in *AddReq, opts ...
 	return out, nil
 }
 
-func (c *integralClient) IntegralExpireCheck(ctx context.Context, in *AddReq, opts ...grpc.CallOption) (*AddResp, error) {
-	out := new(AddResp)
+func (c *integralClient) IntegralExpireCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
 	err := c.cc.Invoke(ctx, "/integral.Integral/integralExpireCheck", in, out, opts...)
 	if err != nil {
 		return nil, err
@@ -478,39 +692,39 @@ func (c *integralClient) IntegralExpireCheck(ctx context.Context, in *AddReq, op
 // IntegralServer is the server API for Integral service.
 type IntegralServer interface {
 	//收获积分
-	IntegralHarvest(context.Context, *AddReq) (*AddResp, error)
+	IntegralHarvest(context.Context, *Req) (*Resp, error)
 	//消耗积分
-	IntegralConsume(context.Context, *AddReq) (*AddResp, error)
+	IntegralConsume(context.Context, *Req) (*Resp, error)
 	//积分余额查询
-	IntegralBalanceCheck(context.Context, *AddReq) (*AddResp, error)
+	IntegralBalanceCheck(context.Context, *Req) (*Resp, error)
 	//积分明细查询
-	IntegralDetailedCheck(context.Context, *AddReq) (*AddResp, error)
+	IntegralDetailedCheck(context.Context, *Req) (*RespList, error)
 	//积分守护
-	IntegralGuard(context.Context, *AddReq) (*AddResp, error)
+	IntegralGuard(context.Context, *Req) (*Resp, error)
 	//到期积分查询
-	IntegralExpireCheck(context.Context, *AddReq) (*AddResp, error)
+	IntegralExpireCheck(context.Context, *Req) (*Resp, error)
 }
 
 // UnimplementedIntegralServer can be embedded to have forward compatible implementations.
 type UnimplementedIntegralServer struct {
 }
 
-func (*UnimplementedIntegralServer) IntegralHarvest(context.Context, *AddReq) (*AddResp, error) {
+func (*UnimplementedIntegralServer) IntegralHarvest(context.Context, *Req) (*Resp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method IntegralHarvest not implemented")
 }
-func (*UnimplementedIntegralServer) IntegralConsume(context.Context, *AddReq) (*AddResp, error) {
+func (*UnimplementedIntegralServer) IntegralConsume(context.Context, *Req) (*Resp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method IntegralConsume not implemented")
 }
-func (*UnimplementedIntegralServer) IntegralBalanceCheck(context.Context, *AddReq) (*AddResp, error) {
+func (*UnimplementedIntegralServer) IntegralBalanceCheck(context.Context, *Req) (*Resp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method IntegralBalanceCheck not implemented")
 }
-func (*UnimplementedIntegralServer) IntegralDetailedCheck(context.Context, *AddReq) (*AddResp, error) {
+func (*UnimplementedIntegralServer) IntegralDetailedCheck(context.Context, *Req) (*RespList, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method IntegralDetailedCheck not implemented")
 }
-func (*UnimplementedIntegralServer) IntegralGuard(context.Context, *AddReq) (*AddResp, error) {
+func (*UnimplementedIntegralServer) IntegralGuard(context.Context, *Req) (*Resp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method IntegralGuard not implemented")
 }
-func (*UnimplementedIntegralServer) IntegralExpireCheck(context.Context, *AddReq) (*AddResp, error) {
+func (*UnimplementedIntegralServer) IntegralExpireCheck(context.Context, *Req) (*Resp, error) {
 	return nil, status.Errorf(codes.Unimplemented, "method IntegralExpireCheck not implemented")
 }
 
@@ -519,7 +733,7 @@ func RegisterIntegralServer(s *grpc.Server, srv IntegralServer) {
 }
 
 func _Integral_IntegralHarvest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(AddReq)
+	in := new(Req)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
@@ -531,13 +745,13 @@ func _Integral_IntegralHarvest_Handler(srv interface{}, ctx context.Context, dec
 		FullMethod: "/integral.Integral/IntegralHarvest",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(IntegralServer).IntegralHarvest(ctx, req.(*AddReq))
+		return srv.(IntegralServer).IntegralHarvest(ctx, req.(*Req))
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
 func _Integral_IntegralConsume_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(AddReq)
+	in := new(Req)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
@@ -549,13 +763,13 @@ func _Integral_IntegralConsume_Handler(srv interface{}, ctx context.Context, dec
 		FullMethod: "/integral.Integral/IntegralConsume",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(IntegralServer).IntegralConsume(ctx, req.(*AddReq))
+		return srv.(IntegralServer).IntegralConsume(ctx, req.(*Req))
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
 func _Integral_IntegralBalanceCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(AddReq)
+	in := new(Req)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
@@ -567,13 +781,13 @@ func _Integral_IntegralBalanceCheck_Handler(srv interface{}, ctx context.Context
 		FullMethod: "/integral.Integral/IntegralBalanceCheck",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(IntegralServer).IntegralBalanceCheck(ctx, req.(*AddReq))
+		return srv.(IntegralServer).IntegralBalanceCheck(ctx, req.(*Req))
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
 func _Integral_IntegralDetailedCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(AddReq)
+	in := new(Req)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
@@ -585,13 +799,13 @@ func _Integral_IntegralDetailedCheck_Handler(srv interface{}, ctx context.Contex
 		FullMethod: "/integral.Integral/IntegralDetailedCheck",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(IntegralServer).IntegralDetailedCheck(ctx, req.(*AddReq))
+		return srv.(IntegralServer).IntegralDetailedCheck(ctx, req.(*Req))
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
 func _Integral_IntegralGuard_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(AddReq)
+	in := new(Req)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
@@ -603,13 +817,13 @@ func _Integral_IntegralGuard_Handler(srv interface{}, ctx context.Context, dec f
 		FullMethod: "/integral.Integral/IntegralGuard",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(IntegralServer).IntegralGuard(ctx, req.(*AddReq))
+		return srv.(IntegralServer).IntegralGuard(ctx, req.(*Req))
 	}
 	return interceptor(ctx, in, info, handler)
 }
 
 func _Integral_IntegralExpireCheck_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(AddReq)
+	in := new(Req)
 	if err := dec(in); err != nil {
 		return nil, err
 	}
@@ -621,7 +835,7 @@ func _Integral_IntegralExpireCheck_Handler(srv interface{}, ctx context.Context,
 		FullMethod: "/integral.Integral/IntegralExpireCheck",
 	}
 	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(IntegralServer).IntegralExpireCheck(ctx, req.(*AddReq))
+		return srv.(IntegralServer).IntegralExpireCheck(ctx, req.(*Req))
 	}
 	return interceptor(ctx, in, info, handler)
 }

+ 16 - 16
rpc/integralclient/integral.go

@@ -14,24 +14,24 @@ import (
 )
 
 type (
-	AddReq    = integral.AddReq
-	AddResp   = integral.AddResp
-	CheckReq  = integral.CheckReq
-	CheckResp = integral.CheckResp
+	Req      = integral.Req
+	Resp     = integral.Resp
+	RespList = integral.RespList
+	Point    = integral.Point
 
 	Integral interface {
 		// 收获积分
-		IntegralHarvest(ctx context.Context, in *AddReq) (*AddResp, error)
+		IntegralHarvest(ctx context.Context, in *Req) (*Resp, error)
 		// 消耗积分
-		IntegralConsume(ctx context.Context, in *AddReq) (*AddResp, error)
+		IntegralConsume(ctx context.Context, in *Req) (*Resp, error)
 		// 积分余额查询
-		IntegralBalanceCheck(ctx context.Context, in *AddReq) (*AddResp, error)
+		IntegralBalanceCheck(ctx context.Context, in *Req) (*Resp, error)
 		// 积分明细查询
-		IntegralDetailedCheck(ctx context.Context, in *AddReq) (*AddResp, error)
+		IntegralDetailedCheck(ctx context.Context, in *Req) (*RespList, error)
 		// 积分守护
-		IntegralGuard(ctx context.Context, in *AddReq) (*AddResp, error)
+		IntegralGuard(ctx context.Context, in *Req) (*Resp, error)
 		// 到期积分查询
-		IntegralExpireCheck(ctx context.Context, in *AddReq) (*AddResp, error)
+		IntegralExpireCheck(ctx context.Context, in *Req) (*Resp, error)
 	}
 
 	defaultIntegral struct {
@@ -46,37 +46,37 @@ func NewIntegral(cli zrpc.Client) Integral {
 }
 
 // 收获积分
-func (m *defaultIntegral) IntegralHarvest(ctx context.Context, in *AddReq) (*AddResp, error) {
+func (m *defaultIntegral) IntegralHarvest(ctx context.Context, in *Req) (*Resp, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
 	return client.IntegralHarvest(ctx, in)
 }
 
 // 消耗积分
-func (m *defaultIntegral) IntegralConsume(ctx context.Context, in *AddReq) (*AddResp, error) {
+func (m *defaultIntegral) IntegralConsume(ctx context.Context, in *Req) (*Resp, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
 	return client.IntegralConsume(ctx, in)
 }
 
 // 积分余额查询
-func (m *defaultIntegral) IntegralBalanceCheck(ctx context.Context, in *AddReq) (*AddResp, error) {
+func (m *defaultIntegral) IntegralBalanceCheck(ctx context.Context, in *Req) (*Resp, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
 	return client.IntegralBalanceCheck(ctx, in)
 }
 
 // 积分明细查询
-func (m *defaultIntegral) IntegralDetailedCheck(ctx context.Context, in *AddReq) (*AddResp, error) {
+func (m *defaultIntegral) IntegralDetailedCheck(ctx context.Context, in *Req) (*RespList, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
 	return client.IntegralDetailedCheck(ctx, in)
 }
 
 // 积分守护
-func (m *defaultIntegral) IntegralGuard(ctx context.Context, in *AddReq) (*AddResp, error) {
+func (m *defaultIntegral) IntegralGuard(ctx context.Context, in *Req) (*Resp, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
 	return client.IntegralGuard(ctx, in)
 }
 
 // 到期积分查询
-func (m *defaultIntegral) IntegralExpireCheck(ctx context.Context, in *AddReq) (*AddResp, error) {
+func (m *defaultIntegral) IntegralExpireCheck(ctx context.Context, in *Req) (*Resp, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
 	return client.IntegralExpireCheck(ctx, in)
 }

+ 13 - 5
rpc/internal/logic/integralbalancechecklogic.go

@@ -2,7 +2,6 @@ package logic
 
 import (
 	"context"
-	"fmt"
 	"points_service/rpc/integral"
 	"points_service/rpc/internal/svc"
 
@@ -24,10 +23,19 @@ func NewIntegralBalanceCheckLogic(ctx context.Context, svcCtx *svc.ServiceContex
 }
 
 // 积分余额查询
-func (l *IntegralBalanceCheckLogic) IntegralBalanceCheck(in *integral.AddReq) (*integral.AddResp, error) {
+func (l *IntegralBalanceCheckLogic) IntegralBalanceCheck(in *integral.Req) (*integral.Resp, error) {
 	// todo: add your logic here and delete this line
+	result := &integral.Resp{}
 	var  bc int64
-	flag,bc := integralService.IntegralBalanceCheckService("ABC","10000")
-	fmt.Println(flag,bc)
-	return &integral.AddResp{}, nil
+	flag,bc := integralService.IntegralBalanceCheckService(in.UserId,in.AppId)
+	if flag {
+		result.Code = 1
+		result.Data = bc
+		result.Message = "积分余额查询成功"
+		return result, nil
+	}
+	result.Code = 0
+	result.Data = 0
+	result.Message = "暂无积分余额"
+	return result, nil
 }

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

@@ -2,7 +2,6 @@ package logic
 
 import (
 	"context"
-	"fmt"
 	"points_service/entity"
 	"points_service/service"
 
@@ -31,18 +30,19 @@ func NewIntegralConsumeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *I
 }
 
 // 消耗积分
-func (l *IntegralConsumeLogic) IntegralConsume(in *integral.AddReq) (*integral.AddResp, error) {
+func (l *IntegralConsumeLogic) IntegralConsume(in *integral.Req) (*integral.Resp, error) {
 	// todo: add your logic here and delete this line
+	result := &integral.Resp{}
 	dat := entity.FlowJSON{}
 	dat.UserId = in.UserId
-	dat.PointType = 2003
-	dat.BusinessTypeId = 1
-	dat.BusinessType = "1"
-	dat.Point = in.CountPoints
-	dat.EndDate = "2021-03-11"
-	dat.AppId = 10000
-	fmt.Println(integralService.IntegralConsumeService(dat))
-	return &integral.AddResp{
-		Status: true,
-	},nil
+	dat.PointType = in.PointType
+	dat.BusinessTypeId = in.BusinessTypeId
+	dat.BusinessType = in.BusinessType
+	dat.Point = in.Point
+	dat.EndDate = in.EndDate
+	dat.AppId = in.AppId
+	code,msg := integralService.IntegralConsumeService(dat)
+	result.Code = code
+	result.Message = msg
+	return result,nil
 }

+ 13 - 8
rpc/internal/logic/integraldetailedchecklogic.go

@@ -26,15 +26,20 @@ func NewIntegralDetailedCheckLogic(ctx context.Context, svcCtx *svc.ServiceConte
 }
 
 // 积分明细查询
-func (l *IntegralDetailedCheckLogic) IntegralDetailedCheck(in *integral.AddReq) (*integral.AddResp, error) {
+func (l *IntegralDetailedCheckLogic) IntegralDetailedCheck(in *integral.Req) (*integral.RespList, error) {
 	// todo: add your logic here and delete this line
+	result := &integral.RespList{}
 	dat := entity.FlowJSON{}
 	dat.UserId = in.UserId
-	dat.EndDate = "2021-03"
-	dat.AppId = 10000
-	dat.Page=1;
-	dat.PageSize=2;
-	data,count := integralService.IntegralDetailedCheck(dat)
-	fmt.Println(count,data)
-	return &integral.AddResp{}, nil
+	dat.EndDate = in.EndDate
+	dat.AppId = in.AppId
+	dat.Page = in.Page
+	dat.PageSize = in.PageSize
+	data, count := integralService.IntegralDetailedCheck(dat)
+	fmt.Println(count, data)
+	result.Code = entity.SuccessCode
+	result.Data = data
+	result.Count = count
+	result.Message = "积分明细查询成功"
+	return result, nil
 }

+ 5 - 9
rpc/internal/logic/integralexpirechecklogic.go

@@ -2,7 +2,6 @@ package logic
 
 import (
 	"context"
-	"fmt"
 	"points_service/entity"
 
 	"points_service/rpc/integral"
@@ -26,19 +25,16 @@ func NewIntegralExpireCheckLogic(ctx context.Context, svcCtx *svc.ServiceContext
 }
 
 // 到期积分查询
-func (l *IntegralExpireCheckLogic) IntegralExpireCheck(in *integral.AddReq) (*integral.AddResp, error) {
+func (l *IntegralExpireCheckLogic) IntegralExpireCheck(in *integral.Req) (*integral.Resp, error) {
 	// todo: add your logic here and delete this line
-	result := &integral.AddResp{}
+	result := &integral.Resp{}
 	dat := entity.ExpireJSON{}
 	dat.UserId = in.UserId
 	dat.EndDate = "2021-03-16"
 	dat.AppId = 10000
 	dataType,points := integralService.IntegralExpireCheckService(dat)
-	res := make(map[string]interface{})
-	res["code"] = dataType
-	res["data"] = points
-	res["msg"] = "到期积分查询成功"
-	fmt.Println(res)
-	result.Status = true
+	result.Code = dataType
+	result.Data = points
+	result.Message = "到期积分查询成功"
 	return result,nil
 }

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

@@ -2,6 +2,7 @@ package logic
 
 import (
 	"context"
+	"points_service/entity"
 
 	"points_service/rpc/integral"
 	"points_service/rpc/internal/svc"
@@ -24,8 +25,16 @@ func NewIntegralGuardLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Int
 }
 
 // 积分守护
-func (l *IntegralGuardLogic) IntegralGuard(in *integral.AddReq) (*integral.AddResp, error) {
+func (l *IntegralGuardLogic) IntegralGuard(in *integral.Req) (*integral.Resp, error) {
 	// todo: add your logic here and delete this line
-	integralService.IntegralGuardService("2021-03-13 23:59:59")
-	return &integral.AddResp{}, nil
+	result := &integral.Resp{}
+	flag := integralService.IntegralGuardService(in.EndDate)
+	if flag {
+		result.Code = entity.SuccessCode
+		result.Message = "积分守护成功"
+		return result, nil
+	}
+	result.Code = entity.ErrorCode
+	result.Message = "积分守护失败"
+	return result, nil
 }

+ 16 - 17
rpc/internal/logic/integralharvestlogic.go

@@ -25,28 +25,27 @@ func NewIntegralHarvestLogic(ctx context.Context, svcCtx *svc.ServiceContext) *I
 }
 
 // 收获积分
-func (l *IntegralHarvestLogic) IntegralHarvest(in *integral.AddReq) (*integral.AddResp, error) {
+func (l *IntegralHarvestLogic) IntegralHarvest(in *integral.Req) (*integral.Resp, error) {
+	result := &integral.Resp{}
 	dat := entity.FlowJSON{}
-	dat.PointType = 1
-	dat.BusinessTypeId = 1
-	dat.BusinessType = "1"
-	dat.EndDate = "2021-03-10"
-	dat.AppId = 10000
-	dat.OperationType = false
+	dat.PointType = in.PointType
+	dat.BusinessTypeId = in.BusinessTypeId
+	dat.BusinessType = in.BusinessType
+	dat.EndDate = in.EndDate
+	dat.AppId = in.AppId
+	dat.OperationType = in.OperationType
 	dat.UserId=in.UserId
-	dat.Point=in.CountPoints
+	dat.Point=in.Point
 	code, msg := integralService.IntegralAddService(dat)
 	fmt.Println(code,msg)
-	if (code == 1) {
-		return &integral.AddResp{
-			Status: true,
-			Msg:    msg,
-		}, nil
+	if code == 1 {
+		result.Code = entity.SuccessCode
+		result.Message = "获取积分成功"
+		return result, nil
 	} else {
-		return &integral.AddResp{
-			Status: false,
-			Msg:    msg,
-		}, nil
+		result.Code = entity.ErrorCode
+		result.Message = "获取积分失败"
+		return result, nil
 	}
 
 }

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

@@ -22,37 +22,37 @@ func NewIntegralServer(svcCtx *svc.ServiceContext) *IntegralServer {
 }
 
 // 收获积分
-func (s *IntegralServer) IntegralHarvest(ctx context.Context, in *integral.AddReq) (*integral.AddResp, error) {
+func (s *IntegralServer) IntegralHarvest(ctx context.Context, in *integral.Req) (*integral.Resp, error) {
 	l := logic.NewIntegralHarvestLogic(ctx, s.svcCtx)
 	return l.IntegralHarvest(in)
 }
 
 // 消耗积分
-func (s *IntegralServer) IntegralConsume(ctx context.Context, in *integral.AddReq) (*integral.AddResp, error) {
+func (s *IntegralServer) IntegralConsume(ctx context.Context, in *integral.Req) (*integral.Resp, error) {
 	l := logic.NewIntegralConsumeLogic(ctx, s.svcCtx)
 	return l.IntegralConsume(in)
 }
 
 // 积分余额查询
-func (s *IntegralServer) IntegralBalanceCheck(ctx context.Context, in *integral.AddReq) (*integral.AddResp, error) {
+func (s *IntegralServer) IntegralBalanceCheck(ctx context.Context, in *integral.Req) (*integral.Resp, error) {
 	l := logic.NewIntegralBalanceCheckLogic(ctx, s.svcCtx)
 	return l.IntegralBalanceCheck(in)
 }
 
 // 积分明细查询
-func (s *IntegralServer) IntegralDetailedCheck(ctx context.Context, in *integral.AddReq) (*integral.AddResp, error) {
+func (s *IntegralServer) IntegralDetailedCheck(ctx context.Context, in *integral.Req) (*integral.RespList, error) {
 	l := logic.NewIntegralDetailedCheckLogic(ctx, s.svcCtx)
 	return l.IntegralDetailedCheck(in)
 }
 
 // 积分守护
-func (s *IntegralServer) IntegralGuard(ctx context.Context, in *integral.AddReq) (*integral.AddResp, error) {
+func (s *IntegralServer) IntegralGuard(ctx context.Context, in *integral.Req) (*integral.Resp, error) {
 	l := logic.NewIntegralGuardLogic(ctx, s.svcCtx)
 	return l.IntegralGuard(in)
 }
 
 // 到期积分查询
-func (s *IntegralServer) IntegralExpireCheck(ctx context.Context, in *integral.AddReq) (*integral.AddResp, error) {
+func (s *IntegralServer) IntegralExpireCheck(ctx context.Context, in *integral.Req) (*integral.Resp, error) {
 	l := logic.NewIntegralExpireCheckLogic(ctx, s.svcCtx)
 	return l.IntegralExpireCheck(in)
 }

+ 8 - 8
rpc/test/consume_test.go

@@ -31,7 +31,7 @@ func init() {
 func  Test_Consume(t *testing.T)  {
 	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
-	req := &integral.AddReq{UserId: "ABC", CountPoints: 24}
+	req := &integral.Req{UserId: "ABC",PointType:2003,BusinessTypeId:1,BusinessType:"1", Point: 24,EndDate:"2021-03-11",AppId: 10000}
 	res, err := FileSystem.IntegralConsume(ctx, req)
 	log.Println("err ", err)
 	log.Println("req ", res)
@@ -40,7 +40,7 @@ func  Test_Consume(t *testing.T)  {
 func  Test_Add(t *testing.T)  {
 	ctx, _ := context.WithTimeout(context.Background(), 500*time.Second)
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
-	req := &integral.AddReq{UserId: "xzh", CountPoints: 123}
+	req := &integral.Req{UserId: "xzh", Point: 123}
 	res, err := FileSystem.IntegralHarvest(ctx, req)
 	log.Println("err ", err)
 	log.Println("req ", res)
@@ -49,7 +49,7 @@ func  Test_Add(t *testing.T)  {
 func  Test_serach(t *testing.T)  {
 	ctx, _ := context.WithTimeout(context.Background(), 500*time.Second)
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
-	req := &integral.AddReq{UserId: "xzh10", CountPoints: 123}
+	req := &integral.Req{UserId: "xzh10", Point: 123}
 	res, err := FileSystem.IntegralDetailedCheck(ctx, req)
 	log.Println("err ", err)
 	log.Println("req ", res)
@@ -62,7 +62,7 @@ func  Test_Ad(t *testing.T)  {
 	conf.MustLoad(*configFile, &c)
 	ctx := svc.NewServiceContext(c)
 	srv := server.NewIntegralServer(ctx)
-	req := &integral.AddReq{UserId: "xzh10", CountPoints: 100}
+	req := &integral.Req{UserId: "xzh10", Point: 100}
 	fmt.Println(srv.IntegralHarvest(context.Background(), req))
 }
 func  Test_Delete(t *testing.T)  {
@@ -70,14 +70,14 @@ func  Test_Delete(t *testing.T)  {
 	conf.MustLoad(*configFile, &c)
 	ctx := svc.NewServiceContext(c)
 	srv := server.NewIntegralServer(ctx)
-	req := &integral.AddReq{UserId: "xzh10", CountPoints: 10}
+	req := &integral.Req{UserId: "xzh10", Point: 10}
 	fmt.Println(srv.IntegralConsume(context.Background(), req))
 }
 
 func  Test_Expire(t *testing.T)  {
 	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
-	req := &integral.AddReq{UserId: "ABC", CountPoints: 123}
+	req := &integral.Req{UserId: "ABC", Point: 123}
 	res, err := FileSystem.IntegralExpireCheck(ctx, req)
 	log.Println("err ", err)
 	log.Println("req ", res)
@@ -86,7 +86,7 @@ func  Test_Expire(t *testing.T)  {
 func  Test_Guard(t *testing.T)  {
 	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
-	req := &integral.AddReq{UserId: "xzh", CountPoints: 123}
+	req := &integral.Req{UserId: "xzh", Point: 123}
 	res, err := FileSystem.IntegralGuard(ctx, req)
 	log.Println("err ", err)
 	log.Println("req ", res)
@@ -95,7 +95,7 @@ func  Test_Guard(t *testing.T)  {
 func  Test_BalanceCheck(t *testing.T)  {
 	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
-	req := &integral.AddReq{UserId: "xzh", CountPoints: 123}
+	req := &integral.Req{UserId: "xzh", Point: 123}
 	res, err := FileSystem.IntegralBalanceCheck(ctx, req)
 	log.Println("err ", err)
 	log.Println("req ", res)

+ 1 - 1
rpc/test/test1_test.go

@@ -29,7 +29,7 @@ func init() {
 func  Test_add(t *testing.T)  {
 	ctx, _ := context.WithTimeout(context.Background(), 5*time.Second)
 	FileSystem :=integralclient.NewIntegral(zrpc.MustNewClient(c.FileSystemConf))
-	req := &integral.AddReq{UserId: "xzh", CountPoints: 123}
+	req := &integral.Req{UserId: "xzh", Point: 123}
 	res, err := FileSystem.IntegralBalanceCheck(ctx, req)
 	log.Println("err ", err)
 	log.Println("req ", res)

+ 8 - 7
service/integralService.go

@@ -3,13 +3,14 @@ package service
 import (
 	"log"
 	"points_service/entity"
+	"points_service/rpc/integral"
 	"time"
 )
 
 type IntegralService struct{}
 
 //新增积分流水
-func (service *IntegralService) IntegralAddService(data entity.FlowJSON) (int, string) {
+func (service *IntegralService) IntegralAddService(data entity.FlowJSON) (int64, string) {
 	orm := entity.Engine
 	flow := entity.Flow{}
 	flow.UserId = data.UserId
@@ -101,7 +102,7 @@ func (service *IntegralService) IntegralAddService(data entity.FlowJSON) (int, s
 }
 
 //消耗积分流水
-func (service *IntegralService) IntegralConsumeService(data entity.FlowJSON) (int, string) {
+func (service *IntegralService) IntegralConsumeService(data entity.FlowJSON) (int64, string) {
 	var af = int64(0)
 	orm := entity.Engine
 	flow := entity.Flow{}
@@ -201,7 +202,7 @@ func (service *IntegralService) IntegralConsumeService(data entity.FlowJSON) (in
 }
 
 //到期积分查询
-func (service *IntegralService) IntegralExpireCheckService(data entity.ExpireJSON) (int,int64) {
+func (service *IntegralService) IntegralExpireCheckService(data entity.ExpireJSON) (int64,int64) {
 	orm := entity.Engine
 	var solde entity.Solde
 	var err error
@@ -419,7 +420,7 @@ func (service *IntegralService) IntegralGuardService(endDate string) bool {
 }
 
 //积分余额查询
-func (service *IntegralService) IntegralBalanceCheckService(userId, appId string) (bool, int64) {
+func (service *IntegralService) IntegralBalanceCheckService(userId string,appId int64) (bool, int64) {
 	orm := entity.Engine
 	balance := entity.Balance{}
 	b, err := orm.Table("integral_balance").
@@ -433,15 +434,15 @@ func (service *IntegralService) IntegralBalanceCheckService(userId, appId string
 }
 
 //按月查询积分使用情况
-func (service *IntegralService) IntegralDetailedCheck(data entity.FlowJSON) ([]entity.FlowReq,int64) {
+func (service *IntegralService) IntegralDetailedCheck(data entity.FlowJSON) ([]*integral.Point,int64) {
 	orm := entity.Engine
-	flowReq := []entity.FlowReq{}
+	flowReq := []*integral.Point{}
 	numb,err := orm.Table("integral_flow").Alias("flow").
 		Select("flow.*,pt.name").
 		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).
 		Desc("flow.createTime").
-		Limit(data.PageSize, (data.Page-1)*data.PageSize).
+		Limit(int(data.PageSize), (int(data.Page-1))*int(data.PageSize)).
 		FindAndCount(&flowReq)
 	if err != nil {
 		log.Println(err)