Forráskód Böngészése

充值额度显示

WH01243 1 éve
szülő
commit
7cf1306d9e

+ 1 - 0
README.md

@@ -1,3 +1,4 @@
 剑鱼会员积分服务
 接口文档地址:https://www.showdoc.com.cn/1288447268514733
 
+ goctl api go -api integral.api -dir .

+ 6 - 4
api/integral.api

@@ -33,10 +33,12 @@ type Point {
 
 type response {
 	// TODO: add members here and delete this comment
-	Code    int64  `form:"code"`
-	Message string `form:"message"`
-	Data    int64  `form:"data"`
-	Expire  int64  `form:"expire"`
+	Code     int64   `form:"code"`
+	Message  string  `form:"message"`
+	Data     int64   `form:"data"`
+	Expire   int64   `form:"expire"`
+	Recharge int64   `form:"recharge"`
+	Worth    float64 `form:"worth"`
 }
 
 type checkReq {

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

@@ -9,8 +9,8 @@ import (
 	"github.com/zeromicro/go-zero/rest"
 )
 
-func RegisterHandlers(engine *rest.Server, serverCtx *svc.ServiceContext) {
-	engine.AddRoutes(
+func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
+	server.AddRoutes(
 		[]rest.Route{
 			{
 				Method:  http.MethodGet,

+ 2 - 0
api/internal/logic/integralbalancechecklogic.go

@@ -40,5 +40,7 @@ func (l *IntegralBalanceCheckLogic) IntegralBalanceCheck(req types.CheckReq) (*t
 	result.Data = resp.Data
 	result.Expire = resp.Expire
 	result.Message = resp.Message
+	result.Recharge = resp.Recharge
+	result.Worth = float64(resp.Data / 100)
 	return result, nil
 }

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

@@ -31,10 +31,12 @@ type Point struct {
 }
 
 type Response struct {
-	Code    int64  `form:"code"`
-	Message string `form:"message"`
-	Data    int64  `form:"data"`
-	Expire  int64  `form:"expire"`
+	Code     int64   `form:"code"`
+	Message  string  `form:"message"`
+	Data     int64   `form:"data"`
+	Expire   int64   `form:"expire"`
+	Recharge int64   `form:"recharge"`
+	Worth    float64 `form:"worth"`
 }
 
 type CheckReq struct {

+ 18 - 16
entity/integral.go

@@ -5,30 +5,32 @@ import (
 	"time"
 )
 
-//定义orm引擎
+// 定义orm引擎
 var Engine *xorm.Engine
 
-//定义返回状态
+// 定义返回状态
 const (
 	SuccessCode int64 = 1
 	ErrorCode   int64 = 0
 )
 
-//流水类型1加-1减
+// 流水类型1加-1减
 const (
 	AddCode    int64 = 1
 	ReduceCode int64 = -1
 )
 
-//积分余额
+// 积分余额
 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       string `xorm:"appId" form:"appId" json:"appId"`                   //剑鱼标识
+	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           string `xorm:"appId" form:"appId" json:"appId"`                               //剑鱼标识
+	PerManEntPoints int64  `xorm:"perManEntPoints" form:"perManEntPoints" json:"perManEntPoints"` //充值积分
+
 }
 
-//积分余额
+// 积分余额
 type BalanceUpdate struct {
 	UserId      string `xorm:"userId" form:"userId" json:"userId"`                //用户标识
 	CountPoints int64  `xorm:"countPoints" form:"countPoints" json:"countPoints"` //合计
@@ -36,7 +38,7 @@ type BalanceUpdate struct {
 	Change      bool   `xorm:"change" form:"change" json:"change"`                //修改方式true新增 false消耗
 }
 
-//积分流水
+// 积分流水
 type Flow struct {
 	Id            int64  `xorm:"pk autoincr id" form:"id" json:"id"`
 	UserId        string `xorm:"userId" form:"userId" json:"userId"`                      //用户标识
@@ -53,7 +55,7 @@ type Flow struct {
 	SerialNumber  string `xorm:"serialNumber" form:"serialNumber" json:"serialNumber"`    //流水号
 }
 
-//积分流水
+// 积分流水
 type FlowReq struct {
 	Id           int64     `xorm:"pk autoincr id" form:"id" json:"id"`
 	UserId       string    `xorm:"userId" form:"userId" json:"userId"`                   //用户标识
@@ -70,7 +72,7 @@ type FlowReq struct {
 	Abstract     string    `xorm:"abstract" form:"abstract" json:"abstract"`             //积分类型名称
 }
 
-//积分结存
+// 积分结存
 type Solde struct {
 	Id              int64  `xorm:"pk autoincr id" form:"id" json:"id"`
 	PerManEntPoints int64  `xorm:"perManEntPoints" form:"perManEntPoints" json:"perManEntPoints"` //永久积分
@@ -80,7 +82,7 @@ type Solde struct {
 	AppId           string `xorm:"appId" form:"appId" json:"appId"`                               //剑鱼标识
 }
 
-//积分流水
+// 积分流水
 type FlowJSON struct {
 	UserId        string `xorm:"userId" form:"userId" json:"userId"`                      //用户标识
 	PointType     int64  `xorm:"pointType" form:"pointType" json:"pointType"`             //积分类型
@@ -97,14 +99,14 @@ type FlowJSON struct {
 	SearchType    int64  `xorm:"searchType" form:"searchType" json:"searchType"`          //searchType 0全部 1新增 -1消耗
 }
 
-//到期积分查询
+// 到期积分查询
 type ExpireJSON struct {
 	UserId  string `xorm:"userId" form:"userId" json:"userId"`    //用户标识
 	EndDate string `xorm:"endDate" form:"endDate" json:"endDate"` //截止时间
 	AppId   string `xorm:"appId" form:"appId" json:"appId"`       //剑鱼标识
 }
 
-//积分结存修改
+// 积分结存修改
 type SoldeUpdate struct {
 	Id         int64  `xorm:"pk autoincr id" form:"id" json:"id"`
 	PointsType bool   `xorm:"pointsType" form:"pointsType" json:"pointsType"` //积分类型true永久 false失效
@@ -114,7 +116,7 @@ type SoldeUpdate struct {
 	AppId      string `xorm:"appId" form:"appId" json:"appId"`                //剑鱼标识
 }
 
-//积分守护
+// 积分守护
 type GuardJSON struct {
 	UserId    string `xorm:"userId" form:"userId" json:"userId"`          //用户标识
 	PointType int64  `xorm:"pointType" form:"pointType" json:"pointType"` //积分类型

+ 2 - 1
rpc/integral.proto

@@ -1,7 +1,7 @@
 syntax = "proto3";
 
 package integral;
-
+option go_package = "./integral";
 message Req {
   string userId = 1;
   string appId = 2;
@@ -23,6 +23,7 @@ message Resp {
   int64 data = 3;   //响应内容
   int64 expire = 4; //到期余额
   string serialNumber=5;//流水号
+  int64 recharge=6;//充值剩余量
 }
 
 message RespList {

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

@@ -1,17 +1,12 @@
 // Code generated by protoc-gen-go. DO NOT EDIT.
 // versions:
-// 	protoc-gen-go v1.25.0
-// 	protoc        v3.15.3
+// 	protoc-gen-go v1.31.0
+// 	protoc        v3.15.1
 // source: integral.proto
 
 package integral
 
 import (
-	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"
@@ -25,10 +20,6 @@ const (
 	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
 )
 
-// This is a compile-time assertion that a sufficiently up-to-date version
-// of the legacy proto package is being used.
-const _ = proto.ProtoPackageIsVersion4
-
 type Req struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -174,6 +165,7 @@ type Resp struct {
 	Data         int64  `protobuf:"varint,3,opt,name=data,proto3" json:"data,omitempty"`                //响应内容
 	Expire       int64  `protobuf:"varint,4,opt,name=expire,proto3" json:"expire,omitempty"`            //到期余额
 	SerialNumber string `protobuf:"bytes,5,opt,name=serialNumber,proto3" json:"serialNumber,omitempty"` //流水号
+	Recharge     int64  `protobuf:"varint,6,opt,name=recharge,proto3" json:"recharge,omitempty"`        //充值剩余量
 }
 
 func (x *Resp) Reset() {
@@ -243,6 +235,13 @@ func (x *Resp) GetSerialNumber() string {
 	return ""
 }
 
+func (x *Resp) GetRecharge() int64 {
+	if x != nil {
+		return x.Recharge
+	}
+	return 0
+}
+
 type RespList struct {
 	state         protoimpl.MessageState
 	sizeCache     protoimpl.SizeCache
@@ -529,7 +528,7 @@ var file_integral_proto_rawDesc = []byte{
 	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, 0x1a, 0x0a, 0x08, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x0c, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x08, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x84, 0x01, 0x0a,
+	0x28, 0x09, 0x52, 0x08, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0xa0, 0x01, 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,
@@ -538,63 +537,66 @@ var file_integral_proto_rawDesc = []byte{
 	0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x12,
 	0x22, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18,
 	0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4e, 0x75, 0x6d,
-	0x62, 0x65, 0x72, 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, 0xa9, 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, 0x1c, 0x0a, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18,
-	0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65,
-	0x12, 0x1a, 0x0a, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01,
-	0x28, 0x09, 0x52, 0x08, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a,
-	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
-	0x52, 0x0a, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05,
-	0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x05, 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, 0x06, 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, 0x07, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04,
-	0x53, 0x6f, 0x72, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x53, 0x6f, 0x72, 0x74,
-	0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04,
-	0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74,
-	0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74,
-	0x12, 0x22, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72,
-	0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4e, 0x75,
-	0x6d, 0x62, 0x65, 0x72, 0x22, 0x5f, 0x0a, 0x09, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x49, 0x6e, 0x66,
-	0x6f, 0x12, 0x1c, 0x0a, 0x09, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x55, 0x73, 0x65, 0x72, 0x18, 0x01,
-	0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12,
-	0x1e, 0x0a, 0x0a, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20,
-	0x01, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12,
-	0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
-	0x61, 0x70, 0x70, 0x49, 0x64, 0x32, 0xf9, 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,
+	0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x18,
+	0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x72, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 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, 0xa9, 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, 0x1c,
+	0x0a, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x09, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1a, 0x0a, 0x08,
+	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
+	0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x73, 0x6f, 0x75, 0x72,
+	0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x6f,
+	0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x6f, 0x69, 0x6e,
+	0x74, 0x18, 0x05, 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, 0x06, 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, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x07, 0x65, 0x6e, 0x64, 0x44, 0x61, 0x74, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x53, 0x6f, 0x72, 0x74,
+	0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x53, 0x6f, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04,
+	0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
+	0x12, 0x1a, 0x0a, 0x08, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x18, 0x0a, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x08, 0x61, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x22, 0x0a, 0x0c,
+	0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x0b, 0x20, 0x01,
+	0x28, 0x09, 0x52, 0x0c, 0x73, 0x65, 0x72, 0x69, 0x61, 0x6c, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72,
+	0x22, 0x5f, 0x0a, 0x09, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1c, 0x0a,
+	0x09, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x55, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
+	0x52, 0x09, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x0a, 0x0a, 0x6d,
+	0x65, 0x72, 0x67, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
+	0x0a, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x61,
+	0x70, 0x70, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x49,
+	0x64, 0x32, 0xf9, 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, 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, 0x12,
-	0x30, 0x0a, 0x09, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x12, 0x13, 0x2e, 0x69,
-	0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x49, 0x6e, 0x66,
-	0x6f, 0x1a, 0x0e, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x73,
-	0x70, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	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, 0x12, 0x30, 0x0a, 0x09, 0x75,
+	0x73, 0x65, 0x72, 0x4d, 0x65, 0x72, 0x67, 0x65, 0x12, 0x13, 0x2e, 0x69, 0x6e, 0x74, 0x65, 0x67,
+	0x72, 0x61, 0x6c, 0x2e, 0x6d, 0x65, 0x72, 0x67, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x0e, 0x2e,
+	0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0c, 0x5a,
+	0x0a, 0x2e, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x62, 0x06, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x33,
 }
 
 var (
@@ -625,14 +627,14 @@ var file_integral_proto_depIdxs = []int32{
 	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
-	4, // 7: integral.Integral.UserMerge:input_type -> integral.mergeInfo
+	4, // 7: integral.Integral.userMerge:input_type -> integral.mergeInfo
 	1, // 8: integral.Integral.integralHarvest:output_type -> integral.Resp
 	1, // 9: integral.Integral.integralConsume:output_type -> integral.Resp
 	1, // 10: integral.Integral.integralBalanceCheck:output_type -> integral.Resp
 	2, // 11: integral.Integral.integralDetailedCheck:output_type -> integral.RespList
 	1, // 12: integral.Integral.integralGuard:output_type -> integral.Resp
 	1, // 13: integral.Integral.integralExpireCheck:output_type -> integral.Resp
-	1, // 14: integral.Integral.UserMerge:output_type -> integral.Resp
+	1, // 14: integral.Integral.userMerge:output_type -> integral.Resp
 	8, // [8:15] is the sub-list for method output_type
 	1, // [1:8] is the sub-list for method input_type
 	1, // [1:1] is the sub-list for extension type_name
@@ -726,313 +728,3 @@ func file_integral_proto_init() {
 	file_integral_proto_goTypes = nil
 	file_integral_proto_depIdxs = nil
 }
-
-// Reference imports to suppress errors if they are not otherwise used.
-var _ context.Context
-var _ grpc.ClientConnInterface
-
-// This is a compile-time assertion to ensure that this generated file
-// is compatible with the grpc package it is being compiled against.
-const _ = grpc.SupportPackageIsVersion6
-
-// IntegralClient is the client API for Integral service.
-//
-// 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 *Req, opts ...grpc.CallOption) (*Resp, error)
-	//消耗积分
-	IntegralConsume(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
-	//积分余额查询
-	IntegralBalanceCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
-	//积分明细查询
-	IntegralDetailedCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*RespList, error)
-	//积分守护
-	IntegralGuard(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
-	//到期积分查询
-	IntegralExpireCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
-	//合并账号
-	UserMerge(ctx context.Context, in *MergeInfo, opts ...grpc.CallOption) (*Resp, error)
-}
-
-type integralClient struct {
-	cc grpc.ClientConnInterface
-}
-
-func NewIntegralClient(cc grpc.ClientConnInterface) IntegralClient {
-	return &integralClient{cc}
-}
-
-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
-	}
-	return out, nil
-}
-
-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
-	}
-	return out, nil
-}
-
-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
-	}
-	return out, nil
-}
-
-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
-	}
-	return out, nil
-}
-
-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
-	}
-	return out, nil
-}
-
-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
-	}
-	return out, nil
-}
-
-func (c *integralClient) UserMerge(ctx context.Context, in *MergeInfo, opts ...grpc.CallOption) (*Resp, error) {
-	out := new(Resp)
-	err := c.cc.Invoke(ctx, "/integral.Integral/UserMerge", in, out, opts...)
-	if err != nil {
-		return nil, err
-	}
-	return out, nil
-}
-
-// IntegralServer is the server API for Integral service.
-type IntegralServer interface {
-	//收获积分
-	IntegralHarvest(context.Context, *Req) (*Resp, error)
-	//消耗积分
-	IntegralConsume(context.Context, *Req) (*Resp, error)
-	//积分余额查询
-	IntegralBalanceCheck(context.Context, *Req) (*Resp, error)
-	//积分明细查询
-	IntegralDetailedCheck(context.Context, *Req) (*RespList, error)
-	//积分守护
-	IntegralGuard(context.Context, *Req) (*Resp, error)
-	//到期积分查询
-	IntegralExpireCheck(context.Context, *Req) (*Resp, error)
-	//合并账号
-	UserMerge(context.Context, *MergeInfo) (*Resp, error)
-}
-
-// UnimplementedIntegralServer can be embedded to have forward compatible implementations.
-type UnimplementedIntegralServer struct {
-}
-
-func (*UnimplementedIntegralServer) IntegralHarvest(context.Context, *Req) (*Resp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method IntegralHarvest not implemented")
-}
-func (*UnimplementedIntegralServer) IntegralConsume(context.Context, *Req) (*Resp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method IntegralConsume not implemented")
-}
-func (*UnimplementedIntegralServer) IntegralBalanceCheck(context.Context, *Req) (*Resp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method IntegralBalanceCheck not implemented")
-}
-func (*UnimplementedIntegralServer) IntegralDetailedCheck(context.Context, *Req) (*RespList, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method IntegralDetailedCheck not implemented")
-}
-func (*UnimplementedIntegralServer) IntegralGuard(context.Context, *Req) (*Resp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method IntegralGuard not implemented")
-}
-func (*UnimplementedIntegralServer) IntegralExpireCheck(context.Context, *Req) (*Resp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method IntegralExpireCheck not implemented")
-}
-func (*UnimplementedIntegralServer) UserMerge(context.Context, *MergeInfo) (*Resp, error) {
-	return nil, status.Errorf(codes.Unimplemented, "method UserMerge not implemented")
-}
-
-func RegisterIntegralServer(s *grpc.Server, srv IntegralServer) {
-	s.RegisterService(&_Integral_serviceDesc, srv)
-}
-
-func _Integral_IntegralHarvest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(Req)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(IntegralServer).IntegralHarvest(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/integral.Integral/IntegralHarvest",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		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(Req)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(IntegralServer).IntegralConsume(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/integral.Integral/IntegralConsume",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		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(Req)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(IntegralServer).IntegralBalanceCheck(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/integral.Integral/IntegralBalanceCheck",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		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(Req)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(IntegralServer).IntegralDetailedCheck(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/integral.Integral/IntegralDetailedCheck",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		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(Req)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(IntegralServer).IntegralGuard(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/integral.Integral/IntegralGuard",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		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(Req)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(IntegralServer).IntegralExpireCheck(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/integral.Integral/IntegralExpireCheck",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(IntegralServer).IntegralExpireCheck(ctx, req.(*Req))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-func _Integral_UserMerge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
-	in := new(MergeInfo)
-	if err := dec(in); err != nil {
-		return nil, err
-	}
-	if interceptor == nil {
-		return srv.(IntegralServer).UserMerge(ctx, in)
-	}
-	info := &grpc.UnaryServerInfo{
-		Server:     srv,
-		FullMethod: "/integral.Integral/UserMerge",
-	}
-	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
-		return srv.(IntegralServer).UserMerge(ctx, req.(*MergeInfo))
-	}
-	return interceptor(ctx, in, info, handler)
-}
-
-var _Integral_serviceDesc = grpc.ServiceDesc{
-	ServiceName: "integral.Integral",
-	HandlerType: (*IntegralServer)(nil),
-	Methods: []grpc.MethodDesc{
-		{
-			MethodName: "integralHarvest",
-			Handler:    _Integral_IntegralHarvest_Handler,
-		},
-		{
-			MethodName: "integralConsume",
-			Handler:    _Integral_IntegralConsume_Handler,
-		},
-		{
-			MethodName: "integralBalanceCheck",
-			Handler:    _Integral_IntegralBalanceCheck_Handler,
-		},
-		{
-			MethodName: "integralDetailedCheck",
-			Handler:    _Integral_IntegralDetailedCheck_Handler,
-		},
-		{
-			MethodName: "integralGuard",
-			Handler:    _Integral_IntegralGuard_Handler,
-		},
-		{
-			MethodName: "integralExpireCheck",
-			Handler:    _Integral_IntegralExpireCheck_Handler,
-		},
-		{
-			MethodName: "UserMerge",
-			Handler:    _Integral_UserMerge_Handler,
-		},
-	},
-	Streams:  []grpc.StreamDesc{},
-	Metadata: "integral.proto",
-}

+ 345 - 0
rpc/integral/integral_grpc.pb.go

@@ -0,0 +1,345 @@
+// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
+// versions:
+// - protoc-gen-go-grpc v1.3.0
+// - protoc             v3.15.1
+// source: integral.proto
+
+package integral
+
+import (
+	context "context"
+	grpc "google.golang.org/grpc"
+	codes "google.golang.org/grpc/codes"
+	status "google.golang.org/grpc/status"
+)
+
+// This is a compile-time assertion to ensure that this generated file
+// is compatible with the grpc package it is being compiled against.
+// Requires gRPC-Go v1.32.0 or later.
+const _ = grpc.SupportPackageIsVersion7
+
+const (
+	Integral_IntegralHarvest_FullMethodName       = "/integral.Integral/integralHarvest"
+	Integral_IntegralConsume_FullMethodName       = "/integral.Integral/integralConsume"
+	Integral_IntegralBalanceCheck_FullMethodName  = "/integral.Integral/integralBalanceCheck"
+	Integral_IntegralDetailedCheck_FullMethodName = "/integral.Integral/integralDetailedCheck"
+	Integral_IntegralGuard_FullMethodName         = "/integral.Integral/integralGuard"
+	Integral_IntegralExpireCheck_FullMethodName   = "/integral.Integral/integralExpireCheck"
+	Integral_UserMerge_FullMethodName             = "/integral.Integral/userMerge"
+)
+
+// IntegralClient is the client API for Integral service.
+//
+// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
+type IntegralClient interface {
+	// 收获积分
+	IntegralHarvest(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
+	// 消耗积分
+	IntegralConsume(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
+	// 积分余额查询
+	IntegralBalanceCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
+	// 积分明细查询
+	IntegralDetailedCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*RespList, error)
+	// 积分守护
+	IntegralGuard(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
+	// 到期积分查询
+	IntegralExpireCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
+	// 合并账号
+	UserMerge(ctx context.Context, in *MergeInfo, opts ...grpc.CallOption) (*Resp, error)
+}
+
+type integralClient struct {
+	cc grpc.ClientConnInterface
+}
+
+func NewIntegralClient(cc grpc.ClientConnInterface) IntegralClient {
+	return &integralClient{cc}
+}
+
+func (c *integralClient) IntegralHarvest(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
+	err := c.cc.Invoke(ctx, Integral_IntegralHarvest_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *integralClient) IntegralConsume(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
+	err := c.cc.Invoke(ctx, Integral_IntegralConsume_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *integralClient) IntegralBalanceCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
+	err := c.cc.Invoke(ctx, Integral_IntegralBalanceCheck_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *integralClient) IntegralDetailedCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*RespList, error) {
+	out := new(RespList)
+	err := c.cc.Invoke(ctx, Integral_IntegralDetailedCheck_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *integralClient) IntegralGuard(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
+	err := c.cc.Invoke(ctx, Integral_IntegralGuard_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *integralClient) IntegralExpireCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
+	err := c.cc.Invoke(ctx, Integral_IntegralExpireCheck_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+func (c *integralClient) UserMerge(ctx context.Context, in *MergeInfo, opts ...grpc.CallOption) (*Resp, error) {
+	out := new(Resp)
+	err := c.cc.Invoke(ctx, Integral_UserMerge_FullMethodName, in, out, opts...)
+	if err != nil {
+		return nil, err
+	}
+	return out, nil
+}
+
+// IntegralServer is the server API for Integral service.
+// All implementations must embed UnimplementedIntegralServer
+// for forward compatibility
+type IntegralServer interface {
+	// 收获积分
+	IntegralHarvest(context.Context, *Req) (*Resp, error)
+	// 消耗积分
+	IntegralConsume(context.Context, *Req) (*Resp, error)
+	// 积分余额查询
+	IntegralBalanceCheck(context.Context, *Req) (*Resp, error)
+	// 积分明细查询
+	IntegralDetailedCheck(context.Context, *Req) (*RespList, error)
+	// 积分守护
+	IntegralGuard(context.Context, *Req) (*Resp, error)
+	// 到期积分查询
+	IntegralExpireCheck(context.Context, *Req) (*Resp, error)
+	// 合并账号
+	UserMerge(context.Context, *MergeInfo) (*Resp, error)
+	mustEmbedUnimplementedIntegralServer()
+}
+
+// UnimplementedIntegralServer must be embedded to have forward compatible implementations.
+type UnimplementedIntegralServer struct {
+}
+
+func (UnimplementedIntegralServer) IntegralHarvest(context.Context, *Req) (*Resp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method IntegralHarvest not implemented")
+}
+func (UnimplementedIntegralServer) IntegralConsume(context.Context, *Req) (*Resp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method IntegralConsume not implemented")
+}
+func (UnimplementedIntegralServer) IntegralBalanceCheck(context.Context, *Req) (*Resp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method IntegralBalanceCheck not implemented")
+}
+func (UnimplementedIntegralServer) IntegralDetailedCheck(context.Context, *Req) (*RespList, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method IntegralDetailedCheck not implemented")
+}
+func (UnimplementedIntegralServer) IntegralGuard(context.Context, *Req) (*Resp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method IntegralGuard not implemented")
+}
+func (UnimplementedIntegralServer) IntegralExpireCheck(context.Context, *Req) (*Resp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method IntegralExpireCheck not implemented")
+}
+func (UnimplementedIntegralServer) UserMerge(context.Context, *MergeInfo) (*Resp, error) {
+	return nil, status.Errorf(codes.Unimplemented, "method UserMerge not implemented")
+}
+func (UnimplementedIntegralServer) mustEmbedUnimplementedIntegralServer() {}
+
+// UnsafeIntegralServer may be embedded to opt out of forward compatibility for this service.
+// Use of this interface is not recommended, as added methods to IntegralServer will
+// result in compilation errors.
+type UnsafeIntegralServer interface {
+	mustEmbedUnimplementedIntegralServer()
+}
+
+func RegisterIntegralServer(s grpc.ServiceRegistrar, srv IntegralServer) {
+	s.RegisterService(&Integral_ServiceDesc, srv)
+}
+
+func _Integral_IntegralHarvest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(Req)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(IntegralServer).IntegralHarvest(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: Integral_IntegralHarvest_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		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(Req)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(IntegralServer).IntegralConsume(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: Integral_IntegralConsume_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		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(Req)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(IntegralServer).IntegralBalanceCheck(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: Integral_IntegralBalanceCheck_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		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(Req)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(IntegralServer).IntegralDetailedCheck(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: Integral_IntegralDetailedCheck_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		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(Req)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(IntegralServer).IntegralGuard(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: Integral_IntegralGuard_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		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(Req)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(IntegralServer).IntegralExpireCheck(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: Integral_IntegralExpireCheck_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(IntegralServer).IntegralExpireCheck(ctx, req.(*Req))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+func _Integral_UserMerge_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+	in := new(MergeInfo)
+	if err := dec(in); err != nil {
+		return nil, err
+	}
+	if interceptor == nil {
+		return srv.(IntegralServer).UserMerge(ctx, in)
+	}
+	info := &grpc.UnaryServerInfo{
+		Server:     srv,
+		FullMethod: Integral_UserMerge_FullMethodName,
+	}
+	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+		return srv.(IntegralServer).UserMerge(ctx, req.(*MergeInfo))
+	}
+	return interceptor(ctx, in, info, handler)
+}
+
+// Integral_ServiceDesc is the grpc.ServiceDesc for Integral service.
+// It's only intended for direct use with grpc.RegisterService,
+// and not to be introspected or modified (even as a copy)
+var Integral_ServiceDesc = grpc.ServiceDesc{
+	ServiceName: "integral.Integral",
+	HandlerType: (*IntegralServer)(nil),
+	Methods: []grpc.MethodDesc{
+		{
+			MethodName: "integralHarvest",
+			Handler:    _Integral_IntegralHarvest_Handler,
+		},
+		{
+			MethodName: "integralConsume",
+			Handler:    _Integral_IntegralConsume_Handler,
+		},
+		{
+			MethodName: "integralBalanceCheck",
+			Handler:    _Integral_IntegralBalanceCheck_Handler,
+		},
+		{
+			MethodName: "integralDetailedCheck",
+			Handler:    _Integral_IntegralDetailedCheck_Handler,
+		},
+		{
+			MethodName: "integralGuard",
+			Handler:    _Integral_IntegralGuard_Handler,
+		},
+		{
+			MethodName: "integralExpireCheck",
+			Handler:    _Integral_IntegralExpireCheck_Handler,
+		},
+		{
+			MethodName: "userMerge",
+			Handler:    _Integral_UserMerge_Handler,
+		},
+	},
+	Streams:  []grpc.StreamDesc{},
+	Metadata: "integral.proto",
+}

+ 24 - 25
rpc/integralclient/integral.go

@@ -1,8 +1,6 @@
-// Code generated by goctl. DO NOT EDIT!
+// Code generated by goctl. DO NOT EDIT.
 // Source: integral.proto
 
-//go:generate mockgen -destination ./integral_mock.go -package integralclient -source $GOFILE
-
 package integralclient
 
 import (
@@ -11,30 +9,31 @@ import (
 	"app.yhyue.com/moapp/jyPoints/rpc/integral"
 
 	"github.com/zeromicro/go-zero/zrpc"
+	"google.golang.org/grpc"
 )
 
 type (
 	MergeInfo = integral.MergeInfo
+	Point     = integral.Point
 	Req       = integral.Req
 	Resp      = integral.Resp
 	RespList  = integral.RespList
-	Point     = integral.Point
 
 	Integral interface {
 		// 收获积分
-		IntegralHarvest(ctx context.Context, in *Req) (*Resp, error)
+		IntegralHarvest(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
 		// 消耗积分
-		IntegralConsume(ctx context.Context, in *Req) (*Resp, error)
+		IntegralConsume(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
 		// 积分余额查询
-		IntegralBalanceCheck(ctx context.Context, in *Req) (*Resp, error)
+		IntegralBalanceCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
 		// 积分明细查询
-		IntegralDetailedCheck(ctx context.Context, in *Req) (*RespList, error)
+		IntegralDetailedCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*RespList, error)
 		// 积分守护
-		IntegralGuard(ctx context.Context, in *Req) (*Resp, error)
+		IntegralGuard(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
 		// 到期积分查询
-		IntegralExpireCheck(ctx context.Context, in *Req) (*Resp, error)
+		IntegralExpireCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error)
 		// 合并账号
-		UserMerge(ctx context.Context, in *MergeInfo) (*Resp, error)
+		UserMerge(ctx context.Context, in *MergeInfo, opts ...grpc.CallOption) (*Resp, error)
 	}
 
 	defaultIntegral struct {
@@ -49,43 +48,43 @@ func NewIntegral(cli zrpc.Client) Integral {
 }
 
 // 收获积分
-func (m *defaultIntegral) IntegralHarvest(ctx context.Context, in *Req) (*Resp, error) {
+func (m *defaultIntegral) IntegralHarvest(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
-	return client.IntegralHarvest(ctx, in)
+	return client.IntegralHarvest(ctx, in, opts...)
 }
 
 // 消耗积分
-func (m *defaultIntegral) IntegralConsume(ctx context.Context, in *Req) (*Resp, error) {
+func (m *defaultIntegral) IntegralConsume(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
-	return client.IntegralConsume(ctx, in)
+	return client.IntegralConsume(ctx, in, opts...)
 }
 
 // 积分余额查询
-func (m *defaultIntegral) IntegralBalanceCheck(ctx context.Context, in *Req) (*Resp, error) {
+func (m *defaultIntegral) IntegralBalanceCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
-	return client.IntegralBalanceCheck(ctx, in)
+	return client.IntegralBalanceCheck(ctx, in, opts...)
 }
 
 // 积分明细查询
-func (m *defaultIntegral) IntegralDetailedCheck(ctx context.Context, in *Req) (*RespList, error) {
+func (m *defaultIntegral) IntegralDetailedCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*RespList, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
-	return client.IntegralDetailedCheck(ctx, in)
+	return client.IntegralDetailedCheck(ctx, in, opts...)
 }
 
 // 积分守护
-func (m *defaultIntegral) IntegralGuard(ctx context.Context, in *Req) (*Resp, error) {
+func (m *defaultIntegral) IntegralGuard(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
-	return client.IntegralGuard(ctx, in)
+	return client.IntegralGuard(ctx, in, opts...)
 }
 
 // 到期积分查询
-func (m *defaultIntegral) IntegralExpireCheck(ctx context.Context, in *Req) (*Resp, error) {
+func (m *defaultIntegral) IntegralExpireCheck(ctx context.Context, in *Req, opts ...grpc.CallOption) (*Resp, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
-	return client.IntegralExpireCheck(ctx, in)
+	return client.IntegralExpireCheck(ctx, in, opts...)
 }
 
 // 合并账号
-func (m *defaultIntegral) UserMerge(ctx context.Context, in *MergeInfo) (*Resp, error) {
+func (m *defaultIntegral) UserMerge(ctx context.Context, in *MergeInfo, opts ...grpc.CallOption) (*Resp, error) {
 	client := integral.NewIntegralClient(m.cli.Conn())
-	return client.UserMerge(ctx, in)
+	return client.UserMerge(ctx, in, opts...)
 }

+ 3 - 1
rpc/internal/logic/integralbalancechecklogic.go

@@ -26,17 +26,19 @@ func NewIntegralBalanceCheckLogic(ctx context.Context, svcCtx *svc.ServiceContex
 func (l *IntegralBalanceCheckLogic) IntegralBalanceCheck(in *integral.Req) (*integral.Resp, error) {
 	// todo: add your logic here and delete this line
 	result := &integral.Resp{}
-	flag, total, expire := integralService.IntegralBalanceCheckService(in.UserId, in.AppId)
+	flag, total, expire, perManEntPoints := integralService.IntegralBalanceCheckService(in.UserId, in.AppId)
 	if flag {
 		result.Code = 1
 		result.Data = total
 		result.Expire = expire
+		result.Recharge = perManEntPoints
 		result.Message = "积分查询成功"
 		return result, nil
 	}
 	result.Code = 0
 	result.Data = 0
 	result.Expire = 0
+	result.Recharge = 0
 	result.Message = "暂无积分"
 	return result, nil
 }

+ 2 - 1
rpc/internal/server/integralserver.go

@@ -1,4 +1,4 @@
-// Code generated by goctl. DO NOT EDIT!
+// Code generated by goctl. DO NOT EDIT.
 // Source: integral.proto
 
 package server
@@ -13,6 +13,7 @@ import (
 
 type IntegralServer struct {
 	svcCtx *svc.ServiceContext
+	integral.UnimplementedIntegralServer
 }
 
 func NewIntegralServer(svcCtx *svc.ServiceContext) *IntegralServer {

+ 7 - 141
service/integralService.go

@@ -242,141 +242,7 @@ func (service *IntegralService) IntegralExpireCheckService(data entity.ExpireJSO
 	return entity.SuccessCode, solde.TimePoints
 }
 
-/*//结存新增
-func (service *IntegralService) IntegralSoldeService(model entity.SoldeUpdate) (bool, string) {
-	solde := entity.Solde{}
-	solde.AppId = model.AppId
-	solde.UserId = model.UserId
-	solde.EndDate = model.EndDate
-	var err error
-	var numb = int64(0)
-	//新增积分
-	if model.PointsType {
-		//永久积分
-		solde.PerManEntPoints = model.Points
-		numb, err = entity.Engine.Table("integral_solde").Insert(&solde)
-		if err != nil && numb == 0 {
-			log.Print("新增永久积分失败")
-			return false, "新增永久积分失败"
-		}
-		return true, "新增永久积分成功"
-	}
-	//时效积分
-	//先查看是否有EndDate的积分
-	soldelist := []entity.Solde{}
-	err = entity.Engine.Table("integral_solde").Where("appId=? and  userId=? and endDate=? ", model.AppId, model.UserId, model.EndDate).Find(&soldelist)
-	if len(soldelist) > 0 {
-		soldelist[0].TimePoints += model.Points
-		numb, err = entity.Engine.Table("integral_solde").ID(soldelist[0].Id).Cols("timePoints").Update(soldelist[0])
-		if err != nil && numb == 0 {
-			log.Print("修改时效积分失败")
-			return false, "修改时效积分失败"
-		}
-		return true, "修改时效积分成功"
-	} else {
-		solde.TimePoints = model.Points
-		numb, err = entity.Engine.Table("integral_solde").Insert(&solde)
-		if err != nil && numb == 0 {
-			log.Print("新增时效积分失败")
-			return false, "新增时效积分失败"
-		}
-		return true, "新增时效积分成功"
-	}
-}
-
-//结存扣除
-func (service *IntegralService) IntegralSoldeReduceService(model entity.SoldeUpdate) (bool, string) {
-	var err error
-	var numb = int64(0)
-	soldelist := []entity.Solde{}
-	err = entity.Engine.Table("integral_solde").Where("appId=? and  userId=? and endDate> ? 	( perManEntPoints != 0 AND timePoints = 0 ) OR ( perManEntPoints = 0 AND timePoints != 0 )", model.AppId, model.UserId, time.Now().Format("2006/01/02/")).Desc("endDate,timePoints").Find(&soldelist)
-	if len(soldelist) > 0 {
-		var point = model.Points
-		for _, solde := range soldelist {
-			if point == 0 {
-				return true, "积分消耗成功"
-			}
-			if solde.TimePoints == 0 {
-				//消耗永久积分
-				if solde.PerManEntPoints >= point {
-					//够消耗
-					point = 0
-					solde.PerManEntPoints = solde.PerManEntPoints - point
-					numb, err = entity.Engine.Table("integral_solde").ID(solde.Id).Cols("perManEntPoints").Update(solde)
-					if err != nil && numb == 0 {
-						log.Print("消耗永久积分失败")
-						return false, "消耗永久积分失败"
-					}
-				}
-			}
-			//消耗时效积分
-			if solde.TimePoints > point {
-				//够消耗
-				point = 0
-				solde.TimePoints = solde.TimePoints - point
-				numb, err = entity.Engine.Table("integral_solde").ID(solde.Id).Cols("timePoints").Update(solde)
-				if err != nil && numb == 0 {
-					log.Print("消耗时效积分失败")
-					return false, "消耗时效积分失败"
-				}
-				return true, "消耗时效积分成功"
-			}
-			//不够消耗
-			point = point - solde.TimePoints
-			solde.TimePoints = 0
-			numb, err = entity.Engine.Table("integral_solde").ID(solde.Id).Cols("timePoints").Update(solde)
-			if err != nil && numb == 0 {
-				log.Print("消耗时效积分失败")
-				return false, "消耗时效积分失败"
-			}
-		}
-	}
-	return false, "没有积分可以扣除"
-}
-
-//调整余额
-func (service *IntegralService) IntegralBalanceService(model entity.BalanceUpdate) (bool, string) {
-	var err error
-	var numb = int64(0)
-	fmt.Println(numb)
-	balanceList := []*entity.Balance{}
-	//查看是否存在本人的余额
-	err = entity.Engine.Table("integral_balance").Where("appId=? and  userId=?  ", model.AppId, model.UserId).Find(&balanceList)
-	if model.Change {
-		//新增
-		if len(balanceList) == 0 {
-			balance := entity.Balance{}
-			balance.UserId = model.UserId
-			balance.AppId = model.AppId
-			balance.CountPoints = model.CountPoints
-			numb, err = entity.Engine.Table("integral_balance").Insert(&balance)
-			if err != nil && numb == 0 {
-				log.Print("新增余额失败")
-				return false, "新增余额失败"
-			}
-		}
-		//修改余额
-		balanceList[0].CountPoints = balanceList[0].CountPoints + model.CountPoints
-	}
-	//消耗
-	if len(balanceList) == 0 {
-		log.Println("没有积分可以扣除")
-		return false, "没有积分可以扣除"
-	}
-	if balanceList[0].CountPoints < model.CountPoints {
-		log.Println("积分余额不足")
-		return false, "积分余额不足"
-	}
-	balanceList[0].CountPoints = balanceList[0].CountPoints - model.CountPoints
-	numb, err = entity.Engine.Table("integral_balance").ID(balanceList[0].Id).Cols("countPoints").Update(balanceList[0])
-	if err != nil && numb == 0 {
-		log.Print("余额扣除失败")
-		return false, "余额扣除失败"
-	}
-	return true, "余额扣除失败"
-}
-*/
-//积分守护
+// 积分守护
 func (service *IntegralService) IntegralGuardService(endDate string) bool {
 	orm := entity.Engine.NewSession()
 	defer orm.Close()
@@ -440,16 +306,16 @@ func (service *IntegralService) IntegralGuardService(endDate string) bool {
 }
 
 // 积分余额查询
-func (service *IntegralService) IntegralBalanceCheckService(userId, appId string) (bool, int64, int64) {
+func (service *IntegralService) IntegralBalanceCheckService(userId, appId string) (bool, int64, int64, int64) {
 	orm := entity.Engine
 	//积分总余额
 	balance := entity.Balance{}
-	_, err := orm.Table("integral_solde").Select("sum(perManEntPoints)+sum(timePoints)  as  CountPoints ,userId").
+	_, err := orm.Table("integral_solde").Select("sum(perManEntPoints)+sum(timePoints)  as  CountPoints ,userId,sum(perManEntPoints)  as perManEntPoints").
 		Where("appId=? and  userId=? and (endDate = '' OR endDate IS NULL OR endDate >= ?) and (( perManEntPoints != 0 AND timePoints = 0 ) OR ( perManEntPoints = 0 AND timePoints != 0 ))", appId, userId, time.Now().Format("2006-01-02")).
-		Get(&balance)
+		GroupBy("userId").Get(&balance)
 	if err != nil {
 		log.Println("积分查询出错")
-		return false, 0, 0
+		return false, 0, 0, 0
 	}
 	//积分30天内到期余额
 	var solde entity.Solde
@@ -459,9 +325,9 @@ func (service *IntegralService) IntegralBalanceCheckService(userId, appId string
 		Get(&solde)
 	if err != nil {
 		log.Println(err)
-		return false, 0, 0
+		return false, 0, 0, 0
 	}
-	return true, balance.CountPoints, solde.TimePoints
+	return true, balance.CountPoints, solde.TimePoints, balance.PerManEntPoints
 }
 
 // 按月查询积分使用情况