GITLAB

zhangqijia / Pro2DServer

Sign in
  • Sign in
  • Project
  • Files
  • Commits
  • Network
  • Graphs
  • Issues 0
  • Merge Requests 0
  • Wiki
  • Pro2DServer
  • models
  • increment.go
  • 101d1cc1   feat: 一个基于redis的自增ID功能。 Browse Code »
    zhangqijia
    2022-04-11 15:43:25 +0800  
increment.go 324 Bytes
Edit Raw Blame History
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
package models

import (
	"pro2d/common/components"
	"pro2d/pb"
)

type IncrementModels struct {
	components.ISchema
	Incre *pb.Increment
}

func NewIncrement(key string) *IncrementModels {
	data := &pb.Increment{
		Key: key,
	}

	r := &IncrementModels{
		ISchema: NewSchema(data.Key, data),
		Incre:   data,
	}
	return r
}