liuyong_awesome 4 år sedan
incheckning
a0e5452615
4 ändrade filer med 126 tillägg och 0 borttagningar
  1. 25 0
      category.go
  2. 17 0
      channel.go
  3. 51 0
      go.mod
  4. 33 0
      main.go

+ 25 - 0
category.go

@@ -0,0 +1,25 @@
+package main
+
+import (
+	"database/sql"
+	"time"
+)
+
+type SemCategory struct {
+	DeletedAt    time.Time      `gorm:"column:deleted_at" json:"deleted_at" db:"deleted_at"`
+	Factor       float64        `gorm:"column:factor" json:"factor" db:"factor"`
+	End          sql.NullString `gorm:"column:end" json:"end" db:"end"`
+	UpdatedAt    time.Time      `gorm:"column:updated_at" json:"updated_at" db:"updated_at"`
+	ChannelID    int            `gorm:"column:channel_id" json:"channel_id" db:"channel_id"`
+	Status       int            `gorm:"column:status" json:"status" db:"status"`
+	DataType     sql.NullInt64  `gorm:"column:data_type" json:"data_type" db:"data_type"`
+	CreatedAt    time.Time      `gorm:"column:created_at" json:"created_at" db:"created_at"`
+	Information  sql.NullInt64  `gorm:"column:information" json:"information" db:"information"`
+	ID           int            `gorm:"column:id;primary_key" json:"id" db:"id"`
+	CategoryName string         `gorm:"column:category_name" json:"category_name" db:"category_name"`
+}
+
+// TableName sets the insert table name for this struct type
+func (s *SemCategory) TableName() string {
+	return "sem_category"
+}

+ 17 - 0
channel.go

@@ -0,0 +1,17 @@
+package main
+
+import "time"
+
+type SemChannel struct {
+	CreatedAt   time.Time `gorm:"column:created_at" json:"created_at" db:"created_at"`
+	UpdatedAt   time.Time `gorm:"column:updated_at" json:"updated_at" db:"updated_at"`
+	DeletedAt   time.Time `gorm:"column:deleted_at" json:"deleted_at" db:"deleted_at"`
+	ID          int       `gorm:"column:id;primary_key" json:"id" db:"id"`
+	ChannelName string    `gorm:"column:channel_name" json:"channel_name" db:"channel_name"`
+	Status      int       `gorm:"column:status" json:"status" db:"status"`
+}
+
+// TableName sets the insert table name for this struct type
+func (s *SemChannel) TableName() string {
+	return "sem_channel"
+}

+ 51 - 0
go.mod

@@ -0,0 +1,51 @@
+module dxz/bids_rpcx
+
+go 1.16
+
+require (
+	github.com/aliyun/alibaba-cloud-sdk-go v1.61.1007 // indirect
+	github.com/apache/thrift v0.14.1 // indirect
+	github.com/armon/go-metrics v0.3.6 // indirect
+	github.com/buger/jsonparser v1.1.1 // indirect
+	github.com/edwingeng/doublejump v0.0.0-20200330080233-e4ea8bd1cbed // indirect
+	github.com/fatih/color v1.10.0 // indirect
+	github.com/go-errors/errors v1.1.1 // indirect
+	github.com/go-ping/ping v0.0.0-20210327002015-80a511380375 // indirect
+	github.com/go-redis/redis/v8 v8.8.0 // indirect
+	github.com/gogo/protobuf v1.3.2 // indirect
+	github.com/golang/protobuf v1.5.2 // indirect
+	github.com/golang/snappy v0.0.3 // indirect
+	github.com/goproxy/goproxy v0.3.0 // indirect
+	github.com/grandcat/zeroconf v1.0.0 // indirect
+	github.com/hashicorp/consul/api v1.8.1 // indirect
+	github.com/hashicorp/errwrap v1.1.0 // indirect
+	github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
+	github.com/hashicorp/go-hclog v0.15.0 // indirect
+	github.com/hashicorp/go-immutable-radix v1.3.0 // indirect
+	github.com/hashicorp/go-multierror v1.1.1 // indirect
+	github.com/hashicorp/golang-lru v0.5.4 // indirect
+	github.com/jmespath/go-jmespath v0.4.0 // indirect
+	github.com/klauspost/cpuid/v2 v2.0.6 // indirect
+	github.com/klauspost/reedsolomon v1.9.12 // indirect
+	github.com/lucas-clemente/quic-go v0.20.0 // indirect
+	github.com/miekg/dns v1.1.41 // indirect
+	github.com/mitchellh/mapstructure v1.4.1 // indirect
+	github.com/nacos-group/nacos-sdk-go v1.0.7 // indirect
+	github.com/opentracing/opentracing-go v1.2.0 // indirect
+	github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
+	github.com/samuel/go-zookeeper v0.0.0-20201211165307-7117e9ea2414 // indirect
+	github.com/smallnest/quick v0.0.0-20200505103731-c8c83f9c76d3 // indirect
+	github.com/smallnest/rpcx v0.0.0-20210329112732-c584448849f9 // indirect
+	github.com/soheilhy/cmux v0.1.5 // indirect
+	github.com/valyala/fastrand v1.0.0 // indirect
+	github.com/vmihailenco/msgpack/v5 v5.3.1 // indirect
+	go.opencensus.io v0.23.0 // indirect
+	go.uber.org/multierr v1.6.0 // indirect
+	go.uber.org/zap v1.16.0 // indirect
+	golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
+	golang.org/x/net v0.0.0-20210329181859-df645c7b52b1 // indirect
+	golang.org/x/sys v0.0.0-20210326220804-49726bf1d181 // indirect
+	golang.org/x/text v0.3.5 // indirect
+	gopkg.in/ini.v1 v1.62.0 // indirect
+	gopkg.in/yaml.v2 v2.4.0 // indirect
+)

+ 33 - 0
main.go

@@ -0,0 +1,33 @@
+package main
+
+import (
+	"context"
+	"flag"
+	"github.com/smallnest/rpcx/server"
+)
+var (
+	addr = flag.String("addr", "127.0.0.1:8972", "server address")
+)
+func main() {
+	flag.Parse()
+	s := server.NewServer()
+	s.Register(new(Bids), "")
+	err := s.Serve("tcp", *addr)
+	if err != nil {
+		panic(err)
+	}
+}
+
+type Bids struct {}
+type Args struct {
+	A int
+}
+func (b *Bids)GetChanList(ctx context.Context,args *int  ,reply  *string)error  {
+	*reply = "你好"
+	return nil
+}
+//func (b *Bids)GetCateList(ctx context.Context,args *Args ,reply  *[]semCategory)error  {
+//	*reply = []semCategory{}
+//	return nil
+//}
+