ソースを参照

增加账户id

wangchuanjin 2 年 前
コミット
be722cbc41

+ 1 - 1
api/internal/logic/haspowerslogic.go

@@ -26,7 +26,7 @@ func NewHaspowersLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Haspowe
 
 func (l *HaspowersLogic) Haspowers(req *types.Req) (resp *types.Reply, err error) {
 	resp = &types.Reply{}
-	powers, err := HasPowers(req.AppId, req.Account_id, req.Ent_id, req.Ent_user_id)
+	powers, err := HasPowers(req.AppId, req.Account_id, req.Ent_account_id, req.Ent_id, req.Ent_user_id)
 	if err != nil {
 		resp.Error_msg = err.Error()
 		l.Error(fmt.Sprintf("%+v", req), err)

+ 1 - 1
api/internal/logic/surplusdetaillogic.go

@@ -29,7 +29,7 @@ func NewSurplusDetailLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Sur
 //资源剩余详情
 func (l *SurplusDetailLogic) SurplusDetail(req *types.Req) (resp *types.Reply, err error) {
 	resp = &types.Reply{}
-	status, total, surplus, err := Surplus(req.AppId, req.Function_code, req.Account_id, req.Ent_id, req.Ent_user_id)
+	status, total, surplus, err := Surplus(req.AppId, req.Function_code, req.Account_id, req.Ent_account_id, req.Ent_id, req.Ent_user_id)
 	if err != nil {
 		resp.Error_msg = err.Error()
 		l.Error(fmt.Sprintf("%+v", req), err)

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

@@ -2,11 +2,12 @@
 package types
 
 type Req struct {
-	AppId         string `header:"appId,default=10000"`
-	Function_code string `header:"functionCode,optional"`
-	Account_id    int64  `header:"accountId,optional"`
-	Ent_id        int64  `header:"entId,optional"`
-	Ent_user_id   int64  `header:"entUserId,optional"`
+	AppId          string `header:"appId,default=10000"`
+	Function_code  string `header:"functionCode,optional"`
+	Account_id     int64  `header:"accountId,optional"`
+	Ent_account_id int64  `header:"entAccountId,optional"`
+	Ent_id         int64  `header:"entId,optional"`
+	Ent_user_id    int64  `header:"entUserId,optional"`
 }
 
 type Reply struct {

+ 6 - 5
api/resource.api

@@ -8,11 +8,12 @@ info(
 
 type (
 	Req {
-		AppId         string `header:"appId,default=10000"`
-		Function_code string `header:"functionCode,optional"`
-		Account_id    int64  `header:"accountId,optional"`
-		Ent_id        int64  `header:"entId,optional"`
-		Ent_user_id   int64  `header:"entUserId,optional"`
+		AppId          string `header:"appId,default=10000"`
+		Function_code  string `header:"functionCode,optional"`
+		Account_id     int64  `header:"accountId,optional"`
+		Ent_account_id int64  `header:"entAccountId,optional"`
+		Ent_id         int64  `header:"entId,optional"`
+		Ent_user_id    int64  `header:"entUserId,optional"`
 	}
 
 	Reply {

+ 13 - 13
public/entity/base_power.go

@@ -29,22 +29,22 @@ type base_power struct {
 }
 
 //获取所有权益
-func (b *base_power) FindMyPowers(appid string, account_id int64) *[]*base_power {
+func (b *base_power) FindMyPowers(appid string, account_id, ent_account_id int64) *[]*base_power {
 	now := NowFormat(Date_Full_Layout)
-	list := Mysql_BaseService.SelectBySql(`select * from base_power where appid=? and account_id=? and end_time>? and status=1 order by power_type`, appid, account_id, now)
+	list := Mysql_BaseService.SelectBySql(`select * from base_power where appid=? and ((power_type=1 and account_id=?) or (power_type=2 and account_id=?)) and end_time>? and status=1 order by power_type`, appid, account_id, ent_account_id, now)
 	return JsonUnmarshal(list, &[]*base_power{}).(*[]*base_power)
 }
 
 //查找我的权益
-func (b *base_power) FindMyPowersByFc(appid, function_code string, account_id int64) *[]*base_power {
+func (b *base_power) FindMyPowersByFc(appid, function_code string, account_id, ent_account_id int64) *[]*base_power {
 	now := NowFormat(Date_Full_Layout)
-	list := Mysql_BaseService.SelectBySql(`select * from base_power where appid=? and function_code=? and account_id=? and end_time>? and status=1 order by power_type`, appid, function_code, account_id, now)
+	list := Mysql_BaseService.SelectBySql(`select * from base_power where appid=? and function_code=? and ((power_type=1 and account_id=?) or (power_type=2 and account_id=?)) and end_time>? and status=1 order by power_type`, appid, function_code, account_id, ent_account_id, now)
 	return JsonUnmarshal(list, &[]*base_power{}).(*[]*base_power)
 }
 
 //查找我最新一条的权益,没有过期限制
-func (b *base_power) FindMyLastPowerByFc(appid, function_code string, account_id int64) *base_power {
-	list := Mysql_BaseService.SelectBySql(`select * from base_power where appid=? and function_code=? and account_id=? order by update_time desc limit 1`, appid, function_code, account_id)
+func (b *base_power) FindMyLastPowerByFc(appid, function_code string, account_id, ent_account_id int64) *base_power {
+	list := Mysql_BaseService.SelectBySql(`select * from base_power where appid=? and function_code=? and ((power_type=1 and account_id=?) or (power_type=2 and account_id=?)) order by update_time desc limit 1`, appid, function_code, account_id, ent_account_id)
 	if len(*list) == 0 {
 		return nil
 	}
@@ -63,11 +63,11 @@ func (b *base_power) FindMyPowerForUpdate(id int64) *base_power {
 //开通权益
 func (b *base_power) OpenPower(goods_spec_id int64, appid, goods_code string, account_id, ent_id int64, buy_num int64, start_time, end_time string, bgss *[]*base_goods_spec) bool {
 	return Mysql_BaseService.ExecTx("开通权益", func(tx *sql.Tx) bool {
-		//企业互斥的功能失效掉
+		//互斥的功能失效掉
 		ok1 := Mysql_BaseService.UpdateOrDeleteBySqlByTx(tx, `update base_power a inner join base_goods_spec_power b 
-				on (a.appid=? and a.account_id=? and a.status=1 and b.appid=? and b.goods_code=? and b.spec_id=? and a.function_code=b.function_code) 
-				inner join base_function c on (c.appid=? and c.status=1 and c.power_type=1 and c.code=a.function_code) 
-				set a.status=0,update_time=?`, appid, account_id, appid, goods_code, goods_spec_id, appid, NowFormat(Date_Full_Layout)) > -1
+			on (a.appid=? and a.account_id=? and a.status=1 and b.appid=? and b.goods_code=? and b.spec_id=? and a.function_code=b.function_code) 
+			inner join base_function c on (c.appid=? and c.status=1 and c.power_type=1 and c.code=a.function_code) 
+			set a.status=0,update_time=?`, appid, account_id, appid, goods_code, goods_spec_id, appid, NowFormat(Date_Full_Layout)) > -1
 		power_values, empower_values, wait_empower_values := []interface{}{}, []interface{}{}, []interface{}{}
 		if start_time == "" {
 			start_time = NowFormat(Date_Full_Layout)
@@ -108,7 +108,7 @@ func (b *base_power) OpenPower(goods_spec_id int64, appid, goods_code string, ac
 				}
 				surplus_count := use_count
 				if v.Base_function.Function_type == 2 {
-					lastPower := b.FindMyLastPowerByFc(appid, v.Function_code, account_id)
+					lastPower := b.FindMyLastPowerByFc(appid, v.Function_code, account_id, account_id)
 					if lastPower != nil {
 						surplus_count = lastPower.Surplus_count
 					}
@@ -144,6 +144,6 @@ func (b *base_power) OpenPower(goods_spec_id int64, appid, goods_code string, ac
 //取消权益
 func (b *base_power) CancelPower(appid, goods_code string, spec_id, account_id int64) bool {
 	return Mysql_BaseService.UpdateOrDeleteBySql(`update base_power a inner join base_goods_spec_power b 
-				on (a.appid=? and a.account_id=? and a.status=1 and b.appid=? and b.goods_code=? and b.spec_id=? and a.function_code=b.function_code) 
-				set a.status=-1,update_time=?`, appid, account_id, appid, goods_code, spec_id, NowFormat(Date_Full_Layout)) > 0
+		on (a.appid=? and a.account_id=? and a.status=1 and b.appid=? and b.goods_code=? and b.spec_id=? and a.function_code=b.function_code) 
+		set a.status=-1,update_time=?`, appid, account_id, appid, goods_code, spec_id, NowFormat(Date_Full_Layout)) > 0
 }

+ 4 - 4
public/service/deduction.go

@@ -19,21 +19,21 @@ import (
  * @param ids 业务id
  * @return 状态 0:失败 1:成功 -1:不在有效期内 -2:数量不足 -3:没有授权
  */
-func Deduction(appid, function_code string, account_id int64, count int64, ids []string) (int64, error) {
+func Deduction(appid, function_code string, account_id, ent_account_id int64, count int64, ids []string) (int64, error) {
 	if appid == "" {
 		return 0, errors.New("无效的参数appid")
 	} else if function_code == "" {
 		return 0, errors.New("无效的参数function_code")
 	} else if count <= 0 {
 		return 0, errors.New("无效的参数count")
-	} else if account_id == 0 {
-		return 0, errors.New("无效的参数account_id")
+	} else if account_id == 0 && ent_account_id == 0 {
+		return 0, errors.New("无效的参数account_id、ent_account_id")
 	}
 	function := Base_function.FindByCode(appid, function_code)
 	if function == nil {
 		return 0, errors.New("功能原始表中没有找到该功能")
 	}
-	myPowers := Base_power.FindMyPowersByFc(appid, function_code, account_id)
+	myPowers := Base_power.FindMyPowersByFc(appid, function_code, account_id, ent_account_id)
 	if myPowers == nil || len(*myPowers) == 0 {
 		return -1, errors.New("功能权益表中没有找到权益记录")
 	}

+ 1 - 1
public/service/deduction_test.go

@@ -13,7 +13,7 @@ func TestDeduction(t *testing.T) {
 	// 医疗机构画像	lyh_yl_yljghx
 	// 医疗机构认领	lyh_yl_yljgrl
 	// 经销商认领		lyh_yl_jxsrl
-	status, err := Deduction("10000", "lyh_yl_yljgrl", 13485, 1, []string{"test"})
+	status, err := Deduction("10000", "lyh_yl_yljgrl", 13485, 0, 1, []string{"test"})
 	assert.Nil(t, err)
 	assert.Equal(t, int64(1), status)
 }

+ 10 - 8
public/service/power.go

@@ -14,9 +14,11 @@ import (
  * @param appid
  * @param goods_code 商品代码
  * @param goods_spec_id 商品规格id
- * @param user_id 用户id
+ * @param account_id 账户id
  * @param ent_id 企业id
  * @param buy_num 购买数量
+ * @param start_time 开始时间
+ * @param end_time 结束时间
  * @return error
  */
 func OpenPower(appid, goods_code string, goods_spec_id, account_id, ent_id int64, buy_num int64, start_time, end_time string) error {
@@ -52,8 +54,7 @@ func OpenPower(appid, goods_code string, goods_spec_id, account_id, ent_id int64
  * @param appid
  * @param goods_code 商品代码
  * @param goods_spec_id 商品规格id
- * @param user_id 用户id
- * @param ent_id 企业id
+ * @param account_id 账户id
  * @return 是否成功
  */
 func CancelPower(appid, goods_code string, goods_spec_id, account_id int64) (bool, error) {
@@ -100,20 +101,21 @@ func WaitEmpowerDetail(appid, function_code string, ent_id int64) (*WaitEmpowerD
 /*
  * 获取已有的权益
  * @param appid
- * @param user_id 用户id
+ * @param account_id 账户id
+ * @param ent_account_id 企业账户id
  * @param ent_id 企业id
  * @param ent_user_id 企业用户id
  * @return 所有已开通的权益
  */
-func HasPowers(appid string, account_id, ent_id, ent_user_id int64) ([]string, error) {
+func HasPowers(appid string, account_id, ent_account_id, ent_id, ent_user_id int64) ([]string, error) {
 	result := []string{}
 	if appid == "" {
 		return result, errors.New("无效的参数appid")
-	} else if account_id == 0 && ent_id == 0 && ent_user_id == 0 {
-		return result, errors.New("无效的参数account_id、ent_id、ent_user_id")
+	} else if account_id == 0 && ent_account_id == 0 {
+		return result, errors.New("无效的参数account_id、ent_account_id")
 	}
 	m := map[string]bool{}
-	bps := Base_power.FindMyPowers(appid, account_id)
+	bps := Base_power.FindMyPowers(appid, account_id, ent_account_id)
 	if bps != nil {
 		for _, v := range *bps {
 			if v.Power_type == 1 || (v.Power_type == 2 && Base_ent_empower.HasEmpower(appid, v.Function_code, ent_id, ent_user_id)) {

+ 3 - 3
public/service/power_test.go

@@ -8,7 +8,7 @@ import (
 
 func TestOpenPower(t *testing.T) {
 	//信息发布
-	err := OpenPower("10000", "xxfb_gyxx", 4, 0, 14184, 1, "", "")
+	err := OpenPower("10000", "xxfb_gyxx", 4, 11686, 14184, 1, "", "")
 	//医疗领域化
 	//err := OpenPower("10000", "lyh", 13, 13485, 0, 1, "", "")
 	assert.Nil(t, err)
@@ -25,9 +25,9 @@ func TestCancelPower(t *testing.T) {
 
 func TestHasPowers(t *testing.T) {
 	//企业
-	powers, err := HasPowers("10000", 11686, 14184, 4271)
+	powers, err := HasPowers("10000", 0, 11686, 14184, 4271)
 	//个人
-	//powers, err := HasPowers("10000", 13485, 0, 0)
+	//powers, err := HasPowers("10000", 13485, 0, 0, 0)
 	assert.Nil(t, err)
 	t.Log(powers)
 }

+ 6 - 5
public/service/recharge.go

@@ -10,27 +10,28 @@ import (
  * 资源充值
  * @param appid
  * @param function_code 功能代码
- * @param userId 用户id
+ * @param account_id 账户id
+ * @param ent_account_id 企业账户id
  * @param entId 企业id
  * @param count 充值数量
  * @param ids 业务id
  * @return 状态 0:失败 1:成功 -1:不在有效期内 -2:数量不足 -3:没有授权 -4:超额
  */
-func Recharge(appid, function_code string, account_id int64, count int64, ids []string) (int64, error) {
+func Recharge(appid, function_code string, account_id, ent_account_id int64, count int64, ids []string) (int64, error) {
 	if appid == "" {
 		return 0, errors.New("无效的参数appid")
 	} else if function_code == "" {
 		return 0, errors.New("无效的参数function_code")
 	} else if count <= 0 {
 		return 0, errors.New("无效的参数count")
-	} else if account_id == 0 {
-		return 0, errors.New("无效的参数account_id")
+	} else if account_id == 0 && ent_account_id == 0 {
+		return 0, errors.New("无效的参数account_id、ent_account_id")
 	}
 	function := Base_function.FindByCode(appid, function_code)
 	if function == nil {
 		return 0, errors.New("功能原始表中没有找到该功能")
 	}
-	myPowers := Base_power.FindMyPowersByFc(appid, function_code, account_id)
+	myPowers := Base_power.FindMyPowersByFc(appid, function_code, account_id, ent_account_id)
 	if myPowers == nil || len(*myPowers) == 0 {
 		return -1, errors.New("功能权益表中没有找到权益记录")
 	}

+ 1 - 1
public/service/recharge_test.go

@@ -9,7 +9,7 @@ import (
 func TestRecharge(t *testing.T) {
 	// 医疗机构认领	lyh_yl_yljgrl
 	// 经销商认领		lyh_yl_jxsrl
-	status, err := Recharge("10000", "lyh_yl_yljgrl", 13485, 1, []string{"test"})
+	status, err := Recharge("10000", "lyh_yl_yljgrl", 13485, 0, 1, []string{"test"})
 	assert.Nil(t, err)
 	assert.Equal(t, int64(1), status)
 }

+ 6 - 5
public/service/surplus.go

@@ -12,26 +12,27 @@ import (
  * 获取资源剩余情况
  * @param appid
  * @param function_code 功能代码
- * @param user_id 用户id
+ * @param account_id 账户id
+ * @param ent_account_id 企业账户id
  * @param ent_id 企业id
  * @return 状态 0:失败 1:成功 -1:不在有效期内 -2:数量不足 -3:没有授权
  * @return 总数
  * @return 剩余数
  * @return 错误信息
  */
-func Surplus(appid, function_code string, account_id, ent_id, ent_user_id int64) (int64, int64, int64, error) {
+func Surplus(appid, function_code string, account_id, ent_account_id, ent_id, ent_user_id int64) (int64, int64, int64, error) {
 	if appid == "" {
 		return 0, 0, 0, errors.New("无效的参数appid")
 	} else if function_code == "" {
 		return 0, 0, 0, errors.New("无效的参数function_code")
-	} else if account_id == 0 && ent_id == 0 && ent_user_id == 0 {
-		return 0, 0, 0, errors.New("无效的参数account_id、ent_id、ent_user_id")
+	} else if account_id == 0 && ent_account_id == 0 {
+		return 0, 0, 0, errors.New("无效的参数account_id、ent_account_id")
 	}
 	function := Base_function.FindByCode(appid, function_code)
 	if function == nil {
 		return 0, 0, 0, errors.New("功能原始表中没有找到该功能")
 	}
-	myPowers := Base_power.FindMyPowersByFc(appid, function_code, account_id)
+	myPowers := Base_power.FindMyPowersByFc(appid, function_code, account_id, ent_account_id)
 	if myPowers == nil || len(*myPowers) == 0 {
 		return -1, 0, 0, errors.New("不在有效期内")
 	}

+ 2 - 2
public/service/surplus_test.go

@@ -6,12 +6,12 @@ import (
 
 func TestSurplus(t *testing.T) {
 	//供应信息发布
-	t.Log(Surplus("10000", "xxfb_gyxx_add", 0, 14184, 0))
+	//t.Log(Surplus("10000", "xxfb_gyxx_add", 0, 0, 14184, 0))
 	// 医疗标讯搜索	lyh_yl_ylbxss
 	// 医疗机构搜索	lyh_yl_yljgss
 	// 经销商搜索		lyh_yl_jxsss
 	// 医疗机构画像	lyh_yl_yljghx
 	// 医疗机构认领	lyh_yl_yljgrl
 	// 经销商认领		lyh_yl_jxsrl
-	//t.Log(Surplus("10000", "lyh_yl_yldy", 13485, 0, 0))
+	t.Log(Surplus("10000", "lyh_yl_yldy", 13485, 0, 0, 0))
 }

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

@@ -44,7 +44,7 @@ func (l *CheckPowerLogic) CheckPower(in *pb.CheckPowerReq) (*pb.Resp, error) {
 		l.Error(fmt.Sprintf("%+v", in), "功能原始表中没有找到该功能")
 		return resp, nil
 	}
-	status, use_count, surplus_count, err := Surplus(in.Appid, in.FunctionCode, in.AccountId, in.EntId, in.EntUserId)
+	status, use_count, surplus_count, err := Surplus(in.Appid, in.FunctionCode, in.AccountId, in.EntAccountId, in.EntId, in.EntUserId)
 	resp.Status = status
 	resp.UseCount = use_count
 	resp.SurplusCount = surplus_count

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

@@ -27,7 +27,7 @@ func NewDeductionLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Deducti
 // 资源扣减
 func (l *DeductionLogic) Deduction(in *pb.DeductionReq) (*pb.Resp, error) {
 	resp := &pb.Resp{}
-	status, err := Deduction(in.Appid, in.FunctionCode, in.AccountId, in.Count, in.Ids)
+	status, err := Deduction(in.Appid, in.FunctionCode, in.AccountId, in.EntAccountId, in.Count, in.Ids)
 	if err != nil {
 		l.Error(fmt.Sprintf("%+v", in), err)
 	}

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

@@ -27,7 +27,7 @@ func NewHaspowersLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Haspowe
 // 所有的权益
 func (l *HaspowersLogic) Haspowers(in *pb.HaspowersReq) (*pb.HaspowersResp, error) {
 	resp := &pb.HaspowersResp{}
-	powers, err := HasPowers(in.Appid, in.AccountId, in.EntId, in.EntUserId)
+	powers, err := HasPowers(in.Appid, in.AccountId, in.EntAccountId, in.EntId, in.EntUserId)
 	if err != nil {
 		l.Error(fmt.Sprintf("%+v", in), err)
 	}

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

@@ -27,7 +27,7 @@ func NewRechargeLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Recharge
 // 资源充值
 func (l *RechargeLogic) Recharge(in *pb.RechargeReq) (*pb.Resp, error) {
 	resp := &pb.Resp{}
-	status, err := Recharge(in.Appid, in.FunctionCode, in.AccountId, in.Count, in.Ids)
+	status, err := Recharge(in.Appid, in.FunctionCode, in.AccountId, in.EntAccountId, in.Count, in.Ids)
 	if err != nil {
 		l.Error(fmt.Sprintf("%+v", in), err)
 	}

+ 140 - 98
rpc/pb/resource.pb.go

@@ -184,10 +184,11 @@ type CheckPowerReq struct {
 	unknownFields protoimpl.UnknownFields
 
 	Appid        string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"`
-	FunctionCode string `protobuf:"bytes,2,opt,name=function_code,json=functionCode,proto3" json:"function_code,omitempty"` //功能代码
-	AccountId    int64  `protobuf:"varint,3,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`         //账户id
-	EntId        int64  `protobuf:"varint,4,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`                     //企业id
-	EntUserId    int64  `protobuf:"varint,5,opt,name=ent_user_id,json=entUserId,proto3" json:"ent_user_id,omitempty"`       //企业用户id
+	FunctionCode string `protobuf:"bytes,2,opt,name=function_code,json=functionCode,proto3" json:"function_code,omitempty"`    //功能代码
+	AccountId    int64  `protobuf:"varint,3,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`            //账户id
+	EntAccountId int64  `protobuf:"varint,4,opt,name=ent_account_id,json=entAccountId,proto3" json:"ent_account_id,omitempty"` //企业账户id
+	EntId        int64  `protobuf:"varint,5,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`                        //企业id
+	EntUserId    int64  `protobuf:"varint,6,opt,name=ent_user_id,json=entUserId,proto3" json:"ent_user_id,omitempty"`          //企业用户id
 }
 
 func (x *CheckPowerReq) Reset() {
@@ -243,6 +244,13 @@ func (x *CheckPowerReq) GetAccountId() int64 {
 	return 0
 }
 
+func (x *CheckPowerReq) GetEntAccountId() int64 {
+	if x != nil {
+		return x.EntAccountId
+	}
+	return 0
+}
+
 func (x *CheckPowerReq) GetEntId() int64 {
 	if x != nil {
 		return x.EntId
@@ -263,11 +271,12 @@ type DeductionReq struct {
 	unknownFields protoimpl.UnknownFields
 
 	Appid        string   `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"`
-	FunctionCode string   `protobuf:"bytes,2,opt,name=function_code,json=functionCode,proto3" json:"function_code,omitempty"` //功能代码
-	EntId        int64    `protobuf:"varint,3,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`                     //企业id
-	AccountId    int64    `protobuf:"varint,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`         //账户id
-	Count        int64    `protobuf:"varint,5,opt,name=count,proto3" json:"count,omitempty"`                                  //扣除数量
-	Ids          []string `protobuf:"bytes,6,rep,name=ids,proto3" json:"ids,omitempty"`                                       //id列表
+	FunctionCode string   `protobuf:"bytes,2,opt,name=function_code,json=functionCode,proto3" json:"function_code,omitempty"`    //功能代码
+	EntId        int64    `protobuf:"varint,3,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`                        //企业id
+	AccountId    int64    `protobuf:"varint,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`            //账户id
+	EntAccountId int64    `protobuf:"varint,5,opt,name=ent_account_id,json=entAccountId,proto3" json:"ent_account_id,omitempty"` //企业账户id
+	Count        int64    `protobuf:"varint,6,opt,name=count,proto3" json:"count,omitempty"`                                     //扣除数量
+	Ids          []string `protobuf:"bytes,7,rep,name=ids,proto3" json:"ids,omitempty"`                                          //id列表
 }
 
 func (x *DeductionReq) Reset() {
@@ -330,6 +339,13 @@ func (x *DeductionReq) GetAccountId() int64 {
 	return 0
 }
 
+func (x *DeductionReq) GetEntAccountId() int64 {
+	if x != nil {
+		return x.EntAccountId
+	}
+	return 0
+}
+
 func (x *DeductionReq) GetCount() int64 {
 	if x != nil {
 		return x.Count
@@ -350,11 +366,12 @@ type RechargeReq struct {
 	unknownFields protoimpl.UnknownFields
 
 	Appid        string   `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"`
-	FunctionCode string   `protobuf:"bytes,2,opt,name=function_code,json=functionCode,proto3" json:"function_code,omitempty"` //功能代码
-	EntId        int64    `protobuf:"varint,3,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`                     //企业id
-	AccountId    int64    `protobuf:"varint,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`         //账户id
-	Count        int64    `protobuf:"varint,5,opt,name=count,proto3" json:"count,omitempty"`                                  //扣除数量
-	Ids          []string `protobuf:"bytes,6,rep,name=ids,proto3" json:"ids,omitempty"`                                       //id列表
+	FunctionCode string   `protobuf:"bytes,2,opt,name=function_code,json=functionCode,proto3" json:"function_code,omitempty"`    //功能代码
+	EntId        int64    `protobuf:"varint,3,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`                        //企业id
+	AccountId    int64    `protobuf:"varint,4,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`            //账户id
+	EntAccountId int64    `protobuf:"varint,5,opt,name=ent_account_id,json=entAccountId,proto3" json:"ent_account_id,omitempty"` //企业账户id
+	Count        int64    `protobuf:"varint,6,opt,name=count,proto3" json:"count,omitempty"`                                     //充值数量
+	Ids          []string `protobuf:"bytes,7,rep,name=ids,proto3" json:"ids,omitempty"`                                          //id列表
 }
 
 func (x *RechargeReq) Reset() {
@@ -417,6 +434,13 @@ func (x *RechargeReq) GetAccountId() int64 {
 	return 0
 }
 
+func (x *RechargeReq) GetEntAccountId() int64 {
+	if x != nil {
+		return x.EntAccountId
+	}
+	return 0
+}
+
 func (x *RechargeReq) GetCount() int64 {
 	if x != nil {
 		return x.Count
@@ -704,10 +728,11 @@ type HaspowersReq struct {
 	sizeCache     protoimpl.SizeCache
 	unknownFields protoimpl.UnknownFields
 
-	Appid     string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"`
-	AccountId int64  `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`   //账户id
-	EntId     int64  `protobuf:"varint,3,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`               //企业id
-	EntUserId int64  `protobuf:"varint,4,opt,name=ent_user_id,json=entUserId,proto3" json:"ent_user_id,omitempty"` //企业用户id
+	Appid        string `protobuf:"bytes,1,opt,name=appid,proto3" json:"appid,omitempty"`
+	AccountId    int64  `protobuf:"varint,2,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"`            //账户id
+	EntAccountId int64  `protobuf:"varint,3,opt,name=ent_account_id,json=entAccountId,proto3" json:"ent_account_id,omitempty"` //企业账户id
+	EntId        int64  `protobuf:"varint,4,opt,name=ent_id,json=entId,proto3" json:"ent_id,omitempty"`                        //企业id
+	EntUserId    int64  `protobuf:"varint,5,opt,name=ent_user_id,json=entUserId,proto3" json:"ent_user_id,omitempty"`          //企业用户id
 }
 
 func (x *HaspowersReq) Reset() {
@@ -756,6 +781,13 @@ func (x *HaspowersReq) GetAccountId() int64 {
 	return 0
 }
 
+func (x *HaspowersReq) GetEntAccountId() int64 {
+	if x != nil {
+		return x.EntAccountId
+	}
+	return 0
+}
+
 func (x *HaspowersReq) GetEntId() int64 {
 	if x != nil {
 		return x.EntId
@@ -839,98 +871,108 @@ var file_resource_proto_rawDesc = []byte{
 	0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x74, 0x61, 0x72, 0x74, 0x5f, 0x74, 0x69,
 	0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54,
 	0x69, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
-	0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xa0,
+	0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xc6,
 	0x01, 0x0a, 0x0d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71,
 	0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
 	0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
 	0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66,
 	0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x61,
 	0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
-	0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e,
-	0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49,
-	0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64,
-	0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49,
-	0x64, 0x22, 0xa7, 0x01, 0x0a, 0x0c, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52,
-	0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x75, 0x6e, 0x63,
-	0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a,
-	0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65,
-	0x6e, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f,
-	0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
-	0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73,
-	0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0xa6, 0x01, 0x0a, 0x0b,
-	0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61,
-	0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69,
-	0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f,
-	0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69,
-	0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64,
-	0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a,
-	0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28,
-	0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05,
-	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75,
-	0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52,
-	0x03, 0x69, 0x64, 0x73, 0x22, 0x7e, 0x0a, 0x0a, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x52,
-	0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
-	0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x75, 0x6e, 0x63,
-	0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52,
-	0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a,
-	0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65,
-	0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72,
-	0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73,
-	0x65, 0x72, 0x49, 0x64, 0x22, 0x9a, 0x01, 0x0a, 0x0e, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72,
-	0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64,
+	0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x6e,
+	0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x0c, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64,
+	0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x5f, 0x75,
+	0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e,
+	0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xcd, 0x01, 0x0a, 0x0c, 0x44, 0x65, 0x64, 0x75,
+	0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69,
+	0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x23,
+	0x0a, 0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18,
+	0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43,
+	0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20,
+	0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63,
+	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09,
+	0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x6e, 0x74,
+	0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28,
+	0x03, 0x52, 0x0c, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12,
+	0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
+	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03,
+	0x28, 0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0xcc, 0x01, 0x0a, 0x0b, 0x52, 0x65, 0x63, 0x68,
+	0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64,
 	0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x23, 0x0a,
 	0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02,
 	0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f,
 	0x64, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
-	0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70, 0x61, 0x67,
-	0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x70, 0x61, 0x67,
-	0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a,
-	0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a,
-	0x65, 0x22, 0x45, 0x0a, 0x0f, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74,
-	0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20,
-	0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x04, 0x6c, 0x69,
-	0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77,
-	0x65, 0x72, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x60, 0x0a, 0x04, 0x52, 0x65, 0x73, 0x70,
-	0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03,
-	0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x5f,
-	0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75, 0x73, 0x65,
-	0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73,
-	0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x73, 0x75,
-	0x72, 0x70, 0x6c, 0x75, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x7a, 0x0a, 0x0c, 0x48, 0x61,
-	0x73, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70,
-	0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64,
-	0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02,
-	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12,
+	0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63,
+	0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61,
+	0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x6e, 0x74, 0x5f,
+	0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03,
+	0x52, 0x0c, 0x65, 0x6e, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x14,
+	0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63,
+	0x6f, 0x75, 0x6e, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28,
+	0x09, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0x7e, 0x0a, 0x0a, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65,
+	0x72, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20,
+	0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x66, 0x75,
+	0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
+	0x09, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x12,
 	0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
 	0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x1e, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73,
-	0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74,
-	0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x27, 0x0a, 0x0d, 0x48, 0x61, 0x73, 0x70, 0x6f, 0x77,
-	0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x70, 0x6f, 0x77, 0x65, 0x72,
-	0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x32,
-	0xb8, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b,
-	0x50, 0x6f, 0x77, 0x65, 0x72, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x09, 0x2e, 0x50, 0x6f,
-	0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a,
-	0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0e, 0x2e, 0x43, 0x68,
-	0x65, 0x63, 0x6b, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65,
-	0x73, 0x70, 0x12, 0x21, 0x0a, 0x09, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12,
-	0x0d, 0x2e, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x05,
-	0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x08, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67,
-	0x65, 0x12, 0x0c, 0x2e, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a,
-	0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f, 0x0a, 0x09, 0x52, 0x65, 0x45, 0x6d, 0x70, 0x6f,
-	0x77, 0x65, 0x72, 0x12, 0x0b, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71,
-	0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x0d, 0x43, 0x61, 0x6e, 0x63, 0x65,
-	0x6c, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0b, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77,
-	0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0b,
-	0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x0f, 0x2e, 0x45, 0x6d,
-	0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x45,
-	0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a,
-	0x0a, 0x09, 0x48, 0x61, 0x73, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x12, 0x0d, 0x2e, 0x48, 0x61,
-	0x73, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x48, 0x61, 0x73,
-	0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f,
-	0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+	0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74,
+	0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x9a, 0x01, 0x0a, 0x0e, 0x45, 0x6d, 0x70, 0x6f, 0x77,
+	0x65, 0x72, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x70, 0x70,
+	0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x12,
+	0x23, 0x0a, 0x0d, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x64, 0x65,
+	0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x66, 0x75, 0x6e, 0x63, 0x74, 0x69, 0x6f, 0x6e,
+	0x43, 0x6f, 0x64, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x03,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x70,
+	0x61, 0x67, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x07, 0x70,
+	0x61, 0x67, 0x65, 0x4e, 0x75, 0x6d, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73,
+	0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53,
+	0x69, 0x7a, 0x65, 0x22, 0x45, 0x0a, 0x0f, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69,
+	0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18,
+	0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1c, 0x0a, 0x04,
+	0x6c, 0x69, 0x73, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x45, 0x6d, 0x70,
+	0x6f, 0x77, 0x65, 0x72, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x22, 0x60, 0x0a, 0x04, 0x52, 0x65,
+	0x73, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01,
+	0x28, 0x03, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x0a, 0x09, 0x75, 0x73,
+	0x65, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x75,
+	0x73, 0x65, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x73, 0x75, 0x72, 0x70, 0x6c,
+	0x75, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c,
+	0x73, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xa0, 0x01, 0x0a,
+	0x0c, 0x48, 0x61, 0x73, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a,
+	0x05, 0x61, 0x70, 0x70, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x70,
+	0x70, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69,
+	0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
+	0x49, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x65, 0x6e, 0x74, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e,
+	0x74, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0c, 0x65, 0x6e, 0x74, 0x41,
+	0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x15, 0x0a, 0x06, 0x65, 0x6e, 0x74, 0x5f,
+	0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12,
+	0x1e, 0x0a, 0x0b, 0x65, 0x6e, 0x74, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05,
+	0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x6e, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22,
+	0x27, 0x0a, 0x0d, 0x48, 0x61, 0x73, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x16, 0x0a, 0x06, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09,
+	0x52, 0x06, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x32, 0xb8, 0x02, 0x0a, 0x08, 0x52, 0x65, 0x73,
+	0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x48, 0x61,
+	0x6e, 0x64, 0x6c, 0x65, 0x12, 0x09, 0x2e, 0x50, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a,
+	0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x23, 0x0a, 0x0a, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50,
+	0x6f, 0x77, 0x65, 0x72, 0x12, 0x0e, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x50, 0x6f, 0x77, 0x65,
+	0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x21, 0x0a, 0x09, 0x44,
+	0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0d, 0x2e, 0x44, 0x65, 0x64, 0x75, 0x63,
+	0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1f,
+	0x0a, 0x08, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x12, 0x0c, 0x2e, 0x52, 0x65, 0x63,
+	0x68, 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70, 0x12,
+	0x1f, 0x0a, 0x09, 0x52, 0x65, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x12, 0x0b, 0x2e, 0x45,
+	0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05, 0x2e, 0x52, 0x65, 0x73, 0x70,
+	0x12, 0x23, 0x0a, 0x0d, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65,
+	0x72, 0x12, 0x0b, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x05,
+	0x2e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x30, 0x0a, 0x0b, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72,
+	0x4c, 0x69, 0x73, 0x74, 0x12, 0x0f, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x69,
+	0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x45, 0x6d, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c,
+	0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x09, 0x48, 0x61, 0x73, 0x70, 0x6f,
+	0x77, 0x65, 0x72, 0x73, 0x12, 0x0d, 0x2e, 0x48, 0x61, 0x73, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73,
+	0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x48, 0x61, 0x73, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x73, 0x52,
+	0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
+	0x74, 0x6f, 0x33,
 }
 
 var (

+ 12 - 8
rpc/resource.proto

@@ -22,8 +22,9 @@ message CheckPowerReq {
   string appid = 1;
   string function_code = 2; //功能代码
   int64 account_id = 3;     //账户id
-  int64 ent_id = 4;         //企业id
-  int64 ent_user_id = 5;    //企业用户id 
+  int64 ent_account_id = 4; //企业账户id
+  int64 ent_id = 5;         //企业id
+  int64 ent_user_id = 6;    //企业用户id 
 }
 
 message DeductionReq {
@@ -31,8 +32,9 @@ message DeductionReq {
   string function_code = 2; //功能代码
   int64 ent_id = 3;         //企业id
   int64 account_id = 4;     //账户id
-  int64 count = 5;          //扣除数量
-  repeated string ids = 6;  //id列表
+  int64 ent_account_id = 5; //企业账户id
+  int64 count = 6;          //扣除数量
+  repeated string ids = 7;  //id列表
 }
 
 message RechargeReq {
@@ -40,8 +42,9 @@ message RechargeReq {
   string function_code = 2; //功能代码
   int64 ent_id = 3;         //企业id
   int64 account_id = 4;     //账户id
-  int64 count = 5;          //扣除数量
-  repeated string ids = 6;  //id列表
+  int64 ent_account_id = 5; //企业账户id
+  int64 count = 6;          //充值数量
+  repeated string ids = 7;  //id列表
 }
 
 message EmpowerReq {
@@ -73,8 +76,9 @@ message Resp {
 message HaspowersReq {
   string appid = 1;
   int64 account_id = 2;     //账户id
-  int64 ent_id = 3;         //企业id
-  int64 ent_user_id = 4;    //企业用户id 
+  int64 ent_account_id = 3; //企业账户id
+  int64 ent_id = 4;         //企业id
+  int64 ent_user_id = 5;    //企业用户id 
 }
 
 message HaspowersResp {