diff --git a/generator/main.go b/generator/main.go index 48a5e554..438eb8b1 100644 --- a/generator/main.go +++ b/generator/main.go @@ -342,11 +342,12 @@ func GenFromPath(mdir string, cols []Column, tableName string, tableComment stri fcontent += importstr + ")\n" fcontent += fmt.Sprintf(structstr, tableName, tableComment, pTableName, fieldstr) - modelstr := fmt.Sprintf(`type %sModel struct {db *gorm.DB}`, pTableName) + modelstr := fmt.Sprintf(`type %sModel struct {db *gorm.DB + name string}`, pTableName) fcontent += modelstr fcontent += "\n" - newfuncstr := fmt.Sprintf(`func New%sModel(db *gorm.DB) *%sModel {return &%sModel{db}}`, pTableName, pTableName, pTableName) + newfuncstr := fmt.Sprintf(`func New%sModel(db *gorm.DB) *%sModel {return &%sModel{db:db,name:"%s"}}`, pTableName, pTableName, pTableName, tableName) fcontent += newfuncstr fcontent += "\n" diff --git a/go.mod b/go.mod index fd58d3af..97759c15 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,7 @@ require ( github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646 github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e github.com/stripe/stripe-go/v74 v74.22.0 - github.com/zeromicro/go-zero v1.5.2 + github.com/zeromicro/go-zero v1.5.4 golang.org/x/image v0.0.0-20190802002840-cff245a6509b golang.org/x/oauth2 v0.10.0 gorm.io/driver/mysql v1.5.1 @@ -24,6 +24,7 @@ require ( github.com/andybalholm/brotli v1.0.5 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/schollz/progressbar v1.0.0 // indirect + go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 // indirect google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect @@ -44,24 +45,22 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect github.com/fatih/color v1.15.0 // indirect - github.com/felixge/fgprof v0.9.3 // indirect github.com/go-logr/logr v1.2.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/go-redis/redis/v8 v8.11.5 // indirect - github.com/go-sql-driver/mysql v1.7.0 + github.com/go-sql-driver/mysql v1.7.1 github.com/golang-jwt/jwt/v4 v4.5.0 // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.17 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/openzipkin/zipkin-go v0.4.1 // indirect - github.com/pelletier/go-toml/v2 v2.0.7 // indirect - github.com/prometheus/client_golang v1.15.0 // indirect + github.com/pelletier/go-toml/v2 v2.0.9 // indirect + github.com/prometheus/client_golang v1.16.0 // indirect github.com/prometheus/client_model v0.3.0 // indirect github.com/prometheus/common v0.42.0 // indirect - github.com/prometheus/procfs v0.9.0 // indirect + github.com/prometheus/procfs v0.10.1 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect go.opentelemetry.io/otel v1.14.0 // indirect go.opentelemetry.io/otel/exporters/jaeger v1.14.0 // indirect @@ -78,7 +77,7 @@ require ( golang.org/x/sys v0.10.0 // indirect golang.org/x/text v0.11.0 google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect - google.golang.org/grpc v1.55.0 // indirect + google.golang.org/grpc v1.56.2 // indirect google.golang.org/protobuf v1.31.0 // indirect gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index ee869494..58ebcc9a 100644 --- a/go.sum +++ b/go.sum @@ -45,7 +45,7 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0 h1:DNrExYwvyyI404SxdUCCANAj9TwnGjRfa3cYFMNY1AU= github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0/go.mod h1:SQq4xfIdvf6WYKSDxAJc+xOJdolt+/bc1jnQKMtPMvQ= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= -github.com/alicebob/miniredis/v2 v2.30.2 h1:lc1UAUT9ZA7h4srlfBmBt2aorm5Yftk9nBjxz7EyY9I= +github.com/alicebob/miniredis/v2 v2.30.4 h1:8S4/o1/KoUArAGbGwPxcwf0krlzceva2XVOSchFS7Eo= github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs= github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= @@ -88,8 +88,6 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go. github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs= github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw= -github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g= -github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw= github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= @@ -102,8 +100,9 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= -github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc= github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= +github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI= +github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI= github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= @@ -160,8 +159,6 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= -github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y= -github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= @@ -176,7 +173,6 @@ github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslC github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w= github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ= @@ -208,21 +204,21 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/openzipkin/zipkin-go v0.4.1 h1:kNd/ST2yLLWhaWrkgchya40TJabe8Hioj9udfPcEO5A= github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAyg7Qt6/I9HecM= -github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us= -github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= +github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0= +github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= -github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM= -github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk= +github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8= +github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4= github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w= github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM= github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc= -github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI= -github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY= +github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg= +github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= @@ -242,8 +238,8 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5 github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= -github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stripe/stripe-go/v74 v74.22.0 h1:A6yqbyS61JYWhq6H4b0PFZukM8Ltx1VOXxsLYBNL+wE= github.com/stripe/stripe-go/v74 v74.22.0/go.mod h1:f9L6LvaXa35ja7eyvP6GQswoaIPaBRvGAimAO+udbBw= github.com/tidwall/gjson v1.12.0 h1:61wEp/qfvFnqKH/WCI3M8HuRut+mHT6Mr82QrFmM2SY= @@ -257,8 +253,8 @@ github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9de github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE= -github.com/zeromicro/go-zero v1.5.2 h1:vpMlZacCMtgdtYzKI3OMyhS6mZ9UQctiAh0J7gIq31I= -github.com/zeromicro/go-zero v1.5.2/go.mod h1:ndCd1nMMAdEMZgPfdm1fpavHUdBW0ykB6ckCRaSG10w= +github.com/zeromicro/go-zero v1.5.4 h1:kRvcYuxcHOkUZvg7887KQl77Qv4klGL7MqGkTBgkpS8= +github.com/zeromicro/go-zero v1.5.4/go.mod h1:x/aUyLmSwRECvOyjOf+lhwThBOilJIY+s3slmPAeboA= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= @@ -276,6 +272,8 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 h1:ap+y8 go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0/go.mod h1:5w41DY6S9gZrbjuq6Y+753e96WfPha5IcsOSZTtullM= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0 h1:3jAYbRHQAqzLjd9I4tzxwJ8Pk/N6AqBcF6m1ZHrxG94= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0/go.mod h1:+N7zNjIJv4K+DeX67XXET0P+eIciESgaFDBqh+ZJFS4= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 h1:sEL90JjOO/4yhquXl5zTAkLLsZ5+MycAgX99SDsxGc8= +go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0/go.mod h1:oCslUcizYdpKYyS9e8srZEqM6BB8fq41VJBjLAE6z1w= go.opentelemetry.io/otel/exporters/zipkin v1.14.0 h1:reEVE1upBF9tcujgvSqLJS0SrI7JQPaTKP4s4rymnSs= go.opentelemetry.io/otel/exporters/zipkin v1.14.0/go.mod h1:RcjvOAcvhzcufQP8aHmzRw1gE9g/VEZufDdo2w+s4sk= go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY= @@ -406,7 +404,6 @@ golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -552,8 +549,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= +google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI= +google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/model/gmodel/fs_address_gen.go b/model/gmodel/fs_address_gen.go index 67ec691d..1d2ec36d 100644 --- a/model/gmodel/fs_address_gen.go +++ b/model/gmodel/fs_address_gen.go @@ -21,6 +21,11 @@ type FsAddress struct { Status *int64 `gorm:"default:0;" json:"status"` // 1正常 0异常 IsDefault *int64 `gorm:"index;default:0;" json:"is_default"` // 1默认地址,0非默认地址 } -type FsAddressModel struct{ db *gorm.DB } +type FsAddressModel struct { + db *gorm.DB + name string +} -func NewFsAddressModel(db *gorm.DB) *FsAddressModel { return &FsAddressModel{db} } +func NewFsAddressModel(db *gorm.DB) *FsAddressModel { + return &FsAddressModel{db: db, name: "fs_address"} +} diff --git a/model/gmodel/fs_auth_assignment_gen.go b/model/gmodel/fs_auth_assignment_gen.go index ca758122..9836eace 100644 --- a/model/gmodel/fs_auth_assignment_gen.go +++ b/model/gmodel/fs_auth_assignment_gen.go @@ -11,6 +11,11 @@ type FsAuthAssignment struct { CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 创建时间 // FsAuthAssignmentIbfk1 foreign `gorm:"" json:"fs_auth_assignment_ibfk_1"`// } -type FsAuthAssignmentModel struct{ db *gorm.DB } +type FsAuthAssignmentModel struct { + db *gorm.DB + name string +} -func NewFsAuthAssignmentModel(db *gorm.DB) *FsAuthAssignmentModel { return &FsAuthAssignmentModel{db} } +func NewFsAuthAssignmentModel(db *gorm.DB) *FsAuthAssignmentModel { + return &FsAuthAssignmentModel{db: db, name: "fs_auth_assignment"} +} diff --git a/model/gmodel/fs_auth_item_child_gen.go b/model/gmodel/fs_auth_item_child_gen.go index a1bb0a22..de11a692 100644 --- a/model/gmodel/fs_auth_item_child_gen.go +++ b/model/gmodel/fs_auth_item_child_gen.go @@ -11,6 +11,11 @@ type FsAuthItemChild struct { // FsAuthItemChildIbfk1 foreign `gorm:"" json:"fs_auth_item_child_ibfk_1"`// // FsAuthItemChildIbfk2 foreign `gorm:"" json:"fs_auth_item_child_ibfk_2"`// } -type FsAuthItemChildModel struct{ db *gorm.DB } +type FsAuthItemChildModel struct { + db *gorm.DB + name string +} -func NewFsAuthItemChildModel(db *gorm.DB) *FsAuthItemChildModel { return &FsAuthItemChildModel{db} } +func NewFsAuthItemChildModel(db *gorm.DB) *FsAuthItemChildModel { + return &FsAuthItemChildModel{db: db, name: "fs_auth_item_child"} +} diff --git a/model/gmodel/fs_auth_item_gen.go b/model/gmodel/fs_auth_item_gen.go index 825782cb..db2acb41 100644 --- a/model/gmodel/fs_auth_item_gen.go +++ b/model/gmodel/fs_auth_item_gen.go @@ -15,6 +15,11 @@ type FsAuthItem struct { UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` // // FsAuthItemIbfk1 foreign `gorm:"" json:"fs_auth_item_ibfk_1"`// } -type FsAuthItemModel struct{ db *gorm.DB } +type FsAuthItemModel struct { + db *gorm.DB + name string +} -func NewFsAuthItemModel(db *gorm.DB) *FsAuthItemModel { return &FsAuthItemModel{db} } +func NewFsAuthItemModel(db *gorm.DB) *FsAuthItemModel { + return &FsAuthItemModel{db: db, name: "fs_auth_item"} +} diff --git a/model/gmodel/fs_auth_rule_gen.go b/model/gmodel/fs_auth_rule_gen.go index f19b43b0..c157140f 100644 --- a/model/gmodel/fs_auth_rule_gen.go +++ b/model/gmodel/fs_auth_rule_gen.go @@ -11,6 +11,11 @@ type FsAuthRule struct { CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` // } -type FsAuthRuleModel struct{ db *gorm.DB } +type FsAuthRuleModel struct { + db *gorm.DB + name string +} -func NewFsAuthRuleModel(db *gorm.DB) *FsAuthRuleModel { return &FsAuthRuleModel{db} } +func NewFsAuthRuleModel(db *gorm.DB) *FsAuthRuleModel { + return &FsAuthRuleModel{db: db, name: "fs_auth_rule"} +} diff --git a/model/gmodel/fs_backend_user_gen.go b/model/gmodel/fs_backend_user_gen.go index 80f22aae..f6cff75f 100644 --- a/model/gmodel/fs_backend_user_gen.go +++ b/model/gmodel/fs_backend_user_gen.go @@ -19,6 +19,11 @@ type FsBackendUser struct { CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 创建时间 UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` // 更新时间 } -type FsBackendUserModel struct{ db *gorm.DB } +type FsBackendUserModel struct { + db *gorm.DB + name string +} -func NewFsBackendUserModel(db *gorm.DB) *FsBackendUserModel { return &FsBackendUserModel{db} } +func NewFsBackendUserModel(db *gorm.DB) *FsBackendUserModel { + return &FsBackendUserModel{db: db, name: "fs_backend_user"} +} diff --git a/model/gmodel/fs_canteen_product_gen.go b/model/gmodel/fs_canteen_product_gen.go index 5d6df880..7c43e5b9 100644 --- a/model/gmodel/fs_canteen_product_gen.go +++ b/model/gmodel/fs_canteen_product_gen.go @@ -15,6 +15,11 @@ type FsCanteenProduct struct { Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 Sid *string `gorm:"default:'';" json:"sid"` // 前端带入的id } -type FsCanteenProductModel struct{ db *gorm.DB } +type FsCanteenProductModel struct { + db *gorm.DB + name string +} -func NewFsCanteenProductModel(db *gorm.DB) *FsCanteenProductModel { return &FsCanteenProductModel{db} } +func NewFsCanteenProductModel(db *gorm.DB) *FsCanteenProductModel { + return &FsCanteenProductModel{db: db, name: "fs_canteen_product"} +} diff --git a/model/gmodel/fs_canteen_type_gen.go b/model/gmodel/fs_canteen_type_gen.go index be382246..94483417 100644 --- a/model/gmodel/fs_canteen_type_gen.go +++ b/model/gmodel/fs_canteen_type_gen.go @@ -12,6 +12,11 @@ type FsCanteenType struct { Status *int64 `gorm:"default:0;" json:"status"` // 状态位 1启用0停用 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 } -type FsCanteenTypeModel struct{ db *gorm.DB } +type FsCanteenTypeModel struct { + db *gorm.DB + name string +} -func NewFsCanteenTypeModel(db *gorm.DB) *FsCanteenTypeModel { return &FsCanteenTypeModel{db} } +func NewFsCanteenTypeModel(db *gorm.DB) *FsCanteenTypeModel { + return &FsCanteenTypeModel{db: db, name: "fs_canteen_type"} +} diff --git a/model/gmodel/fs_card_gen.go b/model/gmodel/fs_card_gen.go index 9c4fa96f..369454a7 100644 --- a/model/gmodel/fs_card_gen.go +++ b/model/gmodel/fs_card_gen.go @@ -12,6 +12,9 @@ type FsCard struct { Ctime *int64 `gorm:"default:0;" json:"ctime"` // 创建时间 CardNum *string `gorm:"default:'';" json:"card_num"` // 卡号 无空格 } -type FsCardModel struct{ db *gorm.DB } +type FsCardModel struct { + db *gorm.DB + name string +} -func NewFsCardModel(db *gorm.DB) *FsCardModel { return &FsCardModel{db} } +func NewFsCardModel(db *gorm.DB) *FsCardModel { return &FsCardModel{db: db, name: "fs_card"} } diff --git a/model/gmodel/fs_card_group_gen.go b/model/gmodel/fs_card_group_gen.go index bf772068..c97ccb97 100644 --- a/model/gmodel/fs_card_group_gen.go +++ b/model/gmodel/fs_card_group_gen.go @@ -12,6 +12,11 @@ type FsCardGroup struct { Num *int64 `gorm:"default:0;" json:"num"` // 生成数量 Ctime *int64 `gorm:"default:0;" json:"ctime"` // } -type FsCardGroupModel struct{ db *gorm.DB } +type FsCardGroupModel struct { + db *gorm.DB + name string +} -func NewFsCardGroupModel(db *gorm.DB) *FsCardGroupModel { return &FsCardGroupModel{db} } +func NewFsCardGroupModel(db *gorm.DB) *FsCardGroupModel { + return &FsCardGroupModel{db: db, name: "fs_card_group"} +} diff --git a/model/gmodel/fs_cart_gen.go b/model/gmodel/fs_cart_gen.go index 83c21fa0..915a837f 100644 --- a/model/gmodel/fs_cart_gen.go +++ b/model/gmodel/fs_cart_gen.go @@ -24,6 +24,9 @@ type FsCart struct { TsTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ts_time"` // IsEmail *int64 `gorm:"default:0;" json:"is_email"` // 是否发送邮件 } -type FsCartModel struct{ db *gorm.DB } +type FsCartModel struct { + db *gorm.DB + name string +} -func NewFsCartModel(db *gorm.DB) *FsCartModel { return &FsCartModel{db} } +func NewFsCartModel(db *gorm.DB) *FsCartModel { return &FsCartModel{db: db, name: "fs_cart"} } diff --git a/model/gmodel/fs_change_code_gen.go b/model/gmodel/fs_change_code_gen.go index 12c33603..6a58a515 100644 --- a/model/gmodel/fs_change_code_gen.go +++ b/model/gmodel/fs_change_code_gen.go @@ -12,6 +12,11 @@ type FsChangeCode struct { CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 创建时间 IsUse *int64 `gorm:"default:0;" json:"is_use"` // 是否使用 1已使用 0未使用 } -type FsChangeCodeModel struct{ db *gorm.DB } +type FsChangeCodeModel struct { + db *gorm.DB + name string +} -func NewFsChangeCodeModel(db *gorm.DB) *FsChangeCodeModel { return &FsChangeCodeModel{db} } +func NewFsChangeCodeModel(db *gorm.DB) *FsChangeCodeModel { + return &FsChangeCodeModel{db: db, name: "fs_change_code"} +} diff --git a/model/gmodel/fs_cloud_deliver_every_tmp_gen.go b/model/gmodel/fs_cloud_deliver_every_tmp_gen.go index b1d26aad..5181f203 100644 --- a/model/gmodel/fs_cloud_deliver_every_tmp_gen.go +++ b/model/gmodel/fs_cloud_deliver_every_tmp_gen.go @@ -13,8 +13,11 @@ type FsCloudDeliverEveryTmp struct { Num *int64 `gorm:"default:0;" json:"num"` // 发货数量 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 } -type FsCloudDeliverEveryTmpModel struct{ db *gorm.DB } +type FsCloudDeliverEveryTmpModel struct { + db *gorm.DB + name string +} func NewFsCloudDeliverEveryTmpModel(db *gorm.DB) *FsCloudDeliverEveryTmpModel { - return &FsCloudDeliverEveryTmpModel{db} + return &FsCloudDeliverEveryTmpModel{db: db, name: "fs_cloud_deliver_every_tmp"} } diff --git a/model/gmodel/fs_cloud_deliver_tmp_gen.go b/model/gmodel/fs_cloud_deliver_tmp_gen.go index bd21ad0c..9a2a119e 100644 --- a/model/gmodel/fs_cloud_deliver_tmp_gen.go +++ b/model/gmodel/fs_cloud_deliver_tmp_gen.go @@ -18,8 +18,11 @@ type FsCloudDeliverTmp struct { IsEnd *int64 `gorm:"default:0;" json:"is_end"` // 0未完成,1已完成 DeliverId *int64 `gorm:"default:0;" json:"deliver_id"` // 发货总表id } -type FsCloudDeliverTmpModel struct{ db *gorm.DB } +type FsCloudDeliverTmpModel struct { + db *gorm.DB + name string +} func NewFsCloudDeliverTmpModel(db *gorm.DB) *FsCloudDeliverTmpModel { - return &FsCloudDeliverTmpModel{db} + return &FsCloudDeliverTmpModel{db: db, name: "fs_cloud_deliver_tmp"} } diff --git a/model/gmodel/fs_cloud_gen.go b/model/gmodel/fs_cloud_gen.go index 576af775..2cbae739 100644 --- a/model/gmodel/fs_cloud_gen.go +++ b/model/gmodel/fs_cloud_gen.go @@ -10,6 +10,9 @@ type FsCloud struct { Address *string `gorm:"default:'';" json:"address"` // 云仓地址 Title *string `gorm:"default:'';" json:"title"` // 云仓名称 } -type FsCloudModel struct{ db *gorm.DB } +type FsCloudModel struct { + db *gorm.DB + name string +} -func NewFsCloudModel(db *gorm.DB) *FsCloudModel { return &FsCloudModel{db} } +func NewFsCloudModel(db *gorm.DB) *FsCloudModel { return &FsCloudModel{db: db, name: "fs_cloud"} } diff --git a/model/gmodel/fs_cloud_pick_up_detail_gen.go b/model/gmodel/fs_cloud_pick_up_detail_gen.go index 94b3bd6f..8d852b99 100644 --- a/model/gmodel/fs_cloud_pick_up_detail_gen.go +++ b/model/gmodel/fs_cloud_pick_up_detail_gen.go @@ -13,8 +13,11 @@ type FsCloudPickUpDetail struct { Boxes *int64 `gorm:"default:0;" json:"boxes"` // 提取箱数 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 } -type FsCloudPickUpDetailModel struct{ db *gorm.DB } +type FsCloudPickUpDetailModel struct { + db *gorm.DB + name string +} func NewFsCloudPickUpDetailModel(db *gorm.DB) *FsCloudPickUpDetailModel { - return &FsCloudPickUpDetailModel{db} + return &FsCloudPickUpDetailModel{db: db, name: "fs_cloud_pick_up_detail"} } diff --git a/model/gmodel/fs_cloud_pick_up_gen.go b/model/gmodel/fs_cloud_pick_up_gen.go index eace4474..24c05360 100644 --- a/model/gmodel/fs_cloud_pick_up_gen.go +++ b/model/gmodel/fs_cloud_pick_up_gen.go @@ -18,6 +18,11 @@ type FsCloudPickUp struct { ArrivalTime *int64 `gorm:"default:0;" json:"arrival_time"` // 到达时间 UpsSn *string `gorm:"default:'';" json:"ups_sn"` // 运输单号 } -type FsCloudPickUpModel struct{ db *gorm.DB } +type FsCloudPickUpModel struct { + db *gorm.DB + name string +} -func NewFsCloudPickUpModel(db *gorm.DB) *FsCloudPickUpModel { return &FsCloudPickUpModel{db} } +func NewFsCloudPickUpModel(db *gorm.DB) *FsCloudPickUpModel { + return &FsCloudPickUpModel{db: db, name: "fs_cloud_pick_up"} +} diff --git a/model/gmodel/fs_cloud_receive_every_gen.go b/model/gmodel/fs_cloud_receive_every_gen.go index 48f676ab..d4e4d1e9 100644 --- a/model/gmodel/fs_cloud_receive_every_gen.go +++ b/model/gmodel/fs_cloud_receive_every_gen.go @@ -12,8 +12,11 @@ type FsCloudReceiveEvery struct { Num *int64 `gorm:"default:0;" json:"num"` // 收到的数量 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 } -type FsCloudReceiveEveryModel struct{ db *gorm.DB } +type FsCloudReceiveEveryModel struct { + db *gorm.DB + name string +} func NewFsCloudReceiveEveryModel(db *gorm.DB) *FsCloudReceiveEveryModel { - return &FsCloudReceiveEveryModel{db} + return &FsCloudReceiveEveryModel{db: db, name: "fs_cloud_receive_every"} } diff --git a/model/gmodel/fs_cloud_receive_gen.go b/model/gmodel/fs_cloud_receive_gen.go index 86729acd..4871dec9 100644 --- a/model/gmodel/fs_cloud_receive_gen.go +++ b/model/gmodel/fs_cloud_receive_gen.go @@ -16,6 +16,11 @@ type FsCloudReceive struct { Ctime *int64 `gorm:"default:0;" json:"ctime"` // 创建时间 Status *int64 `gorm:"default:0;" json:"status"` // 0未收到 1收到 } -type FsCloudReceiveModel struct{ db *gorm.DB } +type FsCloudReceiveModel struct { + db *gorm.DB + name string +} -func NewFsCloudReceiveModel(db *gorm.DB) *FsCloudReceiveModel { return &FsCloudReceiveModel{db} } +func NewFsCloudReceiveModel(db *gorm.DB) *FsCloudReceiveModel { + return &FsCloudReceiveModel{db: db, name: "fs_cloud_receive"} +} diff --git a/model/gmodel/fs_cloud_render_log_gen.go b/model/gmodel/fs_cloud_render_log_gen.go index f31af63a..a1d8aeae 100644 --- a/model/gmodel/fs_cloud_render_log_gen.go +++ b/model/gmodel/fs_cloud_render_log_gen.go @@ -16,6 +16,11 @@ type FsCloudRenderLog struct { Tag *string `gorm:"index;default:'';" json:"tag"` // 标识 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 } -type FsCloudRenderLogModel struct{ db *gorm.DB } +type FsCloudRenderLogModel struct { + db *gorm.DB + name string +} -func NewFsCloudRenderLogModel(db *gorm.DB) *FsCloudRenderLogModel { return &FsCloudRenderLogModel{db} } +func NewFsCloudRenderLogModel(db *gorm.DB) *FsCloudRenderLogModel { + return &FsCloudRenderLogModel{db: db, name: "fs_cloud_render_log"} +} diff --git a/model/gmodel/fs_cloud_user_apply_back_gen.go b/model/gmodel/fs_cloud_user_apply_back_gen.go index ee5ad604..d64f8264 100644 --- a/model/gmodel/fs_cloud_user_apply_back_gen.go +++ b/model/gmodel/fs_cloud_user_apply_back_gen.go @@ -15,8 +15,11 @@ type FsCloudUserApplyBack struct { StorageFee *int64 `gorm:"default:0;" json:"storage_fee"` // 存储费用 Status *int64 `gorm:"default:0;" json:"status"` // 状态位 是否已发货 是否处理 是否删除 是否推送 } -type FsCloudUserApplyBackModel struct{ db *gorm.DB } +type FsCloudUserApplyBackModel struct { + db *gorm.DB + name string +} func NewFsCloudUserApplyBackModel(db *gorm.DB) *FsCloudUserApplyBackModel { - return &FsCloudUserApplyBackModel{db} + return &FsCloudUserApplyBackModel{db: db, name: "fs_cloud_user_apply_back"} } diff --git a/model/gmodel/fs_contact_gen.go b/model/gmodel/fs_contact_gen.go index 562068e3..033c19a9 100644 --- a/model/gmodel/fs_contact_gen.go +++ b/model/gmodel/fs_contact_gen.go @@ -15,6 +15,11 @@ type FsContact struct { Status *int64 `gorm:"default:0;" json:"status"` // Mark *string `gorm:"default:'';" json:"mark"` // 后台订单备注 } -type FsContactModel struct{ db *gorm.DB } +type FsContactModel struct { + db *gorm.DB + name string +} -func NewFsContactModel(db *gorm.DB) *FsContactModel { return &FsContactModel{db} } +func NewFsContactModel(db *gorm.DB) *FsContactModel { + return &FsContactModel{db: db, name: "fs_contact"} +} diff --git a/model/gmodel/fs_contact_service_gen.go b/model/gmodel/fs_contact_service_gen.go index f5ab8219..578c1f7e 100644 --- a/model/gmodel/fs_contact_service_gen.go +++ b/model/gmodel/fs_contact_service_gen.go @@ -20,6 +20,11 @@ type FsContactService struct { HandleUid *int64 `gorm:"default:0;" json:"handle_uid"` // 处理人 HandleTime *int64 `gorm:"default:0;" json:"handle_time"` // 处理时间 } -type FsContactServiceModel struct{ db *gorm.DB } +type FsContactServiceModel struct { + db *gorm.DB + name string +} -func NewFsContactServiceModel(db *gorm.DB) *FsContactServiceModel { return &FsContactServiceModel{db} } +func NewFsContactServiceModel(db *gorm.DB) *FsContactServiceModel { + return &FsContactServiceModel{db: db, name: "fs_contact_service"} +} diff --git a/model/gmodel/fs_coupon_gen.go b/model/gmodel/fs_coupon_gen.go index 80b56d1f..3bd3e32b 100644 --- a/model/gmodel/fs_coupon_gen.go +++ b/model/gmodel/fs_coupon_gen.go @@ -20,6 +20,9 @@ type FsCoupon struct { GetTime *int64 `gorm:"default:0;" json:"get_time"` // Status *int64 `gorm:"default:0;" json:"status"` // 状态 是否可用 是否已绑定到订单 } -type FsCouponModel struct{ db *gorm.DB } +type FsCouponModel struct { + db *gorm.DB + name string +} -func NewFsCouponModel(db *gorm.DB) *FsCouponModel { return &FsCouponModel{db} } +func NewFsCouponModel(db *gorm.DB) *FsCouponModel { return &FsCouponModel{db: db, name: "fs_coupon"} } diff --git a/model/gmodel/fs_deliver_every_gen.go b/model/gmodel/fs_deliver_every_gen.go index 0201b609..4dc241b9 100644 --- a/model/gmodel/fs_deliver_every_gen.go +++ b/model/gmodel/fs_deliver_every_gen.go @@ -11,6 +11,11 @@ type FsDeliverEvery struct { OrderDetailTemplateSn *string `gorm:"index;default:'';" json:"order_detail_template_sn"` // 订单详情模板sn Num *int64 `gorm:"default:0;" json:"num"` // } -type FsDeliverEveryModel struct{ db *gorm.DB } +type FsDeliverEveryModel struct { + db *gorm.DB + name string +} -func NewFsDeliverEveryModel(db *gorm.DB) *FsDeliverEveryModel { return &FsDeliverEveryModel{db} } +func NewFsDeliverEveryModel(db *gorm.DB) *FsDeliverEveryModel { + return &FsDeliverEveryModel{db: db, name: "fs_deliver_every"} +} diff --git a/model/gmodel/fs_deliver_gen.go b/model/gmodel/fs_deliver_gen.go index 97ddf177..327f5c0d 100644 --- a/model/gmodel/fs_deliver_gen.go +++ b/model/gmodel/fs_deliver_gen.go @@ -34,6 +34,11 @@ type FsDeliver struct { TwoDeliverSn *string `gorm:"index;default:'';" json:"two_deliver_sn"` // TsTime *time.Time `gorm:"default:'0000-00-00 00:00:00';" json:"ts_time"` // } -type FsDeliverModel struct{ db *gorm.DB } +type FsDeliverModel struct { + db *gorm.DB + name string +} -func NewFsDeliverModel(db *gorm.DB) *FsDeliverModel { return &FsDeliverModel{db} } +func NewFsDeliverModel(db *gorm.DB) *FsDeliverModel { + return &FsDeliverModel{db: db, name: "fs_deliver"} +} diff --git a/model/gmodel/fs_department_gen.go b/model/gmodel/fs_department_gen.go index 9cc183df..7ce37951 100644 --- a/model/gmodel/fs_department_gen.go +++ b/model/gmodel/fs_department_gen.go @@ -12,6 +12,11 @@ type FsDepartment struct { Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 ParentId *int64 `gorm:"default:0;" json:"parent_id"` // 父级id } -type FsDepartmentModel struct{ db *gorm.DB } +type FsDepartmentModel struct { + db *gorm.DB + name string +} -func NewFsDepartmentModel(db *gorm.DB) *FsDepartmentModel { return &FsDepartmentModel{db} } +func NewFsDepartmentModel(db *gorm.DB) *FsDepartmentModel { + return &FsDepartmentModel{db: db, name: "fs_department"} +} diff --git a/model/gmodel/fs_email_logs_gen.go b/model/gmodel/fs_email_logs_gen.go index e8337252..a16ecd4c 100644 --- a/model/gmodel/fs_email_logs_gen.go +++ b/model/gmodel/fs_email_logs_gen.go @@ -14,6 +14,11 @@ type FsEmailLogs struct { Result *string `gorm:"default:'';" json:"result"` // 发送结果 Status *int64 `gorm:"default:0;" json:"status"` // 状态 1成功0失败 } -type FsEmailLogsModel struct{ db *gorm.DB } +type FsEmailLogsModel struct { + db *gorm.DB + name string +} -func NewFsEmailLogsModel(db *gorm.DB) *FsEmailLogsModel { return &FsEmailLogsModel{db} } +func NewFsEmailLogsModel(db *gorm.DB) *FsEmailLogsModel { + return &FsEmailLogsModel{db: db, name: "fs_email_logs"} +} diff --git a/model/gmodel/fs_email_template_gen.go b/model/gmodel/fs_email_template_gen.go index 4c37a168..520a8e02 100644 --- a/model/gmodel/fs_email_template_gen.go +++ b/model/gmodel/fs_email_template_gen.go @@ -15,6 +15,11 @@ type FsEmailTemplate struct { Status *int64 `gorm:"default:0;" json:"status"` // 状态值(0:禁用,1:启用) Ctime *int64 `gorm:"default:0;" json:"ctime"` // } -type FsEmailTemplateModel struct{ db *gorm.DB } +type FsEmailTemplateModel struct { + db *gorm.DB + name string +} -func NewFsEmailTemplateModel(db *gorm.DB) *FsEmailTemplateModel { return &FsEmailTemplateModel{db} } +func NewFsEmailTemplateModel(db *gorm.DB) *FsEmailTemplateModel { + return &FsEmailTemplateModel{db: db, name: "fs_email_template"} +} diff --git a/model/gmodel/fs_factory_deliver_every_gen.go b/model/gmodel/fs_factory_deliver_every_gen.go index 13539e3e..c349d4ca 100644 --- a/model/gmodel/fs_factory_deliver_every_gen.go +++ b/model/gmodel/fs_factory_deliver_every_gen.go @@ -12,8 +12,11 @@ type FsFactoryDeliverEvery struct { Num *int64 `gorm:"default:0;" json:"num"` // 发货数量 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 } -type FsFactoryDeliverEveryModel struct{ db *gorm.DB } +type FsFactoryDeliverEveryModel struct { + db *gorm.DB + name string +} func NewFsFactoryDeliverEveryModel(db *gorm.DB) *FsFactoryDeliverEveryModel { - return &FsFactoryDeliverEveryModel{db} + return &FsFactoryDeliverEveryModel{db: db, name: "fs_factory_deliver_every"} } diff --git a/model/gmodel/fs_factory_deliver_gen.go b/model/gmodel/fs_factory_deliver_gen.go index c7d0928e..dcd08b0f 100644 --- a/model/gmodel/fs_factory_deliver_gen.go +++ b/model/gmodel/fs_factory_deliver_gen.go @@ -14,6 +14,11 @@ type FsFactoryDeliver struct { IsArriveCloud *int64 `gorm:"default:0;" json:"is_arrive_cloud"` // 是否到达云仓 0:未到达,1已到达 IsArriveAgent *int64 `gorm:"default:0;" json:"is_arrive_agent"` // 是否到达货代公司 0:未到达,1已到达 } -type FsFactoryDeliverModel struct{ db *gorm.DB } +type FsFactoryDeliverModel struct { + db *gorm.DB + name string +} -func NewFsFactoryDeliverModel(db *gorm.DB) *FsFactoryDeliverModel { return &FsFactoryDeliverModel{db} } +func NewFsFactoryDeliverModel(db *gorm.DB) *FsFactoryDeliverModel { + return &FsFactoryDeliverModel{db: db, name: "fs_factory_deliver"} +} diff --git a/model/gmodel/fs_factory_gen.go b/model/gmodel/fs_factory_gen.go index 157a6db3..ec08ad3b 100644 --- a/model/gmodel/fs_factory_gen.go +++ b/model/gmodel/fs_factory_gen.go @@ -13,6 +13,11 @@ type FsFactory struct { Mobile *string `gorm:"default:'';" json:"mobile"` // 联系电话 Status *int64 `gorm:"default:0;" json:"status"` // 状态位 是否禁用 } -type FsFactoryModel struct{ db *gorm.DB } +type FsFactoryModel struct { + db *gorm.DB + name string +} -func NewFsFactoryModel(db *gorm.DB) *FsFactoryModel { return &FsFactoryModel{db} } +func NewFsFactoryModel(db *gorm.DB) *FsFactoryModel { + return &FsFactoryModel{db: db, name: "fs_factory"} +} diff --git a/model/gmodel/fs_factory_product_gen.go b/model/gmodel/fs_factory_product_gen.go index c6de8dab..332f2a1d 100644 --- a/model/gmodel/fs_factory_product_gen.go +++ b/model/gmodel/fs_factory_product_gen.go @@ -16,6 +16,11 @@ type FsFactoryProduct struct { IsDeliver *int64 `gorm:"default:0;" json:"is_deliver"` // 是否已发货(0:未发货,1:已发货) Ctime *int64 `gorm:"default:0;" json:"ctime"` // 创建时间 } -type FsFactoryProductModel struct{ db *gorm.DB } +type FsFactoryProductModel struct { + db *gorm.DB + name string +} -func NewFsFactoryProductModel(db *gorm.DB) *FsFactoryProductModel { return &FsFactoryProductModel{db} } +func NewFsFactoryProductModel(db *gorm.DB) *FsFactoryProductModel { + return &FsFactoryProductModel{db: db, name: "fs_factory_product"} +} diff --git a/model/gmodel/fs_factory_ship_tmp_gen.go b/model/gmodel/fs_factory_ship_tmp_gen.go index b10b6a57..620cd24b 100644 --- a/model/gmodel/fs_factory_ship_tmp_gen.go +++ b/model/gmodel/fs_factory_ship_tmp_gen.go @@ -18,6 +18,11 @@ type FsFactoryShipTmp struct { Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 Status *int64 `gorm:"default:0;" json:"status"` // 状态位 是否到达 是否通知货代公司 是否是发到云仓 } -type FsFactoryShipTmpModel struct{ db *gorm.DB } +type FsFactoryShipTmpModel struct { + db *gorm.DB + name string +} -func NewFsFactoryShipTmpModel(db *gorm.DB) *FsFactoryShipTmpModel { return &FsFactoryShipTmpModel{db} } +func NewFsFactoryShipTmpModel(db *gorm.DB) *FsFactoryShipTmpModel { + return &FsFactoryShipTmpModel{db: db, name: "fs_factory_ship_tmp"} +} diff --git a/model/gmodel/fs_faq_gen.go b/model/gmodel/fs_faq_gen.go index ed5cf893..f087a561 100644 --- a/model/gmodel/fs_faq_gen.go +++ b/model/gmodel/fs_faq_gen.go @@ -15,6 +15,9 @@ type FsFaq struct { Sort *int64 `gorm:"default:1;" json:"sort"` // 排序 Ctime *int64 `gorm:"default:0;" json:"ctime"` // } -type FsFaqModel struct{ db *gorm.DB } +type FsFaqModel struct { + db *gorm.DB + name string +} -func NewFsFaqModel(db *gorm.DB) *FsFaqModel { return &FsFaqModel{db} } +func NewFsFaqModel(db *gorm.DB) *FsFaqModel { return &FsFaqModel{db: db, name: "fs_faq"} } diff --git a/model/gmodel/fs_font_gen.go b/model/gmodel/fs_font_gen.go index 6a062f2f..02f5b748 100644 --- a/model/gmodel/fs_font_gen.go +++ b/model/gmodel/fs_font_gen.go @@ -12,6 +12,9 @@ type FsFont struct { FilePath *string `gorm:"default:'';" json:"file_path"` // 字体文件路径 Sort *int64 `gorm:"default:0;" json:"sort"` // 排序 } -type FsFontModel struct{ db *gorm.DB } +type FsFontModel struct { + db *gorm.DB + name string +} -func NewFsFontModel(db *gorm.DB) *FsFontModel { return &FsFontModel{db} } +func NewFsFontModel(db *gorm.DB) *FsFontModel { return &FsFontModel{db: db, name: "fs_font"} } diff --git a/model/gmodel/fs_gerent_gen.go b/model/gmodel/fs_gerent_gen.go index 8cc7cfae..0c6dfd2a 100644 --- a/model/gmodel/fs_gerent_gen.go +++ b/model/gmodel/fs_gerent_gen.go @@ -18,6 +18,9 @@ type FsGerent struct { Icon *string `gorm:"default:'';" json:"icon"` // DepartmentId *int64 `gorm:"default:0;" json:"department_id"` // 部门id } -type FsGerentModel struct{ db *gorm.DB } +type FsGerentModel struct { + db *gorm.DB + name string +} -func NewFsGerentModel(db *gorm.DB) *FsGerentModel { return &FsGerentModel{db} } +func NewFsGerentModel(db *gorm.DB) *FsGerentModel { return &FsGerentModel{db: db, name: "fs_gerent"} } diff --git a/model/gmodel/fs_guest_gen.go b/model/gmodel/fs_guest_gen.go index 3d699cb9..4cf788b4 100644 --- a/model/gmodel/fs_guest_gen.go +++ b/model/gmodel/fs_guest_gen.go @@ -17,6 +17,9 @@ type FsGuest struct { IsLowRendering *int64 `gorm:"default:0;" json:"is_low_rendering"` // 是否开启低渲染模型渲染 IsRemoveBg *int64 `gorm:"default:1;" json:"is_remove_bg"` // 用户上传logo是否去除背景 } -type FsGuestModel struct{ db *gorm.DB } +type FsGuestModel struct { + db *gorm.DB + name string +} -func NewFsGuestModel(db *gorm.DB) *FsGuestModel { return &FsGuestModel{db} } +func NewFsGuestModel(db *gorm.DB) *FsGuestModel { return &FsGuestModel{db: db, name: "fs_guest"} } diff --git a/model/gmodel/fs_log_gen.go b/model/gmodel/fs_log_gen.go index 51c1cd80..03f0ae7d 100644 --- a/model/gmodel/fs_log_gen.go +++ b/model/gmodel/fs_log_gen.go @@ -15,6 +15,9 @@ type FsLog struct { Uid *int64 `gorm:"default:0;" json:"uid"` // 操作人ID Uname *string `gorm:"default:'';" json:"uname"` // 操作人名字 } -type FsLogModel struct{ db *gorm.DB } +type FsLogModel struct { + db *gorm.DB + name string +} -func NewFsLogModel(db *gorm.DB) *FsLogModel { return &FsLogModel{db} } +func NewFsLogModel(db *gorm.DB) *FsLogModel { return &FsLogModel{db: db, name: "fs_log"} } diff --git a/model/gmodel/fs_map_library_gen.go b/model/gmodel/fs_map_library_gen.go index c6c2c0ad..e3af7036 100644 --- a/model/gmodel/fs_map_library_gen.go +++ b/model/gmodel/fs_map_library_gen.go @@ -14,6 +14,11 @@ type FsMapLibrary struct { Ctime *int64 `gorm:"default:0;" json:"ctime"` // 创建时间 TagId *int64 `gorm:"default:0;" json:"tag_id"` // 模板标签id } -type FsMapLibraryModel struct{ db *gorm.DB } +type FsMapLibraryModel struct { + db *gorm.DB + name string +} -func NewFsMapLibraryModel(db *gorm.DB) *FsMapLibraryModel { return &FsMapLibraryModel{db} } +func NewFsMapLibraryModel(db *gorm.DB) *FsMapLibraryModel { + return &FsMapLibraryModel{db: db, name: "fs_map_library"} +} diff --git a/model/gmodel/fs_menu_gen.go b/model/gmodel/fs_menu_gen.go index 0f4c2e35..bb3a80a9 100644 --- a/model/gmodel/fs_menu_gen.go +++ b/model/gmodel/fs_menu_gen.go @@ -13,6 +13,9 @@ type FsMenu struct { Order *int64 `gorm:"default:0;" json:"order"` // Data *[]byte `gorm:"default:'';" json:"data"` // 其他信息(图标等) } -type FsMenuModel struct{ db *gorm.DB } +type FsMenuModel struct { + db *gorm.DB + name string +} -func NewFsMenuModel(db *gorm.DB) *FsMenuModel { return &FsMenuModel{db} } +func NewFsMenuModel(db *gorm.DB) *FsMenuModel { return &FsMenuModel{db: db, name: "fs_menu"} } diff --git a/model/gmodel/fs_migration_gen.go b/model/gmodel/fs_migration_gen.go index cc081485..8001943c 100644 --- a/model/gmodel/fs_migration_gen.go +++ b/model/gmodel/fs_migration_gen.go @@ -9,6 +9,11 @@ type FsMigration struct { Version string `gorm:"primary_key;default:'';" json:"version"` // 版本信息 ApplyTime *int64 `gorm:"default:0;" json:"apply_time"` // } -type FsMigrationModel struct{ db *gorm.DB } +type FsMigrationModel struct { + db *gorm.DB + name string +} -func NewFsMigrationModel(db *gorm.DB) *FsMigrationModel { return &FsMigrationModel{db} } +func NewFsMigrationModel(db *gorm.DB) *FsMigrationModel { + return &FsMigrationModel{db: db, name: "fs_migration"} +} diff --git a/model/gmodel/fs_order_affiliate_gen.go b/model/gmodel/fs_order_affiliate_gen.go index 76da4af8..7f902e41 100644 --- a/model/gmodel/fs_order_affiliate_gen.go +++ b/model/gmodel/fs_order_affiliate_gen.go @@ -17,6 +17,11 @@ type FsOrderAffiliate struct { ArrivalTime *int64 `gorm:"default:0;" json:"arrival_time"` // 到达云仓的时间 RecevieTime *int64 `gorm:"default:0;" json:"recevie_time"` // 云仓收货时间 } -type FsOrderAffiliateModel struct{ db *gorm.DB } +type FsOrderAffiliateModel struct { + db *gorm.DB + name string +} -func NewFsOrderAffiliateModel(db *gorm.DB) *FsOrderAffiliateModel { return &FsOrderAffiliateModel{db} } +func NewFsOrderAffiliateModel(db *gorm.DB) *FsOrderAffiliateModel { + return &FsOrderAffiliateModel{db: db, name: "fs_order_affiliate"} +} diff --git a/model/gmodel/fs_order_detail_gen.go b/model/gmodel/fs_order_detail_gen.go index 889c4fc4..9a9ad151 100644 --- a/model/gmodel/fs_order_detail_gen.go +++ b/model/gmodel/fs_order_detail_gen.go @@ -31,6 +31,11 @@ type FsOrderDetail struct { IsEnd *int64 `gorm:"default:0;" json:"is_end"` // 是否完成订单(签收) CartId *int64 `gorm:"index;default:0;" json:"cart_id"` // 购物车编号 } -type FsOrderDetailModel struct{ db *gorm.DB } +type FsOrderDetailModel struct { + db *gorm.DB + name string +} -func NewFsOrderDetailModel(db *gorm.DB) *FsOrderDetailModel { return &FsOrderDetailModel{db} } +func NewFsOrderDetailModel(db *gorm.DB) *FsOrderDetailModel { + return &FsOrderDetailModel{db: db, name: "fs_order_detail"} +} diff --git a/model/gmodel/fs_order_detail_template_gen.go b/model/gmodel/fs_order_detail_template_gen.go index a2fbe890..698b691c 100644 --- a/model/gmodel/fs_order_detail_template_gen.go +++ b/model/gmodel/fs_order_detail_template_gen.go @@ -18,8 +18,11 @@ type FsOrderDetailTemplate struct { DesignId *int64 `gorm:"index;default:0;" json:"design_id"` // 设计ID Ctime *int64 `gorm:"default:0;" json:"ctime"` // } -type FsOrderDetailTemplateModel struct{ db *gorm.DB } +type FsOrderDetailTemplateModel struct { + db *gorm.DB + name string +} func NewFsOrderDetailTemplateModel(db *gorm.DB) *FsOrderDetailTemplateModel { - return &FsOrderDetailTemplateModel{db} + return &FsOrderDetailTemplateModel{db: db, name: "fs_order_detail_template"} } diff --git a/model/gmodel/fs_order_gen.go b/model/gmodel/fs_order_gen.go index 32428a08..2ca004bf 100644 --- a/model/gmodel/fs_order_gen.go +++ b/model/gmodel/fs_order_gen.go @@ -44,6 +44,9 @@ type FsOrder struct { DeliverSn *string `gorm:"default:'';" json:"deliver_sn"` // 发货单号 EmailTime *int64 `gorm:"default:0;" json:"email_time"` // 邮件发送时间 } -type FsOrderModel struct{ db *gorm.DB } +type FsOrderModel struct { + db *gorm.DB + name string +} -func NewFsOrderModel(db *gorm.DB) *FsOrderModel { return &FsOrderModel{db} } +func NewFsOrderModel(db *gorm.DB) *FsOrderModel { return &FsOrderModel{db: db, name: "fs_order"} } diff --git a/model/gmodel/fs_order_remark_gen.go b/model/gmodel/fs_order_remark_gen.go index ae7de59b..0b975c67 100644 --- a/model/gmodel/fs_order_remark_gen.go +++ b/model/gmodel/fs_order_remark_gen.go @@ -12,6 +12,11 @@ type FsOrderRemark struct { AdminId *int64 `gorm:"default:0;" json:"admin_id"` // 后台操作人员 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 } -type FsOrderRemarkModel struct{ db *gorm.DB } +type FsOrderRemarkModel struct { + db *gorm.DB + name string +} -func NewFsOrderRemarkModel(db *gorm.DB) *FsOrderRemarkModel { return &FsOrderRemarkModel{db} } +func NewFsOrderRemarkModel(db *gorm.DB) *FsOrderRemarkModel { + return &FsOrderRemarkModel{db: db, name: "fs_order_remark"} +} diff --git a/model/gmodel/fs_pay_gen.go b/model/gmodel/fs_pay_gen.go index 2c2fb9e3..0ee65802 100644 --- a/model/gmodel/fs_pay_gen.go +++ b/model/gmodel/fs_pay_gen.go @@ -22,6 +22,9 @@ type FsPay struct { CardNo *string `gorm:"default:'';" json:"card_no"` // 卡后4位 Brand *string `gorm:"default:'';" json:"brand"` // 银行品牌 } -type FsPayModel struct{ db *gorm.DB } +type FsPayModel struct { + db *gorm.DB + name string +} -func NewFsPayModel(db *gorm.DB) *FsPayModel { return &FsPayModel{db} } +func NewFsPayModel(db *gorm.DB) *FsPayModel { return &FsPayModel{db: db, name: "fs_pay"} } diff --git a/model/gmodel/fs_product_copy1_gen.go b/model/gmodel/fs_product_copy1_gen.go index 880039e4..92c78e28 100644 --- a/model/gmodel/fs_product_copy1_gen.go +++ b/model/gmodel/fs_product_copy1_gen.go @@ -33,6 +33,11 @@ type FsProductCopy1 struct { IsMicrowave *int64 `gorm:"default:1;" json:"is_microwave"` // 是否可微波炉 IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除 } -type FsProductCopy1Model struct{ db *gorm.DB } +type FsProductCopy1Model struct { + db *gorm.DB + name string +} -func NewFsProductCopy1Model(db *gorm.DB) *FsProductCopy1Model { return &FsProductCopy1Model{db} } +func NewFsProductCopy1Model(db *gorm.DB) *FsProductCopy1Model { + return &FsProductCopy1Model{db: db, name: "fs_product_copy1"} +} diff --git a/model/gmodel/fs_product_design_gather_gen.go b/model/gmodel/fs_product_design_gather_gen.go index 1d41f0ec..5e466861 100644 --- a/model/gmodel/fs_product_design_gather_gen.go +++ b/model/gmodel/fs_product_design_gather_gen.go @@ -21,8 +21,11 @@ type FsProductDesignGather struct { ClientIp *string `gorm:"default:'';" json:"client_ip"` // 客户端ip ClientNo *string `gorm:"default:'';" json:"client_no"` // 客户端唯一标识 } -type FsProductDesignGatherModel struct{ db *gorm.DB } +type FsProductDesignGatherModel struct { + db *gorm.DB + name string +} func NewFsProductDesignGatherModel(db *gorm.DB) *FsProductDesignGatherModel { - return &FsProductDesignGatherModel{db} + return &FsProductDesignGatherModel{db: db, name: "fs_product_design_gather"} } diff --git a/model/gmodel/fs_product_design_gen.go b/model/gmodel/fs_product_design_gen.go index 80c05630..978031f5 100644 --- a/model/gmodel/fs_product_design_gen.go +++ b/model/gmodel/fs_product_design_gen.go @@ -24,6 +24,11 @@ type FsProductDesign struct { LogoColor *string `gorm:"default:'';" json:"logo_color"` // logo图片备选项 PageGuid *string `gorm:"default:'';" json:"page_guid"` // 页面识别id } -type FsProductDesignModel struct{ db *gorm.DB } +type FsProductDesignModel struct { + db *gorm.DB + name string +} -func NewFsProductDesignModel(db *gorm.DB) *FsProductDesignModel { return &FsProductDesignModel{db} } +func NewFsProductDesignModel(db *gorm.DB) *FsProductDesignModel { + return &FsProductDesignModel{db: db, name: "fs_product_design"} +} diff --git a/model/gmodel/fs_product_gen.go b/model/gmodel/fs_product_gen.go index b9c83e0e..9eccb236 100644 --- a/model/gmodel/fs_product_gen.go +++ b/model/gmodel/fs_product_gen.go @@ -36,6 +36,11 @@ type FsProduct struct { RecommendProductSort *string `gorm:"default:'';" json:"recommend_product_sort"` // SceneIds *string `gorm:"default:'';" json:"scene_ids"` // } -type FsProductModel struct{ db *gorm.DB } +type FsProductModel struct { + db *gorm.DB + name string +} -func NewFsProductModel(db *gorm.DB) *FsProductModel { return &FsProductModel{db} } +func NewFsProductModel(db *gorm.DB) *FsProductModel { + return &FsProductModel{db: db, name: "fs_product"} +} diff --git a/model/gmodel/fs_product_model3d_gen.go b/model/gmodel/fs_product_model3d_gen.go index 597c408f..20924185 100644 --- a/model/gmodel/fs_product_model3d_gen.go +++ b/model/gmodel/fs_product_model3d_gen.go @@ -25,6 +25,11 @@ type FsProductModel3d struct { Price *int64 `gorm:"default:0;" json:"price"` // 仅配件用,配件的价格, 单位:美分 Sku *string `gorm:"default:'';" json:"sku"` // sku } -type FsProductModel3dModel struct{ db *gorm.DB } +type FsProductModel3dModel struct { + db *gorm.DB + name string +} -func NewFsProductModel3dModel(db *gorm.DB) *FsProductModel3dModel { return &FsProductModel3dModel{db} } +func NewFsProductModel3dModel(db *gorm.DB) *FsProductModel3dModel { + return &FsProductModel3dModel{db: db, name: "fs_product_model3d"} +} diff --git a/model/gmodel/fs_product_model3d_light_gen.go b/model/gmodel/fs_product_model3d_light_gen.go index 9a1819c9..aa93db60 100644 --- a/model/gmodel/fs_product_model3d_light_gen.go +++ b/model/gmodel/fs_product_model3d_light_gen.go @@ -12,8 +12,11 @@ type FsProductModel3dLight struct { Status *int64 `gorm:"default:1;" json:"status"` // 状态值(1:显示,0:删除) Ctime *int64 `gorm:"default:0;" json:"ctime"` // } -type FsProductModel3dLightModel struct{ db *gorm.DB } +type FsProductModel3dLightModel struct { + db *gorm.DB + name string +} func NewFsProductModel3dLightModel(db *gorm.DB) *FsProductModel3dLightModel { - return &FsProductModel3dLightModel{db} + return &FsProductModel3dLightModel{db: db, name: "fs_product_model3d_light"} } diff --git a/model/gmodel/fs_product_option_gen.go b/model/gmodel/fs_product_option_gen.go index e0ea082b..c528a1a5 100644 --- a/model/gmodel/fs_product_option_gen.go +++ b/model/gmodel/fs_product_option_gen.go @@ -14,6 +14,11 @@ type FsProductOption struct { Status *int64 `gorm:"default:0;" json:"status"` // 状态值(0:禁用,1:启用) Ctime *int64 `gorm:"default:0;" json:"ctime"` // } -type FsProductOptionModel struct{ db *gorm.DB } +type FsProductOptionModel struct { + db *gorm.DB + name string +} -func NewFsProductOptionModel(db *gorm.DB) *FsProductOptionModel { return &FsProductOptionModel{db} } +func NewFsProductOptionModel(db *gorm.DB) *FsProductOptionModel { + return &FsProductOptionModel{db: db, name: "fs_product_option"} +} diff --git a/model/gmodel/fs_product_price_gen.go b/model/gmodel/fs_product_price_gen.go index 3d9a9981..fe17d749 100644 --- a/model/gmodel/fs_product_price_gen.go +++ b/model/gmodel/fs_product_price_gen.go @@ -20,6 +20,11 @@ type FsProductPrice struct { Status *int64 `gorm:"default:1;" json:"status"` // 是否可用 IsDefault *int64 `gorm:"default:0;" json:"is_default"` // 是否默认 } -type FsProductPriceModel struct{ db *gorm.DB } +type FsProductPriceModel struct { + db *gorm.DB + name string +} -func NewFsProductPriceModel(db *gorm.DB) *FsProductPriceModel { return &FsProductPriceModel{db} } +func NewFsProductPriceModel(db *gorm.DB) *FsProductPriceModel { + return &FsProductPriceModel{db: db, name: "fs_product_price"} +} diff --git a/model/gmodel/fs_product_render_design_gen.go b/model/gmodel/fs_product_render_design_gen.go index 6115e18e..460ec90f 100644 --- a/model/gmodel/fs_product_render_design_gen.go +++ b/model/gmodel/fs_product_render_design_gen.go @@ -22,8 +22,11 @@ type FsProductRenderDesign struct { ClientNo *string `gorm:"default:'';" json:"client_no"` // 客户端唯一标识 LogoColor *string `gorm:"default:'';" json:"logo_color"` // logo图片备选颜色 } -type FsProductRenderDesignModel struct{ db *gorm.DB } +type FsProductRenderDesignModel struct { + db *gorm.DB + name string +} func NewFsProductRenderDesignModel(db *gorm.DB) *FsProductRenderDesignModel { - return &FsProductRenderDesignModel{db} + return &FsProductRenderDesignModel{db: db, name: "fs_product_render_design"} } diff --git a/model/gmodel/fs_product_scene_gen.go b/model/gmodel/fs_product_scene_gen.go index f4fe3f2c..3bcfb944 100644 --- a/model/gmodel/fs_product_scene_gen.go +++ b/model/gmodel/fs_product_scene_gen.go @@ -13,6 +13,11 @@ type FsProductScene struct { Status *int64 `gorm:"default:0;" json:"status"` // 状态1正常 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 } -type FsProductSceneModel struct{ db *gorm.DB } +type FsProductSceneModel struct { + db *gorm.DB + name string +} -func NewFsProductSceneModel(db *gorm.DB) *FsProductSceneModel { return &FsProductSceneModel{db} } +func NewFsProductSceneModel(db *gorm.DB) *FsProductSceneModel { + return &FsProductSceneModel{db: db, name: "fs_product_scene"} +} diff --git a/model/gmodel/fs_product_size_gen.go b/model/gmodel/fs_product_size_gen.go index 34ac6247..c8779e7a 100644 --- a/model/gmodel/fs_product_size_gen.go +++ b/model/gmodel/fs_product_size_gen.go @@ -17,6 +17,11 @@ type FsProductSize struct { Remark *string `gorm:"default:'';" json:"remark"` // PartsCanDeleted *int64 `gorm:"default:1;" json:"parts_can_deleted"` // 配件是否可移除 1是0否 } -type FsProductSizeModel struct{ db *gorm.DB } +type FsProductSizeModel struct { + db *gorm.DB + name string +} -func NewFsProductSizeModel(db *gorm.DB) *FsProductSizeModel { return &FsProductSizeModel{db} } +func NewFsProductSizeModel(db *gorm.DB) *FsProductSizeModel { + return &FsProductSizeModel{db: db, name: "fs_product_size"} +} diff --git a/model/gmodel/fs_product_template_basemap_gen.go b/model/gmodel/fs_product_template_basemap_gen.go index 78e2f41b..0ad054f1 100644 --- a/model/gmodel/fs_product_template_basemap_gen.go +++ b/model/gmodel/fs_product_template_basemap_gen.go @@ -12,8 +12,11 @@ type FsProductTemplateBasemap struct { Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 Status *int64 `gorm:"default:1;" json:"status"` // 状态值,1正常0删除 } -type FsProductTemplateBasemapModel struct{ db *gorm.DB } +type FsProductTemplateBasemapModel struct { + db *gorm.DB + name string +} func NewFsProductTemplateBasemapModel(db *gorm.DB) *FsProductTemplateBasemapModel { - return &FsProductTemplateBasemapModel{db} + return &FsProductTemplateBasemapModel{db: db, name: "fs_product_template_basemap"} } diff --git a/model/gmodel/fs_product_template_element_gen.go b/model/gmodel/fs_product_template_element_gen.go index 4e2dae6f..7dd21864 100644 --- a/model/gmodel/fs_product_template_element_gen.go +++ b/model/gmodel/fs_product_template_element_gen.go @@ -27,8 +27,11 @@ type FsProductTemplateElement struct { ModelP *string `gorm:"default:'';" json:"model_p"` // 配件对应的云渲染贴图数据 Refletion *string `gorm:"default:'';" json:"refletion"` // 反射探头组 } -type FsProductTemplateElementModel struct{ db *gorm.DB } +type FsProductTemplateElementModel struct { + db *gorm.DB + name string +} func NewFsProductTemplateElementModel(db *gorm.DB) *FsProductTemplateElementModel { - return &FsProductTemplateElementModel{db} + return &FsProductTemplateElementModel{db: db, name: "fs_product_template_element"} } diff --git a/model/gmodel/fs_product_template_gen.go b/model/gmodel/fs_product_template_gen.go index c4e1a58f..4a857c80 100644 --- a/model/gmodel/fs_product_template_gen.go +++ b/model/gmodel/fs_product_template_gen.go @@ -18,8 +18,11 @@ type FsProductTemplate struct { LogoWidth *int64 `gorm:"default:0;" json:"logo_width"` // logo图最大宽度 LogoHeight *int64 `gorm:"default:0;" json:"logo_height"` // logo图最大高度 } -type FsProductTemplateModel struct{ db *gorm.DB } +type FsProductTemplateModel struct { + db *gorm.DB + name string +} func NewFsProductTemplateModel(db *gorm.DB) *FsProductTemplateModel { - return &FsProductTemplateModel{db} + return &FsProductTemplateModel{db: db, name: "fs_product_template"} } diff --git a/model/gmodel/fs_product_template_tags_gen.go b/model/gmodel/fs_product_template_tags_gen.go index 212c8e9a..db246f6e 100644 --- a/model/gmodel/fs_product_template_tags_gen.go +++ b/model/gmodel/fs_product_template_tags_gen.go @@ -11,8 +11,11 @@ type FsProductTemplateTags struct { Status *int64 `gorm:"default:0;" json:"status"` // 状态 1:可用 CreateAt *int64 `gorm:"default:0;" json:"create_at"` // 创建时间 } -type FsProductTemplateTagsModel struct{ db *gorm.DB } +type FsProductTemplateTagsModel struct { + db *gorm.DB + name string +} func NewFsProductTemplateTagsModel(db *gorm.DB) *FsProductTemplateTagsModel { - return &FsProductTemplateTagsModel{db} + return &FsProductTemplateTagsModel{db: db, name: "fs_product_template_tags"} } diff --git a/model/gmodel/fs_product_template_v2_gen.go b/model/gmodel/fs_product_template_v2_gen.go index 136705e5..62b8bce3 100644 --- a/model/gmodel/fs_product_template_v2_gen.go +++ b/model/gmodel/fs_product_template_v2_gen.go @@ -23,8 +23,11 @@ type FsProductTemplateV2 struct { Tag *string `gorm:"default:'';" json:"tag"` // 标签(用户自填) IsDel *int64 `gorm:"default:0;" json:"is_del"` // 是否删除 1删除 } -type FsProductTemplateV2Model struct{ db *gorm.DB } +type FsProductTemplateV2Model struct { + db *gorm.DB + name string +} func NewFsProductTemplateV2Model(db *gorm.DB) *FsProductTemplateV2Model { - return &FsProductTemplateV2Model{db} + return &FsProductTemplateV2Model{db: db, name: "fs_product_template_v2"} } diff --git a/model/gmodel/fs_product_v2_tmp_gen.go b/model/gmodel/fs_product_v2_tmp_gen.go index 3a1d8396..b947c85d 100644 --- a/model/gmodel/fs_product_v2_tmp_gen.go +++ b/model/gmodel/fs_product_v2_tmp_gen.go @@ -33,6 +33,11 @@ type FsProductV2Tmp struct { RecommendProduct *string `gorm:"default:'';" json:"recommend_product"` // RecommendProductSort *string `gorm:"default:'';" json:"recommend_product_sort"` // } -type FsProductV2TmpModel struct{ db *gorm.DB } +type FsProductV2TmpModel struct { + db *gorm.DB + name string +} -func NewFsProductV2TmpModel(db *gorm.DB) *FsProductV2TmpModel { return &FsProductV2TmpModel{db} } +func NewFsProductV2TmpModel(db *gorm.DB) *FsProductV2TmpModel { + return &FsProductV2TmpModel{db: db, name: "fs_product_v2_tmp"} +} diff --git a/model/gmodel/fs_qrcode_gen.go b/model/gmodel/fs_qrcode_gen.go index a2c54a4f..c65c1775 100644 --- a/model/gmodel/fs_qrcode_gen.go +++ b/model/gmodel/fs_qrcode_gen.go @@ -16,6 +16,9 @@ type FsQrcode struct { Status *int64 `gorm:"default:1;" json:"status"` // 状态:1:正常 0:下架 ProductId *int64 `gorm:"default:0;" json:"product_id"` // 0 } -type FsQrcodeModel struct{ db *gorm.DB } +type FsQrcodeModel struct { + db *gorm.DB + name string +} -func NewFsQrcodeModel(db *gorm.DB) *FsQrcodeModel { return &FsQrcodeModel{db} } +func NewFsQrcodeModel(db *gorm.DB) *FsQrcodeModel { return &FsQrcodeModel{db: db, name: "fs_qrcode"} } diff --git a/model/gmodel/fs_qrcode_log_gen.go b/model/gmodel/fs_qrcode_log_gen.go index f8182cc6..45b3477d 100644 --- a/model/gmodel/fs_qrcode_log_gen.go +++ b/model/gmodel/fs_qrcode_log_gen.go @@ -14,6 +14,11 @@ type FsQrcodeLog struct { Platform *string `gorm:"default:'';" json:"platform"` // UserAgent *string `gorm:"default:'';" json:"user_agent"` // } -type FsQrcodeLogModel struct{ db *gorm.DB } +type FsQrcodeLogModel struct { + db *gorm.DB + name string +} -func NewFsQrcodeLogModel(db *gorm.DB) *FsQrcodeLogModel { return &FsQrcodeLogModel{db} } +func NewFsQrcodeLogModel(db *gorm.DB) *FsQrcodeLogModel { + return &FsQrcodeLogModel{db: db, name: "fs_qrcode_log"} +} diff --git a/model/gmodel/fs_qrcode_set_gen.go b/model/gmodel/fs_qrcode_set_gen.go index 8d3ef794..84814926 100644 --- a/model/gmodel/fs_qrcode_set_gen.go +++ b/model/gmodel/fs_qrcode_set_gen.go @@ -19,6 +19,11 @@ type FsQrcodeSet struct { Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 Utime *int64 `gorm:"default:0;" json:"utime"` // 更新时间 } -type FsQrcodeSetModel struct{ db *gorm.DB } +type FsQrcodeSetModel struct { + db *gorm.DB + name string +} -func NewFsQrcodeSetModel(db *gorm.DB) *FsQrcodeSetModel { return &FsQrcodeSetModel{db} } +func NewFsQrcodeSetModel(db *gorm.DB) *FsQrcodeSetModel { + return &FsQrcodeSetModel{db: db, name: "fs_qrcode_set"} +} diff --git a/model/gmodel/fs_qrcode_user_gen.go b/model/gmodel/fs_qrcode_user_gen.go index 1639b533..0b9ca6c0 100644 --- a/model/gmodel/fs_qrcode_user_gen.go +++ b/model/gmodel/fs_qrcode_user_gen.go @@ -11,6 +11,11 @@ type FsQrcodeUser struct { Status *int64 `gorm:"default:0;" json:"status"` // 状态 1正常0删除 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 } -type FsQrcodeUserModel struct{ db *gorm.DB } +type FsQrcodeUserModel struct { + db *gorm.DB + name string +} -func NewFsQrcodeUserModel(db *gorm.DB) *FsQrcodeUserModel { return &FsQrcodeUserModel{db} } +func NewFsQrcodeUserModel(db *gorm.DB) *FsQrcodeUserModel { + return &FsQrcodeUserModel{db: db, name: "fs_qrcode_user"} +} diff --git a/model/gmodel/fs_quotation_gen.go b/model/gmodel/fs_quotation_gen.go index 2e3bbff2..08b6885f 100644 --- a/model/gmodel/fs_quotation_gen.go +++ b/model/gmodel/fs_quotation_gen.go @@ -21,6 +21,11 @@ type FsQuotation struct { IsMark *int64 `gorm:"default:0;" json:"is_mark"` // 星标 Qid *int64 `gorm:"default:0;" json:"qid"` // } -type FsQuotationModel struct{ db *gorm.DB } +type FsQuotationModel struct { + db *gorm.DB + name string +} -func NewFsQuotationModel(db *gorm.DB) *FsQuotationModel { return &FsQuotationModel{db} } +func NewFsQuotationModel(db *gorm.DB) *FsQuotationModel { + return &FsQuotationModel{db: db, name: "fs_quotation"} +} diff --git a/model/gmodel/fs_quotation_product_gen.go b/model/gmodel/fs_quotation_product_gen.go index 3175b904..9f417951 100644 --- a/model/gmodel/fs_quotation_product_gen.go +++ b/model/gmodel/fs_quotation_product_gen.go @@ -21,8 +21,11 @@ type FsQuotationProduct struct { Remark *string `gorm:"default:'';" json:"remark"` // 备注 Num *int64 `gorm:"default:0;" json:"num"` // 产品数量 } -type FsQuotationProductModel struct{ db *gorm.DB } +type FsQuotationProductModel struct { + db *gorm.DB + name string +} func NewFsQuotationProductModel(db *gorm.DB) *FsQuotationProductModel { - return &FsQuotationProductModel{db} + return &FsQuotationProductModel{db: db, name: "fs_quotation_product"} } diff --git a/model/gmodel/fs_quotation_remark_template_gen.go b/model/gmodel/fs_quotation_remark_template_gen.go index c587e32d..171ed22c 100644 --- a/model/gmodel/fs_quotation_remark_template_gen.go +++ b/model/gmodel/fs_quotation_remark_template_gen.go @@ -11,8 +11,11 @@ type FsQuotationRemarkTemplate struct { Status *int64 `gorm:"default:1;" json:"status"` // 状态 1启用0停用 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 } -type FsQuotationRemarkTemplateModel struct{ db *gorm.DB } +type FsQuotationRemarkTemplateModel struct { + db *gorm.DB + name string +} func NewFsQuotationRemarkTemplateModel(db *gorm.DB) *FsQuotationRemarkTemplateModel { - return &FsQuotationRemarkTemplateModel{db} + return &FsQuotationRemarkTemplateModel{db: db, name: "fs_quotation_remark_template"} } diff --git a/model/gmodel/fs_quotation_saler_gen.go b/model/gmodel/fs_quotation_saler_gen.go index f85a9c0f..a7d222bd 100644 --- a/model/gmodel/fs_quotation_saler_gen.go +++ b/model/gmodel/fs_quotation_saler_gen.go @@ -13,6 +13,11 @@ type FsQuotationSaler struct { Status *int64 `gorm:"default:0;" json:"status"` // 状态位 1启用0停用 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 } -type FsQuotationSalerModel struct{ db *gorm.DB } +type FsQuotationSalerModel struct { + db *gorm.DB + name string +} -func NewFsQuotationSalerModel(db *gorm.DB) *FsQuotationSalerModel { return &FsQuotationSalerModel{db} } +func NewFsQuotationSalerModel(db *gorm.DB) *FsQuotationSalerModel { + return &FsQuotationSalerModel{db: db, name: "fs_quotation_saler"} +} diff --git a/model/gmodel/fs_refund_reason_gen.go b/model/gmodel/fs_refund_reason_gen.go index 7e077449..4a12b499 100644 --- a/model/gmodel/fs_refund_reason_gen.go +++ b/model/gmodel/fs_refund_reason_gen.go @@ -17,6 +17,11 @@ type FsRefundReason struct { HandleUid *int64 `gorm:"default:0;" json:"handle_uid"` // 处理人 HandleTime *int64 `gorm:"default:0;" json:"handle_time"` // 处理时间 } -type FsRefundReasonModel struct{ db *gorm.DB } +type FsRefundReasonModel struct { + db *gorm.DB + name string +} -func NewFsRefundReasonModel(db *gorm.DB) *FsRefundReasonModel { return &FsRefundReasonModel{db} } +func NewFsRefundReasonModel(db *gorm.DB) *FsRefundReasonModel { + return &FsRefundReasonModel{db: db, name: "fs_refund_reason"} +} diff --git a/model/gmodel/fs_standard_logo_gen.go b/model/gmodel/fs_standard_logo_gen.go index f82325ce..0c36725d 100644 --- a/model/gmodel/fs_standard_logo_gen.go +++ b/model/gmodel/fs_standard_logo_gen.go @@ -12,6 +12,11 @@ type FsStandardLogo struct { Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 Status *int64 `gorm:"default:1;" json:"status"` // 状态 1正常 0删除 } -type FsStandardLogoModel struct{ db *gorm.DB } +type FsStandardLogoModel struct { + db *gorm.DB + name string +} -func NewFsStandardLogoModel(db *gorm.DB) *FsStandardLogoModel { return &FsStandardLogoModel{db} } +func NewFsStandardLogoModel(db *gorm.DB) *FsStandardLogoModel { + return &FsStandardLogoModel{db: db, name: "fs_standard_logo"} +} diff --git a/model/gmodel/fs_tags_gen.go b/model/gmodel/fs_tags_gen.go index 041c2577..13bc3800 100644 --- a/model/gmodel/fs_tags_gen.go +++ b/model/gmodel/fs_tags_gen.go @@ -19,6 +19,9 @@ type FsTags struct { RecommendProduct *string `gorm:"default:'';" json:"recommend_product"` // RecommendProductSort *string `gorm:"default:'';" json:"recommend_product_sort"` // } -type FsTagsModel struct{ db *gorm.DB } +type FsTagsModel struct { + db *gorm.DB + name string +} -func NewFsTagsModel(db *gorm.DB) *FsTagsModel { return &FsTagsModel{db} } +func NewFsTagsModel(db *gorm.DB) *FsTagsModel { return &FsTagsModel{db: db, name: "fs_tags"} } diff --git a/model/gmodel/fs_tool_logs_gen.go b/model/gmodel/fs_tool_logs_gen.go index fd039548..57ba8919 100644 --- a/model/gmodel/fs_tool_logs_gen.go +++ b/model/gmodel/fs_tool_logs_gen.go @@ -16,6 +16,11 @@ type FsToolLogs struct { Uid *int64 `gorm:"index;default:0;" json:"uid"` // 3d设计用户 Name *string `gorm:"default:'';" json:"name"` // 产品名称 } -type FsToolLogsModel struct{ db *gorm.DB } +type FsToolLogsModel struct { + db *gorm.DB + name string +} -func NewFsToolLogsModel(db *gorm.DB) *FsToolLogsModel { return &FsToolLogsModel{db} } +func NewFsToolLogsModel(db *gorm.DB) *FsToolLogsModel { + return &FsToolLogsModel{db: db, name: "fs_tool_logs"} +} diff --git a/model/gmodel/fs_tool_template_gen.go b/model/gmodel/fs_tool_template_gen.go index 473f8da1..107ad8dc 100644 --- a/model/gmodel/fs_tool_template_gen.go +++ b/model/gmodel/fs_tool_template_gen.go @@ -17,6 +17,11 @@ type FsToolTemplate struct { Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间 Status *int64 `gorm:"default:0;" json:"status"` // 1正常 0:禁用 } -type FsToolTemplateModel struct{ db *gorm.DB } +type FsToolTemplateModel struct { + db *gorm.DB + name string +} -func NewFsToolTemplateModel(db *gorm.DB) *FsToolTemplateModel { return &FsToolTemplateModel{db} } +func NewFsToolTemplateModel(db *gorm.DB) *FsToolTemplateModel { + return &FsToolTemplateModel{db: db, name: "fs_tool_template"} +} diff --git a/model/gmodel/fs_tool_user_gen.go b/model/gmodel/fs_tool_user_gen.go index 3b313164..e7282bdb 100644 --- a/model/gmodel/fs_tool_user_gen.go +++ b/model/gmodel/fs_tool_user_gen.go @@ -12,6 +12,11 @@ type FsToolUser struct { Status *int64 `gorm:"default:0;" json:"status"` // 状态位 1正常0删除 Ctime *int64 `gorm:"default:0;" json:"ctime"` // 创建时间 } -type FsToolUserModel struct{ db *gorm.DB } +type FsToolUserModel struct { + db *gorm.DB + name string +} -func NewFsToolUserModel(db *gorm.DB) *FsToolUserModel { return &FsToolUserModel{db} } +func NewFsToolUserModel(db *gorm.DB) *FsToolUserModel { + return &FsToolUserModel{db: db, name: "fs_tool_user"} +} diff --git a/model/gmodel/fs_trade_gen.go b/model/gmodel/fs_trade_gen.go index 814e5e6c..740f1300 100644 --- a/model/gmodel/fs_trade_gen.go +++ b/model/gmodel/fs_trade_gen.go @@ -18,6 +18,9 @@ type FsTrade struct { Desc *string `gorm:"default:'';" json:"desc"` // Status *int64 `gorm:"default:0;" json:"status"` // } -type FsTradeModel struct{ db *gorm.DB } +type FsTradeModel struct { + db *gorm.DB + name string +} -func NewFsTradeModel(db *gorm.DB) *FsTradeModel { return &FsTradeModel{db} } +func NewFsTradeModel(db *gorm.DB) *FsTradeModel { return &FsTradeModel{db: db, name: "fs_trade"} } diff --git a/model/gmodel/fs_user_design_gen.go b/model/gmodel/fs_user_design_gen.go index fa519743..08d76923 100644 --- a/model/gmodel/fs_user_design_gen.go +++ b/model/gmodel/fs_user_design_gen.go @@ -15,6 +15,11 @@ type FsUserDesign struct { Info *string `gorm:"default:'';" json:"info"` // 其他设计信息 Ctime *int64 `gorm:"default:0;" json:"ctime"` // } -type FsUserDesignModel struct{ db *gorm.DB } +type FsUserDesignModel struct { + db *gorm.DB + name string +} -func NewFsUserDesignModel(db *gorm.DB) *FsUserDesignModel { return &FsUserDesignModel{db} } +func NewFsUserDesignModel(db *gorm.DB) *FsUserDesignModel { + return &FsUserDesignModel{db: db, name: "fs_user_design"} +} diff --git a/model/gmodel/fs_user_gen.go b/model/gmodel/fs_user_gen.go index 79535807..05b8cdd1 100644 --- a/model/gmodel/fs_user_gen.go +++ b/model/gmodel/fs_user_gen.go @@ -33,6 +33,9 @@ type FsUser struct { IsLowRendering *int64 `gorm:"default:0;" json:"is_low_rendering"` // IsRemoveBg *int64 `gorm:"default:1;" json:"is_remove_bg"` // 用户上传logo是否去除背景 } -type FsUserModel struct{ db *gorm.DB } +type FsUserModel struct { + db *gorm.DB + name string +} -func NewFsUserModel(db *gorm.DB) *FsUserModel { return &FsUserModel{db} } +func NewFsUserModel(db *gorm.DB) *FsUserModel { return &FsUserModel{db: db, name: "fs_user"} } diff --git a/model/gmodel/fs_user_logic.go b/model/gmodel/fs_user_logic.go index 59edcfb8..e80917e5 100644 --- a/model/gmodel/fs_user_logic.go +++ b/model/gmodel/fs_user_logic.go @@ -2,6 +2,8 @@ package gmodel import ( "context" + + "gorm.io/gorm" ) // TODO: 使用model的属性做你想做的 @@ -28,10 +30,19 @@ func (u *FsUserModel) FindUserByEmail(ctx context.Context, emailname string) (re } func (u *FsUserModel) FindUserById(ctx context.Context, Id int64) (resp FsUser, err error) { - err = u.db.WithContext(ctx).Model(&FsUser{}).Where("`id` = ? and is_del = ?", Id, 0).First(&resp).Error + err = u.db.WithContext(ctx).Model(&FsUser{}).Where("`id` = ? and is_del = ?", Id, 0).Take(&resp).Error return resp, err } +func (u *FsUserModel) FindUserByGoogleId(ctx context.Context, Id int64) (resp *FsUser, err error) { + err = u.db.WithContext(ctx).Model(resp).Where("`google_id` = ? and is_del = ?", Id, 0).Take(resp).Error + return resp, err +} + +func (u *FsUserModel) TransactionRegsterGoogle(ctx context.Context, fc func(tx *gorm.DB) error) (err error) { + return u.db.WithContext(ctx).Transaction(fc) +} + func (u *FsUserModel) UpdateUserBasicInfoById(ctx context.Context, Id int64, user *UserBasicInfoForSave) (err error) { err = u.db.WithContext(ctx).Model(&FsUser{}). diff --git a/model/gmodel/fs_user_stock_gen.go b/model/gmodel/fs_user_stock_gen.go index dd865857..1ae1768e 100644 --- a/model/gmodel/fs_user_stock_gen.go +++ b/model/gmodel/fs_user_stock_gen.go @@ -21,6 +21,11 @@ type FsUserStock struct { IsEmail *int64 `gorm:"default:0;" json:"is_email"` // 是否发送邮件 Utime *int64 `gorm:"default:0;" json:"utime"` // 更新时间 } -type FsUserStockModel struct{ db *gorm.DB } +type FsUserStockModel struct { + db *gorm.DB + name string +} -func NewFsUserStockModel(db *gorm.DB) *FsUserStockModel { return &FsUserStockModel{db} } +func NewFsUserStockModel(db *gorm.DB) *FsUserStockModel { + return &FsUserStockModel{db: db, name: "fs_user_stock"} +} diff --git a/model/gmodel/fs_web_set_gen.go b/model/gmodel/fs_web_set_gen.go index 49fd2152..e64bfa26 100644 --- a/model/gmodel/fs_web_set_gen.go +++ b/model/gmodel/fs_web_set_gen.go @@ -12,6 +12,9 @@ type FsWebSet struct { Ctime *int64 `gorm:"default:0;" json:"ctime"` // 创建时间 ExpTime *int64 `gorm:"default:0;" json:"exp_time"` // 过期时间 } -type FsWebSetModel struct{ db *gorm.DB } +type FsWebSetModel struct { + db *gorm.DB + name string +} -func NewFsWebSetModel(db *gorm.DB) *FsWebSetModel { return &FsWebSetModel{db} } +func NewFsWebSetModel(db *gorm.DB) *FsWebSetModel { return &FsWebSetModel{db: db, name: "fs_web_set"} } diff --git a/server/home-user-auth/internal/handler/usergoogleloginhandler.go b/server/home-user-auth/internal/handler/usergoogleloginhandler.go index a2daca84..125bd876 100644 --- a/server/home-user-auth/internal/handler/usergoogleloginhandler.go +++ b/server/home-user-auth/internal/handler/usergoogleloginhandler.go @@ -2,7 +2,6 @@ package handler import ( "errors" - "log" "net/http" "github.com/zeromicro/go-zero/core/logx" @@ -54,7 +53,6 @@ func UserGoogleLoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { userinfo = &auth.UserInfo{UserId: 0, GuestId: 0} } - log.Println(r.URL.String(), r.URL.Query()) var req types.RequestGoogleLogin // 如果端点有请求结构体,则使用httpx.Parse方法从HTTP请求体中解析请求数据 if err := httpx.Parse(r, &req); err != nil { @@ -65,12 +63,18 @@ func UserGoogleLoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { logx.Info(err) return } + // 创建一个业务逻辑层实例 l := logic.NewUserGoogleLoginLogic(r.Context(), svcCtx) resp := l.UserGoogleLogin(&req, userinfo) + // 如果响应不为nil,则使用httpx.OkJsonCtx方法返回JSON响应; if resp != nil { - httpx.OkJsonCtx(r.Context(), w, resp) + if resp.IsRewriteHandler() { + resp.RewriteHandler(w, r) + } else { + httpx.OkJsonCtx(r.Context(), w, resp) + } } else { err := errors.New("server logic is error, resp must not be nil") httpx.ErrorCtx(r.Context(), w, err) diff --git a/server/home-user-auth/internal/logic/usergoogleloginlogic.go b/server/home-user-auth/internal/logic/usergoogleloginlogic.go index 12fbf720..ba8efec7 100644 --- a/server/home-user-auth/internal/logic/usergoogleloginlogic.go +++ b/server/home-user-auth/internal/logic/usergoogleloginlogic.go @@ -5,6 +5,8 @@ import ( "fusenapi/utils/basic" "log" "net/http" + "net/url" + "time" "context" @@ -16,6 +18,7 @@ import ( "golang.org/x/net/proxy" "golang.org/x/oauth2" "golang.org/x/oauth2/google" + "gorm.io/gorm" ) type UserGoogleLoginLogic struct { @@ -67,9 +70,36 @@ func (l *UserGoogleLoginLogic) UserGoogleLogin(req *types.RequestGoogleLogin, us r, err := ses.Get("https://www.googleapis.com/oauth2/v2/userinfo?access_token=" + token.AccessToken).Execute() if err != nil { - panic(err) + logx.Error(err) + return resp.SetStatus(basic.CodeOAuthGoogleApiErr) } + log.Println(r.Json()) + googleId := r.Json().Get("id").Int() + user, err := l.svcCtx.AllModels.FsUser.FindUserByGoogleId(context.TODO(), googleId) + log.Println(user) + if err != nil { + if err != gorm.ErrRecordNotFound { + logx.Error(err) + return resp.SetStatus(basic.CodeDbSqlErr) + } + + // 如果密码匹配,则生成 JWT Token。 + nowSec := time.Now().Unix() + jwtToken, err := auth.GenerateJwtToken(&l.svcCtx.Config.Auth.AccessSecret, l.svcCtx.Config.Auth.AccessExpire, nowSec, 0, 0) + + // 如果生成 JWT Token 失败,则抛出错误并返回未认证的状态码。 + if err != nil { + logx.Error(err) + return resp.SetStatus(basic.CodeServiceErr) + } + + return resp.SetRewriteHandler(func(w http.ResponseWriter, r *http.Request) { + http.Redirect(w, r, "http://localhost:9900?token="+url.QueryEscape(jwtToken), http.StatusFound) + }) + + } + return resp.SetStatus(basic.CodeOK) } diff --git a/utils/basic/basic.go b/utils/basic/basic.go index 0e7e2e5b..a33bd006 100644 --- a/utils/basic/basic.go +++ b/utils/basic/basic.go @@ -39,9 +39,11 @@ var ( CodeServiceErr = &StatusResponse{510, "server logic error"} // 服务逻辑错误 CodeUnAuth = &StatusResponse{401, "unauthorized"} // 未授权 + CodeOAuthGoogleApiErr = &StatusResponse{5070, "oauth2 google api error"} + CodeS3PutObjectRequestErr = &StatusResponse{5060, "s3 PutObjectRequest error"} // s3 PutObjectRequest 错误 - CodeS3PutSizeLimitErr = &StatusResponse{5060, "s3 over limit size error"} // s3 超过文件大小限制 错误 - CodeS3CategoryErr = &StatusResponse{5060, "s3 category not exists error"} // s3 类别不存在 错误 + CodeS3PutSizeLimitErr = &StatusResponse{5061, "s3 over limit size error"} // s3 超过文件大小限制 错误 + CodeS3CategoryErr = &StatusResponse{5062, "s3 category not exists error"} // s3 类别不存在 错误 CodeEmailNotFoundErr = &StatusResponse{5050, "email not found"} // 未找到email CodeUserIdNotFoundErr = &StatusResponse{5051, "user not found"} // 未找到用户 @@ -73,9 +75,10 @@ var ( ) type Response struct { - Code int `json:"code"` - Message string `json:"msg"` - Data interface{} `json:"data"` + rewriteHandlerFunc http.HandlerFunc + Code int `json:"code"` + Message string `json:"msg"` + Data interface{} `json:"data"` } // Set 设置Response的Code和Message值 @@ -228,3 +231,22 @@ func RequestFileParse(r *http.Request, req any) error { return nil } + +// RewriteHandler +func (resp *Response) SetRewriteHandler(do http.HandlerFunc) *Response { + resp = &Response{ + Code: 304, + } + resp.rewriteHandlerFunc = do + return resp +} + +// RewriteHandler +func (resp *Response) RewriteHandler(w http.ResponseWriter, r *http.Request) { + resp.rewriteHandlerFunc(w, r) +} + +// Set 设置Response的Code和Message值 +func (resp *Response) IsRewriteHandler() bool { + return resp.rewriteHandlerFunc != nil +}