wanghuidong 4 years ago
parent
commit
263a8f48ba
1 changed files with 13 additions and 10 deletions
  1. 13 10
      lock/interface.go

+ 13 - 10
lock/interface.go

@@ -4,12 +4,9 @@ package lock
 用户消费接口
 */
 type Cost interface {
-	deduction() //扣费(剩余量|账户余额)
-	before() bool
-	after()
-}
-
-type Deduction interface {
+	Deduction() //扣费(剩余量|账户余额)
+	Before() bool
+	After()
 }
 
 type LeftNumCost struct {
@@ -25,10 +22,10 @@ type AccountBalanceCost struct {
 	AccountBalance int
 }
 
-func (l *LeftNumCost) deduction() {
+func (l *LeftNumCost) Deduction() {
 }
 
-func (l *LeftNumCost) before() bool {
+func (l *LeftNumCost) Before() bool {
 	switch l.ProductType {
 	case 0:
 		//按次扣费的产品-判断left_num
@@ -44,13 +41,19 @@ func (l *LeftNumCost) before() bool {
 	return true
 }
 
-func (l *LeftNumCost) after() {
+func (l *LeftNumCost) After() {
 	switch l.ProductType {
 	case 0:
 	case 1:
 	}
 }
 
-func (a *AccountBalanceCost) deduction() {
+func (a *AccountBalanceCost) Deduction() {
+
+}
+func (a *AccountBalanceCost) Before() bool {
+
+}
+func (a *AccountBalanceCost) After() {
 
 }