WH01243 4 years ago
parent
commit
3989a51ef8

+ 5 - 5
api/integral.api

@@ -3,7 +3,7 @@ syntax = "v1"
 type DetailedReq {
 	// TODO: add members here and delete this comment
 	UserId     string `form:"userId"`
-	AppId      int64  `form:"appId"`
+	AppId      string `form:"appId"`
 	SearchType int64  `form:"searchType"`
 	Page       int64  `form:"page"`
 	PageSize   int64  `form:"pageSize"`
@@ -39,19 +39,19 @@ type response {
 
 type checkReq {
 	UserId string `form:"userId"`
-	AppId  int64  `form:"appId"`
+	AppId  string `form:"appId"`
 }
 
 type expireReq {
 	UserId  string `form:"userId"`
-	AppId   int64  `form:"appId"`
+	AppId   string `form:"appId"`
 	EndDate string `form:"endDate"`
 }
 
 type (
 	addReq {
 		UserId         string `form:"userId"`
-		AppId          int64  `form:"appId"`
+		AppId          string `form:"appId"`
 		PointType      int64  `form:"pointType"`
 		BusinessTypeId string `form:"businessTypeId"`
 		BusinessType   string `form:"businessType"`
@@ -68,7 +68,7 @@ type (
 type (
 	ConsumeReq {
 		UserId         string `form:"userId"`
-		AppId          int64  `form:"appId"`
+		AppId          string `form:"appId"`
 		PointType      int64  `form:"pointType"`
 		BusinessTypeId string `form:"businessTypeId"`
 		BusinessType   string `form:"businessType"`

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

@@ -3,7 +3,7 @@ package types
 
 type DetailedReq struct {
 	UserId     string `form:"userId"`
-	AppId      int64  `form:"appId"`
+	AppId      string `form:"appId"`
 	SearchType int64  `form:"searchType"`
 	Page       int64  `form:"page"`
 	PageSize   int64  `form:"pageSize"`
@@ -37,18 +37,18 @@ type Response struct {
 
 type CheckReq struct {
 	UserId string `form:"userId"`
-	AppId  int64  `form:"appId"`
+	AppId  string `form:"appId"`
 }
 
 type ExpireReq struct {
 	UserId  string `form:"userId"`
-	AppId   int64  `form:"appId"`
+	AppId   string `form:"appId"`
 	EndDate string `form:"endDate"`
 }
 
 type AddReq struct {
 	UserId         string `form:"userId"`
-	AppId          int64  `form:"appId"`
+	AppId          string `form:"appId"`
 	PointType      int64  `form:"pointType"`
 	BusinessTypeId string `form:"businessTypeId"`
 	BusinessType   string `form:"businessType"`
@@ -64,7 +64,7 @@ type AddResp struct {
 
 type ConsumeReq struct {
 	UserId         string `form:"userId"`
-	AppId          int64  `form:"appId"`
+	AppId          string `form:"appId"`
 	PointType      int64  `form:"pointType"`
 	BusinessTypeId string `form:"businessTypeId"`
 	BusinessType   string `form:"businessType"`

+ 9 - 9
entity/integral.go

@@ -24,14 +24,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       int64  `xorm:"appId" form:"appId" json:"appId"`                   //剑鱼标识
+	AppId       string  `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       int64  `xorm:"appId" form:"appId" json:"appId"`                   //剑鱼标识
+	AppId       string  `xorm:"appId" form:"appId" json:"appId"`                   //剑鱼标识
 	Change      bool   `xorm:"change" form:"change" json:"change"`                //修改方式true新增 false消耗
 }
 
@@ -45,7 +45,7 @@ type Flow struct {
 	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          int64  `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
+	AppId          string  `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
 	Sort           int64  `xorm:"sort" form:"sort" json:"sort"`                               //操作类型1加-1减
 }
 
@@ -59,7 +59,7 @@ type FlowReq struct {
 	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          int64  `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
+	AppId          string  `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
 	Sort           int64  `xorm:"sort" form:"sort" json:"sort"`                               //操作类型1加-1减
 	Name           string `xorm:"name" form:"name" json:"name"`                               //积分类型名称
 }
@@ -71,7 +71,7 @@ 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           int64  `xorm:"appId" form:"appId" json:"appId"`                               //剑鱼标识
+	AppId           string  `xorm:"appId" form:"appId" json:"appId"`                               //剑鱼标识
 }
 
 //积分流水
@@ -82,7 +82,7 @@ type FlowJSON struct {
 	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          int64  `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
+	AppId          string  `xorm:"appId" form:"appId" json:"appId"`                            //剑鱼标识
 	OperationType  bool   `xorm:"operationType" form:"operationType" json:"operationType"`    //永久:true、时效:false
 	Sort           int64  `xorm:"sort" form:"sort" json:"sort"`                               //操作类型1加-1减
 	Page           int64  `xorm:"page" form:"page" json:"page"`                               //当前页数
@@ -94,7 +94,7 @@ type FlowJSON struct {
 type ExpireJSON struct {
 	UserId  string `xorm:"userId" form:"userId" json:"userId"`    //用户标识
 	EndDate string `xorm:"endDate" form:"endDate" json:"endDate"` //截止时间
-	AppId   int64  `xorm:"appId" form:"appId" json:"appId"`       //剑鱼标识
+	AppId   string  `xorm:"appId" form:"appId" json:"appId"`       //剑鱼标识
 }
 
 //积分结存修改
@@ -104,7 +104,7 @@ 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      int64  `xorm:"appId" form:"appId" json:"appId"`                //剑鱼标识
+	AppId      string  `xorm:"appId" form:"appId" json:"appId"`                //剑鱼标识
 }
 
 //积分守护
@@ -112,5 +112,5 @@ type GuardJSON struct {
 	UserId    string `xorm:"userId" form:"userId" json:"userId"`          //用户标识
 	PointType int64  `xorm:"pointType" form:"pointType" json:"pointType"` //积分类型
 	EndDate   string `xorm:"endDate" form:"endDate" json:"endDate"`       //截止时间
-	AppId     int64  `xorm:"appId" form:"appId" json:"appId"`             //剑鱼标识
+	AppId     string  `xorm:"appId" form:"appId" json:"appId"`             //剑鱼标识
 }

+ 1 - 1
rpc/integral.proto

@@ -4,7 +4,7 @@ package integral;
 
 message Req {
   string userId = 1;
-  int64 appId = 2;
+  string appId = 2;
   int64 pointType = 3;
   string businessTypeId = 4;
   string businessType = 5;

+ 4 - 4
rpc/integral/integral.pb.go

@@ -35,7 +35,7 @@ type Req struct {
 	unknownFields protoimpl.UnknownFields
 
 	UserId         string `protobuf:"bytes,1,opt,name=userId,proto3" json:"userId,omitempty"`
-	AppId          int64  `protobuf:"varint,2,opt,name=appId,proto3" json:"appId,omitempty"`
+	AppId          string `protobuf:"bytes,2,opt,name=appId,proto3" json:"appId,omitempty"`
 	PointType      int64  `protobuf:"varint,3,opt,name=pointType,proto3" json:"pointType,omitempty"`
 	BusinessTypeId string `protobuf:"bytes,4,opt,name=businessTypeId,proto3" json:"businessTypeId,omitempty"`
 	BusinessType   string `protobuf:"bytes,5,opt,name=businessType,proto3" json:"businessType,omitempty"`
@@ -86,11 +86,11 @@ func (x *Req) GetUserId() string {
 	return ""
 }
 
-func (x *Req) GetAppId() int64 {
+func (x *Req) GetAppId() string {
 	if x != nil {
 		return x.AppId
 	}
-	return 0
+	return ""
 }
 
 func (x *Req) GetPointType() int64 {
@@ -416,7 +416,7 @@ var file_integral_proto_rawDesc = []byte{
 	0x12, 0x08, 0x69, 0x6e, 0x74, 0x65, 0x67, 0x72, 0x61, 0x6c, 0x22, 0xc3, 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,
+	0x70, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 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,

+ 1 - 1
rpc/integralclient/integral.go

@@ -14,10 +14,10 @@ import (
 )
 
 type (
-	Req      = integral.Req
 	Resp     = integral.Resp
 	RespList = integral.RespList
 	Point    = integral.Point
+	Req      = integral.Req
 
 	Integral interface {
 		// 收获积分

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

@@ -31,7 +31,7 @@ func (l *IntegralExpireCheckLogic) IntegralExpireCheck(in *integral.Req) (*integ
 	dat := entity.ExpireJSON{}
 	dat.UserId = in.UserId
 	dat.EndDate = "2021-03-16"
-	dat.AppId = 10000
+	dat.AppId = "10000"
 	dataType,points := integralService.IntegralExpireCheckService(dat)
 	result.Code = dataType
 	result.Data = points

+ 1 - 1
service/integralService.go

@@ -466,7 +466,7 @@ func (service *IntegralService) IntegralGuardService(endDate string) bool {
 }
 
 //积分余额查询
-func (service *IntegralService) IntegralBalanceCheckService(userId string, appId int64) (bool, int64,int64) {
+func (service *IntegralService) IntegralBalanceCheckService(userId,appId string  ) (bool, int64,int64) {
 	orm := entity.Engine
 	//积分总余额
 	balance := entity.Balance{}