text
stringlengths
11
4.05M
// Copyright 2022 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package intel import ( "context" "fmt" "time" "chromiumos/tast/errors" "chromiumos/tast/remote/firmware/fixture" "chromiumos/tast/remote/powercontrol" "chromiumos/tast/testing" ) func init() { testing.AddTest(&testing.Test{ Func: AltVolupRWarmReboot, LacrosStatus: testing.LacrosVariantUnneeded, Desc: "Test if 'Alt + Vol Up + R' warm reboots the DUT successfully", Contacts: []string{"ambalavanan.m.m@intel.com", "intel-chrome-system-automation-team@intel.com"}, ServiceDeps: []string{"tast.cros.security.BootLockboxService"}, SoftwareDeps: []string{"chrome"}, Fixture: fixture.NormalMode, Timeout: 5 * time.Minute, }) } func AltVolupRWarmReboot(ctx context.Context, s *testing.State) { h := s.FixtValue().(*fixture.Value).Helper if err := h.RequireServo(ctx); err != nil { s.Fatal("Failed to connect to servo: ", err) } // Perform a Chrome login. s.Log("Login to Chrome") if err := powercontrol.ChromeOSLogin(ctx, h.DUT, s.RPCHint()); err != nil { s.Fatal("Failed to login to chrome: ", err) } // Press three keys together: Alt + Vol Up + R if err := func(ctx context.Context) error { for _, targetKey := range []string{"<alt_l>", "<f10>", "r"} { row, col, err := h.Servo.GetKeyRowCol(targetKey) if err != nil { return errors.Wrapf(err, "failed to get key %s column and row", targetKey) } targetKeyName := targetKey targetKeyHold := fmt.Sprintf("kbpress %d %d 1", col, row) targetKeyRelease := fmt.Sprintf("kbpress %d %d 0", col, row) s.Logf("Pressing and holding key %s", targetKey) if err := h.Servo.RunECCommand(ctx, targetKeyHold); err != nil { return errors.Wrapf(err, "failed to press and hold key %s", targetKey) } defer func(releaseKey, name string) error { s.Logf("Releasing key %s", name) if err := h.Servo.RunECCommand(ctx, releaseKey); err != nil { return errors.Wrapf(err, "failed to release key %s", releaseKey) } return nil }(targetKeyRelease, targetKeyName) } return nil }(ctx); err != nil { s.Fatal("Failed to press keys: ", err) } s.Log(ctx, "Waiting for DUT to shutdown") sdCtx, cancel := context.WithTimeout(ctx, 30*time.Second) defer cancel() if err := h.DUT.WaitUnreachable(sdCtx); err != nil { s.Fatal("Failed to shutdown DUT: ", err) } waitCtx, cancel := context.WithTimeout(ctx, time.Minute) defer cancel() if err := h.DUT.WaitConnect(waitCtx); err != nil { s.Fatal("Failed to wait connect DUT: ", err) } // Performing prev_sleep_state check. if err := powercontrol.ValidatePrevSleepState(ctx, h.DUT, 0); err != nil { s.Fatal("Failed to validate previous sleep state: ", err) } }
package cmd import ( "fmt" "github.com/cnrancher/autok3s/cmd/common" "github.com/cnrancher/autok3s/pkg/providers" "github.com/cnrancher/autok3s/pkg/utils" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) var ( createCmd = &cobra.Command{ Use: "create", Short: "Create a K3s cluster", } cProvider = "" cp providers.Provider ) func init() { createCmd.Flags().StringVarP(&cProvider, "provider", "p", cProvider, "Provider is a module which provides an interface for managing cloud resources") } func CreateCommand() *cobra.Command { // load dynamic provider flags. pStr := common.FlagHackLookup("--provider") if pStr != "" { if reg, err := providers.GetProvider(pStr); err != nil { logrus.Fatalln(err) } else { cp = reg } createCmd.Flags().AddFlagSet(utils.ConvertFlags(createCmd, cp.GetCredentialFlags())) createCmd.Flags().AddFlagSet(utils.ConvertFlags(createCmd, cp.GetOptionFlags())) createCmd.Flags().AddFlagSet(utils.ConvertFlags(createCmd, cp.GetCreateFlags())) createCmd.Example = cp.GetUsageExample("create") createCmd.Use = fmt.Sprintf("create -p %s", pStr) } createCmd.PreRunE = func(cmd *cobra.Command, args []string) error { if cProvider == "" { logrus.Fatalln("required flag(s) \"--provider\" not set") } common.BindEnvFlags(cmd) if err := common.MakeSureCredentialFlag(cmd.Flags(), cp); err != nil { return err } utils.ValidateRequiredFlags(cmd.Flags()) return nil } createCmd.Run = func(cmd *cobra.Command, args []string) { // generate cluster name. i.e. input: "--name k3s1 --region cn-hangzhou" output: "k3s1.cn-hangzhou.<provider>". cp.GenerateClusterName() if err := cp.BindCredential(); err != nil { logrus.Fatalln(err) } if err := cp.CreateCheck(); err != nil { logrus.Fatalln(err) } // create k3s cluster with generated cluster name. if err := cp.CreateK3sCluster(); err != nil { logrus.Fatalln(err) } } return createCmd }
package main import ( "errors" "os" "strconv" ) func getArgs() (accTXTFP, rssURL string, forumID int, err error) { args := os.Args[1:] if len(args) != 3 { err = errors.New("<acc.txt file path> <lenta.ru rss feed," + "for example http://lenta.ru/rss >" + " <forum id ie http://forum.sc2tv.ru/forums/{id}>") return } accTXTFP = args[0] rssURL = args[1] forumID, err = strconv.Atoi(args[2]) return }
package algorithm // Ketama Hash return 0 ~ (2^32 - 1) . // Inner uses lower letter if not unix_socket . // Distributed system does not use unix_socket . // Hash Value >= 0 , unsigned value // Try its best to defined Unsigned Value . // Each instance default weight is 1 (recommand), that must be >= 1 . import ( "crypto/sha1" "errors" "math" "sort" "strconv" "strings" "sync" // third pkgs log "github.com/cihub/seelog" ) const ( MIN_VIRTUAL_NODES = uint32(2048) MAX_TOTAL_WEIGHT = uint32(math.MaxUint32 / MIN_VIRTUAL_NODES) MIN_ZOOM_FACTOR = uint32(100) // Theoretical ZOOM_FACTOR : 100~200 MAX_ZOOM_FACTOR = uint32(200) // Theoretical ZOOM_FACTOR : 100~200 SAFE_NUM_INSTANCES = uint32(MIN_VIRTUAL_NODES/MAX_ZOOM_FACTOR + 1) ) var ( ErrTotalWeightOverflow = errors.New("Ketama: the total weight is overflow! Please minimize it!") ErrNoServer = errors.New("No valid server definitions found.") ErrInvalidWeight = errors.New("Please set weight >= 1.") ErrNodeNotFound = errors.New("No node found in the existed ring.") ErrExistedNode = errors.New("Your input new node actually exists in the Ring!") ) // domain modeling . key : addr , value : weight type instances map[string]uint32 // Virtual Node in Ketama type node struct { address string // ip:port or hostname:port hash uint32 // in the Ring } type nodes []node func (r nodes) Len() int { return len(r) } func (r nodes) Less(i, j int) bool { return r[i].hash < r[j].hash } func (r nodes) Swap(i, j int) { r[i], r[j] = r[j], r[i] } func (r nodes) Sort() { sort.Sort(r) } type HashRing struct { instances instances // Physical Nodes nodes nodes // sorted nodes zoomFactor uint32 // do not modify after initialization length int // > uint32 nodes is horrible big pool totalWeight uint32 // mutex mu sync.Mutex } func Hash(in string) uint32 { hash := sha1.New() hash.Write([]byte(in)) digest := hash.Sum(nil) v := uint32(digest[19]) | uint32(digest[18])<<8 | uint32(digest[17])<<16 | uint32(digest[16])<<24 return v } // NewRing is the online min Ring with Virtual Nodes func NewRing(instances map[string]uint32) (ring *HashRing, err error) { s := len(instances) if s <= 0 { log.Error("No servers so that can not execute NewRing") return nil, ErrNoServer } if s < int(SAFE_NUM_INSTANCES) { log.Info("Your instances is not enough! Please increase the number of instances in one ring to ", SAFE_NUM_INSTANCES) } ring = new(HashRing) totalWeight := uint32(0) for _, w := range instances { // weight >= 1 if w <= 0 { log.Error("Weight is invalid, please check the configuration") return nil, ErrInvalidWeight } totalWeight += uint32(w) } if totalWeight >= MAX_TOTAL_WEIGHT { log.Error("It is horrible, too big total weight.") return nil, ErrTotalWeightOverflow } quotient := uint32(MIN_VIRTUAL_NODES / totalWeight) zoomFactor := uint32(0) if MIN_VIRTUAL_NODES%totalWeight == 0 { zoomFactor = quotient } else { zoomFactor = quotient + 1 } if zoomFactor < MIN_ZOOM_FACTOR { log.Infof("Have %d instances and totalWeight: %d,but zoomFactor: %d is too small. Now change to MIN_ZOOM_FACTOR explicitly", s, totalWeight, zoomFactor) zoomFactor = MIN_ZOOM_FACTOR } // the format of KeyForNode : 10.15.0.200:6379-0 , 10.15.0.200:6379-1 for addr, w := range instances { vCnt := int(uint32(zoomFactor) * w) for i := 0; i < vCnt; i++ { key := addr + "-" + strconv.Itoa(i) hashing := Hash(key) // one virtual node vn := &node{address: addr, hash: hashing} ring.nodes = append(ring.nodes, *vn) } } // initialize ring.nodes.Sort() ring.instances = instances ring.length = len(ring.nodes) ring.totalWeight = uint32(totalWeight) ring.zoomFactor = uint32(zoomFactor) // post check to tip if ring.length >= int(math.MaxUint32/4*3) { log.Infof("Too large ring, has %d virtual nodes", ring.length) } return } // virtual node , max hash value func (ring *HashRing) getMaxKey() uint32 { return ring.nodes[ring.length-1].hash } // situation : Just add one new instance dynamically func (ring *HashRing) AddInstance(addr string, weight uint32) error { // instance should not be in the existed ring // copy from the existed ring newNodes := make(nodes, ring.length, ring.length+int(weight*ring.zoomFactor)) copy(newNodes, ring.nodes) for _, n := range newNodes { if strings.EqualFold(addr, n.address) { log.Errorf("The %s add exists in runtime", addr) return ErrExistedNode } } vCnt := int(ring.zoomFactor * weight) for i := 0; i < vCnt; i++ { key := addr + "-" + strconv.Itoa(i) hashing := Hash(key) // one virtual node vn := &node{address: addr, hash: hashing} newNodes = append(newNodes, *vn) } newNodes.Sort() ring.mu.Lock() defer ring.mu.Unlock() ring.instances[addr] = weight ring.nodes = newNodes ring.length = len(ring.nodes) ring.totalWeight = uint32(ring.totalWeight + weight) return nil } func (ring *HashRing) AddInstances(instances map[string]uint32) { ring.mu.Lock() defer ring.mu.Unlock() // nodes should not be in the existed ring, // so do filter the existed instance var adds = make(map[string]uint32) for name, w := range instances { _, ok := ring.instances[name] if !ok { // node not in instances , will append adds[name] = w } } if len(adds) <= 0 { log.Error("Have no address from instances map") return } // copy from the existed ring newNodes := make(nodes, ring.length) copy(newNodes, ring.nodes) appendWeight := uint32(0) for n, w := range adds { appendWeight += w vCnt := int(ring.zoomFactor * w) for i := 0; i < vCnt; i++ { key := n + "-" + strconv.Itoa(i) hashing := Hash(key) // one virtual node vn := &node{address: n, hash: hashing} newNodes = append(newNodes, *vn) } ring.instances[n] = w } if len(newNodes) <= len(ring.nodes) { log.Info("No more node need to be added") return } newNodes.Sort() ring.nodes = newNodes ring.length = len(ring.nodes) ring.totalWeight = uint32(ring.totalWeight + appendWeight) } func (ring *HashRing) RemoveInstance(addr string) error { ring.mu.Lock() defer ring.mu.Unlock() // copy-on-write newNodes := make(nodes, 0, ring.length) removeCount := uint32(0) for _, v := range ring.nodes { if !strings.EqualFold(addr, v.address) { newNodes = append(newNodes, v) } else { removeCount = removeCount + 1 } } if len(newNodes) == len(ring.nodes) { log.Error("No found %s need to be removed", addr) return ErrNodeNotFound } weight := ring.instances[addr] ring.nodes = newNodes ring.length = len(ring.nodes) ring.totalWeight = ring.totalWeight - weight if ring.length < int(SAFE_NUM_INSTANCES) { log.Info("Virtual Nodes are not enough caused by you remove instances!") } delete(ring.instances, addr) return nil } func (ring *HashRing) PickMaster(key string) string { v := Hash(key) i := sort.Search(ring.length, func(i int) bool { return ring.nodes[i].hash >= v }) if i >= ring.length { i = 0 } return ring.nodes[i].address }
package cache import ( "strconv" "time" ) func timeSlot(dur time.Duration) string { durSec := int64(dur / time.Second) if durSec <= 0 { return "" } slot := time.Now().Unix() / durSec return strconv.FormatInt(slot, 10) }
package maccount import ( "time" "webserver/common" "webserver/models" ) type UserAccount struct { Id int UserId int Amount float64 Freeze float64 Status int Extra string CreatedAt time.Time UpdatedAt time.Time } func FindUserAccountById(userId interface{}) (*UserAccount, error) { account := &UserAccount{} if err := models.GetDb().Where("user_id = ?", userId).First(account).Error; err != nil { return account, err } return account, nil } func AddUserAccount(userId interface{}, amount float64) error { account := &UserAccount{} if err := models.GetDb().Where("user_id = ?", userId).First(account).Error; err != nil { return err } account.Amount = account.Amount + amount if err := models.GetDb().Save(account).Error; err != nil { return err } return nil } func AddUserAccountAndFreeze(userId interface{}, amount, freeze float64) error { account := &UserAccount{} if err := models.GetDb().Where("user_id = ?", userId).First(account).Error; err != nil { return err } account.Amount = account.Amount + amount account.Freeze = account.Freeze + freeze if account.Amount < account.Freeze { return common.ErrBalance } if err := models.GetDb().Save(account).Error; err != nil { return err } return nil } func CostUserAccount(userId interface{}, amount float64) error { account := &UserAccount{} if err := models.GetDb().Where("user_id = ?", userId).First(account).Error; err != nil { return err } if account.Amount <= amount-0.0001+account.Freeze { return common.ErrBalance } account.Amount = account.Amount - amount if err := models.GetDb().Save(account).Error; err != nil { return err } return nil } func FreezeUserAccount(userId interface{}, amount float64) error { account := &UserAccount{} if err := models.GetDb().Where("user_id = ?", userId).First(account).Error; err != nil { return err } if account.Amount <= amount-0.0001+account.Freeze { return common.ErrBalance } account.Freeze += amount if err := models.GetDb().Save(account).Error; err != nil { return err } return nil } func UnfreezeUserAccount(userId interface{}, amount float64) error { account := &UserAccount{} if err := models.GetDb().Where("user_id = ?", userId).First(account).Error; err != nil { return err } if account.Freeze <= amount-0.0001 { return common.ErrBalance } account.Freeze -= amount if err := models.GetDb().Save(account).Error; err != nil { return err } return nil } func AvailableAmount(userId interface{}) (float64, error) { if account, err := FindUserAccountById(userId); err == nil { amount := account.Amount - account.Freeze if amount > -0.0001 { return amount, nil } } else { return 0.0, err } return 0.0, nil } func CostFreezeUserAccount(userId interface{}, amount, freeze float64) error { account := &UserAccount{} if err := models.GetDb().Where("user_id = ?", userId).First(account).Error; err != nil { return err } if account.Amount <= amount+freeze-0.0001+account.Freeze { return common.ErrBalance } account.Amount = account.Amount - amount account.Freeze += freeze if err := models.GetDb().Save(account).Error; err != nil { return err } return nil } func EarnUnfreezeUserAccount(userId interface{}, amount, freeze float64) error { account := &UserAccount{} if err := models.GetDb().Where("user_id = ?", userId).First(account).Error; err != nil { return err } account.Amount += amount account.Freeze -= freeze return models.GetDb().Save(account).Error } func PayUserPay(userId interface{}, amount float64) error { account := &UserAccount{} if err := models.GetDb().Where("user_id = ?", userId).First(account).Error; err != nil { return err } account.Amount -= amount account.Freeze -= amount return models.GetDb().Save(account).Error } func PayUnfreezePunish(userId interface{}, amount, freeze float64) error { account := &UserAccount{} if err := models.GetDb().Where("user_id = ?", userId).First(account).Error; err != nil { return err } account.Amount -= amount account.Freeze -= freeze return models.GetDb().Save(account).Error }
// Copyright 2021 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package mgs import ( "chromiumos/tast/common/policy" "chromiumos/tast/local/chrome" ) // Option is a self-referential function can be used to configure MGS mode. // See https://commandcenter.blogspot.com.au/2014/01/self-referential-functions-and-design.html // for details about this pattern. type Option func(cfg *MutableConfig) error // Config contains configurations for MGS mode. It holds the necessary // policies that will be set to enable MGS mode. // Once retrieved by NewConfig() it should be used to read from not to modify. type Config struct { m MutableConfig } // MutableConfig holds pieces of configuration that are set with Options. type MutableConfig struct { // MGSAccounts applies DeviceLocalAccountInfo custom DeviceLocalAccountInfo configuration. MGSAccounts *policy.DeviceLocalAccounts // ExtraPolicies holds extra policies that will be applied. ExtraPolicies []policy.Policy // PublicAccountPolicies holds public accounts' IDs with associated polices // that will be applied to the them. PublicAccountPolicies map[string][]policy.Policy // AutoLaunch determines whether to set MGS mode to autolaunch. When true // AutoLaunchMGSAppID id is set to autolaunch. AutoLaunch bool // AutoLaunchMGSAppID is an id of the autolaunched MGS account. AutoLaunchMGSAppID *string // ExtraChromeOptions holds all extra options that will be passed to Chrome // instance that will run in MGS mode. ExtraChromeOptions []chrome.Option } // NewConfig creates new configuration. func NewConfig(opts []Option) (*Config, error) { cfg := &Config{ m: MutableConfig{}, } for _, opt := range opts { if err := opt(&cfg.m); err != nil { return nil, err } } return cfg, nil }
package v1 import ( "net/http" "net/http/httptest" "testing" "github.com/robert-inkpen/randeng_co_mirror/backend/config" ) func TestWebserver(t *testing.T) { cfg, err := config.Load() if err != nil { t.Error(err) } s := NewServer(cfg) t.Run("Test Prom Metrics Endpoint", func(t *testing.T) { w := httptest.NewRecorder() req := httptest.NewRequest(http.MethodGet, "/api/metrics", nil) s.ServeHTTP(w, req) if w.Result().StatusCode != http.StatusOK { t.Errorf("Expected HTTP status 200, got %v", w.Result().StatusCode) } }) }
// Copyright 2018 Satoshi Konno. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // +build bsd freebsd darwin package transport import ( "os" "syscall" ) // SetReuseAddr sets a flag to SO_REUSEADDR and SO_REUSEPORT func (sock *Socket) SetReuseAddr(file *os.File, flag bool) error { fd := file.Fd() opt := 0 if flag { opt = 1 } err := syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, syscall.SO_REUSEADDR, opt) if err != nil { return err } err = syscall.SetsockoptInt(int(fd), syscall.SOL_SOCKET, syscall.SO_REUSEPORT, opt) if err != nil { return err } return nil }
package main import ( "fmt" ) func main() { if true && true { fmt.Println("0") } if !false && true { fmt.Println("1") } if !!true && !false { fmt.Println("3") } if true || false { fmt.Println("4") } if true || true { fmt.Println("5") } }
package k8swatch import ( "context" "fmt" "testing" "time" "github.com/stretchr/testify/require" "k8s.io/apimachinery/pkg/types" "github.com/tilt-dev/tilt/internal/controllers/apis/cluster" "github.com/tilt-dev/tilt/internal/controllers/fake" "github.com/tilt-dev/tilt/pkg/apis" "github.com/tilt-dev/tilt/pkg/apis/core/v1alpha1" "github.com/jonboulle/clockwork" "github.com/pkg/errors" "github.com/stretchr/testify/assert" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/tilt-dev/tilt/internal/k8s/testyaml" "github.com/tilt-dev/tilt/internal/store/k8sconv" "github.com/tilt-dev/tilt/internal/testutils" "github.com/tilt-dev/tilt/internal/testutils/manifestbuilder" "github.com/tilt-dev/tilt/internal/testutils/podbuilder" "github.com/tilt-dev/tilt/internal/testutils/tempdir" "github.com/tilt-dev/tilt/internal/k8s" "github.com/tilt-dev/tilt/internal/store" "github.com/tilt-dev/tilt/pkg/model" ) func TestEventWatchManager_dispatchesEvent(t *testing.T) { f := newEWMFixture(t) mn := model.ManifestName("someK8sManifest") // Seed the k8s client with a pod and its owner tree manifest := f.addManifest(mn) pb := podbuilder.New(t, manifest) entities := pb.ObjectTreeEntities() f.addDeployedEntity(manifest, entities.Deployment()) f.kClient.Inject(entities...) evt := f.makeEvent(k8s.NewK8sEntity(pb.Build())) require.NoError(t, f.ewm.OnChange(f.ctx, f.store, store.LegacyChangeSummary())) f.kClient.UpsertEvent(evt) expected := store.K8sEventAction{Event: evt, ManifestName: mn} f.assertActions(expected) } func TestEventWatchManager_dispatchesNamespaceEvent(t *testing.T) { f := newEWMFixture(t) mn := model.ManifestName("someK8sManifest") // Seed the k8s client with a pod and its owner tree manifest := f.addManifest(mn) pb := podbuilder.New(t, manifest) entities := pb.ObjectTreeEntities() f.addDeployedEntity(manifest, entities.Deployment()) f.kClient.Inject(entities...) evt1 := f.makeEvent(k8s.NewK8sEntity(pb.Build())) evt1.ObjectMeta.Namespace = "kube-system" evt2 := f.makeEvent(k8s.NewK8sEntity(pb.Build())) require.NoError(t, f.ewm.OnChange(f.ctx, f.store, store.LegacyChangeSummary())) f.kClient.UpsertEvent(evt1) f.kClient.UpsertEvent(evt2) expected := store.K8sEventAction{Event: evt2, ManifestName: mn} f.assertActions(expected) } func TestEventWatchManager_duplicateDeployIDs(t *testing.T) { f := newEWMFixture(t) fe1 := model.ManifestName("fe1") m1 := f.addManifest(fe1) fe2 := model.ManifestName("fe2") m2 := f.addManifest(fe2) // Seed the k8s client with a pod and its owner tree pb := podbuilder.New(t, m1) entities := pb.ObjectTreeEntities() f.addDeployedEntity(m1, entities.Deployment()) f.addDeployedEntity(m2, entities.Deployment()) f.kClient.Inject(entities...) evt := f.makeEvent(k8s.NewK8sEntity(pb.Build())) f.kClient.UpsertEvent(evt) require.NoError(t, f.ewm.OnChange(f.ctx, f.store, store.LegacyChangeSummary())) require.NoError(t, f.ewm.OnChange(f.ctx, f.store, store.LegacyChangeSummary())) expected := store.K8sEventAction{Event: evt, ManifestName: fe1} f.assertActions(expected) } type eventTestCase struct { Reason string Type string Expected bool } func TestEventWatchManagerDifferentEvents(t *testing.T) { cases := []eventTestCase{ eventTestCase{Reason: "Bumble", Type: v1.EventTypeNormal, Expected: false}, eventTestCase{Reason: "Bumble", Type: v1.EventTypeWarning, Expected: true}, eventTestCase{Reason: ImagePulledReason, Type: v1.EventTypeNormal, Expected: true}, eventTestCase{Reason: ImagePullingReason, Type: v1.EventTypeNormal, Expected: true}, } for i, c := range cases { t.Run(fmt.Sprintf("Case%d", i), func(t *testing.T) { f := newEWMFixture(t) mn := model.ManifestName("someK8sManifest") // Seed the k8s client with a pod and its owner tree manifest := f.addManifest(mn) pb := podbuilder.New(t, manifest) entities := pb.ObjectTreeEntities() f.addDeployedEntity(manifest, entities.Deployment()) f.kClient.Inject(entities...) evt := f.makeEvent(k8s.NewK8sEntity(pb.Build())) evt.Reason = c.Reason evt.Type = c.Type require.NoError(t, f.ewm.OnChange(f.ctx, f.store, store.LegacyChangeSummary())) f.kClient.UpsertEvent(evt) if c.Expected { expected := store.K8sEventAction{Event: evt, ManifestName: mn} f.assertActions(expected) } else { f.assertNoActions() } }) } } func TestEventWatchManager_listensOnce(t *testing.T) { f := newEWMFixture(t) m := f.addManifest("fe") entities := podbuilder.New(t, m).ObjectTreeEntities() f.addDeployedEntity(m, entities.Deployment()) f.kClient.Inject(entities...) require.NoError(t, f.ewm.OnChange(f.ctx, f.store, store.LegacyChangeSummary())) f.kClient.EventsWatchErr = fmt.Errorf("Multiple watches forbidden") require.NoError(t, f.ewm.OnChange(f.ctx, f.store, store.LegacyChangeSummary())) f.assertNoActions() } func TestEventWatchManager_watchError(t *testing.T) { f := newEWMFixture(t) err := fmt.Errorf("oh noes") f.kClient.EventsWatchErr = err m := f.addManifest("someK8sManifest") entities := podbuilder.New(t, m).ObjectTreeEntities() f.addDeployedEntity(m, entities.Deployment()) f.kClient.Inject(entities...) require.NoError(t, f.ewm.OnChange(f.ctx, f.store, store.LegacyChangeSummary())) expectedErr := errors.Wrap(err, "Error watching events. Are you connected to kubernetes?\nTry running `kubectl get events -n \"default\"`") expected := store.ErrorAction{Error: expectedErr} f.assertActions(expected) f.store.ClearActions() } func TestEventWatchManager_eventBeforeUID(t *testing.T) { f := newEWMFixture(t) mn := model.ManifestName("someK8sManifest") // Seed the k8s client with a pod and its owner tree manifest := f.addManifest(mn) require.NoError(t, f.ewm.OnChange(f.ctx, f.store, store.LegacyChangeSummary())) pb := podbuilder.New(t, manifest) entities := pb.ObjectTreeEntities() f.kClient.Inject(entities...) evt := f.makeEvent(k8s.NewK8sEntity(pb.Build())) // The UIDs haven't shown up in the engine state yet, so // we shouldn't emit the events. f.kClient.UpsertEvent(evt) f.assertNoActions() // When the UIDs of the deployed objects show up, then // we need to go back and emit the events we saw earlier. f.addDeployedEntity(manifest, entities.Deployment()) expected := store.K8sEventAction{Event: evt, ManifestName: mn} f.assertActions(expected) } func TestEventWatchManager_ignoresPreStartEvents(t *testing.T) { f := newEWMFixture(t) mn := model.ManifestName("someK8sManifest") // Seed the k8s client with a pod and its owner tree manifest := f.addManifest(mn) pb := podbuilder.New(t, manifest) entities := pb.ObjectTreeEntities() f.addDeployedEntity(manifest, entities.Deployment()) f.kClient.Inject(entities...) entity := k8s.NewK8sEntity(pb.Build()) evt1 := f.makeEvent(entity) evt1.CreationTimestamp = apis.NewTime(f.clock.Now().Add(-time.Minute)) f.kClient.UpsertEvent(evt1) evt2 := f.makeEvent(entity) f.kClient.UpsertEvent(evt2) // first event predates tilt start time, so should be ignored expected := store.K8sEventAction{Event: evt2, ManifestName: mn} f.assertActions(expected) } func (f *ewmFixture) makeEvent(obj k8s.K8sEntity) *v1.Event { return &v1.Event{ ObjectMeta: metav1.ObjectMeta{ CreationTimestamp: apis.NewTime(f.clock.Now()), Namespace: k8s.DefaultNamespace.String(), }, Reason: "test event reason", Message: "test event message", InvolvedObject: v1.ObjectReference{UID: obj.UID(), Name: obj.Name()}, Type: v1.EventTypeWarning, } } type ewmFixture struct { *tempdir.TempDirFixture t *testing.T kClient *k8s.FakeK8sClient ewm *EventWatchManager ctx context.Context cancel func() store *store.TestingStore clock clockwork.FakeClock } func newEWMFixture(t *testing.T) *ewmFixture { ctx, _, _ := testutils.CtxAndAnalyticsForTest() ctx, cancel := context.WithCancel(ctx) clock := clockwork.NewFakeClock() st := store.NewTestingStore() cc := cluster.NewFakeClientProvider(t, fake.NewFakeTiltClient()) kClient := cc.EnsureDefaultK8sCluster(ctx) ret := &ewmFixture{ TempDirFixture: tempdir.NewTempDirFixture(t), kClient: kClient, ewm: NewEventWatchManager(cc, k8s.DefaultNamespace), ctx: ctx, cancel: cancel, t: t, clock: clock, store: st, } state := ret.store.LockMutableStateForTesting() state.TiltStartTime = clock.Now() _, createdAt, err := cc.GetK8sClient(types.NamespacedName{Name: "default"}) require.NoError(t, err, "Failed to get default cluster client hash") state.Clusters["default"] = &v1alpha1.Cluster{ ObjectMeta: metav1.ObjectMeta{ Name: "default", }, Spec: v1alpha1.ClusterSpec{ Connection: &v1alpha1.ClusterConnection{ Kubernetes: &v1alpha1.KubernetesClusterConnection{}, }, }, Status: v1alpha1.ClusterStatus{ Arch: "fake-arch", ConnectedAt: createdAt.DeepCopy(), }, } ret.store.UnlockMutableState() t.Cleanup(ret.TearDown) return ret } func (f *ewmFixture) TearDown() { f.cancel() f.store.AssertNoErrorActions(f.t) } func (f *ewmFixture) addManifest(manifestName model.ManifestName) model.Manifest { state := f.store.LockMutableStateForTesting() m := manifestbuilder.New(f, manifestName). WithK8sYAML(testyaml.SanchoYAML). Build() state.UpsertManifestTarget(store.NewManifestTarget(m)) f.store.UnlockMutableState() return m } func (f *ewmFixture) addDeployedEntity(m model.Manifest, entity k8s.K8sEntity) { defer func() { require.NoError(f.t, f.ewm.OnChange(f.ctx, f.store, store.LegacyChangeSummary())) }() state := f.store.LockMutableStateForTesting() defer f.store.UnlockMutableState() mState, ok := state.ManifestState(m.Name) if !ok { f.t.Fatalf("Unknown manifest: %s", m.Name) } runtimeState := mState.K8sRuntimeState() runtimeState.ApplyFilter = &k8sconv.KubernetesApplyFilter{ DeployedRefs: k8s.ObjRefList{entity.ToObjectReference()}, } mState.RuntimeState = runtimeState } func (f *ewmFixture) assertNoActions() { f.assertActions() } func (f *ewmFixture) assertActions(expected ...store.Action) { f.t.Helper() start := time.Now() for time.Since(start) < time.Second { actions := f.store.Actions() if len(actions) >= len(expected) { break } } // Make extra sure we didn't get any extra actions time.Sleep(10 * time.Millisecond) // NOTE(maia): this test will break if this the code ever returns other // correct-but-incidental-to-this-test actions, but for now it's fine. actual := f.store.Actions() if !assert.Len(f.t, actual, len(expected)) { f.t.FailNow() } for i, a := range actual { switch exp := expected[i].(type) { case store.ErrorAction: // Special case -- we can't just assert.Equal b/c pointer equality stuff act, ok := a.(store.ErrorAction) if !ok { f.t.Fatalf("got non-%T: %v", store.ErrorAction{}, a) } assert.Equal(f.t, exp.Error.Error(), act.Error.Error()) default: assert.Equal(f.t, expected[i], a) } } }
package main import ( "sync" "github.com/singchia/go-hammer/doublinker" ) const ( AUTHORIZING = iota + 10 AUTHORIZED CHATTING OPERATING INTERACTING UNKNOW ) var singleSSI *sessionStatesIndex var mutexSSI sync.Mutex type handler interface { handle(chid doublinker.DoubID, cmd string, suffix string) delete(chid doublinker.DoubID) } type sessionStatesIndex struct { ss map[doublinker.DoubID]*sessionStates //chid and sessionStates mutex *sync.RWMutex handlers map[int]handler } func getSessionStatesIndex() *sessionStatesIndex { if singleSSI == nil { mutexSSI.Lock() if singleSSI == nil { singleSSI = &sessionStatesIndex{ss: make(map[doublinker.DoubID]*sessionStates), mutex: new(sync.RWMutex), handlers: make(map[int]handler)} singleSSI.handlers[AUTHORIZING] = getAuthStatesIndex() singleSSI.handlers[AUTHORIZED] = singleSSI singleSSI.handlers[CHATTING] = getChatStatesIndex() singleSSI.handlers[OPERATING] = getGroups() singleSSI.handlers[INTERACTING] = getGroups() singleSSI.handlers[CLOSED] = singleSSI } mutexSSI.Unlock() } return singleSSI } func (s *sessionStatesIndex) handle(chid doublinker.DoubID, cmd, suffix string) { if cmd != SIGNOUT && cmd != CLOSE { getQueue().pushDown(&message{mtype: PASSTHROUGH, chid: chid, data: "[from system] unsupported command.\n"}) return } s.mutex.RLock() states, ok := s.ss[chid] if !ok && cmd == SIGNOUT { getQueue().pushDown(&message{mtype: PASSTHROUGH, chid: chid, data: "[from system] user unauthed yet.\n"}) s.mutex.RUnlock() return } s.mutex.RUnlock() s.mutex.Lock() for ret := states.pop(); ret != -1; ret = states.pop() { s.handlers[ret].delete(chid) } s.mutex.Unlock() s.delete(chid) return } func (s *sessionStatesIndex) delete(chid doublinker.DoubID) { delete(s.ss, chid) } func (s *sessionStatesIndex) dispatch(chid doublinker.DoubID, cmd, suffix string) { s.mutex.RLock() states, ok := s.ss[chid] //since chid is unique, value is unique too s.mutex.RUnlock() if !ok { if s.mapping(cmd) != AUTHORIZING { getQueue().pushDown(&message{chid: chid, data: "using [signup: foo] or [signin: foo]\n"}) return } ss := &sessionStates{} ss.push(AUTHORIZING) s.mutex.Lock() s.ss[chid] = ss s.mutex.Unlock() getAuthStatesIndex().handle(chid, cmd, suffix) return } if cmd == NONCOMMAND { s.handlers[states.top()].handle(chid, cmd, suffix) return } s.changeSession(chid, s.mapping(cmd), true) s.handlers[s.mapping(cmd)].handle(chid, cmd, suffix) return } func (s *sessionStatesIndex) mapping(cmd string) int { if cmd == SIGNUP || cmd == SIGNIN || cmd == SIGNOUT { return AUTHORIZING } if cmd == TOUSER || cmd == TOGROUP { return CHATTING } if cmd == CREATEGROUP || cmd == JOINGROUP || cmd == INVITEGROUP || cmd == RESTORENOTES { return OPERATING } if cmd == CLOSE { return CLOSED } return UNKNOW } func (s *sessionStatesIndex) lookupSessionState(chid doublinker.DoubID) int { s.mutex.RLock() defer s.mutex.RUnlock() return s.ss[chid].top() } func (s *sessionStatesIndex) changeSession(chid doublinker.DoubID, state int, over bool) { s.mutex.RLock() defer s.mutex.RUnlock() states, ok := s.ss[chid] if ok { if over { states.push(state) return } states.pop() states.push(state) return } return } func (s *sessionStatesIndex) restoreSession(chid doublinker.DoubID) { s.mutex.RLock() states, ok := s.ss[chid] s.mutex.RUnlock() if ok { states.pop() if states.count == 0 { s.mutex.Lock() delete(s.ss, chid) s.mutex.Unlock() } return } return } type sessionStates struct { states []int count int } func (s *sessionStates) top() int { if s.count == 0 { return -1 } return s.states[s.count-1] } func (s *sessionStates) push(n int) { s.states = append(s.states[:s.count], n) s.count++ } // Pop removes and returns a node from the stack in last to first order. func (s *sessionStates) pop() int { if s.count == 0 { return -1 } s.count-- return s.states[s.count] }
package main import ( "github.com/PROger4ever-Golang/Redis-serialization-benchmarks/utils" "github.com/jinzhu/configor" ) type Address struct { Host string `yaml:"Host"` Port int `yaml:"Port"` } type Config struct { CommonRedis Address `yaml:"CommonRedis" required:"true"` RejsonRedis Address `yaml:"RejsonRedis" required:"true"` } func LoadConfig(files ...string) (*Config, error) { existingFiles, err := utils.GetExistingFiles(files...) if err != nil { return nil, utils.WrapIfError(err, "config->LoadConfig()->GetExistingFiles()") } var config Config err = configor.New(&configor.Config{ENVPrefix: "-"}).Load(&config, existingFiles...) if err != nil { return &config, utils.WrapIfError(err, "config->LoadConfig()->Load()") } return &config, nil }
package appkey import ( yaml "gopkg.in/yaml.v2" "github.com/joernweissenborn/aursir4go/util" ) type AppKey struct { ApplicationKeyName string Functions []Function } type Function struct { Name string Input []Data Output []Data } type Data struct { Name string Type int } func (AppKey *AppKey) CreateFromJson(JSON string) error { codec := util.GetCodec("JSON") return codec.Decode([]byte(JSON), AppKey) } func (AppKey *AppKey) CreateFromYaml(YAML string) { if yaml.Unmarshal([]byte(YAML),&AppKey) !=nil { panic("Insane Appkey") } return }
package core import ( "io" "mime" "net/url" "os" "path/filepath" "github.com/jzaikovs/core/loggy" ) func init() { mime.AddExtensionType(".json", MIME_JSON) } // ServeFile this is just for development, file handling (CDN) better done by nginx or other // TODO: there can be better alternative just to use http.FileServer func ServeFile(out Output, path string) { if x, err := url.Parse(path); err == nil { path = x.Path } loggy.Trace.Println(path) f, err := os.OpenFile(filepath.Join("./www/", path), os.O_RDONLY, 0) if err != nil { out.Response(Response_Not_Found) out.Flush() return } defer f.Close() out.Response(Response_Ok) out.SetContentType(mime.TypeByExtension(filepath.Ext(f.Name()))) // then write directly to response writer io.Copy(out, f) out.Flush() // flush response header }
package main import ( "github.com/gin-gonic/gin" "github.com/swaggo/files" // swagger embed files "github.com/swaggo/gin-swagger" // gin-swagger middleware _ "ingrid-coding-assignment/docs" "ingrid-coding-assignment/route" ) func initializeRoutes(router *gin.Engine) { // Swagger url := ginSwagger.URL("http://localhost:8080/swagger/doc.json") // The url pointing to API definition router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, url)) router.GET("/routes", route.GetRoutes) }
package main //457. 环形数组是否存在循环 //存在一个不含 0 的 环形 数组nums ,每个 nums[i] 都表示位于下标 i 的角色应该向前或向后移动的下标个数: // //如果 nums[i] 是正数,向前(下标递增方向)移动 |nums[i]| 步 //如果nums[i] 是负数,向后(下标递减方向)移动 |nums[i]| 步 //因为数组是 环形 的,所以可以假设从最后一个元素向前移动一步会到达第一个元素,而第一个元素向后移动一步会到达最后一个元素。 // //数组中的 循环 由长度为 k 的下标序列 seq 标识: // //遵循上述移动规则将导致一组重复下标序列 seq[0] -> seq[1] -> ... -> seq[k - 1] -> seq[0] -> ... //所有 nums[seq[j]] 应当不是 全正 就是 全负 //k > 1 //如果 nums 中存在循环,返回 true ;否则,返回 false 。 // // // //示例 1: // //输入:nums = [2,-1,1,2,2] //输出:true //解释:存在循环,按下标 0 -> 2 -> 3 -> 0 。循环长度为 3 。 //示例 2: // //输入:nums = [-1,2] //输出:false //解释:按下标 1 -> 1 -> 1 ... 的运动无法构成循环,因为循环的长度为 1 。根据定义,循环的长度必须大于 1 。 //示例 3: // //输入:nums = [-2,1,-1,-2,-2] //输出:false //解释:按下标 1 -> 2 -> 1 -> ... 的运动无法构成循环,因为 nums[1] 是正数,而 nums[2] 是负数。 //所有 nums[seq[j]] 应当不是全正就是全负。 // // //提示: // //1 <= nums.length <= 5000 //-1000 <= nums[i] <= 1000 //nums[i] != 0 func circularArrayLoop(nums []int) bool { index := 0 n := len(nums) for nums[index] != 0 { next := (index + nums[index] + n) % n if nums[index]*nums[next] < 0 || next == index { return false } nums[index] = 0 index = next } return true } func circularArrayLoop2(nums []int) bool { n := len(nums) next := func(cur int) int { return ((cur+nums[cur])%n + n) % n // 保证返回值在 [0,n) 中 } for i, num := range nums { if num == 0 { continue } slow, fast := i, next(i) // 判断非零且方向相同 for nums[slow]*nums[fast] > 0 && nums[slow]*nums[next(fast)] > 0 { if slow == fast { if slow == next(slow) { break } return true } slow = next(slow) fast = next(next(fast)) } add := i for nums[add]*nums[next(add)] > 0 { tmp := add add = next(add) nums[tmp] = 0 } } return false } func main() { println(circularArrayLoop2([]int{3, 1, 2})) }
package apilifecycle import godd "github.com/pagongamedev/go-dd" // ValidateParam Type type ValidateParam = func(context *godd.Context) (requestValidatedParam interface{}, goddErr *godd.Error) // ValidateParam Set func (api *APILifeCycle) ValidateParam(handler ValidateParam) { api.validateParam = handler } // GetValidateParam Get func (api *APILifeCycle) GetValidateParam() ValidateParam { return api.validateParam } // Handler Default func handlerDefaultValidateParam() ValidateParam { return func(context *godd.Context) (requestValidatedParam interface{}, goddErr *godd.Error) { return nil, nil } }
package models import ( "bytes" "encoding/json" "fmt" "os" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/dynamodb" "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute" "github.com/google/uuid" "github.com/qor/admin" "github.com/qor/qor" "github.com/qor/qor/resource" "github.com/qor/roles" ) // Customer data structure type Customer struct { // ID uuid.UUID `gorm:"primary_key;type:uuid;default:uuid_generate_v4()"` ID string CreatedAt time.Time UpdatedAt time.Time DeletedAt *time.Time `sql:"index"` Name string Description string } // DeepCopy method is to copy interface object func DeepCopy(source interface{}, destination interface{}) { var buf bytes.Buffer json.NewEncoder(&buf).Encode(source) json.NewDecoder(bytes.NewBuffer(buf.Bytes())).Decode(&destination) } // ConfigureQorResourceDynamoDB is to configure the resource to DynamoDB CRUD func ConfigureQorResourceDynamoDB(r resource.Resourcer) { // Configure resource with DynamoDB config := &aws.Config{ Region: aws.String("us-west-2"), Endpoint: aws.String("http://localhost:8000"), } // Create DynamoDB client svc := dynamodb.New(session.New(), config) customer, ok := r.(*admin.Resource) if !ok { panic(fmt.Sprintf("Unexpected resource! T: %T", r)) } tableName := "Customers" customer.FindOneHandler = func(result interface{}, metaValues *resource.MetaValues, context *qor.Context) error { fmt.Println("FindOneHandler") if customer.HasPermission(roles.Read, context) { customerIDString := context.ResourceID // input to define the data to input := &dynamodb.GetItemInput{ Key: map[string]*dynamodb.AttributeValue{ "ID": { S: aws.String(customerIDString), }, }, TableName: aws.String(tableName), } resultFromDB, err := svc.GetItem(input) dbCustomer := Customer{} err = dynamodbattribute.UnmarshalMap(resultFromDB.Item, &dbCustomer) if err != nil { panic(fmt.Sprintf("Failed to unmarshal Record, %v", err)) } DeepCopy(dbCustomer, &result) fmt.Println("Found item: ", dbCustomer) return err } return roles.ErrPermissionDenied } customer.FindManyHandler = func(result interface{}, context *qor.Context) error { fmt.Println("FindManyHandler") if customer.HasPermission(roles.Read, context) { input := &dynamodb.ScanInput{ TableName: aws.String(tableName), } resultFromDB, err := svc.Scan(input) if err != nil { fmt.Println("Query API call failed:") fmt.Println((err.Error())) os.Exit(1) } // create a slice to store result dbCustomers := make([]Customer, 0) numResult := 0 for _, i := range resultFromDB.Items { dbcustomersTMP := Customer{} err = dynamodbattribute.UnmarshalMap(i, &dbcustomersTMP) if err != nil { fmt.Println("Got error unmarshalling:") fmt.Println(err.Error()) os.Exit(1) } dbCustomers = append(dbCustomers, dbcustomersTMP) numResult++ } DeepCopy(dbCustomers, &result) fmt.Println("Found", numResult, "result(s) as below: ", dbCustomers) return err } return roles.ErrPermissionDenied } customer.SaveHandler = func(result interface{}, context *qor.Context) error { fmt.Println("SaveHandler") if customer.HasPermission(roles.Create, context) || customer.HasPermission(roles.Update, context) { var customerTMP Customer DeepCopy(result, &customerTMP) newUUID, _ := uuid.NewRandom() if customerTMP.ID == "" { customerTMP.ID = newUUID.String() customerTMP.CreatedAt = time.Now() } customerTMP.UpdatedAt = time.Now() input := &dynamodb.UpdateItemInput{ ExpressionAttributeNames: map[string]*string{ "#N": aws.String("Name"), "#D": aws.String("Description"), "#C": aws.String("CreatedAt"), "#U": aws.String("UpdatedAt:"), }, ExpressionAttributeValues: map[string]*dynamodb.AttributeValue{ ":name": { S: aws.String(customerTMP.Name), }, ":description": { S: aws.String(customerTMP.Description), }, ":createdat": { S: aws.String(customerTMP.CreatedAt.Format(time.RFC3339)), }, ":updateat": { S: aws.String(customerTMP.UpdatedAt.Format(time.RFC3339)), }, }, Key: map[string]*dynamodb.AttributeValue{ "ID": { S: aws.String(customerTMP.ID), }, }, ReturnValues: aws.String("UPDATED_NEW"), TableName: aws.String(tableName), UpdateExpression: aws.String("SET #N =:name, #D =:description, #C =:createdat, #U =:updateat "), } _, err := svc.UpdateItem(input) if err != nil { fmt.Println(err.Error()) } else { fmt.Println("Successfully updated ", customerTMP) } return err } return roles.ErrPermissionDenied } customer.DeleteHandler = func(result interface{}, context *qor.Context) error { fmt.Println("DeleteHandler") if customer.HasPermission(roles.Delete, context) { // var dbCustomerTMP Customer // dbCustomerTMP.ID, _ = uuid.Parse(context.ResourceID) customerIDString := context.ResourceID input := &dynamodb.DeleteItemInput{ Key: map[string]*dynamodb.AttributeValue{ "ID": { S: aws.String(customerIDString), }, }, TableName: aws.String(tableName), } _, err := svc.DeleteItem(input) if err != nil { fmt.Println("Got error calling DeleteItem") fmt.Println(err.Error()) return nil } fmt.Println("Deleted ", customerIDString) return err } return roles.ErrPermissionDenied } }
// +build integration package main import ( "fmt" "os" "github.com/Azure/go-autorest/autorest/azure/auth" "github.com/osbuild/osbuild-composer/internal/boot/azuretest" ) func panicErr(err error) { if err != nil { panic(err) } } func printErr(err error) { if err != nil { fmt.Println(err) } } // GenerateCIArtifactName generates a new identifier for CI artifacts which is based // on environment variables specified by Jenkins // note: in case of migration to sth else like Github Actions, change it to whatever variables GH Action provides func GenerateCIArtifactName(prefix string) (string, error) { distroCode := os.Getenv("DISTRO_CODE") branchName := os.Getenv("BRANCH_NAME") buildId := os.Getenv("BUILD_ID") if branchName == "" || buildId == "" || distroCode == "" { return "", fmt.Errorf("The environment variables must specify BRANCH_NAME, BUILD_ID, and DISTRO_CODE") } return fmt.Sprintf("%s%s-%s-%s", prefix, distroCode, branchName, buildId), nil } func main() { fmt.Println("Running a cloud cleanup") // Load Azure credentials creds, err := azuretest.GetAzureCredentialsFromEnv() panicErr(err) if creds == nil { panic("empty credentials") } // Get test ID testID, err := GenerateCIArtifactName("") panicErr(err) // Delete the vhd image imageName := "image-" + testID + ".vhd" fmt.Println("Running delete image from Azure, this should fail if the test succedded") err = azuretest.DeleteImageFromAzure(creds, imageName) printErr(err) // Delete all remaining resources (see the full list in the CleanUpBootedVM function) fmt.Println("Running clean up booted VM, this should fail if the test succedded") parameters := azuretest.NewDeploymentParameters(creds, imageName, testID, "") clientCredentialsConfig := auth.NewClientCredentialsConfig(creds.ClientID, creds.ClientSecret, creds.TenantID) authorizer, err := clientCredentialsConfig.Authorizer() panicErr(err) err = azuretest.CleanUpBootedVM(creds, parameters, authorizer, testID) printErr(err) }
package classifier import ( "encoding/json" "github.com/louistsaitszho/wggesuchtscraper/validator" ) // Output is the return type of the classifier. It contains all the meta data about the url you just enter. // TODO see if it is a good idea to make some enum-like things type Output struct { DataSrouce string IsList bool IsRequest bool Language string } func (output Output) String() string { text, _ := json.Marshal(output) return string(text) } //Classify is basically a wrapper around the validator func Classify(url string) Output { output := Output{} //1. where does this comes from if validator.LooksWgGesucht(url) { output.DataSrouce = "wg-gescuht" //2. is it a list of an ad if validator.IsList(url) { output.IsList = false } //3. is it an request or an offer? if validator.IsRequest(url) { output.IsRequest = true } //4. which language is it in? if validator.IsEnglish(url) { output.Language = "en" } else if validator.IsSpanish(url) { output.Language = "es" } else if validator.IsGerman(url) { output.Language = "de" } //5. TODO does it need fixing, and if yes, which part? } return output }
package edGalaxy import ( "encoding/json" "fmt" "testing" ) type tStep struct { val int64 expected string } var ( tSteps = []tStep{ tStep{2, `[{"time_mark":2,"visit_count":1}]`}, tStep{4, `[{"time_mark":4,"visit_count":1},{"time_mark":2,"visit_count":1}]`}, tStep{6, `[{"time_mark":6,"visit_count":1},{"time_mark":4,"visit_count":1},{"time_mark":2,"visit_count":1}]`}, tStep{1, `[{"time_mark":6,"visit_count":1},{"time_mark":4,"visit_count":1},{"time_mark":2,"visit_count":1},{"time_mark":1,"visit_count":1}]`}, tStep{6, `[{"time_mark":6,"visit_count":2},{"time_mark":4,"visit_count":1},{"time_mark":2,"visit_count":1},{"time_mark":1,"visit_count":1}]`}, tStep{4, `[{"time_mark":6,"visit_count":2},{"time_mark":4,"visit_count":2},{"time_mark":2,"visit_count":1},{"time_mark":1,"visit_count":1}]`}, tStep{2, `[{"time_mark":6,"visit_count":2},{"time_mark":4,"visit_count":2},{"time_mark":2,"visit_count":2},{"time_mark":1,"visit_count":1}]`}, tStep{5, `[{"time_mark":6,"visit_count":2},{"time_mark":5,"visit_count":1},{"time_mark":4,"visit_count":2},{"time_mark":2,"visit_count":2}]`}, tStep{8, `[{"time_mark":8,"visit_count":1},{"time_mark":6,"visit_count":2},{"time_mark":5,"visit_count":1},{"time_mark":4,"visit_count":2}]`}, tStep{7, `[{"time_mark":8,"visit_count":1},{"time_mark":7,"visit_count":1},{"time_mark":6,"visit_count":2},{"time_mark":5,"visit_count":1}]`}} ) func dump(c *TimeVisitStatCollector) { b, err := json.Marshal(c) if err != nil { fmt.Printf("Failed to dump : %v\n", err) return } fmt.Println("---") fmt.Println(string(b)) } func compare(t *testing.T, c *TimeVisitStatCollector, expected string) bool { var expectedVisits []TimeVisitStat err := json.Unmarshal([]byte(expected), expectedVisits) if err != nil { t.Fatalf("Decode expected string failed: %v\n", err) return false } if len(expectedVisits) != len(c.Visits) { dump(c) t.Fatalf("Length mismatch expected: %s\n", expected) return false } for i, r := range c.Visits { if expectedVisits[i].VisitCount != r.VisitCount { dump(c) t.Fatalf("Visit count mismatch expected: %s\n", expected) } if expectedVisits[i].Timemark != r.Timemark { dump(c) t.Fatalf("Time mark mismatch expected: %s\n", expected) } } return true } func TestTimeVisitStatCollector(t *testing.T) { c := NewTimeVisitStatCollector(4, 1) for _, st := range tSteps { c.noteVisitByTimemark(st.val) } }
package volsupervisor import ( "github.com/contiv/volplugin/config" log "github.com/Sirupsen/logrus" ) type volumeDispatch struct { config *config.TopLevelConfig tenant string volumes map[string]*config.VolumeConfig } func iterateVolumes(config *config.TopLevelConfig, dispatch func(v *volumeDispatch)) { tenants, err := config.ListTenants() if err != nil { log.Warnf("Could not locate any tenant information; sleeping from error: %v.", err) return } for _, tenant := range tenants { volumes, err := config.ListVolumes(tenant) if err != nil { log.Warnf("Could not list volumes for tenant %q: sleeping.", tenant) return } dispatch(&volumeDispatch{config, tenant, volumes}) } }
package view import ( caos_errs "github.com/caos/zitadel/internal/errors" org_model "github.com/caos/zitadel/internal/org/model" "github.com/caos/zitadel/internal/org/repository/view/model" "github.com/caos/zitadel/internal/view/repository" "github.com/jinzhu/gorm" ) func OrgByID(db *gorm.DB, table, orgID string) (*model.OrgView, error) { org := new(model.OrgView) query := repository.PrepareGetByKey(table, model.OrgSearchKey(org_model.OrgSearchKeyOrgID), orgID) err := query(db, org) if caos_errs.IsNotFound(err) { return nil, caos_errs.ThrowNotFound(nil, "VIEW-GEwea", "Errors.Org.NotFound") } return org, err } func SearchOrgs(db *gorm.DB, table string, req *org_model.OrgSearchRequest) ([]*model.OrgView, int, error) { orgs := make([]*model.OrgView, 0) query := repository.PrepareSearchQuery(table, model.OrgSearchRequest{Limit: req.Limit, Offset: req.Offset, Queries: req.Queries}) count, err := query(db, &orgs) if err != nil { return nil, 0, err } return orgs, count, nil } func PutOrg(db *gorm.DB, table string, org *model.OrgView) error { save := repository.PrepareSave(table) return save(db, org) } func DeleteOrg(db *gorm.DB, table, orgID string) error { delete := repository.PrepareDeleteByKey(table, model.OrgSearchKey(org_model.OrgSearchKeyOrgID), orgID) return delete(db) }
package config import "os" type Config struct { Host string Port string TZ string ENV string Image string Mongos []Mongo JWTSecret string } type Mongo struct { URI string ConnectionName string DatabaseName string } func New() *Config { config := &Config{} config.Host = os.Getenv("HOST") config.Port = os.Getenv("PORT") config.TZ = os.Getenv("TZ") config.ENV = os.Getenv("ENV") config.Image = os.Getenv("IMAGE") config.JWTSecret = os.Getenv("JWT_SECRET") config.Mongos = append(config.Mongos, Mongo{ URI: os.Getenv("MONGO_URI"), ConnectionName: os.Getenv("MONGO_CONNECTION_NAME"), DatabaseName: os.Getenv("MONGO_DATABASE_NAME"), }) return config }
package common import ( "context" "fmt" "io/ioutil" "os" "path/filepath" "strings" "time" "github.com/google/go-github/github" "github.com/pkg/errors" ) const ( Monitoring_Owner = "pingcap" Monitoirng_Repo = "monitoring" Commit_Message = "Automatically generate monitoring configurations for %s" ) var ( PR_Subject = "Automatically generate monitoring configurations for %s" PR_Description = "Automatically generate monitoring configurations" Monitoring_Base_Brach = "master" ) func WriteFile(baseDir string, fileName string, body string) { if body == "" { return } fn := fmt.Sprintf("%s%c%s", baseDir, filepath.Separator, fileName) f, err := os.Create(fn) CheckErr(err, "create file failed, f="+fn) defer f.Close() if _, err := f.WriteString(body); err != nil { CheckErr(err, "write file failed, f="+fn) } } func CheckErr(err error, msg string) { if err != nil { panic(errors.Wrap(err, msg)) } } func PathExist(path string) bool { if _, err := os.Stat(path); err != nil { return false } else { return true } } func ExtractFromPath(path string) string { for i := len(path) - 1; i >= 0; i-- { if path[i] == filepath.Separator { return path[i:] } } return path } func ListAllFiles(path string) []string { info, err := os.Stat(path) CheckErr(err, "") if !info.IsDir() { return []string{path} } return ListFiles(path) } func ListFiles(dir string) []string { rd, err := ioutil.ReadDir(dir) CheckErr(err, "") files := make([]string, 0) for _, r := range rd { path := fmt.Sprintf("%s%c%s", dir, filepath.Separator, r.Name()) if r.IsDir() { paths := ListFiles(path) files = append(files, paths...) } else { files = append(files, path) } } return files } func GetRef(client *github.Client, commitBranch string, ctx context.Context) (ref *github.Reference, err error) { if ref, _, err = client.Git.GetRef(ctx, Monitoring_Owner, Monitoirng_Repo, "refs/heads/"+commitBranch); err == nil { return ref, nil } // We consider that an error means the branch has not been found and needs to // be created. if commitBranch == Monitoring_Base_Brach { return nil, errors.New("The commit branch does not exist but `-base-branch` is the same as `-commit-branch`") } var baseRef *github.Reference if baseRef, _, err = client.Git.GetRef(ctx, Monitoring_Owner, Monitoirng_Repo, "refs/heads/"+Monitoring_Base_Brach); err != nil { return nil, err } newRef := &github.Reference{Ref: github.String("refs/heads/" + commitBranch), Object: &github.GitObject{SHA: baseRef.Object.SHA}} ref, _, err = client.Git.CreateRef(ctx, Monitoring_Owner, Monitoirng_Repo, newRef) return ref, err } // getTree generates the tree to commit based on the given files and the commit // of the ref you got in getRef. func GetTree(client *github.Client, ref *github.Reference, directory string, ctx context.Context, rootDir string) (tree *github.Tree, err error) { // Create a tree with what to commit. entries := []github.TreeEntry{} // Load each file into the tree. files := ListAllFiles(directory) for _, fileArg := range files { file, content, err := getFileContent(fileArg) if err != nil { return nil, err } if rootDir[len(rootDir)-1] == filepath.Separator { rootDir = rootDir[0 : len(rootDir)-1] } treePath := strings.ReplaceAll(file, fmt.Sprintf("%s%c", rootDir, filepath.Separator), "") entries = append(entries, github.TreeEntry{Path: github.String(treePath), Type: github.String("blob"), Content: github.String(string(content)), Mode: github.String("100644")}) } tree, _, err = client.Git.CreateTree(ctx, Monitoring_Owner, Monitoirng_Repo, *ref.Object.SHA, entries) return tree, err } // getFileContent loads the local content of a file and return the target name // of the file in the target repository and its contents. func getFileContent(fileArg string) (targetName string, b []byte, err error) { var localFile string files := strings.Split(fileArg, ":") switch { case len(files) < 1: return "", nil, errors.New("empty `-files` parameter") case len(files) == 1: localFile = files[0] targetName = files[0] default: localFile = files[0] targetName = files[1] } b, err = ioutil.ReadFile(localFile) return targetName, b, err } // createCommit creates the commit in the given reference using the given tree. func PushCommit(client *github.Client, ref *github.Reference, tree *github.Tree, ctx context.Context, tag string, authorName string, authorEmail string) (err error) { // Get the parent commit to attach the commit to. parent, _, err := client.Repositories.GetCommit(ctx, Monitoring_Owner, Monitoirng_Repo, *ref.Object.SHA) if err != nil { return err } // This is not always populated, but is needed. parent.Commit.SHA = parent.SHA // Create the commit using the tree. date := time.Now() author := &github.CommitAuthor{Date: &date, Name: &authorName, Email: &authorEmail} commitMsg := fmt.Sprintf(Commit_Message, tag) commit := &github.Commit{Author: author, Message: &commitMsg, Tree: tree, Parents: []github.Commit{*parent.Commit}} newCommit, _, err := client.Git.CreateCommit(ctx, Monitoring_Owner, Monitoirng_Repo, commit) if err != nil { return err } // Attach the commit to the master branch. ref.Object.SHA = newCommit.SHA _, _, err = client.Git.UpdateRef(ctx, Monitoring_Owner, Monitoirng_Repo, ref, false) return err } func CreatePR(client *github.Client, commitBranch string, ctx context.Context, tag string) (err error) { title := fmt.Sprintf(PR_Subject, tag) newPR := &github.NewPullRequest{ Title: &title, Head: &commitBranch, Base: &Monitoring_Base_Brach, Body: &PR_Description, MaintainerCanModify: github.Bool(true), } pr, _, err := client.PullRequests.Create(ctx, Monitoring_Owner, Monitoirng_Repo, newPR) if err != nil { return err } fmt.Printf("PR created: %s\n", pr.GetHTMLURL()) return nil }
package main import "fmt" // x 已声明 y 未声明 var x int func main() { //x, _ := f() x, _ = f() x, y := f() // 当多值赋值时,:= 左边的变量无论声明与否都可以 //x, y = f() fmt.Println(x, y) } func f() (int, int) { return 0, 1 }
// Copyright (C) 2019-2020 Zilliz. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software distributed under the License // is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express // or implied. See the License for the specific language governing permissions and limitations under the License. package proxy import ( "context" "sync" "time" "go.uber.org/zap" "github.com/apache/pulsar-client-go/pulsar" "github.com/milvus-io/milvus/internal/log" "github.com/milvus-io/milvus/internal/msgstream" "github.com/milvus-io/milvus/internal/proto/commonpb" "github.com/milvus-io/milvus/internal/proto/internalpb" ) type tickCheckFunc = func(Timestamp) bool type timeTick struct { lastTick Timestamp currentTick Timestamp interval time.Duration pulsarProducer pulsar.Producer tsoAllocator *TimestampAllocator tickMsgStream msgstream.MsgStream msFactory msgstream.Factory peerID UniqueID wg sync.WaitGroup ctx context.Context cancel func() timer *time.Ticker tickLock sync.RWMutex checkFunc tickCheckFunc } func newTimeTick(ctx context.Context, tsoAllocator *TimestampAllocator, interval time.Duration, checkFunc tickCheckFunc, factory msgstream.Factory) *timeTick { ctx1, cancel := context.WithCancel(ctx) t := &timeTick{ ctx: ctx1, cancel: cancel, tsoAllocator: tsoAllocator, interval: interval, peerID: Params.ProxyID, checkFunc: checkFunc, msFactory: factory, } t.tickMsgStream, _ = t.msFactory.NewMsgStream(t.ctx) t.tickMsgStream.AsProducer(Params.ProxyTimeTickChannelNames) log.Debug("proxy", zap.Strings("proxy AsProducer", Params.ProxyTimeTickChannelNames)) return t } func (tt *timeTick) tick() error { if tt.lastTick == tt.currentTick { ts, err := tt.tsoAllocator.AllocOne() if err != nil { return err } tt.currentTick = ts } if !tt.checkFunc(tt.currentTick) { return nil } msgPack := msgstream.MsgPack{} timeTickMsg := &msgstream.TimeTickMsg{ BaseMsg: msgstream.BaseMsg{ HashValues: []uint32{uint32(Params.ProxyID)}, }, TimeTickMsg: internalpb.TimeTickMsg{ Base: &commonpb.MsgBase{ MsgType: commonpb.MsgType_TimeTick, MsgID: 0, Timestamp: tt.currentTick, SourceID: tt.peerID, }, }, } msgPack.Msgs = append(msgPack.Msgs, timeTickMsg) err := tt.tickMsgStream.Produce(&msgPack) if err != nil { log.Warn("proxy", zap.String("error", err.Error())) } tt.tickLock.Lock() defer tt.tickLock.Unlock() tt.lastTick = tt.currentTick return nil } func (tt *timeTick) tickLoop() { defer tt.wg.Done() tt.timer = time.NewTicker(tt.interval) for { select { case <-tt.timer.C: if err := tt.tick(); err != nil { log.Warn("timeTick error") } case <-tt.ctx.Done(): return } } } func (tt *timeTick) LastTick() Timestamp { tt.tickLock.RLock() defer tt.tickLock.RUnlock() return tt.lastTick } func (tt *timeTick) Start() error { tt.lastTick = 0 ts, err := tt.tsoAllocator.AllocOne() if err != nil { return err } tt.currentTick = ts tt.tickMsgStream.Start() tt.wg.Add(1) go tt.tickLoop() return nil } func (tt *timeTick) Close() { if tt.timer != nil { tt.timer.Stop() } tt.cancel() tt.tickMsgStream.Close() tt.wg.Wait() }
// Copyright 2019 The Cockroach Authors. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.txt. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0, included in the file // licenses/APL.txt. package quotapool import ( "context" "time" "github.com/cockroachdb/cockroach/pkg/util/log" "github.com/cockroachdb/cockroach/pkg/util/timeutil" ) // Option is used to configure a quotapool. type Option interface { apply(*config) } // AcquisitionFunc is used to configure a quotapool to call a function after // an acquisition has occurred. type AcquisitionFunc func( ctx context.Context, poolName string, r Request, start time.Time, ) // OnAcquisition creates an Option to configure a callback upon acquisition. // It is often useful for recording metrics. func OnAcquisition(f AcquisitionFunc) Option { return optionFunc(func(cfg *config) { cfg.onAcquisition = f }) } // OnWaitFunc is the prototype for functions called to notify the start or // finish of a waiting period when a request is blocked. type OnWaitFunc func( ctx context.Context, poolName string, r Request, ) // OnWait creates an Option to configure two callbacks which are called when a // request blocks and has to wait for quota (at the start and end of the // wait). func OnWait(onStart, onFinish OnWaitFunc) Option { return optionFunc(func(cfg *config) { cfg.onWaitStart = onStart cfg.onWaitFinish = onFinish }) } // OnSlowAcquisition creates an Option to configure a callback upon slow // acquisitions. Only one OnSlowAcquisition may be used. If multiple are // specified only the last will be used. func OnSlowAcquisition(threshold time.Duration, f SlowAcquisitionFunc) Option { return optionFunc(func(cfg *config) { cfg.slowAcquisitionThreshold = threshold cfg.onSlowAcquisition = f }) } // LogSlowAcquisition is a SlowAcquisitionFunc. func LogSlowAcquisition(ctx context.Context, poolName string, r Request, start time.Time) func() { log.Warningf(ctx, "have been waiting %s attempting to acquire %s quota", timeutil.Since(start), poolName) return func() { log.Infof(ctx, "acquired %s quota after %s", poolName, timeutil.Since(start)) } } // SlowAcquisitionFunc is used to configure a quotapool to call a function when // quota acquisition is slow. The returned callback is called when the // acquisition occurs. type SlowAcquisitionFunc func( ctx context.Context, poolName string, r Request, start time.Time, ) (onAcquire func()) type optionFunc func(cfg *config) func (f optionFunc) apply(cfg *config) { f(cfg) } // WithTimeSource is used to configure a quotapool to use the provided // TimeSource. func WithTimeSource(ts timeutil.TimeSource) Option { return optionFunc(func(cfg *config) { cfg.timeSource = ts }) } // WithCloser allows the client to provide a channel which will lead to the // AbstractPool being closed. func WithCloser(closer <-chan struct{}) Option { return optionFunc(func(cfg *config) { cfg.closer = closer }) } // WithMinimumWait is used with the RateLimiter to control the minimum duration // which a goroutine will sleep waiting for quota to accumulate. This // can help avoid expensive spinning when the workload consists of many // small acquisitions. If used with a regular (not rate limiting) quotapool, // this option has no effect. func WithMinimumWait(duration time.Duration) Option { return optionFunc(func(cfg *config) { cfg.minimumWait = duration }) } type config struct { onAcquisition AcquisitionFunc onSlowAcquisition SlowAcquisitionFunc onWaitStart, onWaitFinish OnWaitFunc slowAcquisitionThreshold time.Duration timeSource timeutil.TimeSource closer <-chan struct{} minimumWait time.Duration } var defaultConfig = config{ timeSource: timeutil.DefaultTimeSource{}, } func initializeConfig(cfg *config, options ...Option) { *cfg = defaultConfig for _, opt := range options { opt.apply(cfg) } }
package main import ( "fmt" "sort" ) func main() { ints := []int{12, 4, 8, 54} // 排序 sort.Ints(ints) fmt.Printf("sort.Ints(ints) \n") if sort.IntsAreSorted(ints) { fmt.Printf("ints is sorted \n") for _, value := range ints { fmt.Printf("value: %d ", value) } // 搜索 x := 1 index := sort.SearchInts(ints, x) fmt.Println(index) x = 5 index = sort.SearchInts(ints, x) fmt.Println(index) x = 33 index = sort.SearchInts(ints, x) fmt.Println(index) // if index > 0 { // fmt.Printf("\n\n %d is in []ints, and index is: %d", x, index) // } else { // fmt.Printf("\n %d is not in []ints, and index is: %d ", x, index) // } } }
package redisstore_test import ( "context" "log" "time" "github.com/opencensus-integrations/redigo/redis" "github.com/sethvargo/go-redisstore" ) func ExampleNew() { ctx := context.Background() store, err := redisstore.New(&redisstore.Config{ Tokens: 15, Interval: time.Minute, Dial: func() (redis.Conn, error) { return redis.Dial("tcp", "127.0.0,1:6379", redis.DialPassword("my-password")) }, }) if err != nil { log.Fatal(err) } defer store.Close(ctx) limit, remaining, reset, ok, err := store.Take(ctx, "my-key") if err != nil { log.Fatal(err) } _, _, _, _ = limit, remaining, reset, ok }
package main import "fmt" type Contact struct { greeting string name string } func Greet(contact Contact) { myGreetingMas, myNameMas := CreateMessage(contact.name, contact.greeting, "howdy","Marcus") fmt.Print(myGreetingMas) fmt.Print(myNameMas) } // VARIADIC FUNCTIONS // a variable number of parameters of a certain type // useful when we don't know how many parameters are going to be passed in func CreateMessage(name string, greeting ...string) (myGreeting string, myName string) { // change the index from 0 to 1 and watch what happens myGreeting = greeting[2] + " " + name myName = "\n Hey " + name return myGreeting, myName } func main() { var t = Contact{"Good to see you,", "Tim"} Greet(t) u := Contact{"Glad you're in class,", "Jenny"} Greet(u) v := Contact{} v.greeting = "We're learning great things," v.name = "Julian" Greet(v) }
package main import ( "crypto/md5" "fmt" "io" "os" "log" "math/rand" "time" ) const ( dog="doge.jpg" cat="gcat.jpg" newCat="newGcat.jpg" newDog="newDoge.jpg" ) func alterHashit(filename string, alteredFilename string) ([]byte, []byte) { file, err := os.Open(filename) if err != nil { log.Fatal(err) } defer file.Close() // Generate 20 bytes of random string newData := make([]byte, 20) rand.Read(newData) // copy cat file out, err := os.Create(alteredFilename) if err != nil { log.Fatal(err) } _, err = io.Copy(out, file) if err != nil { log.Fatal(err) } // Alter the file out.Write(newData) // close the file, otherwise weird behavior with md5 out.Close() out2, err := os.Open(alteredFilename) defer out2.Close() // MD5 time hasher := md5.New() if _, err := io.Copy(hasher, out2); err != nil { panic(err) } return hasher.Sum(nil), newData } // Strong hash collision func hashit(filename string) ([]byte) { file, err := os.Open(filename) if err != nil { log.Fatal(err) } defer file.Close() hasher := md5.New() if _, err := io.Copy(hasher, file); err != nil { log.Fatal(err) } result := hasher.Sum(nil) return result } func recreateOutput(str string, filename,alteredFilename string) { file, err := os.Open(filename) if err != nil { log.Fatal(err) } defer file.Close() newData := []byte(str) // copy cat file out, err := os.Create(alteredFilename) if err != nil { log.Fatal(err) } _, err = io.Copy(out, file) if err != nil { log.Fatal(err) } // Alter the file out.Write(newData) // close the file, otherwise weird behavior with md5 out.Close() out2, err := os.Open(alteredFilename) defer out2.Close() // MD5 time hasher := md5.New() if _, err := io.Copy(hasher, out2); err != nil { panic(err) } } func main() { rand.Seed(time.Now().UTC().UnixNano()) // maps of all hashes seen dogHashList := make(map[string]string) catHashList := make(map[string]string) // Get the dog hash dogHash := hashit(dog) // Get cat hash catHash := hashit(cat) fmt.Printf("Dog: %x, Cat: %x\n", dogHash, catHash) dogHashList[" "] = string(dogHash) catHashList[" "] = string(catHash) for i := 0; i > -1; i++ { catHash, catString := alterHashit(cat, newCat) catComp := catHash[0:5] if val, ok := dogHashList[string(catComp)]; ok { fmt.Printf("Cat:string %x \ncat hash %x dog hash %x\n%v\n", catString, string(catComp), val,i) recreateOutput(val, dog, newDog) return } catHashList[string(catComp)] = string(catString) dogHash, dogString := alterHashit(dog, newDog) dogComp := dogHash[0:5] if val, ok := catHashList[string(dogComp)]; ok { fmt.Printf("Dog:string %x \ndog hash %x \ncat hash %x\n%v\n", dogString, string(dogComp), val,i) recreateOutput(val, cat, newCat) return } dogHashList[string(dogComp)] = string(dogString) } }
package metadata import ( "bytes" "encoding/json" "errors" "net/http" "net/http/httptest" "testing" "github.com/edgexfoundry/edgex-go/internal/core/metadata/interfaces" "github.com/edgexfoundry/edgex-go/internal/core/metadata/interfaces/mocks" "github.com/edgexfoundry/edgex-go/internal/pkg/config" "github.com/edgexfoundry/edgex-go/internal/pkg/db" "github.com/edgexfoundry/go-mod-core-contracts/clients/logger" contract "github.com/edgexfoundry/go-mod-core-contracts/models" "github.com/gorilla/mux" ) var TestError = errors.New("test error") var TestDeviceProfileID = "TestProfileID" var TestDeviceProfileName = "TestProfileName" var TestDeviceProfile = createTestDeviceProfile() var TestCommand = contract.Command{Name: "TestCommand", Id: "TestCommandId"} var TestDevices = []contract.Device{ { Name: "TestDevice1", }, { Name: "TestDevice2", }, } var TestProvisionWatchers = []contract.ProvisionWatcher{ { Name: "TestProvisionWatcher1", }, { Name: "TestProvisionWatcher2", }, } func TestUpdateDeviceProfile(t *testing.T) { tests := []struct { name string request *http.Request dbMock interfaces.DBClient expectedStatus int }{ { "OK", createRequestWithBody(TestDeviceProfile), createDBClient(), http.StatusOK, }, { "Multiple devices associated with device profile", createRequestWithBody(TestDeviceProfile), createDBClientMultipleDevicesFoundError(), http.StatusConflict, }, { "Multiple provision watchers associated with device profile", createRequestWithBody(TestDeviceProfile), createDBClientMultipleProvisionWatchersFoundError(), http.StatusConflict, }, { "Device profile duplicate name", createRequestWithBody(TestDeviceProfile), createDBClientDuplicateDeviceProfileNameError(), http.StatusConflict, }, { "GetAllDeviceProfilesError database error ", createRequestWithBody(TestDeviceProfile), createDBClientGetAllDeviceProfilesError(), http.StatusInternalServerError, }, { "Invalid request body", createRequestWithInvalidBody(), createDBClient(), http.StatusBadRequest, }, { "Device Profile Not Found", createRequestWithBody(TestDeviceProfile), createDBClientDeviceProfileNotFoundError(), http.StatusNotFound, }, { "GetProvisionWatchersByProfileId database error ", createRequestWithBody(TestDeviceProfile), createDBClientGetProvisionWatchersByProfileIdError(), http.StatusInternalServerError, }, { "UpdateDeviceProfile database error ", createRequestWithBody(TestDeviceProfile), createDBClientPersistDeviceProfileError(), http.StatusInternalServerError, }, { "GetDevicesByProfileId database error", createRequestWithBody(TestDeviceProfile), createDBClientGetDevicesByProfileIdError(), http.StatusInternalServerError, }, { "Duplicate commands error ", createRequestWithBody(createTestDeviceProfileWithCommands(TestCommand, TestCommand)), createDBClient(), http.StatusBadRequest, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { LoggingClient = logger.MockLogger{} Configuration = &ConfigurationStruct{Service: config.ServiceInfo{MaxResultCount: 1}} dbClient = tt.dbMock rr := httptest.NewRecorder() handler := http.HandlerFunc(restUpdateDeviceProfile) handler.ServeHTTP(rr, tt.request) response := rr.Result() if response.StatusCode != tt.expectedStatus { t.Errorf("status code mismatch -- expected %v got %v", tt.expectedStatus, response.StatusCode) return } }) } } func TestDeleteDeviceProfileById(t *testing.T) { tests := []struct { name string request *http.Request dbMock interfaces.DBClient expectedStatus int }{ { "OK", createRequestWithPathParameters(ID, TestDeviceProfileID), createDBClient(), http.StatusOK, }, { "Multiple devices associated with device profile", createRequestWithPathParameters(ID, TestDeviceProfileID), createDBClientMultipleDevicesFoundError(), http.StatusConflict, }, { "Multiple provision watchers associated with device profile", createRequestWithPathParameters(ID, TestDeviceProfileID), createDBClientMultipleProvisionWatchersFoundError(), http.StatusConflict, }, { "Device Profile Not Found", createRequestWithPathParameters(ID, TestDeviceProfileID), createDBClientDeviceProfileNotFoundError(), http.StatusNotFound, }, { "GetProvisionWatchersByProfileId database error ", createRequestWithPathParameters(ID, TestDeviceProfileID), createDBClientGetProvisionWatchersByProfileIdError(), http.StatusInternalServerError, }, { "DeleteDeviceProfileById database error ", createRequestWithPathParameters(ID, TestDeviceProfileID), createDBClientPersistDeviceProfileError(), http.StatusInternalServerError, }, { "GetDevicesByProfileId database error", createRequestWithPathParameters(ID, TestDeviceProfileID), createDBClientGetDevicesByProfileIdError(), http.StatusInternalServerError, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { LoggingClient = logger.MockLogger{} Configuration = &ConfigurationStruct{Service: config.ServiceInfo{MaxResultCount: 1}} dbClient = tt.dbMock rr := httptest.NewRecorder() handler := http.HandlerFunc(restDeleteProfileByProfileId) handler.ServeHTTP(rr, tt.request) response := rr.Result() if response.StatusCode != tt.expectedStatus { t.Errorf("status code mismatch -- expected %v got %v", tt.expectedStatus, response.StatusCode) return } }) } } func TestDeleteDeviceProfileByName(t *testing.T) { tests := []struct { name string request *http.Request dbMock interfaces.DBClient expectedStatus int }{ { "OK", createRequestWithPathParameters(NAME, TestDeviceProfileName), createDBClient(), http.StatusOK, }, { "Invalid name", createRequestWithPathParameters(NAME, ErrorPathParam), createDBClient(), http.StatusBadRequest, }, { "Multiple devices associated with device profile", createRequestWithPathParameters(NAME, TestDeviceProfileName), createDBClientMultipleDevicesFoundError(), http.StatusConflict, }, { "Multiple provision watchers associated with device profile", createRequestWithPathParameters(NAME, TestDeviceProfileName), createDBClientMultipleProvisionWatchersFoundError(), http.StatusConflict, }, { "Device Profile Not Found", createRequestWithPathParameters(NAME, TestDeviceProfileName), createDBClientDeviceProfileNotFoundError(), http.StatusNotFound, }, { "GetProvisionWatchersByProfileId database error ", createRequestWithPathParameters(NAME, TestDeviceProfileName), createDBClientGetProvisionWatchersByProfileIdError(), http.StatusInternalServerError, }, { "DeleteDeviceProfileById database error ", createRequestWithPathParameters(NAME, TestDeviceProfileName), createDBClientPersistDeviceProfileError(), http.StatusInternalServerError, }, { "GetDevicesByProfileId database error", createRequestWithPathParameters(NAME, TestDeviceProfileName), createDBClientGetDevicesByProfileIdError(), http.StatusInternalServerError, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { LoggingClient = logger.MockLogger{} Configuration = &ConfigurationStruct{Service: config.ServiceInfo{MaxResultCount: 1}} dbClient = tt.dbMock rr := httptest.NewRecorder() handler := http.HandlerFunc(restDeleteProfileByName) handler.ServeHTTP(rr, tt.request) response := rr.Result() if response.StatusCode != tt.expectedStatus { t.Errorf("status code mismatch -- expected %v got %v", tt.expectedStatus, response.StatusCode) return } }) } } func createRequestWithBody(d contract.DeviceProfile) *http.Request { body, err := d.MarshalJSON() if err != nil { panic("Failed to create test JSON:" + err.Error()) } return httptest.NewRequest(http.MethodPut, TestURI, bytes.NewBuffer(body)) } func createRequestWithPathParameters(pathParamName string, pathParamValue string) *http.Request { req := httptest.NewRequest(http.MethodDelete, TestURI, nil) return mux.SetURLVars(req, map[string]string{pathParamName: pathParamValue}) } func createRequestWithInvalidBody() *http.Request { return httptest.NewRequest(http.MethodPut, TestURI, bytes.NewBufferString("Bad JSON")) } func createDBClient() interfaces.DBClient { d := &mocks.DBClient{} d.On("GetDeviceProfileById", TestDeviceProfileID).Return(TestDeviceProfile, nil) d.On("GetDeviceProfileByName", TestDeviceProfileName).Return(TestDeviceProfile, nil) d.On("GetDevicesByProfileId", TestDeviceProfileID).Return(make([]contract.Device, 0), nil) d.On("GetProvisionWatchersByProfileId", TestDeviceProfileID).Return(make([]contract.ProvisionWatcher, 0), nil) d.On("GetAllDeviceProfiles").Return(make([]contract.DeviceProfile, 0), nil) // Mock both the update and delete functions so we can reuse this function for both scenarios d.On("UpdateDeviceProfile", TestDeviceProfile).Return(nil) d.On("DeleteDeviceProfileById", TestDeviceProfileID).Return(nil) d.On("DeleteDeviceProfileByName", TestDeviceProfileName).Return(nil) return d } func createDBClientDeviceProfileNotFoundError() interfaces.DBClient { d := &mocks.DBClient{} d.On("GetDeviceProfileById", TestDeviceProfileID).Return(contract.DeviceProfile{}, db.ErrNotFound) d.On("GetDeviceProfileByName", TestDeviceProfileName).Return(contract.DeviceProfile{}, db.ErrNotFound) return d } func createDBClientMultipleDevicesFoundError() interfaces.DBClient { d := &mocks.DBClient{} d.On("GetDeviceProfileById", TestDeviceProfileID).Return(TestDeviceProfile, nil) d.On("GetDeviceProfileByName", TestDeviceProfileName).Return(TestDeviceProfile, nil) d.On("GetDevicesByProfileId", TestDeviceProfileID).Return(TestDevices, nil) return d } func createDBClientMultipleProvisionWatchersFoundError() interfaces.DBClient { d := &mocks.DBClient{} d.On("GetDeviceProfileById", TestDeviceProfileID).Return(TestDeviceProfile, nil) d.On("GetDeviceProfileByName", TestDeviceProfileName).Return(TestDeviceProfile, nil) d.On("GetDevicesByProfileId", TestDeviceProfileID).Return(make([]contract.Device, 0), nil) d.On("GetProvisionWatchersByProfileId", TestDeviceProfileID).Return(TestProvisionWatchers, nil) return d } func createDBClientDuplicateDeviceProfileNameError() interfaces.DBClient { d := &mocks.DBClient{} d.On("GetDeviceProfileById", TestDeviceProfileID).Return(TestDeviceProfile, nil) d.On("GetDeviceProfileByName", TestDeviceProfileName).Return(TestDeviceProfile, nil) d.On("GetDevicesByProfileId", TestDeviceProfileID).Return(make([]contract.Device, 0), nil) d.On("GetProvisionWatchersByProfileId", TestDeviceProfileID).Return(make([]contract.ProvisionWatcher, 0), nil) d.On("GetAllDeviceProfiles").Return([]contract.DeviceProfile{{Name: TestDeviceProfile.Name, Id: "SomethingElse"}}, nil) d.On("UpdateDeviceProfile", TestDeviceProfile).Return(nil) return d } func createDBClientGetDevicesByProfileIdError() interfaces.DBClient { d := &mocks.DBClient{} d.On("GetDeviceProfileById", TestDeviceProfileID).Return(TestDeviceProfile, nil) d.On("GetDeviceProfileByName", TestDeviceProfileName).Return(TestDeviceProfile, nil) d.On("GetDevicesByProfileId", TestDeviceProfileID).Return(make([]contract.Device, 0), TestError) return d } func createDBClientGetAllDeviceProfilesError() interfaces.DBClient { d := &mocks.DBClient{} d.On("GetDeviceProfileById", TestDeviceProfileID).Return(TestDeviceProfile, nil) d.On("GetDevicesByProfileId", TestDeviceProfileID).Return(make([]contract.Device, 0), nil) d.On("GetProvisionWatchersByProfileId", TestDeviceProfileID).Return(make([]contract.ProvisionWatcher, 0), nil) d.On("GetAllDeviceProfiles").Return([]contract.DeviceProfile{}, TestError) return d } func createDBClientGetProvisionWatchersByProfileIdError() interfaces.DBClient { d := &mocks.DBClient{} d.On("GetDeviceProfileById", TestDeviceProfileID).Return(TestDeviceProfile, nil) d.On("GetDeviceProfileByName", TestDeviceProfileName).Return(TestDeviceProfile, nil) d.On("GetDevicesByProfileId", TestDeviceProfileID).Return(make([]contract.Device, 0), nil) d.On("GetProvisionWatchersByProfileId", TestDeviceProfileID).Return(make([]contract.ProvisionWatcher, 0), TestError) d.On("GetAllDeviceProfiles").Return([]contract.DeviceProfile{}, TestError) return d } func createDBClientPersistDeviceProfileError() interfaces.DBClient { d := &mocks.DBClient{} d.On("GetDeviceProfileById", TestDeviceProfileID).Return(TestDeviceProfile, nil) d.On("GetDeviceProfileByName", TestDeviceProfileName).Return(TestDeviceProfile, nil) d.On("GetDevicesByProfileId", TestDeviceProfileID).Return(make([]contract.Device, 0), nil) d.On("GetProvisionWatchersByProfileId", TestDeviceProfileID).Return(make([]contract.ProvisionWatcher, 0), nil) d.On("GetAllDeviceProfiles").Return(make([]contract.DeviceProfile, 0), nil) // Mock both persistence functions so this can be used for updates and delete tests d.On("UpdateDeviceProfile", TestDeviceProfile).Return(TestError) d.On("DeleteDeviceProfileById", TestDeviceProfile.Id).Return(TestError) return d } // createTestDeviceProfile creates a device profile to be used during testing. // This function handles some of the necessary creation nuances which need to take place for proper mocking and equality // verifications. func createTestDeviceProfile() contract.DeviceProfile { return createTestDeviceProfileWithCommands(TestCommand) } // createTestDeviceProfileWithCommands creates a device profile to be used during testing. // This function handles some of the necessary creation nuances which need to take place for proper mocking and equality // verifications. func createTestDeviceProfileWithCommands(commands ...contract.Command) contract.DeviceProfile { return contract.DeviceProfile{ Id: TestDeviceProfileID, Name: TestDeviceProfileName, DescribedObject: contract.DescribedObject{ Description: "Some test data", Timestamps: contract.Timestamps{ Origin: 123, Created: 456, Modified: 789, }, }, Labels: []string{"test", "data"}, Manufacturer: "Test Manufacturer", Model: "Test Model", CoreCommands: createCoreCommands(commands), DeviceResources: []contract.DeviceResource{ { Name: "TestDeviceResource", }, }, DeviceCommands: []contract.ProfileResource{ { Name: "TestProfileResource", }, }, } } // createCoreCommands creates Command instances which can be used during testing. // This function is necessary due to the internal field 'isValidated', which is not exported, being false when created // manually and true when serialized. This causes the mocking infrastructure to not match when Commands are involved // with matching parameters or verifying results. func createCoreCommands(commands []contract.Command) []contract.Command { cs := make([]contract.Command, 0) for _, command := range commands { b, _ := command.MarshalJSON() var temp contract.Command err := json.Unmarshal(b, &temp) if err != nil { panic(err.Error()) } cs = append(cs, temp) } return cs }
package main //import "fmt" type dHash struct { ht []hNode count int words []string } func dEnhash(s string, dh *dHash) int { i := enhash(s, len(dh.ht)) c := 0 k := doubleEnhash(len(dh.ht), s) for true { i = (i + c*k) % len(dh.ht) if dh.ht[i].key == "" { dh.ht[i].key = s dh.ht[i].count = 1 dh.words[dh.count] = s dh.count++ break } else if dh.ht[i].key == s { dh.ht[i].count++ break } c++ } return i } func doubleEnhash(l int, key string) int { j := 0 sub := []rune(key) for i := 0; i < len(sub); i += 3 { j = (j + int(sub[i])) % l } return j } func dRetrieve(s string, dh *dHash) int { i := 0 index := enhash(s, len(dh.ht)) di := doubleEnhash(len(dh.ht), s) c := 0 j := 0 for true { j = (index + c*di) % len(dh.ht) if dh.ht[j].key == s { i = dh.ht[j].count break } c++ } return i } func dRehash(old *dHash) *dHash { new := &dHash{make([]hNode, len(old.ht)*2+1), 0, make([]string, len(old.ht)*2+1)} k := "" c := 0 index := 0 ks := dKeys(old) for i := 0; i < len(ks); i++ { k = ks[i] c = dRetrieve(k, old) index = dEnhash(k, new) new.ht[index].count = c } return new } func dKeys(dh *dHash) []string { return dh.words[:dh.count] }
package main import ( "errors" "flag" "fmt" "log" "net/http" _ "net/http/pprof" "os" "path/filepath" "strconv" "strings" "bazil.org/fuse" "bazil.org/fuse/fs" "perot.me/splitfs/hashes" "perot.me/splitfs/split" ) var progName = filepath.Base(os.Args[0]) func usage() { fmt.Fprintf(os.Stderr, "Usage of %s:\n", progName) fmt.Fprintf(os.Stderr, " %s [options] <source directory> <target mountpoint>\n", progName) flag.PrintDefaults() } // parseChunkSize parses a chunk size string into its value in bytes. func parseChunkSize(chunkSize string) (int64, error) { units := map[string]int64{ "B": 1, "KiB": 1 << 10, "MiB": 1 << 20, "GiB": 1 << 30, "TiB": 1 << 40, } unitsOrder := []string{"TiB", "GiB", "MiB", "KiB", "B"} for _, unit := range unitsOrder { if !strings.HasSuffix(chunkSize, unit) { continue } amountString := strings.TrimSuffix(chunkSize, unit) amount, err := strconv.Atoi(amountString) if err != nil { return 0, fmt.Errorf("%q is not an integer", amountString) } return int64(amount) * units[unit], nil } return 0, errors.New("no unit specified") } func main() { log.SetFlags(0) log.SetPrefix(fmt.Sprintf("%s: ", progName)) flag.Usage = usage chunkSizeFlag := flag.String("chunk_size", "32MiB", "Chunk size. Available units: B, KiB, MiB, GiB, TiB.") excludeRegexpFlag := flag.String("exclude_regexp", "", "If specified, files with paths matching this regex (rooted at the source directory) will be reflected as plain, non-split files in the mountpoint. The regex is not full-match; use ^ and $ to make it so.") filenameHashFlag := flag.String("filename_hash", "sha256-b32", fmt.Sprintf("Algorithm for filename hashes in chunked filenames. Options: %v", hashes.HashNames)) filenameIncludesTotalChunksFlag := flag.Bool("filename_includes_total_chunks", true, "Whether or not chunk filenames will contain the total number of chunks of the overall file.") filenameIncludesMtimeFlag := flag.Bool("filename_includes_mtime", false, "Controls whether or not chunk filenames will contain the mtime of the overall file.") pprofHostPortFlag := flag.String("pprof_host_port", "", "If specified, bind to this 'host:port'-formatted string and export pprof HTTP handlers on it. Useful for debugging.") flag.Parse() if flag.NArg() != 2 { usage() os.Exit(2) } sourceDirectory := flag.Arg(0) targetMountpoint := flag.Arg(1) if *pprofHostPortFlag != "" { go http.ListenAndServe(*pprofHostPortFlag, http.DefaultServeMux) } chunkSize, err := parseChunkSize(*chunkSizeFlag) if err != nil { log.Fatalf("Invalid chunk size %q: %v", *chunkSizeFlag, err) } hashFunc := hashes.GetHashFunc(*filenameHashFlag) if hashFunc == nil { log.Fatalf("Invalid hash function %q; must use one of %v", *filenameHashFlag, hashes.HashNames) } var options []split.Option if *excludeRegexpFlag != "" { options = append(options, split.ExcludeRegexp(*excludeRegexpFlag)) } options = append(options, split.FilenameHashFunc(hashFunc)) options = append(options, split.FilenameIncludesTotalChunks(*filenameIncludesTotalChunksFlag)) options = append(options, split.FilenameIncludesMtime(*filenameIncludesMtimeFlag)) splitFS, err := split.NewFS(sourceDirectory, int64(chunkSize), options...) if err != nil { log.Fatalf("Cannot initialize filesystem: %v", err) } fuseConn, err := fuse.Mount( targetMountpoint, fuse.FSName("splitfs"), fuse.LocalVolume(), fuse.VolumeName(fmt.Sprintf("splitfs %d %s", chunkSize, filepath.Base(sourceDirectory)))) if err != nil { log.Fatalf("Cannot mount a filesystem at %q: %v", targetMountpoint, err) } defer fuseConn.Close() if err = fs.Serve(fuseConn, splitFS); err != nil { log.Fatalf("Cannot serve filesystem: %v", err) } <-fuseConn.Ready if err := fuseConn.MountError; err != nil { log.Fatal("Mount error: %v", err) } }
package client_test import ( "context" "testing" "time" "github.com/EventStore/EventStore-Client-Go/messages" "github.com/EventStore/EventStore-Client-Go/persistent" stream_revision "github.com/EventStore/EventStore-Client-Go/streamrevision" "github.com/stretchr/testify/require" ) func Test_PersistentSubscription_ReadExistingStream_AckToReceiveNewEvents(t *testing.T) { containerInstance, clientInstance := initializeContainerAndClient(t) defer func() { err := clientInstance.Close() require.NoError(t, err) }() defer containerInstance.Close() streamID := "someStream" firstEvent := createTestEvent() secondEvent := createTestEvent() thirdEvent := createTestEvent() events := []messages.ProposedEvent{firstEvent, secondEvent, thirdEvent} pushEventsToStream(t, clientInstance, streamID, events) groupName := "Group 1" err := clientInstance.CreatePersistentSubscription( context.Background(), persistent.SubscriptionStreamConfig{ StreamOption: persistent.StreamSettings{ StreamName: []byte(streamID), Revision: persistent.Revision_Start, }, GroupName: groupName, Settings: persistent.DefaultSubscriptionSettings, }, ) require.NoError(t, err) var bufferSize int32 = 2 readConnectionClient, err := clientInstance.ConnectToPersistentSubscription( context.Background(), bufferSize, groupName, []byte(streamID)) require.NoError(t, err) firstReadEvent := readConnectionClient.Recv().EventAppeared require.NoError(t, err) require.NotNil(t, firstReadEvent) secondReadEvent := readConnectionClient.Recv() require.NoError(t, err) require.NotNil(t, secondReadEvent) // since buffer size is two, after reading two outstanding messages // we must acknowledge a message in order to receive third one err = readConnectionClient.Ack(firstReadEvent) require.NoError(t, err) thirdReadEvent := readConnectionClient.Recv() require.NoError(t, err) require.NotNil(t, thirdReadEvent) } func Test_PersistentSubscription_ToExistingStream_StartFromBeginning_AndEventsInIt(t *testing.T) { containerInstance, clientInstance := initializeContainerAndClient(t) defer func() { err := clientInstance.Close() require.NoError(t, err) }() defer containerInstance.Close() // create 10 events events := testCreateEvents(10) streamID := "someStream" // append events to StreamsClient.AppendToStreamAsync(Stream, StreamState.NoStream, Events); _, err := clientInstance.AppendToStream(context.Background(), streamID, stream_revision.StreamRevisionNoStream, events) require.NoError(t, err) // create persistent stream connection with Revision set to Start groupName := "Group 1" err = clientInstance.CreatePersistentSubscription( context.Background(), persistent.SubscriptionStreamConfig{ StreamOption: persistent.StreamSettings{ StreamName: []byte(streamID), Revision: persistent.Revision_Start, }, GroupName: groupName, Settings: persistent.DefaultSubscriptionSettings, }, ) require.NoError(t, err) // read one event readConnectionClient, err := clientInstance.ConnectToPersistentSubscription( context.Background(), 10, groupName, []byte(streamID)) require.NoError(t, err) readEvent := readConnectionClient.Recv().EventAppeared require.NoError(t, err) require.NotNil(t, readEvent) // assert Event Number == stream Start // assert Event.ID == first event ID (readEvent.EventID == events[0].EventID) require.EqualValues(t, 0, readEvent.GetOriginalEvent().EventNumber) require.Equal(t, events[0].EventID, readEvent.GetOriginalEvent().EventID) } func Test_PersistentSubscription_ToNonExistingStream_StartFromBeginning_AppendEventsAfterwards(t *testing.T) { containerInstance, clientInstance := initializeContainerAndClient(t) defer func() { err := clientInstance.Close() require.NoError(t, err) }() defer containerInstance.Close() // create 10 events events := testCreateEvents(10) // create persistent stream connection with Revision set to Start streamID := "someStream" groupName := "Group 1" err := clientInstance.CreatePersistentSubscription( context.Background(), persistent.SubscriptionStreamConfig{ StreamOption: persistent.StreamSettings{ StreamName: []byte(streamID), Revision: persistent.Revision_Start, }, GroupName: groupName, Settings: persistent.DefaultSubscriptionSettings, }, ) require.NoError(t, err) // append events to StreamsClient.AppendToStreamAsync(Stream, stream_revision.StreamRevisionNoStream, Events); _, err = clientInstance.AppendToStream(context.Background(), streamID, stream_revision.StreamRevisionNoStream, events) require.NoError(t, err) // read one event readConnectionClient, err := clientInstance.ConnectToPersistentSubscription( context.Background(), 10, groupName, []byte(streamID)) require.NoError(t, err) readEvent := readConnectionClient.Recv().EventAppeared require.NoError(t, err) require.NotNil(t, readEvent) // assert Event Number == stream Start // assert Event.ID == first event ID (readEvent.EventID == events[0].EventID) require.EqualValues(t, 0, readEvent.GetOriginalEvent().EventNumber) require.Equal(t, events[0].EventID, readEvent.GetOriginalEvent().EventID) } func Test_PersistentSubscription_ToExistingStream_StartFromEnd_EventsInItAndAppendEventsAfterwards(t *testing.T) { // enable these tests once we switch to EventStore version 21.6.0 and greater t.Skip() containerInstance, clientInstance := initializeContainerAndClient(t) defer func() { err := clientInstance.Close() require.NoError(t, err) }() defer containerInstance.Close() // create 11 events events := testCreateEvents(11) // append 10 events to StreamsClient.AppendToStreamAsync(Stream, StreamState.NoStream, events[:10]); streamID := "someStream" // append events to StreamsClient.AppendToStreamAsync(Stream, StreamState.NoStream, Events); _, err := clientInstance.AppendToStream(context.Background(), streamID, stream_revision.StreamRevisionNoStream, events[:10]) require.NoError(t, err) // create persistent stream connection with Revision set to End groupName := "Group 1" err = clientInstance.CreatePersistentSubscription( context.Background(), persistent.SubscriptionStreamConfig{ StreamOption: persistent.StreamSettings{ StreamName: []byte(streamID), Revision: persistent.Revision_End, }, GroupName: groupName, Settings: persistent.DefaultSubscriptionSettings, }, ) require.NoError(t, err) // append 1 event to StreamsClient.AppendToStreamAsync(Stream, new StreamRevision(9), event[10]) _, err = clientInstance.AppendToStream(context.Background(), streamID, stream_revision.NewStreamRevision(9), events[10:]) require.NoError(t, err) // read one event readConnectionClient, err := clientInstance.ConnectToPersistentSubscription( context.Background(), 10, groupName, []byte(streamID)) require.NoError(t, err) readEvent := readConnectionClient.Recv().EventAppeared require.NoError(t, err) require.NotNil(t, readEvent) // assert readEvent.EventNumber == stream position 10 // assert readEvent.ID == events[10].EventID require.EqualValues(t, 10, readEvent.GetOriginalEvent().EventNumber) require.Equal(t, events[10].EventID, readEvent.GetOriginalEvent().EventID) } func Test_PersistentSubscription_ToExistingStream_StartFromEnd_EventsInIt(t *testing.T) { // enable these tests once we switch to EventStore version 21.6.0 and greater t.Skip() containerInstance, clientInstance := initializeContainerAndClient(t) defer func() { err := clientInstance.Close() require.NoError(t, err) }() defer containerInstance.Close() // create 10 events events := testCreateEvents(10) // append 10 events to StreamsClient.AppendToStreamAsync(Stream, StreamState.NoStream, events[:10]); streamID := "someStream" // append events to StreamsClient.AppendToStreamAsync(Stream, StreamState.NoStream, Events); _, err := clientInstance.AppendToStream(context.Background(), streamID, stream_revision.StreamRevisionNoStream, events[:10]) require.NoError(t, err) // create persistent stream connection with position set to End groupName := "Group 1" err = clientInstance.CreatePersistentSubscription( context.Background(), persistent.SubscriptionStreamConfig{ StreamOption: persistent.StreamSettings{ StreamName: []byte(streamID), Revision: persistent.Revision_End, }, GroupName: groupName, Settings: persistent.DefaultSubscriptionSettings, }, ) require.NoError(t, err) // reading one event after 10 seconds timeout will return no events ctx, cancelFunc := context.WithTimeout(context.Background(), 10*time.Second) readConnectionClient, err := clientInstance.ConnectToPersistentSubscription( ctx, 10, groupName, []byte(streamID)) require.NoError(t, err) doneChannel := make(chan struct{}) go func() { event := readConnectionClient.Recv().EventAppeared if event != nil && err == nil { doneChannel <- struct{}{} } }() noEvents := false waitLoop: for { select { case <-ctx.Done(): noEvents = true break waitLoop case <-doneChannel: noEvents = false break waitLoop } } require.True(t, noEvents) cancelFunc() } func Test_PersistentSubscription_ToNonExistingStream_StartFromTwo_AppendEventsAfterwards(t *testing.T) { // enable these tests once we switch to EventStore version 21.6.0 and greater t.Skip() containerInstance, clientInstance := initializeContainerAndClient(t) defer func() { err := clientInstance.Close() require.NoError(t, err) }() defer containerInstance.Close() // create 3 events events := testCreateEvents(3) // create persistent stream connection with position set to Position(2) streamID := "someStream" groupName := "Group 1" err := clientInstance.CreatePersistentSubscription( context.Background(), persistent.SubscriptionStreamConfig{ StreamOption: persistent.StreamSettings{ StreamName: []byte(streamID), Revision: persistent.Revision(2), }, GroupName: groupName, Settings: persistent.DefaultSubscriptionSettings, }, ) require.NoError(t, err) // append 3 event to StreamsClient.AppendToStreamAsync(Stream, StreamState.NoStream, events) _, err = clientInstance.AppendToStream(context.Background(), streamID, stream_revision.StreamRevisionNoStream, events) require.NoError(t, err) // read one event readConnectionClient, err := clientInstance.ConnectToPersistentSubscription( context.Background(), 10, groupName, []byte(streamID)) require.NoError(t, err) readEvent := readConnectionClient.Recv().EventAppeared require.NoError(t, err) require.NotNil(t, readEvent) // assert readEvent.EventNumber == stream position 2 // assert readEvent.ID == events[2].EventID require.EqualValues(t, 2, readEvent.GetOriginalEvent().EventNumber) require.Equal(t, events[2].EventID, readEvent.GetOriginalEvent().EventID) } func Test_PersistentSubscription_ToExistingStream_StartFrom10_EventsInItAppendEventsAfterwards(t *testing.T) { // enable these tests once we switch to EventStore version 21.6.0 and greater t.Skip() containerInstance, clientInstance := initializeContainerAndClient(t) defer func() { err := clientInstance.Close() require.NoError(t, err) }() defer containerInstance.Close() // create 11 events events := testCreateEvents(11) // append 10 events to StreamsClient.AppendToStreamAsync(Stream, StreamState.NoStream, events[:10]); streamID := "someStream" _, err := clientInstance.AppendToStream(context.Background(), streamID, stream_revision.StreamRevisionNoStream, events[:10]) require.NoError(t, err) // create persistent stream connection with start position set to Position(10) groupName := "Group 1" err = clientInstance.CreatePersistentSubscription( context.Background(), persistent.SubscriptionStreamConfig{ StreamOption: persistent.StreamSettings{ StreamName: []byte(streamID), Revision: persistent.Revision(10), }, GroupName: groupName, Settings: persistent.DefaultSubscriptionSettings, }, ) require.NoError(t, err) // append 1 event to StreamsClient.AppendToStreamAsync(Stream, StreamRevision(9), events[10:) _, err = clientInstance.AppendToStream(context.Background(), streamID, stream_revision.StreamRevision(9), events[10:]) require.NoError(t, err) // read one event readConnectionClient, err := clientInstance.ConnectToPersistentSubscription( context.Background(), 10, groupName, []byte(streamID)) require.NoError(t, err) readEvent := readConnectionClient.Recv().EventAppeared require.NoError(t, err) require.NotNil(t, readEvent) // assert readEvent.EventNumber == stream position 10 // assert readEvent.ID == events[10].EventID require.EqualValues(t, 10, readEvent.GetOriginalEvent().EventNumber) require.Equal(t, events[10].EventID, readEvent.GetOriginalEvent().EventID) } func Test_PersistentSubscription_ToExistingStream_StartFrom4_EventsInIt(t *testing.T) { // enable these tests once we switch to EventStore version 21.6.0 and greater t.Skip() containerInstance, clientInstance := initializeContainerAndClient(t) defer func() { err := clientInstance.Close() require.NoError(t, err) }() defer containerInstance.Close() // create 11 events events := testCreateEvents(11) // append 10 events to StreamsClient.AppendToStreamAsync(Stream, StreamState.NoStream, events[:10]); streamID := "someStream" _, err := clientInstance.AppendToStream(context.Background(), streamID, stream_revision.StreamRevisionNoStream, events[:10]) require.NoError(t, err) // create persistent stream connection with start position set to Position(4) groupName := "Group 1" err = clientInstance.CreatePersistentSubscription( context.Background(), persistent.SubscriptionStreamConfig{ StreamOption: persistent.StreamSettings{ StreamName: []byte(streamID), Revision: persistent.Revision(4), }, GroupName: groupName, Settings: persistent.DefaultSubscriptionSettings, }, ) require.NoError(t, err) // append 1 event to StreamsClient.AppendToStreamAsync(Stream, StreamRevision(9), events) _, err = clientInstance.AppendToStream(context.Background(), streamID, stream_revision.StreamRevision(9), events[10:]) require.NoError(t, err) // read one event readConnectionClient, err := clientInstance.ConnectToPersistentSubscription( context.Background(), 10, groupName, []byte(streamID)) require.NoError(t, err) readEvent := readConnectionClient.Recv().EventAppeared require.NoError(t, err) require.NotNil(t, readEvent) // assert readEvent.EventNumber == stream position 4 // assert readEvent.ID == events[4].EventID require.EqualValues(t, 4, readEvent.GetOriginalEvent().EventNumber) require.Equal(t, events[4].EventID, readEvent.GetOriginalEvent().EventID) } func Test_PersistentSubscription_ToExistingStream_StartFromHigherRevisionThenEventsInStream_EventsInItAppendEventsAfterwards(t *testing.T) { // enable these tests once we switch to EventStore version 21.6.0 and greater t.Skip() containerInstance, clientInstance := initializeContainerAndClient(t) defer func() { err := clientInstance.Close() require.NoError(t, err) }() defer containerInstance.Close() // create 12 events events := testCreateEvents(12) // append 11 events to StreamsClient.AppendToStreamAsync(Stream, StreamState.NoStream, events[:11]); // append 10 events to StreamsClient.AppendToStreamAsync(Stream, StreamState.NoStream, events[:10]); streamID := "someStream" _, err := clientInstance.AppendToStream(context.Background(), streamID, stream_revision.StreamRevisionNoStream, events[:11]) require.NoError(t, err) // create persistent stream connection with start position set to Position(11) groupName := "Group 1" err = clientInstance.CreatePersistentSubscription( context.Background(), persistent.SubscriptionStreamConfig{ StreamOption: persistent.StreamSettings{ StreamName: []byte(streamID), Revision: persistent.Revision(11), }, GroupName: groupName, Settings: persistent.DefaultSubscriptionSettings, }, ) require.NoError(t, err) // append event to StreamsClient.AppendToStreamAsync(Stream, StreamRevision(10), events[11:]) _, err = clientInstance.AppendToStream(context.Background(), streamID, stream_revision.StreamRevision(10), events[11:]) require.NoError(t, err) // read one event readConnectionClient, err := clientInstance.ConnectToPersistentSubscription( context.Background(), 10, groupName, []byte(streamID)) require.NoError(t, err) readEvent := readConnectionClient.Recv().EventAppeared require.NoError(t, err) require.NotNil(t, readEvent) // assert readEvent.EventNumber == stream position 11 // assert readEvent.ID == events[11].EventID require.EqualValues(t, 11, readEvent.GetOriginalEvent().EventNumber) require.Equal(t, events[11].EventID, readEvent.GetOriginalEvent().EventID) } func Test_PersistentSubscription_ReadExistingStream_NackToReceiveNewEvents(t *testing.T) { containerInstance, clientInstance := initializeContainerAndClient(t) defer func() { err := clientInstance.Close() require.NoError(t, err) }() defer containerInstance.Close() streamID := "someStream" firstEvent := createTestEvent() secondEvent := createTestEvent() thirdEvent := createTestEvent() events := []messages.ProposedEvent{firstEvent, secondEvent, thirdEvent} pushEventsToStream(t, clientInstance, streamID, events) groupName := "Group 1" err := clientInstance.CreatePersistentSubscription( context.Background(), persistent.SubscriptionStreamConfig{ StreamOption: persistent.StreamSettings{ StreamName: []byte(streamID), Revision: persistent.Revision_Start, }, GroupName: groupName, Settings: persistent.DefaultSubscriptionSettings, }, ) var bufferSize int32 = 2 readConnectionClient, err := clientInstance.ConnectToPersistentSubscription( context.Background(), bufferSize, groupName, []byte(streamID)) require.NoError(t, err) firstReadEvent := readConnectionClient.Recv().EventAppeared require.NoError(t, err) require.NotNil(t, firstReadEvent) secondReadEvent := readConnectionClient.Recv() require.NoError(t, err) require.NotNil(t, secondReadEvent) // since buffer size is two, after reading two outstanding messages // we must acknowledge a message in order to receive third one err = readConnectionClient.Nack("test reason", persistent.Nack_Park, firstReadEvent) require.NoError(t, err) thirdReadEvent := readConnectionClient.Recv() require.NoError(t, err) require.NotNil(t, thirdReadEvent) } func testCreateEvents(count uint32) []messages.ProposedEvent { result := make([]messages.ProposedEvent, count) var i uint32 = 0 for ; i < count; i++ { result[i] = createTestEvent() } return result }
package users import ( gorm "github.com/jinzhu/gorm" _ "github.com/jinzhu/gorm/dialects/mysql" _ "github.com/jinzhu/gorm/dialects/postgres" _ "github.com/jinzhu/gorm/dialects/sqlite" _ "github.com/mattn/go-sqlite3" // _ "github.com/jinzhu/gorm/dialects/mssql" "errors" "golang.org/x/crypto/bcrypt" "strconv" "log" ) // UserGorm is the GORM database connector of the User model // This connector can be used for sqlite3, mysql and postgresql databases type UserGorm struct { DB *gorm.DB } // Init performs Gorm's automigrate function to initialize the table and drops the table if drop is set to true func (o *UserGorm) Init(drop bool) error { if drop { err := o.DB.DropTable(&User{}).Error if err != nil { return err } } err := o.DB.AutoMigrate(&User{}, &Profile{}).Error if err != nil { return err } return nil } // GetByID queries the database for a User instance by the user ID // Returns *User and and error func (o *UserGorm) GetByID(id string) (*User, error) { user := &User{} if id == "" { return nil, errors.New("Empty ID") } gid, err := strconv.ParseUint(id, 10, 32) if err != nil { return nil, err } err = o.DB.Where("id = ?", gid).First(user).Error if err != nil { return nil, err } o.DB.Model(user).Related(&user.Profile, "Profile") return user, nil } // GetByEmail queries the database for a User instance by email // Returns *User and and error func (o *UserGorm) GetByEmail(email string) (*User, error) { user := &User{} err := o.DB.Where("email = ? AND \"users\".deleted IS NULL", email).First(user).Error if err != nil { return nil, err } o.DB.Model(user).Related(&user.Profile, "Profile") return user, nil } // Get queries the database via the provided query // Returns *User and and error func (o *UserGorm) Get(query interface{}, values ...interface{}) (*User, error) { user := &User{} err := o.DB.Where(query, values...).Where("\"users\".deleted IS NULL").First(user).Error if err != nil { return nil, err } o.DB.Model(user).Related(&user.Profile, "Profile") return user, nil } // Find queries the database via the provided query // Returns a slice of User and and error func (o *UserGorm) Find(query interface{}, values ...interface{}) (*[]User, error) { users := &[]User{} err := o.DB.Preload("Profile").Where(query, values...).Find(users).Error if err != nil { return nil, err } return users, nil } func (o *UserGorm) compareHashAndPassword(password1 string, password2 string) error { err := bcrypt.CompareHashAndPassword([]byte(password1), []byte(password2)) if err != nil { return err } return nil } // Authenticate provides functionality to authenticate a user with the provided password // Authenticate first queries for a user based on the value of authBy, valid search criteria are AuthByUsername, AuthByEmail, AuthByUsernameAndEmail // After a successful user query the given password will compared to the password hash in the User record. // Returns *User and error func (o *UserGorm) Authenticate(user string, password string, authBy uint) (*User, error) { u := &User{} var err error if authBy == AuthByUsername { err = o.DB.Where("username = ? AND \"users\".deleted IS NULL", user, true).First(u).Error } else if authBy == AuthByEmail { err = o.DB.Where("email = ? AND \"users\".deleted IS NULL", user, true).First(u).Error } else if authBy == AuthByUsernameOrEmail { err = o.DB.Where("(email = ? OR username = ?) AND \"users\".deleted IS NULL", user, user, true).First(u).Error } else { err = errors.New("Invalid authBy value") } if err != nil { return nil, err } err = o.compareHashAndPassword(u.Password, password) if err != nil { return nil, err } o.DB.Model(user).Related(&u.Profile, "Profile") return u, nil } // Create will create a new record in the database for the provided user or return an error func (o *UserGorm) Create(u *User) error { u.setEmailMD5() log.Printf("%+v", *u) err := o.DB.Create(u).Error if err != nil { return err } return nil } // Update will update the provided record in the database or return an error func (o *UserGorm) Update(u *User) error { u.setEmailMD5() err := o.DB.Save(u).Error if err != nil { return err } return nil } // Delete will delete the provided record in the database or return an error func (o *UserGorm) Delete(u *User) error { err := o.DB.Delete(u).Error if err != nil { return err } return nil } // NewPageManagerGorm returns a database connector for Gorm databases func NewUserManagerGorm(db *gorm.DB) *UserGorm { return &UserGorm{DB: db} }
package game import "testing" func TestWhosNext(t *testing.T) { g := &Game{ MinSize, Players{'A', 'B', 'C'}, History{ Move{'A', 0, 0}, Move{'B', 1, 0}, Move{'C', 1, 1}, Move{'A', 0, 1}, }, } if p := g.WhoIsNext(); p != 'B' { t.Fatalf("false player: wanted B have %c", p) } }
package ipam import "context" type Interface interface { // Test executes the cluster IPAM test using the configured provider // implementation. The test processes the following steps to ensure the // provider specific operator implements guest cluster IPAM correctly. // // - Create guest clusters #1, #2, #3. // - Wait for guest clusters to be ready. // - Verify that clusters have distinct subnets. // - Terminate guest cluster #2 and immediately create guest cluster #4. // - Wait for guest clusters to be deleted and created. // - Verify that clusters have distinct subnets and created cluster #4 did // not receive same subnet that deleted cluster #2 had. // - Delete guest clusters. // Test(ctx context.Context) error }
package types type StockProfileResp struct { Response Data struct { Sector Category `json:"sector"` Industry Category `json:"industry"` Company CompanyObject `json:"company"` //主要股东 Shareholder []ShareholderObject `json:"shareholder"` //股东更新时间 ShareholderUpdateAt int64 `json:"shareholderUpdateAt"` } `json:"data"` } type CompanyObject struct { //国家 Country Category `json:"country"` //城市 City Category `json:"city"` //公司中文名 CompanyNameCN string `json:"companyNameCN"` //公司英文名 CompanyNameEN string `json:"companyNameEN"` //公司简介,经营业务介绍 BusinessSummary string `json:"businessSummary"` //网址 Website string `json:"website"` // Address1 string `json:"address1"` // Address2 string `json:"address2"` //邮编 PostalCode string `json:"postalCode"` } //股东持股 type ShareholderObject struct { //股东名 Name string `json:"name"` //持股数 HoldingQuantity float64 `json:"holdingQuantity"` //占比 Proportion float64 `json:"proportion"` //较上期变动数 Change int64 `json:"change"` //较上期变动百分比 ChangePercent string `json:"changePercent"` } type GatheredCompanyResult struct { Address string `json:"address"` Code string `json:"code"` Introduction string `json:"introduction"` Name string `json:"name"` Website string `json:"website"` } type GatheredCompanyResponse struct { ErrorCode int `json:"errorCode"` Result GatheredCompanyResult `json:"result"` }
package onboarding import ( "encoding/json" "fmt" "math/rand" "net/http" "strconv" "time" "github.com/sirupsen/logrus" ) type InMemoryStore interface { SaveVerificationCode(code, email string) error GetVerificationCode(email string) (string, error) } type CodeStore map[string]string func (s CodeStore) SaveVerificationCode(email, code string) error { s[email] = code return nil } func (s CodeStore) GetVerificationCode(email string) (string, error) { return s[email], nil } type OnboardingHandler struct { InMemoryStore InMemoryStore Logger *logrus.Logger } func New(i InMemoryStore, l *logrus.Logger) *OnboardingHandler { onboardingHandler := &OnboardingHandler{ InMemoryStore: i, Logger: l, } if i == nil { onboardingHandler.InMemoryStore = CodeStore{} } return onboardingHandler } func (o *OnboardingHandler) BeginVerification(w http.ResponseWriter, r *http.Request) { email := r.URL.Query().Get("email") code := strconv.Itoa(generateCode()) if err := o.InMemoryStore.SaveVerificationCode(email, code); err != nil { respondInternalServerError(w) o.Logger.WithField("email", email).Warn("Failed to save verification code") return } respondNoContent(w) fmt.Printf("Email: %s \nCode: %s\n\n", email, code) } type verificationData struct { Email string `json:"email"` Code string `json:"code"` } func (o *OnboardingHandler) VerifyCode(w http.ResponseWriter, r *http.Request) { var data verificationData if err := json.NewDecoder(r.Body).Decode(&data); err != nil { respondBadRequest(w, "The data you sent is not valid json format.") return } actualCode, err := o.InMemoryStore.GetVerificationCode(data.Email) if err != nil { respondInternalServerError(w) o.Logger.WithField("email", data.Email).Warn("Failed to get verification code") return } if actualCode == "" { respondBadRequest(w, "This email has no verification code. Try signing up again") return } if actualCode != data.Code { respondCode(w, false, "Wrong code") return } respondCode(w, true, "Good code") } func generateCode() int { min := 600000 max := 699999 rand.Seed(time.Now().UnixNano()) return rand.Intn(max-min) + min } func respondInternalServerError(w http.ResponseWriter) { w.WriteHeader(http.StatusInternalServerError) fmt.Fprint(w) } func respondBadRequest(w http.ResponseWriter, msg string) { w.WriteHeader(http.StatusBadRequest) json.NewEncoder(w).Encode(struct { Code int Msg string }{ Code: http.StatusBadRequest, Msg: msg, }) } func respondNoContent(w http.ResponseWriter) { w.WriteHeader(http.StatusNoContent) fmt.Fprint(w) } func respondCode(w http.ResponseWriter, valid bool, msg string) { w.WriteHeader(http.StatusOK) json.NewEncoder(w).Encode(struct { Valid bool `json:"valid"` Msg string `json:"msg"` }{ Valid: valid, Msg: msg, }) }
package exterrors import ( "encoding/json" "testing" ) func TestError_ErrDescription(t *testing.T) { const want = "test description" err := Error{ Description: want, } if got := err.ErrDescription(); got != want { t.Errorf("ErrDescription() = %v, want %v", got, want) } } func TestError_ErrField(t *testing.T) { const want = "test field" err := Error{ Field: want, } if got := err.ErrField(); got != want { t.Errorf("ErrField() = %v, want %v", got, want) } } func TestError_ErrMessage(t *testing.T) { const want = "test message" err := Error{ Message: want, } if got := err.ErrMessage(); got != want { t.Errorf("ErrMessage() = %v, want %v", got, want) } } func TestError_Error(t *testing.T) { const want = "test message: test description" err := Error{ Message: "test message", Description: "test description", } if got := err.Error(); got != want { t.Errorf("Error() = %v, want %v", got, want) } } func TestError_HTTPCode(t *testing.T) { const want = 500 err := Error{ Code: want, } if got := err.HTTPCode(); got != want { t.Errorf("HTTPCode() = %v, want %v", got, want) } } func TestError_MarshalJSON(t *testing.T) { err := Error{ Code: 500, Message: "test message", Description: "test description", Field: "test field", } got, e := json.Marshal(err) if e != nil { t.Errorf("json.Marshal(), err: %s", err.Error()) } var err2 Error e = json.Unmarshal(got, &err2) if e != nil { t.Errorf("json.Unmarshal(), err: %s", err.Error()) } if err.Message != err2.Message { t.Errorf("invalid message, got: %v, want: %v", err2.Message, err.Message) } if err.Field != err2.Field { t.Errorf("invalid field, got: %v, want: %v", err2.Field, err.Field) } if err.Description != err2.Description { t.Errorf("invalid description, got: %v, want: %v", err2.Description, err.Description) } }
// Copyright (c) 2016-2019 Uber Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package dispatch import ( "errors" "fmt" "sync" "time" "github.com/uber/kraken/core" "github.com/uber/kraken/gen/go/proto/p2p" "github.com/uber/kraken/lib/torrent/networkevent" "github.com/uber/kraken/lib/torrent/scheduler/conn" "github.com/uber/kraken/lib/torrent/scheduler/dispatch/piecerequest" "github.com/uber/kraken/lib/torrent/scheduler/torrentlog" "github.com/uber/kraken/lib/torrent/storage" "github.com/uber/kraken/utils/syncutil" "github.com/andres-erbsen/clock" "github.com/uber-go/tally" "github.com/willf/bitset" "go.uber.org/zap" "golang.org/x/sync/syncmap" ) var ( errPeerAlreadyDispatched = errors.New("peer is already dispatched for the torrent") errPieceOutOfBounds = errors.New("piece index out of bounds") errChunkNotSupported = errors.New("reading / writing chunk of piece not supported") errRepeatedBitfieldMessage = errors.New("received repeated bitfield message") ) // Events defines Dispatcher events. type Events interface { DispatcherComplete(*Dispatcher) PeerRemoved(core.PeerID, core.InfoHash) } // Messages defines a subset of conn.Conn methods which Dispatcher requires to // communicate with remote peers. type Messages interface { Send(msg *conn.Message) error Receiver() <-chan *conn.Message Close() } // Dispatcher coordinates torrent state with sending / receiving messages between multiple // peers. As such, Dispatcher and Torrent have a one-to-one relationship, while Dispatcher // and Conn have a one-to-many relationship. type Dispatcher struct { config Config stats tally.Scope clk clock.Clock createdAt time.Time localPeerID core.PeerID torrent *torrentAccessWatcher peers syncmap.Map // core.PeerID -> *peer peerStats syncmap.Map // core.PeerID -> *peerStats, persists on peer removal. numPeersByPiece syncutil.Counters netevents networkevent.Producer pieceRequestTimeout time.Duration pieceRequestManager *piecerequest.Manager pendingPiecesDoneOnce sync.Once pendingPiecesDone chan struct{} completeOnce sync.Once events Events logger *zap.SugaredLogger torrentlog *torrentlog.Logger } // New creates a new Dispatcher. func New( config Config, stats tally.Scope, clk clock.Clock, netevents networkevent.Producer, events Events, peerID core.PeerID, t storage.Torrent, logger *zap.SugaredLogger, tlog *torrentlog.Logger) (*Dispatcher, error) { d, err := newDispatcher(config, stats, clk, netevents, events, peerID, t, logger, tlog) if err != nil { return nil, err } // Exits when d.pendingPiecesDone is closed. go d.watchPendingPieceRequests() if t.Complete() { d.complete() } return d, nil } // newDispatcher creates a new Dispatcher with no side-effects for testing purposes. func newDispatcher( config Config, stats tally.Scope, clk clock.Clock, netevents networkevent.Producer, events Events, peerID core.PeerID, t storage.Torrent, logger *zap.SugaredLogger, tlog *torrentlog.Logger) (*Dispatcher, error) { config = config.applyDefaults() stats = stats.Tagged(map[string]string{ "module": "dispatch", }) pieceRequestTimeout := config.calcPieceRequestTimeout(t.MaxPieceLength()) pieceRequestManager, err := piecerequest.NewManager( clk, pieceRequestTimeout, config.PieceRequestPolicy, config.PipelineLimit) if err != nil { return nil, fmt.Errorf("piece request manager: %s", err) } return &Dispatcher{ config: config, stats: stats, clk: clk, createdAt: clk.Now(), localPeerID: peerID, torrent: newTorrentAccessWatcher(t, clk), numPeersByPiece: syncutil.NewCounters(t.NumPieces()), netevents: netevents, pieceRequestTimeout: pieceRequestTimeout, pieceRequestManager: pieceRequestManager, pendingPiecesDone: make(chan struct{}), events: events, logger: logger, torrentlog: tlog, }, nil } // Digest returns the blob digest for d's torrent. func (d *Dispatcher) Digest() core.Digest { return d.torrent.Digest() } // InfoHash returns d's torrent hash. func (d *Dispatcher) InfoHash() core.InfoHash { return d.torrent.InfoHash() } // Length returns d's torrent length. func (d *Dispatcher) Length() int64 { return d.torrent.Length() } // Stat returns d's TorrentInfo. func (d *Dispatcher) Stat() *storage.TorrentInfo { return d.torrent.Stat() } // Complete returns true if d's torrent is complete. func (d *Dispatcher) Complete() bool { return d.torrent.Complete() } // CreatedAt returns when d was created. func (d *Dispatcher) CreatedAt() time.Time { return d.createdAt } // LastGoodPieceReceived returns when d last received a valid and needed piece // from peerID. func (d *Dispatcher) LastGoodPieceReceived(peerID core.PeerID) time.Time { v, ok := d.peers.Load(peerID) if !ok { return time.Time{} } return v.(*peer).getLastGoodPieceReceived() } // LastPieceSent returns when d last sent a piece to peerID. func (d *Dispatcher) LastPieceSent(peerID core.PeerID) time.Time { v, ok := d.peers.Load(peerID) if !ok { return time.Time{} } return v.(*peer).getLastPieceSent() } // LastReadTime returns when d's torrent was last read from. func (d *Dispatcher) LastReadTime() time.Time { return d.torrent.getLastReadTime() } // LastWriteTime returns when d's torrent was last written to. func (d *Dispatcher) LastWriteTime() time.Time { return d.torrent.getLastWriteTime() } // Empty returns true if the Dispatcher has no peers. func (d *Dispatcher) Empty() bool { empty := true d.peers.Range(func(k, v interface{}) bool { empty = false return false }) return empty } // RemoteBitfields returns the bitfields of peers connected to the dispatcher. func (d *Dispatcher) RemoteBitfields() conn.RemoteBitfields { remoteBitfields := make(conn.RemoteBitfields) d.peers.Range(func(k, v interface{}) bool { remoteBitfields[k.(core.PeerID)] = v.(*peer).bitfield.Copy() return true }) return remoteBitfields } // AddPeer registers a new peer with the Dispatcher. func (d *Dispatcher) AddPeer( peerID core.PeerID, b *bitset.BitSet, messages Messages) error { p, err := d.addPeer(peerID, b, messages) if err != nil { return err } go d.maybeRequestMorePieces(p) go d.feed(p) return nil } // addPeer creates and inserts a new peer into the Dispatcher. Split from AddPeer // with no goroutine side-effects for testing purposes. func (d *Dispatcher) addPeer( peerID core.PeerID, b *bitset.BitSet, messages Messages) (*peer, error) { pstats := &peerStats{} if s, ok := d.peerStats.LoadOrStore(peerID, pstats); ok { pstats = s.(*peerStats) } p := newPeer(peerID, b, messages, d.clk, pstats) if _, ok := d.peers.LoadOrStore(peerID, p); ok { return nil, errors.New("peer already exists") } for _, i := range p.bitfield.GetAllSet() { d.numPeersByPiece.Increment(int(i)) } return p, nil } func (d *Dispatcher) removePeer(p *peer) error { d.peers.Delete(p.id) d.pieceRequestManager.ClearPeer(p.id) for _, i := range p.bitfield.GetAllSet() { d.numPeersByPiece.Decrement(int(i)) } return nil } // TearDown closes all Dispatcher connections. func (d *Dispatcher) TearDown() { d.pendingPiecesDoneOnce.Do(func() { close(d.pendingPiecesDone) }) d.peers.Range(func(k, v interface{}) bool { p := v.(*peer) d.log("peer", p).Info("Dispatcher teardown closing connection") p.messages.Close() return true }) summaries := make(torrentlog.LeecherSummaries, 0) d.peerStats.Range(func(k, v interface{}) bool { peerID := k.(core.PeerID) pstats := v.(*peerStats) summaries = append(summaries, torrentlog.LeecherSummary{ PeerID: peerID, RequestsReceived: pstats.getPieceRequestsReceived(), PiecesSent: pstats.getPiecesSent(), }) return true }) if err := d.torrentlog.LeecherSummaries( d.torrent.Digest(), d.torrent.InfoHash(), summaries); err != nil { d.log().Errorf("Error logging incoming piece request summary: %s", err) } } func (d *Dispatcher) String() string { return fmt.Sprintf("Dispatcher(%s)", d.torrent) } func (d *Dispatcher) complete() { d.completeOnce.Do(func() { go d.events.DispatcherComplete(d) }) d.pendingPiecesDoneOnce.Do(func() { close(d.pendingPiecesDone) }) d.peers.Range(func(k, v interface{}) bool { p := v.(*peer) if p.bitfield.Complete() { // Close connections to other completed peers since those connections // are now useless. d.log("peer", p).Info("Closing connection to completed peer") p.messages.Close() } else { // Notify in-progress peers that we have completed the torrent and // all pieces are available. p.messages.Send(conn.NewCompleteMessage()) } return true }) var piecesRequestedTotal int summaries := make(torrentlog.SeederSummaries, 0) d.peerStats.Range(func(k, v interface{}) bool { peerID := k.(core.PeerID) pstats := v.(*peerStats) requested := pstats.getPieceRequestsSent() piecesRequestedTotal += requested summary := torrentlog.SeederSummary{ PeerID: peerID, RequestsSent: requested, GoodPiecesReceived: pstats.getGoodPiecesReceived(), DuplicatePiecesReceived: pstats.getDuplicatePiecesReceived(), } summaries = append(summaries, summary) return true }) // Only log if we actually requested pieces from others. if piecesRequestedTotal > 0 { if err := d.torrentlog.SeederSummaries( d.torrent.Digest(), d.torrent.InfoHash(), summaries); err != nil { d.log().Errorf("Error logging outgoing piece request summary: %s", err) } } } func (d *Dispatcher) endgame() bool { if d.config.DisableEndgame { return false } remaining := d.torrent.NumPieces() - int(d.torrent.Bitfield().Count()) return remaining <= d.config.EndgameThreshold } func (d *Dispatcher) maybeRequestMorePieces(p *peer) (bool, error) { candidates := p.bitfield.Intersection(d.torrent.Bitfield().Complement()) return d.maybeSendPieceRequests(p, candidates) } func (d *Dispatcher) maybeSendPieceRequests(p *peer, candidates *bitset.BitSet) (bool, error) { pieces, err := d.pieceRequestManager.ReservePieces(p.id, candidates, d.numPeersByPiece, d.endgame()) if err != nil { return false, err } if len(pieces) == 0 { return false, nil } for _, i := range pieces { if err := p.messages.Send(conn.NewPieceRequestMessage(i, d.torrent.PieceLength(i))); err != nil { // Connection closed. d.pieceRequestManager.MarkUnsent(p.id, i) return false, err } d.netevents.Produce( networkevent.RequestPieceEvent(d.torrent.InfoHash(), d.localPeerID, p.id, i)) p.pstats.incrementPieceRequestsSent() } return true, nil } func (d *Dispatcher) resendFailedPieceRequests() { failedRequests := d.pieceRequestManager.GetFailedRequests() if len(failedRequests) > 0 { d.log().Infof("Resending %d failed piece requests", len(failedRequests)) d.stats.Counter("piece_request_failures").Inc(int64(len(failedRequests))) } var sent int for _, r := range failedRequests { d.peers.Range(func(k, v interface{}) bool { p := v.(*peer) if (r.Status == piecerequest.StatusExpired || r.Status == piecerequest.StatusInvalid) && r.PeerID == p.id { // Do not resend to the same peer for expired or invalid requests. return true } b := d.torrent.Bitfield() candidates := p.bitfield.Intersection(b.Complement()) if candidates.Test(uint(r.Piece)) { nb := bitset.New(b.Len()).Set(uint(r.Piece)) if sent, err := d.maybeSendPieceRequests(p, nb); sent && err == nil { return false } } return true }) } unsent := len(failedRequests) - sent if unsent > 0 { d.log().Infof("Nowhere to resend %d / %d failed piece requests", unsent, len(failedRequests)) } } func (d *Dispatcher) watchPendingPieceRequests() { for { select { case <-d.clk.After(d.pieceRequestTimeout / 2): d.resendFailedPieceRequests() case <-d.pendingPiecesDone: return } } } // feed reads off of peer and handles incoming messages. When peer's messages close, // the feed goroutine removes peer from the Dispatcher and exits. func (d *Dispatcher) feed(p *peer) { for msg := range p.messages.Receiver() { if err := d.dispatch(p, msg); err != nil { d.log().Errorf("Error dispatching message: %s", err) } } d.removePeer(p) d.events.PeerRemoved(p.id, d.torrent.InfoHash()) } func (d *Dispatcher) dispatch(p *peer, msg *conn.Message) error { switch msg.Message.Type { case p2p.Message_ERROR: d.handleError(p, msg.Message.Error) case p2p.Message_ANNOUCE_PIECE: d.handleAnnouncePiece(p, msg.Message.AnnouncePiece) case p2p.Message_PIECE_REQUEST: d.handlePieceRequest(p, msg.Message.PieceRequest) case p2p.Message_PIECE_PAYLOAD: d.handlePiecePayload(p, msg.Message.PiecePayload, msg.Payload) case p2p.Message_CANCEL_PIECE: d.handleCancelPiece(p, msg.Message.CancelPiece) case p2p.Message_BITFIELD: d.handleBitfield(p, msg.Message.Bitfield) case p2p.Message_COMPLETE: d.handleComplete(p) default: return fmt.Errorf("unknown message type: %d", msg.Message.Type) } return nil } func (d *Dispatcher) handleError(p *peer, msg *p2p.ErrorMessage) { switch msg.Code { case p2p.ErrorMessage_PIECE_REQUEST_FAILED: d.log().Errorf("Piece request failed: %s", msg.Error) d.pieceRequestManager.MarkInvalid(p.id, int(msg.Index)) } } func (d *Dispatcher) handleAnnouncePiece(p *peer, msg *p2p.AnnouncePieceMessage) { if int(msg.Index) >= d.torrent.NumPieces() { d.log().Errorf("Announce piece out of bounds: %d >= %d", msg.Index, d.torrent.NumPieces()) return } i := int(msg.Index) p.bitfield.Set(uint(i), true) d.numPeersByPiece.Increment(int(i)) d.maybeRequestMorePieces(p) } func (d *Dispatcher) isFullPiece(i, offset, length int) bool { return offset == 0 && length == int(d.torrent.PieceLength(i)) } func (d *Dispatcher) handlePieceRequest(p *peer, msg *p2p.PieceRequestMessage) { p.pstats.incrementPieceRequestsReceived() i := int(msg.Index) if !d.isFullPiece(i, int(msg.Offset), int(msg.Length)) { d.log("peer", p, "piece", i).Error("Rejecting piece request: chunk not supported") p.messages.Send(conn.NewErrorMessage(i, p2p.ErrorMessage_PIECE_REQUEST_FAILED, errChunkNotSupported)) return } payload, err := d.torrent.GetPieceReader(i) if err != nil { d.log("peer", p, "piece", i).Errorf("Error getting reader for requested piece: %s", err) p.messages.Send(conn.NewErrorMessage(i, p2p.ErrorMessage_PIECE_REQUEST_FAILED, err)) return } if err := p.messages.Send(conn.NewPiecePayloadMessage(i, payload)); err != nil { return } p.touchLastPieceSent() p.pstats.incrementPiecesSent() // Assume that the peer successfully received the piece. p.bitfield.Set(uint(i), true) } func (d *Dispatcher) handlePiecePayload( p *peer, msg *p2p.PiecePayloadMessage, payload storage.PieceReader) { defer payload.Close() i := int(msg.Index) if !d.isFullPiece(i, int(msg.Offset), int(msg.Length)) { d.log("peer", p, "piece", i).Error("Rejecting piece payload: chunk not supported") d.pieceRequestManager.MarkInvalid(p.id, i) return } if err := d.torrent.WritePiece(payload, i); err != nil { if err != storage.ErrPieceComplete { d.log("peer", p, "piece", i).Errorf("Error writing piece payload: %s", err) d.pieceRequestManager.MarkInvalid(p.id, i) } else { p.pstats.incrementDuplicatePiecesReceived() } return } d.netevents.Produce( networkevent.ReceivePieceEvent(d.torrent.InfoHash(), d.localPeerID, p.id, i)) p.pstats.incrementGoodPiecesReceived() p.touchLastGoodPieceReceived() if d.torrent.Complete() { d.complete() } d.pieceRequestManager.Clear(i) d.maybeRequestMorePieces(p) d.peers.Range(func(k, v interface{}) bool { if k.(core.PeerID) == p.id { return true } pp := v.(*peer) pp.messages.Send(conn.NewAnnouncePieceMessage(i)) return true }) } func (d *Dispatcher) handleCancelPiece(p *peer, msg *p2p.CancelPieceMessage) { // No-op: cancelling not supported because all received messages are synchronized, // therefore if we receive a cancel it is already too late -- we've already read // the piece. } func (d *Dispatcher) handleBitfield(p *peer, msg *p2p.BitfieldMessage) { d.log("peer", p).Error("Unexpected bitfield message from established conn") } func (d *Dispatcher) handleComplete(p *peer) { if d.Complete() { d.log("peer", p).Info("Closing connection to completed peer") p.messages.Close() } else { p.bitfield.SetAll(true) d.maybeRequestMorePieces(p) } } func (d *Dispatcher) log(args ...interface{}) *zap.SugaredLogger { args = append(args, "torrent", d.torrent) return d.logger.With(args...) }
package container_test import ( "fmt" . "github.com/golangit/dic/container" "github.com/golangit/dic/definition" "github.com/golangit/dic/reference" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "reflect" "testing" "time" ) func TestDic(t *testing.T) { RegisterFailHandler(Fail) RunSpecs(t, "Container Suite") } var _ = Describe("Container", func() { It("should create a new instance", func() { cnt := New() Expect(cnt).ShouldNot(BeNil()) }) var ( goodProviders = map[string]interface{}{ "hello": func() { print("hello") }, "foobar": func(a, b, c int) int { return a + b + c }, } ) Context("When I register a function", func() { It("Should not return nil", func() { cnt := New() for k, v := range goodProviders { Expect(cnt.Register(k, v)).Should(BeNil()) } }) PIt("should understand when there's a Circular reference", func() { cnt := New() cnt.Register("orm", func(dbName string) string { return "db:" + dbName }) Expect(cnt.Get("orm", reference.New("orm"))).Should(BeNil()) }) }) Context("When I try to inject all the dependency", func() { It("inject all the dependency for a struct", func() { type Orm struct { DbTable string `dic:"table"` } cnt := New() cnt.Register("table", "table-name") orm := new(Orm) cnt.Inject(&orm) Expect(orm.DbTable).Should(Equal("table-name")) }) }) Context("When I try to get a definition", func() { It("should return nil if the service doesn't exist", func() { cnt := New() def, _ := cnt.GetDefinition("hello") Expect(def).Should(BeNil()) }) It("should return a definition", func() { def := definition.New(fmt.Printf, true, true) cnt := New() cnt.Register("hello", func() { fmt.Printf("hello") }) Expect(cnt.GetDefinition("hello")).Should(BeAssignableToTypeOf(def)) }) }) Context("When I try to get a service", func() { It("should execute it and return a list of result", func() { cnt := New() cnt.Register("root", func() int { return 2 * 2 }) def, err := cnt.GetAll("root") var i int = def[0].Interface().(int) Expect(i).Should(Equal(4)) Expect(err).Should(BeNil()) }) It("should execute it and return the interface of the element", func() { cnt := New() cnt.Register("root", func() int { return 2 * 2 }) Expect(cnt.Get("root").(int)).Should(Equal(4)) }) It("should not execute if is not public", func() { cnt := New() def := definition.New(func() int { return 2 * 2 }, false, false) cnt.SetDefinition("root", def) result, err := cnt.GetAll("root") Expect(result).Should(BeNil()) Expect(err.Error()).Should(ContainSubstring("not public")) }) It("should return err if the service doesn't exist", func() { cnt := New() def, err := cnt.GetAll("hello") Expect(def).Should(BeNil()) Expect(err.Error()).Should(ContainSubstring("Service hello not found")) }) }) Context("When I try to get a static service", func() { It("should not be executed twice", func() { cnt := New() cnt.Register("root", time.Now) before, err := cnt.GetAll("root") Expect(err).Should(BeNil()) now, err := cnt.GetAll("root") Expect(err).Should(BeNil()) Expect(now).Should(Equal(before)) }) }) Context("When I try to inject a dependency into a callable service", func() { It("should resolve a dependency to another service", func() { cnt := New() cnt.Register("service.4", func() int { return 4 }) cnt.Register("multiplicator", func(a int) int { return a * 2 }) val, err := cnt.GetAll("multiplicator", reference.New("service.4")) Expect(err).Should(BeNil()) var i int = val[0].Interface().(int) Expect(i).Should(Equal(8)) }) It("should resolve a dependency to string", func() { cnt := New() cnt.Register("db.name", "golang") cnt.Register("orm", func(dbName string) string { return "db:" + dbName }) Expect(cnt.Get("orm", reference.New("db.name"))).Should(Equal("db:golang")) }) It("should resolve a mixed type dependencies", func() { cnt := New() cnt.Register("service.2", func() int { return 2 }) cnt.Register("service.sum", func(a int, b int, str string) string { return fmt.Sprintf(str, a, b) }) val, err := cnt.GetAll("service.sum", reference.New("service.2"), 3, "a:%d,b:%d") Expect(err).Should(BeNil()) var i string = val[0].Interface().(string) Expect(i).Should(Equal("a:2,b:3")) }) }) Context("When I try to understand if a parameter is a Reference", func() { It("should return the reference Name if the param is a reference", func() { ref := reflect.ValueOf(reference.New("ref")) ret, err := IsAReference(ref) Expect(err).Should(BeNil()) Expect(ret).Should(Equal("ref")) }) It("should return err if the param is not a ref", func() { ref := reflect.ValueOf(true) ret, err := IsAReference(ref) Expect(ret).Should(BeEmpty()) Expect(err).ShouldNot(BeNil()) }) }) Context("When I try to get a not static service", func() { It("should be executed each time", func() { cnt := New() def := definition.New(time.Now, true, false) cnt.SetDefinition("root", def) before, err := cnt.GetAll("root") Expect(err).Should(BeNil()) now, err := cnt.GetAll("root") Expect(err).Should(BeNil()) Expect(now).ShouldNot(Equal(before)) }) }) Context("When I try to Register an objects with fields", func() { Context("Using a struct", func() { It("should register correctly", func() { type TestStruct struct { Nerd string } test := &TestStruct{} cnt := New() err := cnt.Register("root", test) Expect(err).Should(BeNil()) }) It("should register it and inject its fields", func() { type TestStruct struct { Nerd string } test := &TestStruct{} cnt := New() err := cnt.Register("struct", test, "liuggio") Expect(err).Should(BeNil()) res, err := cnt.GetAll("struct") Expect(res).ShouldNot(BeNil()) Expect(err).Should(BeNil()) Expect(res[0].Interface().(TestStruct).Nerd).Should(Equal("liuggio")) }) }) }) Context("When I register a parameters", func() { It("should register it", func() { db := "golang" cnt := New() err := cnt.Register("database.name", db) Expect(err).Should(BeNil()) }) It("should register, and get it", func() { db := "golang" cnt := New() err := cnt.Register("database.name", db) Expect(err).Should(BeNil()) res, err := cnt.GetAll("database.name") Expect(res).ShouldNot(BeNil()) Expect(err).Should(BeNil()) Expect(res[0].Interface().(string)).Should(Equal("golang")) }) }) PContext("When I register a struct", func() { PIt("should inject by tagging", func() { }) }) })
// Copyright 2021 Comcast Cable Communications Management, LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package bit import "fmt" type Mask uint func (b *Mask) Set(flag Mask) { *b = *b | flag } func (b *Mask) Clear(flag Mask) { *b = *b & ^flag } func (b *Mask) Flip(flag Mask) { *b ^= flag } func (b Mask) IsSet(flag Mask) bool { return b&flag != 0 } func (b Mask) String() string { return fmt.Sprintf("%b", b) }
// +build storage_badger storage_all !storage_pgx,!storage_boltdb,!storage_fs,!storage_sqlite package badger type logger struct { logFn loggerFn errFn loggerFn } func (l logger) Errorf(s string, p ...interface{}) { if l.errFn == nil { return } l.errFn(nil, s, p...) } func (l logger) Warningf(s string, p ...interface{}) { if l.logFn == nil { return } l.logFn(nil, "WARN: "+s, p...) } func (l logger) Infof(s string, p ...interface{}) { if l.logFn == nil { return } l.logFn(nil, "INFO: " + s, p...) } func (l logger) Debugf(s string, p ...interface{}) { if l.logFn == nil { return } l.logFn(nil, "DEBUG: " + s, p...) }
package exchange import ( "github.com/stretchr/testify/assert" "log" "testing" ) func TestBitfinex_SetPairs(t *testing.T) { bitfinex := Bitfinex{} bitfinex.SetPairs() pairs := bitfinex.GetConfig().Pairs assert.Contains(t, pairs, &Pair{"ETH", "USD"}) assert.Contains(t, pairs, &Pair{"ETH", "BTC"}) } func TestBitfinex_GetResponse(t *testing.T) { bitfinex := Bitfinex{} price, err := bitfinex.GetResponse("ETH", "USD") if err != nil { log.Fatal(err) } assert.True(t, price.Price > 0, "price from Bitfinex isn't greater than 0") assert.True(t, price.Volume > 0, "volume from Bitfinex isn't greater than 0") }
// Copyright 2019 Yunion // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package shell import ( "fmt" "yunion.io/x/onecloud/pkg/multicloud/huawei" "yunion.io/x/onecloud/pkg/multicloud/objectstore" "yunion.io/x/onecloud/pkg/util/shellutils" ) func init() { objectstore.S3Shell() type BucketNameOptions struct { NAME string } shellutils.R(&BucketNameOptions{}, "bucket-head", "Head bucket", func(cli *huawei.SRegion, args *BucketNameOptions) error { result, err := cli.HeadBucket(args.NAME) if err != nil { return err } printObject(result) return nil }) shellutils.R(&BucketNameOptions{}, "bucket-project", "Show bucket project", func(cli *huawei.SRegion, args *BucketNameOptions) error { bucket, err := cli.GetIBucketByName(args.NAME) if err != nil { return err } fmt.Println("project: ", bucket.GetProjectId()) return nil }) }
// thanks dsal and Athiwat from #go-nuts for the amazing amount of help // and patience they showed package main import ( "fmt" "sync" ) func isPalindrome(n int) bool { n1, n2 := n, 0 for n != 0 { n2 *= 10 n2 += n % 10 n /= 10 } return n1 == n2 } func check(i, j int, c chan<- int) { k := i * j if isPalindrome(k) { c <- k } } func worker(wg *sync.WaitGroup, ch <-chan int, outch chan<- int) { defer wg.Done() for i := range ch { for j := 900; j < 1000; j++ { check(i, j, outch) } } } func feedTheBatch(ch chan<- int) { for i := 900; i < 1000; i++ { ch <- i } close(ch) } func waitAndClose(wg *sync.WaitGroup, ch chan int) { wg.Wait() close(ch) } func main() { var ans int wg := &sync.WaitGroup{} possibleAnswers := make(chan int) batchCh := make(chan int) for i := 0; i < 8; i++ { // however many workers make sense wg.Add(1) go worker(wg, batchCh, possibleAnswers) } go feedTheBatch(batchCh) go waitAndClose(wg, possibleAnswers) for possibleAnswer := range possibleAnswers { if possibleAnswer > ans { ans = possibleAnswer } } fmt.Println(ans) }
package main func main() { var x string x++ }
package main import ( "fmt" "strings" ) func dockerGetCgroupConfig() (string, error) { var dockerInfo = []string{"docker", "info"} stdout, _, err := execUserCmd(dockerInfo) if err != nil { return "", err } stdoutLines := strings.Split(stdout, "\n") for _, line := range stdoutLines { if strings.Contains(line, "Cgroup Driver: ") != true { continue } cgInfo := strings.Split(line, ":") if len(cgInfo) != 2 { return "", fmt.Errorf("Error parsing cgroup info") } cgdriver := strings.Trim(cgInfo[1], " ") if cgdriver == "cgroupfs" || cgdriver == "systemd" { return cgdriver, nil } } return "", fmt.Errorf("Fail to find key") }
package main type PublishMessage struct { // }
package core import ( "fmt" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/opspec-io/sdk-golang/pkg/model" "path" "path/filepath" ) var _ = Context("caller", func() { Context("newCaller", func() { It("should return caller", func() { /* arrange/act/assert */ Expect(newCaller(new(fakeContainerCaller))).Should(Not(BeNil())) }) }) Context("Call", func() { Context("Null SCG", func() { It("should not throw", func() { /* arrange */ fakeContainerCaller := new(fakeContainerCaller) /* act */ objectUnderTest := newCaller(fakeContainerCaller) /* assert */ objectUnderTest.Call( "dummyNodeId", map[string]*model.Data{}, nil, "dummyPkgRef", "dummyRootOpId", ) }) }) Context("Container SCG", func() { It("should call containerCaller.Call w/ expected args", func() { /* arrange */ fakeContainerCaller := new(fakeContainerCaller) providedNodeId := "dummyNodeId" providedArgs := map[string]*model.Data{} providedScg := &model.Scg{ Container: &model.ScgContainerCall{}, } providedPkgRef := "dummyPkgRef" providedRootOpId := "dummyRootOpId" objectUnderTest := newCaller(fakeContainerCaller) /* act */ objectUnderTest.Call( providedNodeId, providedArgs, providedScg, providedPkgRef, providedRootOpId, ) /* assert */ actualArgs, actualNodeId, actualScg, actualPkgRef, actualRootOpId := fakeContainerCaller.CallArgsForCall(0) Expect(actualNodeId).To(Equal(providedNodeId)) Expect(actualArgs).To(Equal(providedArgs)) Expect(actualScg).To(Equal(providedScg.Container)) Expect(actualPkgRef).To(Equal(providedPkgRef)) Expect(actualRootOpId).To(Equal(providedRootOpId)) }) Context("containerCaller.Call errors", func() { }) Context("containerCaller.Call doesn't error", func() { }) }) Context("Op SCG", func() { It("should call opCaller.Call w/ expected args", func() { /* arrange */ fakeOpCaller := new(fakeOpCaller) providedNodeId := "dummyNodeId" providedArgs := map[string]*model.Data{} providedScg := &model.Scg{ Op: &model.ScgOpCall{ Ref: "dummyPkgRef", }, } providedPkgRef := "dummyPkgRef" providedRootOpId := "dummyRootOpId" objectUnderTest := newCaller(new(fakeContainerCaller)) objectUnderTest.setOpCaller(fakeOpCaller) /* act */ objectUnderTest.Call( providedNodeId, providedArgs, providedScg, providedPkgRef, providedRootOpId, ) /* assert */ actualArgs, actualNodeId, actualPkgRef, actualRootOpId := fakeOpCaller.CallArgsForCall(0) Expect(actualNodeId).To(Equal(providedNodeId)) Expect(actualArgs).To(Equal(providedArgs)) Expect(actualPkgRef).To(Equal(path.Join(filepath.Dir(providedPkgRef), providedScg.Op.Ref))) Expect(actualRootOpId).To(Equal(providedRootOpId)) }) Context("opCaller.Call errors", func() { }) Context("opCaller.Call doesn't error", func() { }) }) Context("Parallel SCG", func() { It("should call parallelCaller.Call w/ expected args", func() { /* arrange */ fakeParallelCaller := new(fakeParallelCaller) providedNodeId := "dummyNodeId" providedArgs := map[string]*model.Data{} providedScg := &model.Scg{ Parallel: []*model.Scg{ {Container: &model.ScgContainerCall{}}, }, } providedPkgRef := "dummyPkgRef" providedRootOpId := "dummyRootOpId" objectUnderTest := newCaller(new(fakeContainerCaller)) objectUnderTest.setParallelCaller(fakeParallelCaller) /* act */ objectUnderTest.Call( providedNodeId, providedArgs, providedScg, providedPkgRef, providedRootOpId, ) /* assert */ actualArgs, actualRootOpId, actualPkgRef, actualScg := fakeParallelCaller.CallArgsForCall(0) Expect(actualArgs).To(Equal(providedArgs)) Expect(actualRootOpId).To(Equal(providedRootOpId)) Expect(actualPkgRef).To(Equal(providedPkgRef)) Expect(actualScg).To(Equal(providedScg.Parallel)) }) Context("parallelCaller.Call errors", func() { }) Context("parallelCaller.Call doesn't error", func() { }) }) Context("Serial SCG", func() { It("should call serialCaller.Call w/ expected args", func() { /* arrange */ fakeSerialCaller := new(fakeSerialCaller) providedNodeId := "dummyNodeId" providedArgs := map[string]*model.Data{} providedScg := &model.Scg{ Serial: []*model.Scg{ {Container: &model.ScgContainerCall{}}, }, } providedPkgRef := "dummyPkgRef" providedRootOpId := "dummyRootOpId" objectUnderTest := newCaller(new(fakeContainerCaller)) objectUnderTest.setSerialCaller(fakeSerialCaller) /* act */ objectUnderTest.Call( providedNodeId, providedArgs, providedScg, providedPkgRef, providedRootOpId, ) /* assert */ actualArgs, actualRootOpId, actualPkgRef, actualScg := fakeSerialCaller.CallArgsForCall(0) Expect(actualArgs).To(Equal(providedArgs)) Expect(actualRootOpId).To(Equal(providedRootOpId)) Expect(actualPkgRef).To(Equal(providedPkgRef)) Expect(actualScg).To(Equal(providedScg.Serial)) }) Context("serialCaller.Call errors", func() { }) Context("serialCaller.Call doesn't error", func() { }) }) Context("No SCG", func() { It("should error", func() { /* arrange */ fakeSerialCaller := new(fakeSerialCaller) providedNodeId := "dummyNodeId" providedArgs := map[string]*model.Data{} providedScg := &model.Scg{} providedPkgRef := "dummyPkgRef" providedRootOpId := "dummyRootOpId" expectedError := fmt.Errorf("Invalid call graph %+v\n", providedScg) objectUnderTest := newCaller(new(fakeContainerCaller)) objectUnderTest.setSerialCaller(fakeSerialCaller) /* act */ _, actualError := objectUnderTest.Call( providedNodeId, providedArgs, providedScg, providedPkgRef, providedRootOpId, ) /* assert */ Expect(actualError).To(Equal(expectedError)) }) }) }) })
package main import ( "net/http" log "github.com/sirupsen/logrus" ) // twoHundred func twoHundred(w http.ResponseWriter, r *http.Request) { w.Header().Set("content-type", "application/json") w.WriteHeader(http.StatusOK) w.Write([]byte(`{"message": "HTTP Endpoint OK!"}`)) } // fiveHundred func fiveHundred(w http.ResponseWriter, r *http.Request) { // simulate 500 eror code w.Header().Set("content-type", "application/json") w.WriteHeader(http.StatusInternalServerError) w.Write([]byte(`{"message": "HTTP Endpoint Internal Error!"}`)) } func router() http.Handler { m := http.NewServeMux() m.HandleFunc("/test200", twoHundred) m.HandleFunc("/test500", fiveHundred) return m } func main() { const addr = ":8080" server := &http.Server{ Addr: addr, Handler: router(), } log.Infof("listening on '%s'", addr) log.Fatal(server.ListenAndServe()) }
package main import "fmt" /* A 3 x 3 magic square is a 3 x 3 grid filled with distinct numbers from 1 to 9 such that each row, column, and both diagonals all have the same sum. Given an N x N grid of integers, how many 3 x 3 "magic square" subgrids are there? (Each subgrid is contiguous). Example 1: Input: [[4,3,8,4], [9,5,1,9], [2,7,6,2]] Output: 1 Explanation: The following subgrid is a 3 x 3 magic square: 438 951 276 while this one is not: 384 519 762 In total, there is only one magic square inside the given grid. Note: 1 <= grid.length = grid[0].length <= 10 0 <= grid[i][j] <= 15 */ func numMagicSquaresInside(grid [][]int) int { line := len(grid) row := len(grid[0]) ret := 0 for i:=0;i<=line-3;i++ { for j:=0;j<=row-3;j++ { if is19(i,j,grid) { ret += 1 } } } return ret } func is19(x,y int,grid [][]int) bool { if grid[x+1][y+1] != 5 {return false} for m:=x;m<x+3;m++ { sum1 := 0 for n:=y;n<y+3;n++ { if grid[m][n] > 9 { return false } sum1 += grid[m][n] } if sum1 != 15 { return false } } if grid[x][y]+grid[x+1][y]+grid[x+2][y] != 15 {return false} if grid[x][y+1]+grid[x+1][y+1]+grid[x+2][y+1] != 15 {return false} if grid[x][y+2]+grid[x+1][y+2]+grid[x+2][y+2] != 15 {return false} if grid[x][y]+grid[x+1][y+1]+grid[x+2][y+2] != 15 {return false} if grid[x+2][y]+grid[x+1][y+1]+grid[x][y+2] != 15 {return false} return true } func main() { fmt.Println(numMagicSquaresInside([][]int{ []int{3,2,9,2,7}, []int{6,1,8,4,2}, []int{7,5,3,2,7}, []int{2,9,4,9,6}, []int{4,3,8,2,5}, })) }
package v1 import ( "errors" "fmt" "net/url" "os" ) type Handler struct{} func NewHandler() *Handler { return &Handler{} } func (*Handler) Addr() (string, error) { port, ok := os.LookupEnv(envKeyPort) if !ok { return "", errors.New("PORT is not set") } return port, nil } func (*Handler) SessionKey() (string, error) { return "sessions", nil } func (*Handler) SessionSecret() (string, error) { secret, ok := os.LookupEnv(envKeySessionSecret) if !ok { return "", errors.New("SESSION_SECRET is not set") } return secret, nil } func (*Handler) TraqBaseURL() (*url.URL, error) { traQBaseURL, err := url.Parse("https://q.trap.jp/api/v3") if err != nil { return nil, fmt.Errorf("failed to parse traQBaseURL: %w", err) } return traQBaseURL, nil }
// Copyright 2018 The ChromiumOS Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // Package caps is a package for capabilities used in autotest-capability. package caps import ( "context" "fmt" "regexp" "strings" "chromiumos/tast/autocaps" "chromiumos/tast/common/testexec" "chromiumos/tast/errors" "chromiumos/tast/testing" ) // These are constant strings for capabilities in autotest-capability. // Tests may list these in SoftwareDeps. // See the below link for detail. // https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/main/chromeos-base/autotest-capability-default/. const ( // Prefix is the prefix of capability. Prefix = "autotest-capability:" // Video Decoding HWDecodeH264 = Prefix + "hw_dec_h264_1080_30" HWDecodeH264_60 = Prefix + "hw_dec_h264_1080_60" HWDecodeH264_4K = Prefix + "hw_dec_h264_2160_30" HWDecodeH264_4K60 = Prefix + "hw_dec_h264_2160_60" HWDecodeH264_8K = Prefix + "hw_dec_h264_4320_30" HWDecodeH264_8K60 = Prefix + "hw_dec_h264_4320_60" HWDecodeVP8 = Prefix + "hw_dec_vp8_1080_30" HWDecodeVP8_60 = Prefix + "hw_dec_vp8_1080_60" HWDecodeVP8_4K = Prefix + "hw_dec_vp8_2160_30" HWDecodeVP8_4K60 = Prefix + "hw_dec_vp8_2160_60" HWDecodeVP9 = Prefix + "hw_dec_vp9_1080_30" HWDecodeVP9_60 = Prefix + "hw_dec_vp9_1080_60" HWDecodeVP9_4K = Prefix + "hw_dec_vp9_2160_30" HWDecodeVP9_4K60 = Prefix + "hw_dec_vp9_2160_60" HWDecodeVP9_8K = Prefix + "hw_dec_vp9_4320_30" HWDecodeVP9_8K60 = Prefix + "hw_dec_vp9_4320_60" HWDecodeVP9_2 = Prefix + "hw_dec_vp9-2_1080_30" HWDecodeVP9_2_60 = Prefix + "hw_dec_vp9-2_1080_60" HWDecodeVP9_2_4K = Prefix + "hw_dec_vp9-2_2160_30" HWDecodeVP9_2_4K60 = Prefix + "hw_dec_vp9-2_2160_60" HWDecodeVP9_2_8K = Prefix + "hw_dec_vp9-2_4320_30" HWDecodeVP9_2_8K60 = Prefix + "hw_dec_vp9-2_4320_60" HWDecodeAV1 = Prefix + "hw_dec_av1_1080_30" HWDecodeAV1_60 = Prefix + "hw_dec_av1_1080_60" HWDecodeAV1_4K = Prefix + "hw_dec_av1_2160_30" HWDecodeAV1_4K60 = Prefix + "hw_dec_av1_2160_60" HWDecodeAV1_8K = Prefix + "hw_dec_av1_4320_30" HWDecodeAV1_8K60 = Prefix + "hw_dec_av1_4320_60" HWDecodeAV1_10BPP = Prefix + "hw_dec_av1_1080_30_10bpp" HWDecodeAV1_60_10BPP = Prefix + "hw_dec_av1_1080_60_10bpp" HWDecodeAV1_4K10BPP = Prefix + "hw_dec_av1_2160_30_10bpp" HWDecodeAV1_4K60_10BPP = Prefix + "hw_dec_av1_2160_60_10bpp" HWDecodeAV1_8K10BPP = Prefix + "hw_dec_av1_4320_30_10bpp" HWDecodeAV1_8K60_10BPP = Prefix + "hw_dec_av1_4320_60_10bpp" HWDecodeHEVC = Prefix + "hw_dec_hevc_1080_30" HWDecodeHEVC60 = Prefix + "hw_dec_hevc_1080_60" HWDecodeHEVC4K = Prefix + "hw_dec_hevc_2160_30" HWDecodeHEVC4K60 = Prefix + "hw_dec_hevc_2160_60" HWDecodeHEVC8K = Prefix + "hw_dec_hevc_4320_30" HWDecodeHEVC8K60 = Prefix + "hw_dec_hevc_4320_60" HWDecodeHEVC10BPP = Prefix + "hw_dec_hevc_1080_30_10bpp" HWDecodeHEVC60_10BPP = Prefix + "hw_dec_hevc_1080_60_10bpp" HWDecodeHEVC4K10BPP = Prefix + "hw_dec_hevc_2160_30_10bpp" HWDecodeHEVC4K60_10BPP = Prefix + "hw_dec_hevc_2160_60_10bpp" HWDecodeHEVC8K10BPP = Prefix + "hw_dec_hevc_4320_30_10bpp" HWDecodeHEVC8K60_10BPP = Prefix + "hw_dec_hevc_4320_60_10bpp" // Protected Video Decoding HWDecodeCBCV1H264 = Prefix + "hw_video_prot_cencv1_h264_cbc" HWDecodeCTRV1H264 = Prefix + "hw_video_prot_cencv1_h264_ctr" HWDecodeCBCV3AV1 = Prefix + "hw_video_prot_cencv3_av1_cbc" HWDecodeCTRV3AV1 = Prefix + "hw_video_prot_cencv3_av1_ctr" HWDecodeCBCV3H264 = Prefix + "hw_video_prot_cencv3_h264_cbc" HWDecodeCTRV3H264 = Prefix + "hw_video_prot_cencv3_h264_ctr" HWDecodeCBCV3HEVC = Prefix + "hw_video_prot_cencv3_hevc_cbc" HWDecodeCTRV3HEVC = Prefix + "hw_video_prot_cencv3_hevc_ctr" HWDecodeCBCV3VP9 = Prefix + "hw_video_prot_cencv3_vp9_cbc" HWDecodeCTRV3VP9 = Prefix + "hw_video_prot_cencv3_vp9_ctr" // JPEG Decoding HWDecodeJPEG = Prefix + "hw_dec_jpeg" // Video Encoding HWEncodeH264 = Prefix + "hw_enc_h264_1080_30" HWEncodeH264_4K = Prefix + "hw_enc_h264_2160_30" HWEncodeH264VBR = Prefix + "hw_enc_h264_vbr" // TODO: add here HWEncodeH264OddDimension when video.EncodeAccel has a test // exercising odd-dimension encoding. HWEncodeVP8 = Prefix + "hw_enc_vp8_1080_30" HWEncodeVP8_4K = Prefix + "hw_enc_vp8_2160_30" HWEncodeVP8OddDimension = Prefix + "hw_enc_vp8_odd_dimension" HWEncodeVP8VBR = Prefix + "hw_enc_vp8_vbr" HWEncodeVP9 = Prefix + "hw_enc_vp9_1080_30" HWEncodeVP9_4K = Prefix + "hw_enc_vp9_2160_30" HWEncodeVP9OddDimension = Prefix + "hw_enc_vp9_odd_dimension" HWEncodeVP9VBR = Prefix + "hw_enc_vp9_vbr" // JPEG Encoding HWEncodeJPEG = Prefix + "hw_enc_jpeg" // Camera BuiltinUSBCamera = Prefix + "builtin_usb_camera" BuiltinMIPICamera = Prefix + "builtin_mipi_camera" VividCamera = Prefix + "vivid_camera" BuiltinCamera = Prefix + "builtin_camera" BuiltinOrVividCamera = Prefix + "builtin_or_vivid_camera" ) // Capability bundles a capability's name and if its optional. The optional // field allows skipping the verification of a capability and is used on devices // that technically support e.g. 4K HW decoding, but don't have the static // autocaps labels set because these devices are so slow that running 4K tests // would be a huge drain on lab resources. type Capability struct { Name string // The name of the capability Optional bool // Whether the capability is optional } // ErrorReporter is used by VerifyCapabilities() to define a type where only the // Error reporting method is defined. type ErrorReporter interface { Error(args ...interface{}) Errorf(format string, args ...interface{}) } // VerifyCapabilities compares the capabilities statically defined by the // autocaps package against those detected by the avtest_label_detect command // line tool. The function logic follows the table below, essentially verifying // that a capability is detected if expected and is not detected if not expected // (either marked as "no" or not statically defined). Capabilities statically // marked as "disable", or those with Capability.Optional set are not verified. // // | Static capability | // | Yes | No / Not defined | // --------------|-------------|------------------| // Detected | OK | Fail | // Not detected | Fail | OK | // // For more information see: // /src/third_party/chromiumos-overlay/chromeos-base/autotest-capability-default/files/managed-capabilities.yaml func VerifyCapabilities(ctx context.Context, e ErrorReporter, avtestLabelToCapability map[string]Capability) error { // Get capabilities computed by autocaps package. staticCaps, err := autocaps.Read(autocaps.DefaultCapabilityDir, nil) if err != nil { return errors.Wrap(err, "failed to read statically-set capabilities") } testing.ContextLog(ctx, "Statically-set capabilities:") for c, s := range staticCaps { testing.ContextLogf(ctx, " %v: %v", c, s) } // Get capabilities detected by "avtest_label_detect" command. cmd := testexec.CommandContext(ctx, "avtest_label_detect") avOut, err := cmd.Output() if err != nil { cmd.DumpLog(ctx) return errors.Wrap(err, "failed to execute avtest_label_detect") } detectedLabelRegexp := regexp.MustCompile(`(?m)^Detected label: (.*)$`) detectedCaps := make(map[string]struct{}) for _, m := range detectedLabelRegexp.FindAllStringSubmatch(string(avOut), -1) { label := strings.TrimSpace(m[1]) if c, found := avtestLabelToCapability[label]; found { detectedCaps[stripPrefix(c.Name)] = struct{}{} } } testing.ContextLog(ctx, "avtest_label_detect result:") for c := range detectedCaps { testing.ContextLog(ctx, " ", c) } for _, c := range avtestLabelToCapability { c.Name = stripPrefix(c.Name) state, ok := staticCaps[c.Name] if !ok { // This is a smoke check: avtestLabelToCapability is using a capability // name that is unknown to autocaps. e.Errorf("static capabilities don't include %q", c.Name) continue } _, wasDetected := detectedCaps[c.Name] switch state { case autocaps.Yes: if !wasDetected { e.Errorf("%q statically set but not detected", c.Name) } case autocaps.No: if wasDetected && !c.Optional { e.Errorf("%q detected but not statically set and not optional", c.Name) } } } return nil } // stripPrefix removes Prefix from the beginning of cap. func stripPrefix(cap string) string { if !strings.HasPrefix(cap, Prefix) { panic(fmt.Sprintf("%q doesn't start with %q", cap, Prefix)) } return cap[len(Prefix):] }
package balance import ( "testing" ) func TestAnalysis(t *testing.T) { type testData struct { q []rune a map[string]int } data := []testData{ testData{ []rune("C6H12O6"), map[string]int{"C": 6, "H": 12, "O": 6}, }, testData{ []rune("Fe2O3"), map[string]int{"Fe": 2, "O": 3}, }, testData{ []rune("C2H5OH"), map[string]int{"C": 2, "H": 6, "O": 1}, }, } for _, v := range data { answer := analysis(v.q) for name, number := range v.a { if value, ok := answer[name]; ok { if value != number { t.Errorf("Answer is not equal: should %s: %d\tget %s: %d", name, number, name, value) t.Log(answer) } } else { t.Errorf("Answer is not equal: doesn't find %s", name) t.Log(answer) } } } } func TestConvEquation(t *testing.T) { q := "C2H5OH + O2 = CO2 + H2O" reactants, products := convEquation(q) if !equal(reactants, []int{4800, 9}) || !equal(products, []int{45, 12}) { t.Error("Conversion Fatal: ", reactants, products) } } func TestExport(t *testing.T) { equation := "C2H5OH + O2 = CO2 + H2O" ca, cb := []int{1, 3}, []int{2, 3} if a := export(equation, ca, cb); a != "C2H5OH + 3O2 = 2CO2 + 3H2O" { t.Error("Export fatal: ", a) } }
package main import "fmt" func main() { x := 1 y := 2 // apenas postfix x++ // x += 1 ou x = x +1 fmt.Println(x) y-- // y -= 1 ou y = y -1 fmt.Println(y) }
// Copyright 2018 The gVisor Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // // These tests are flaky when run under the go race detector due to some // iterations taking long enough that the retransmit timer can kick in causing // the congestion window measurements to fail due to extra packets etc. package tcp_noracedetector_test import ( "bytes" "fmt" "math" "os" "testing" "time" "gvisor.dev/gvisor/pkg/refs" "gvisor.dev/gvisor/pkg/tcpip" "gvisor.dev/gvisor/pkg/tcpip/header" "gvisor.dev/gvisor/pkg/tcpip/transport/tcp" "gvisor.dev/gvisor/pkg/tcpip/transport/tcp/test/e2e" "gvisor.dev/gvisor/pkg/tcpip/transport/tcp/testing/context" "gvisor.dev/gvisor/pkg/test/testutil" ) func TestFastRecovery(t *testing.T) { maxPayload := 32 c := context.New(t, uint32(header.TCPMinimumSize+header.IPv4MinimumSize+maxPayload)) defer c.Cleanup() c.CreateConnected(789, 30000, -1 /* epRcvBuf */) const iterations = 3 data := make([]byte, 2*maxPayload*(tcp.InitialCwnd<<(iterations+1))) for i := range data { data[i] = byte(i) } // Write all the data in one shot. Packets will only be written at the // MTU size though. var r bytes.Reader r.Reset(data) if _, err := c.EP.Write(&r, tcpip.WriteOptions{}); err != nil { t.Fatalf("Write failed: %s", err) } // Do slow start for a few iterations. expected := tcp.InitialCwnd bytesRead := 0 for i := 0; i < iterations; i++ { expected = tcp.InitialCwnd << uint(i) if i > 0 { // Acknowledge all the data received so far if not on // first iteration. c.SendAck(790, bytesRead) } // Read all packets expected on this iteration. Don't // acknowledge any of them just yet, so that we can measure the // congestion window. for j := 0; j < expected; j++ { c.ReceiveAndCheckPacket(data, bytesRead, maxPayload) bytesRead += maxPayload } // Check we don't receive any more packets on this iteration. // The timeout can't be too high or we'll trigger a timeout. c.CheckNoPacketTimeout("More packets received than expected for this cwnd.", 50*time.Millisecond) } // Send 3 duplicate acks. This should force an immediate retransmit of // the pending packet and put the sender into fast recovery. rtxOffset := bytesRead - maxPayload*expected for i := 0; i < 3; i++ { c.SendAck(790, rtxOffset) } // Receive the retransmitted packet. c.ReceiveAndCheckPacket(data, rtxOffset, maxPayload) // Wait before checking metrics. metricPollFn := func() error { if got, want := c.Stack().Stats().TCP.FastRetransmit.Value(), uint64(1); got != want { return fmt.Errorf("got stats.TCP.FastRetransmit.Value = %d, want = %d", got, want) } if got, want := c.Stack().Stats().TCP.Retransmits.Value(), uint64(1); got != want { return fmt.Errorf("got stats.TCP.Retransmit.Value = %d, want = %d", got, want) } if got, want := c.Stack().Stats().TCP.FastRecovery.Value(), uint64(1); got != want { return fmt.Errorf("got stats.TCP.FastRecovery.Value = %d, want = %d", got, want) } return nil } if err := testutil.Poll(metricPollFn, 1*time.Second); err != nil { t.Error(err) } // Now send 7 mode duplicate acks. Each of these should cause a window // inflation by 1 and cause the sender to send an extra packet. for i := 0; i < 7; i++ { c.SendAck(790, rtxOffset) } recover := bytesRead // Ensure no new packets arrive. c.CheckNoPacketTimeout("More packets received than expected during recovery after dupacks for this cwnd.", 50*time.Millisecond) // Acknowledge half of the pending data. rtxOffset = bytesRead - expected*maxPayload/2 c.SendAck(790, rtxOffset) // Receive the retransmit due to partial ack. c.ReceiveAndCheckPacket(data, rtxOffset, maxPayload) // Wait before checking metrics. metricPollFn = func() error { if got, want := c.Stack().Stats().TCP.FastRetransmit.Value(), uint64(2); got != want { return fmt.Errorf("got stats.TCP.FastRetransmit.Value = %d, want = %d", got, want) } if got, want := c.Stack().Stats().TCP.Retransmits.Value(), uint64(2); got != want { return fmt.Errorf("got stats.TCP.Retransmit.Value = %d, want = %d", got, want) } return nil } if err := testutil.Poll(metricPollFn, 1*time.Second); err != nil { t.Error(err) } // Receive the 10 extra packets that should have been released due to // the congestion window inflation in recovery. for i := 0; i < 10; i++ { c.ReceiveAndCheckPacket(data, bytesRead, maxPayload) bytesRead += maxPayload } // A partial ACK during recovery should reduce congestion window by the // number acked. Since we had "expected" packets outstanding before sending // partial ack and we acked expected/2 , the cwnd and outstanding should // be expected/2 + 10 (7 dupAcks + 3 for the original 3 dupacks that triggered // fast recovery). Which means the sender should not send any more packets // till we ack this one. c.CheckNoPacketTimeout("More packets received than expected during recovery after partial ack for this cwnd.", 50*time.Millisecond) // Acknowledge all pending data to recover point. c.SendAck(790, recover) // At this point, the cwnd should reset to expected/2 and there are 10 // packets outstanding. // // NOTE: Technically netstack is incorrect in that we adjust the cwnd on // the same segment that takes us out of recovery. But because of that // the actual cwnd at exit of recovery will be expected/2 + 1 as we // acked a cwnd worth of packets which will increase the cwnd further by // 1 in congestion avoidance. // // Now in the first iteration since there are 10 packets outstanding. // We would expect to get expected/2 +1 - 10 packets. But subsequent // iterations will send us expected/2 + 1 + 1 (per iteration). expected = expected/2 + 1 - 10 for i := 0; i < iterations; i++ { // Read all packets expected on this iteration. Don't // acknowledge any of them just yet, so that we can measure the // congestion window. for j := 0; j < expected; j++ { c.ReceiveAndCheckPacket(data, bytesRead, maxPayload) bytesRead += maxPayload } // Check we don't receive any more packets on this iteration. // The timeout can't be too high or we'll trigger a timeout. c.CheckNoPacketTimeout(fmt.Sprintf("More packets received(after deflation) than expected %d for this cwnd.", expected), 50*time.Millisecond) // Acknowledge all the data received so far. c.SendAck(790, bytesRead) // In cogestion avoidance, the packets trains increase by 1 in // each iteration. if i == 0 { // After the first iteration we expect to get the full // congestion window worth of packets in every // iteration. expected += 10 } expected++ } } func TestExponentialIncreaseDuringSlowStart(t *testing.T) { maxPayload := 32 c := context.New(t, uint32(header.TCPMinimumSize+header.IPv4MinimumSize+maxPayload)) defer c.Cleanup() c.CreateConnected(789, 30000, -1 /* epRcvBuf */) const iterations = 3 data := make([]byte, maxPayload*(tcp.InitialCwnd<<(iterations+1))) for i := range data { data[i] = byte(i) } // Write all the data in one shot. Packets will only be written at the // MTU size though. var r bytes.Reader r.Reset(data) if _, err := c.EP.Write(&r, tcpip.WriteOptions{}); err != nil { t.Fatalf("Write failed: %s", err) } expected := tcp.InitialCwnd bytesRead := 0 for i := 0; i < iterations; i++ { // Read all packets expected on this iteration. Don't // acknowledge any of them just yet, so that we can measure the // congestion window. for j := 0; j < expected; j++ { c.ReceiveAndCheckPacket(data, bytesRead, maxPayload) bytesRead += maxPayload } // Check we don't receive any more packets on this iteration. // The timeout can't be too high or we'll trigger a timeout. c.CheckNoPacketTimeout("More packets received than expected for this cwnd.", 50*time.Millisecond) // Acknowledge all the data received so far. c.SendAck(790, bytesRead) // Double the number of expected packets for the next iteration. expected *= 2 } } func TestCongestionAvoidance(t *testing.T) { maxPayload := 32 c := context.New(t, uint32(header.TCPMinimumSize+header.IPv4MinimumSize+maxPayload)) defer c.Cleanup() c.CreateConnected(789, 30000, -1 /* epRcvBuf */) const iterations = 3 data := make([]byte, 2*maxPayload*(tcp.InitialCwnd<<(iterations+1))) for i := range data { data[i] = byte(i) } // Write all the data in one shot. Packets will only be written at the // MTU size though. var r bytes.Reader r.Reset(data) if _, err := c.EP.Write(&r, tcpip.WriteOptions{}); err != nil { t.Fatalf("Write failed: %s", err) } // Do slow start for a few iterations. expected := tcp.InitialCwnd bytesRead := 0 for i := 0; i < iterations; i++ { expected = tcp.InitialCwnd << uint(i) if i > 0 { // Acknowledge all the data received so far if not on // first iteration. c.SendAck(790, bytesRead) } // Read all packets expected on this iteration. Don't // acknowledge any of them just yet, so that we can measure the // congestion window. for j := 0; j < expected; j++ { c.ReceiveAndCheckPacket(data, bytesRead, maxPayload) bytesRead += maxPayload } // Check we don't receive any more packets on this iteration. // The timeout can't be too high or we'll trigger a timeout. c.CheckNoPacketTimeout("More packets received than expected for this cwnd (slow start phase).", 50*time.Millisecond) } // Don't acknowledge the first packet of the last packet train. Let's // wait for them to time out, which will trigger a restart of slow // start, and initialization of ssthresh to cwnd/2. rtxOffset := bytesRead - maxPayload*expected c.ReceiveAndCheckPacket(data, rtxOffset, maxPayload) // Acknowledge all the data received so far. c.SendAck(790, bytesRead) // This part is tricky: when the timeout happened, we had "expected" // packets pending, cwnd reset to 1, and ssthresh set to expected/2. // By acknowledging "expected" packets, the slow-start part will // increase cwnd to expected/2 (which "consumes" expected/2-1 of the // acknowledgements), then the congestion avoidance part will consume // an extra expected/2 acks to take cwnd to expected/2 + 1. One ack // remains in the "ack count" (which will cause cwnd to be incremented // once it reaches cwnd acks). // // So we're straight into congestion avoidance with cwnd set to // expected/2 + 1. // // Check that packets trains of cwnd packets are sent, and that cwnd is // incremented by 1 after we acknowledge each packet. expected = expected/2 + 1 for i := 0; i < iterations; i++ { // Read all packets expected on this iteration. Don't // acknowledge any of them just yet, so that we can measure the // congestion window. for j := 0; j < expected; j++ { c.ReceiveAndCheckPacket(data, bytesRead, maxPayload) bytesRead += maxPayload } // Check we don't receive any more packets on this iteration. // The timeout can't be too high or we'll trigger a timeout. c.CheckNoPacketTimeout("More packets received than expected for this cwnd (congestion avoidance phase).", 50*time.Millisecond) // Acknowledge all the data received so far. c.SendAck(790, bytesRead) // In cogestion avoidance, the packets trains increase by 1 in // each iteration. expected++ } } // cubicCwnd returns an estimate of a cubic window given the // originalCwnd, wMax, last congestion event time and sRTT. func cubicCwnd(origCwnd int, wMax int, congEventTime time.Time, sRTT time.Duration) int { cwnd := float64(origCwnd) // We wait 50ms between each iteration so sRTT as computed by cubic // should be close to 50ms. elapsed := (time.Since(congEventTime) + sRTT).Seconds() k := math.Cbrt(float64(wMax) * 0.3 / 0.7) wtRTT := 0.4*math.Pow(elapsed-k, 3) + float64(wMax) cwnd += (wtRTT - cwnd) / cwnd return int(cwnd) } func TestCubicCongestionAvoidance(t *testing.T) { maxPayload := 32 c := context.New(t, uint32(header.TCPMinimumSize+header.IPv4MinimumSize+maxPayload)) defer c.Cleanup() e2e.EnableCUBIC(t, c) c.CreateConnected(789, 30000, -1 /* epRcvBuf */) const iterations = 3 data := make([]byte, 2*maxPayload*(tcp.InitialCwnd<<(iterations+1))) for i := range data { data[i] = byte(i) } // Write all the data in one shot. Packets will only be written at the // MTU size though. var r bytes.Reader r.Reset(data) if _, err := c.EP.Write(&r, tcpip.WriteOptions{}); err != nil { t.Fatalf("Write failed: %s", err) } // Do slow start for a few iterations. expected := tcp.InitialCwnd bytesRead := 0 for i := 0; i < iterations; i++ { expected = tcp.InitialCwnd << uint(i) if i > 0 { // Acknowledge all the data received so far if not on // first iteration. c.SendAck(790, bytesRead) } // Read all packets expected on this iteration. Don't // acknowledge any of them just yet, so that we can measure the // congestion window. for j := 0; j < expected; j++ { c.ReceiveAndCheckPacket(data, bytesRead, maxPayload) bytesRead += maxPayload } // Check we don't receive any more packets on this iteration. // The timeout can't be too high or we'll trigger a timeout. c.CheckNoPacketTimeout("More packets received than expected for this cwnd (during slow-start phase).", 50*time.Millisecond) } // Don't acknowledge the first packet of the last packet train. Let's // wait for them to time out, which will trigger a restart of slow // start, and initialization of ssthresh to cwnd * 0.7. rtxOffset := bytesRead - maxPayload*expected c.ReceiveAndCheckPacket(data, rtxOffset, maxPayload) // Acknowledge all pending data. c.SendAck(790, bytesRead) // Store away the time we sent the ACK and assuming a 200ms RTO // we estimate that the sender will have an RTO 200ms from now // and go back into slow start. packetDropTime := time.Now().Add(200 * time.Millisecond) // This part is tricky: when the timeout happened, we had "expected" // packets pending, cwnd reset to 1, and ssthresh set to expected * 0.7. // By acknowledging "expected" packets, the slow-start part will // increase cwnd to expected/2 essentially putting the connection // straight into congestion avoidance. wMax := expected // Lower expected as per cubic spec after a congestion event. expected = int(float64(expected) * 0.7) cwnd := expected for i := 0; i < iterations; i++ { // Cubic grows window independent of ACKs. Cubic Window growth // is a function of time elapsed since last congestion event. // As a result the congestion window does not grow // deterministically in response to ACKs. // // We need to roughly estimate what the cwnd of the sender is // based on when we sent the dupacks. cwnd := cubicCwnd(cwnd, wMax, packetDropTime, 50*time.Millisecond) packetsExpected := cwnd for j := 0; j < packetsExpected; j++ { c.ReceiveAndCheckPacket(data, bytesRead, maxPayload) bytesRead += maxPayload } t.Logf("expected packets received, next trying to receive any extra packets that may come") // If our estimate was correct there should be no more pending packets. // We attempt to read a packet a few times with a short sleep in between // to ensure that we don't see the sender send any unexpected packets. unexpectedPackets := 0 for { gotPacket := c.ReceiveNonBlockingAndCheckPacket(data, bytesRead, maxPayload) if !gotPacket { break } bytesRead += maxPayload unexpectedPackets++ time.Sleep(1 * time.Millisecond) } if unexpectedPackets != 0 { t.Fatalf("received %d unexpected packets for iteration %d", unexpectedPackets, i) } // Check we don't receive any more packets on this iteration. // The timeout can't be too high or we'll trigger a timeout. c.CheckNoPacketTimeout("More packets received than expected for this cwnd(congestion avoidance)", 5*time.Millisecond) // Acknowledge all the data received so far. c.SendAck(790, bytesRead) } } func TestRetransmit(t *testing.T) { maxPayload := 32 c := context.New(t, uint32(header.TCPMinimumSize+header.IPv4MinimumSize+maxPayload)) defer c.Cleanup() c.CreateConnected(789, 30000, -1 /* epRcvBuf */) const iterations = 3 data := make([]byte, maxPayload*(tcp.InitialCwnd<<(iterations+1))) for i := range data { data[i] = byte(i) } // Write all the data in two shots. Packets will only be written at the // MTU size though. var r bytes.Reader r.Reset(data[:len(data)/2]) if _, err := c.EP.Write(&r, tcpip.WriteOptions{}); err != nil { t.Fatalf("Write failed: %s", err) } r.Reset(data[len(data)/2:]) if _, err := c.EP.Write(&r, tcpip.WriteOptions{}); err != nil { t.Fatalf("Write failed: %s", err) } // Do slow start for a few iterations. expected := tcp.InitialCwnd bytesRead := 0 for i := 0; i < iterations; i++ { expected = tcp.InitialCwnd << uint(i) if i > 0 { // Acknowledge all the data received so far if not on // first iteration. c.SendAck(790, bytesRead) } // Read all packets expected on this iteration. Don't // acknowledge any of them just yet, so that we can measure the // congestion window. for j := 0; j < expected; j++ { c.ReceiveAndCheckPacket(data, bytesRead, maxPayload) bytesRead += maxPayload } // Check we don't receive any more packets on this iteration. // The timeout can't be too high or we'll trigger a timeout. c.CheckNoPacketTimeout("More packets received than expected for this cwnd.", 50*time.Millisecond) } // Wait for a timeout and retransmit. rtxOffset := bytesRead - maxPayload*expected c.ReceiveAndCheckPacket(data, rtxOffset, maxPayload) metricPollFn := func() error { if got, want := c.Stack().Stats().TCP.Timeouts.Value(), uint64(1); got != want { return fmt.Errorf("got stats.TCP.Timeouts.Value = %d, want = %d", got, want) } if got, want := c.Stack().Stats().TCP.Retransmits.Value(), uint64(1); got != want { return fmt.Errorf("got stats.TCP.Retransmits.Value = %d, want = %d", got, want) } if got, want := c.EP.Stats().(*tcp.Stats).SendErrors.Timeouts.Value(), uint64(1); got != want { return fmt.Errorf("got EP SendErrors.Timeouts.Value = %d, want = %d", got, want) } if got, want := c.EP.Stats().(*tcp.Stats).SendErrors.Retransmits.Value(), uint64(1); got != want { return fmt.Errorf("got EP stats SendErrors.Retransmits.Value = %d, want = %d", got, want) } if got, want := c.Stack().Stats().TCP.SlowStartRetransmits.Value(), uint64(1); got != want { return fmt.Errorf("got stats.TCP.SlowStartRetransmits.Value = %d, want = %d", got, want) } return nil } // Poll when checking metrics. if err := testutil.Poll(metricPollFn, 1*time.Second); err != nil { t.Error(err) } // Acknowledge half of the pending data. rtxOffset = bytesRead - expected*maxPayload/2 c.SendAck(790, rtxOffset) // Receive the remaining data, making sure that acknowledged data is not // retransmitted. for offset := rtxOffset; offset < len(data); offset += maxPayload { c.ReceiveAndCheckPacket(data, offset, maxPayload) c.SendAck(790, offset+maxPayload) } c.CheckNoPacketTimeout("More packets received than expected for this cwnd.", 50*time.Millisecond) } func TestMain(m *testing.M) { refs.SetLeakMode(refs.LeaksPanic) code := m.Run() // Allow TCP async work to complete to avoid false reports of leaks. // TODO(gvisor.dev/issue/5940): Use fake clock in tests. time.Sleep(1 * time.Second) refs.DoLeakCheck() os.Exit(code) }
/* Copyright 2020 The Tilt Dev Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package v1alpha1 import ( "context" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/validation/field" "github.com/tilt-dev/tilt-apiserver/pkg/server/builder/resource" "github.com/tilt-dev/tilt-apiserver/pkg/server/builder/resource/resourcerest" "github.com/tilt-dev/tilt-apiserver/pkg/server/builder/resource/resourcestrategy" ) // +genclient // +genclient:nonNamespaced // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // PortForward // +k8s:openapi-gen=true type PortForward struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` Spec PortForwardSpec `json:"spec,omitempty" protobuf:"bytes,2,opt,name=spec"` Status PortForwardStatus `json:"status,omitempty" protobuf:"bytes,3,opt,name=status"` } // PortForwardList // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object type PortForwardList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"` Items []PortForward `json:"items" protobuf:"bytes,2,rep,name=items"` } // PortForwardSpec defines the desired state of PortForward type PortForwardSpec struct { // The name of the pod to port forward to/from. Required. PodName string `json:"podName" protobuf:"bytes,1,opt,name=podName"` // The namespace of the pod to port forward to/from. Defaults to the kubecontext default namespace. // // +optional Namespace string `json:"namespace,omitempty" protobuf:"bytes,2,opt,name=namespace"` // One or more port forwards to execute on the given pod. Required. Forwards []Forward `json:"forwards" protobuf:"bytes,3,rep,name=forwards"` // Cluster to forward ports from to the local machine. // // If not specified, the default Kubernetes cluster will be used. // // +optional Cluster string `json:"cluster" protobuf:"bytes,4,opt,name=cluster"` } // Forward defines a port forward to execute on a given pod. type Forward struct { // The port to expose on the current machine. // // If not specified (or 0), a random free port will be chosen and can // be discovered via the status once established. // // +optional LocalPort int32 `json:"localPort,omitempty" protobuf:"varint,4,opt,name=localPort"` // The port on the Kubernetes pod to connect to. Required. ContainerPort int32 `json:"containerPort" protobuf:"varint,3,opt,name=containerPort"` // Optional host to bind to on the current machine. // // If not explicitly specified, uses the bind host of the tilt web UI (usually localhost). // // +optional Host string `json:"host" protobuf:"bytes,5,opt,name=host"` // Name to identify this port forward. // // +optional Name string `json:"name,omitempty" protobuf:"bytes,6,opt,name=name"` // Path to include as part of generated links for port forward. // // +optional Path string `json:"path,omitempty" protobuf:"bytes,7,opt,name=path"` } var _ resource.Object = &PortForward{} var _ resourcerest.SingularNameProvider = &PortForward{} var _ resourcestrategy.Validater = &PortForward{} var _ resourcerest.ShortNamesProvider = &PortForward{} func (in *PortForward) GetSingularName() string { return "portforward" } func (in *PortForward) GetObjectMeta() *metav1.ObjectMeta { return &in.ObjectMeta } func (in *PortForward) NamespaceScoped() bool { return false } func (in *PortForward) ShortNames() []string { return []string{"pf"} } func (in *PortForward) New() runtime.Object { return &PortForward{} } func (in *PortForward) NewList() runtime.Object { return &PortForwardList{} } func (in *PortForward) GetGroupVersionResource() schema.GroupVersionResource { return schema.GroupVersionResource{ Group: "tilt.dev", Version: "v1alpha1", Resource: "portforwards", } } func (in *PortForward) IsStorageVersion() bool { return true } func (in *PortForward) Validate(_ context.Context) field.ErrorList { var fieldErrors field.ErrorList if in.Spec.PodName == "" { fieldErrors = append(fieldErrors, field.Required(field.NewPath("spec.podName"), "PodName cannot be empty")) } forwardsPath := field.NewPath("spec.forwards") if len(in.Spec.Forwards) == 0 { fieldErrors = append(fieldErrors, field.Required(forwardsPath, "At least one Forward is required")) } localPorts := make(map[int32]bool) for i, f := range in.Spec.Forwards { p := forwardsPath.Index(i) localPortPath := p.Child("localPort") if f.LocalPort != 0 { // multiple forwards can have 0 as LocalPort since they will each get a unique, randomized port // there is no restriction for duplicate ContainerPorts (i.e. it's acceptable to forward the same // port multiple times as long as the LocalPort is different in each forward) if localPorts[f.LocalPort] { fieldErrors = append(fieldErrors, field.Duplicate(localPortPath, "Cannot bind more than one forward to same LocalPort")) } localPorts[f.LocalPort] = true } if f.LocalPort < 0 || f.LocalPort > 65535 { fieldErrors = append(fieldErrors, field.Invalid(localPortPath, f.LocalPort, "LocalPort must be in the range [0, 65535]")) } if f.ContainerPort <= 0 || f.ContainerPort > 65535 { fieldErrors = append(fieldErrors, field.Invalid(p.Child("containerPort"), f.ContainerPort, "ContainerPort must be in the range (0, 65535]")) } } return fieldErrors } var _ resourcestrategy.Defaulter = &PortForward{} func (in *PortForward) Default() { if in.Spec.Cluster == "" { in.Spec.Cluster = ClusterNameDefault } } var _ resource.ObjectList = &PortForwardList{} func (in *PortForwardList) GetListMeta() *metav1.ListMeta { return &in.ListMeta } // PortForwardStatus defines the observed state of PortForward type PortForwardStatus struct { ForwardStatuses []ForwardStatus `json:"forwardStatuses,omitempty" protobuf:"bytes,2,opt,name=forwardStatuses"` } type ForwardStatus struct { // LocalPort is the port bound to on the system running Tilt. LocalPort int32 `json:"localPort" protobuf:"varint,1,opt,name=localPort"` // ContainerPort is the port in the container being forwarded. ContainerPort int32 `json:"containerPort" protobuf:"varint,2,opt,name=containerPort"` // Addresses that the forwarder is bound to. // // For example, a `localhost` host will bind to 127.0.0.1 and [::1]. Addresses []string `json:"addresses" protobuf:"bytes,3,rep,name=addresses"` // StartedAt is the time at which the forward was initiated. // // If the forwarder is not running yet, this will be zero/empty. StartedAt metav1.MicroTime `json:"startedAt,omitempty" protobuf:"bytes,4,opt,name=startedAt"` // Error is a human-readable description if a problem was encountered // while initializing the forward. Error string `json:"error,omitempty" protobuf:"bytes,5,opt,name=error"` } // PortForward implements ObjectWithStatusSubResource interface. var _ resource.ObjectWithStatusSubResource = &PortForward{} func (in *PortForward) GetStatus() resource.StatusSubResource { return in.Status } // PortForwardStatus{} implements StatusSubResource interface. var _ resource.StatusSubResource = &PortForwardStatus{} func (in PortForwardStatus) CopyTo(parent resource.ObjectWithStatusSubResource) { parent.(*PortForward).Status = in }
package main import ( "fmt" "net" ) func main() { ln, err := net.Listen("tcp", ":8090") if err != nil { fmt.Println(err) } for { conn, err := ln.Accept() if err != nil { fmt.Println(err) } fmt.Println(conn) fmt.Println(&conn) } //go handleConnection(conn) }
package main import ( "os" "testing" ) func TestCreateDestinationFileStructure(t *testing.T) { config := GetTestConfig() config.Overwrite = true config.DestinationDirAbs = "./temp/testdestination/" err := CreateDestinationFileStructure(config) if err != nil { t.Errorf("Error creating the destination File Structure: %v ", err) } err = os.RemoveAll(config.DestinationDirAbs) if err != nil { //XXX silently supress that error becuase of en error in GO 1.3 and OSX 10.10 // t.Errorf("Error Cleaning up: %v. Argument: %v", err, config.DestinationDirAbs) } }
package main func main(a int) { }
package util import ( "encoding/base64" "testing" ) func TestECBDecrypt(t *testing.T) { key := []byte("04dc8389d85cb3093781ff6c6f994cd9") data := "1qXIZ5HeCS53vq6vekntsRBkPyaqd+c+282L+yNmCU6qBiLqnJyDFdwAeeM385TJ4KDD3p4EMJMdRnuU68I0tr2nO1h3NypEE0g+wxM4NKplol64MUCCX0En8OA1vRonQx1I6jV3OIXOazK2kZ7iMIc8o03YmHWKA7V5Q9Xt+5ffzcM7sNb7OJMXmYAZq74ds758bqdsZEFVJ5Bxf8wdBlRXItcsPml7z5Hm/PvfiMzhJ3NFivpAsifN7rxt4sDMKZd8ZxU32/8NKUKf+Q8M3r6WNSEdxAR4ejIXEHYpXI9iosRLOK63BJ9seewBKxd1rX8eKXwvd+UgK77UqIX+fgX+wOdEMf14phKggZtgooqiq9OD5sxkCKw1G9oQCuy+mQfaTQGaOq1RXwt7eR+IAw2RXdRdR6B6Nbv1iYFjs2RJKWdyilx3jI4iXpYrOpXcntEZ0XjUaOCalvpdLu5ITHWWkJbuaZ/3mz8+NRHJ2uuLoufYL1qYAXsTSSeF6bf5mSnKsT2b33R+YFZ2TGD3IL53UbsACdI3TFz19ewOfVpZxbdme21yaAEOCxtkahO9wU911PhEsLPSidaJiChC7HKuXTIFCnt8RukGxizQ/azbNw02f4SBK221giZR1zDArZGlb9iLSaq/uN9OvD9c7lzxdotM4sk1qExbOCYq9R1hqONKQ3wz330UDK32f7Xsww1jkGKPedvr2s+JdotbPFBpse2TfVdoOwuGQ/wPWlr3jwZP58jcNhISomuVV/mw1EgWb7JjwNNTtN/Auend/50EZdvs2EtXyrwHNYhuUajmfVorfkL/FdlVixa9EEZtZrDzBTv9L0y2XfZxu5SeO/GmnNpzoMPVFblCPAbZgvYsoZsfrM+yjlmSdLAsUnUNFQY+fL5UCPnVXG/EicwOBMp3LMs5m0janHggfAVcScYEIgNxbqs1YgYYU8URa3nn6xpe6IfOWH+yw4S88W/zHfkzOuEYDtW1RSLmrqRcSlPFO4Eii+52UHqB8CNGIkvFXjI0uhnm3fB8WFACIx+za2CTZkMCSF/3KkEOKtt6+UPPqV8jk4DkG/aCqnfio8Vu" data1, _ := base64.StdEncoding.DecodeString(data) // tool := NewAesTool(key, 16) r, err := ECBDecrypt(data1, key) // r, err := tool.Decrypt(data1) t.Log(string(r), err) }
// Copyright 2020 Red Hat, Inc. and/or its affiliates // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package service import ( "github.com/kiegroup/kogito-operator/apis" "github.com/kiegroup/kogito-operator/apis/app/v1beta1" "github.com/kiegroup/kogito-operator/cmd/kogito/command/context" "github.com/kiegroup/kogito-operator/cmd/kogito/command/converter" "github.com/kiegroup/kogito-operator/cmd/kogito/command/flag" "github.com/kiegroup/kogito-operator/cmd/kogito/command/message" "github.com/kiegroup/kogito-operator/cmd/kogito/command/shared" "github.com/kiegroup/kogito-operator/cmd/kogito/command/util" "github.com/kiegroup/kogito-operator/core/client" "github.com/kiegroup/kogito-operator/core/client/kubernetes" "github.com/kiegroup/kogito-operator/core/logger" "github.com/kiegroup/kogito-operator/core/manager" "github.com/kiegroup/kogito-operator/core/operator" "github.com/kiegroup/kogito-operator/internal/app" "github.com/kiegroup/kogito-operator/meta" "k8s.io/apimachinery/pkg/apis/meta/v1" ) // RuntimeService is interface to perform Kogito Runtime type RuntimeService interface { InstallRuntimeService(cli *client.Client, flags *flag.RuntimeFlags) (err error) DeleteRuntimeService(cli *client.Client, name, project string) (err error) } type runtimeService struct { resourceCheckService shared.ResourceCheckService } // NewRuntimeService create and return runtimeService value func NewRuntimeService() RuntimeService { return runtimeService{ resourceCheckService: shared.NewResourceCheckService(), } } // InstallRuntimeService install Kogito runtime service func (i runtimeService) InstallRuntimeService(cli *client.Client, flags *flag.RuntimeFlags) (err error) { log := context.GetDefaultLogger() log.Debugf("Installing Kogito Runtime : %s", flags.Name) configMap, err := converter.CreateConfigMapFromFile(cli, flags.Name, flags.Project, &flags.ConfigFlags) if err != nil { return err } kogitoRuntime := v1beta1.KogitoRuntime{ ObjectMeta: v1.ObjectMeta{ Name: flags.Name, Namespace: flags.Project, }, Spec: v1beta1.KogitoRuntimeSpec{ EnableIstio: flags.EnableIstio, Runtime: converter.FromRuntimeFlagsToRuntimeType(&flags.RuntimeTypeFlags), KogitoServiceSpec: v1beta1.KogitoServiceSpec{ Replicas: &flags.Replicas, Env: converter.FromStringArrayToEnvs(flags.Env, flags.SecretEnv), Image: flags.ImageFlags.Image, Resources: converter.FromPodResourceFlagsToResourceRequirement(&flags.PodResourceFlags), ServiceLabels: util.FromStringsKeyPairToMap(flags.ServiceLabels), InsecureImageRegistry: flags.ImageFlags.InsecureImageRegistry, PropertiesConfigMap: configMap, Infra: flags.Infra, Monitoring: converter.FromMonitoringFlagToMonitoring(&flags.MonitoringFlags), Config: converter.FromConfigFlagsToMap(&flags.ConfigFlags), Probes: converter.FromProbeFlagToKogitoProbe(&flags.ProbeFlags), TrustStoreSecret: flags.TrustStoreSecret, }, }, } log.Debugf("Trying to deploy Kogito Service '%s'", kogitoRuntime.Name) // Create the Kogito application err = shared. ServicesInstallationBuilder(cli, flags.Project). CheckOperatorCRDs(). InstallRuntimeService(&kogitoRuntime). GetError() if err != nil { return err } return printMgmtConsoleInfo(cli, flags.Project) } func printMgmtConsoleInfo(client *client.Client, project string) error { log := context.GetDefaultLogger() context := operator.Context{ Client: client, Log: logger.GetLogger("deploy_runtime"), Scheme: meta.GetRegisteredSchema(), } supportingServiceHandler := app.NewKogitoSupportingServiceHandler(context) supportingServiceManager := manager.NewKogitoSupportingServiceManager(context, supportingServiceHandler) route, err := supportingServiceManager.FetchKogitoSupportingServiceRoute(project, api.MgmtConsole) if err != nil { return err } if len(route) == 0 { log.Info(message.RuntimeServiceMgmtConsole) } else { log.Infof(message.RuntimeServiceMgmtConsoleEndpoint, route) } return nil } // DeleteRuntimeService delete Kogito runtime service func (i runtimeService) DeleteRuntimeService(cli *client.Client, name, project string) (err error) { log := context.GetDefaultLogger() if err := i.resourceCheckService.CheckKogitoRuntimeExists(cli, name, project); err != nil { return err } log.Debugf("About to delete service %s in namespace %s", name, project) if err := kubernetes.ResourceC(cli).Delete(&v1beta1.KogitoRuntime{ ObjectMeta: v1.ObjectMeta{ Name: name, Namespace: project, }, }); err != nil { return err } log.Infof("Successfully deleted Kogito Service %s in the Project %s", name, project) return nil }
package main import ( "log" "time" "context" "fmt" "net/http" ) func main() { uri := "https://httpbin.org/delay/3" req, err := http.NewRequest("GET", uri, nil) if err != nil { fmt.Println(err) } ctx, cancel := context.WithTimeout(context.Background(), time.Microsecond * 100) defer cancel() req = req.WithContext(ctx) resp, err := http.DefaultClient.Do(req) if err != nil{ log.Fatalf("%s", err) } defer resp.Body.Close() }
package main import ( "encoding/json" "fmt" ) type Book struct { Name string `json:"name"` Page int `json:page` Price float32 `json:price` } func main() { book := Book{"go in actin", 345, 99.99} jsonStr, err := json.Marshal(book) if err != nil { fmt.Println("json marshal error", err) return } fmt.Printf("jsonStr = %s\n", jsonStr) myBook := Book{} json.Unmarshal(jsonStr, myBook) if err != nil { fmt.Println("json unmarshal error ", err) return } fmt.Printf("%v\n", myBook) }
// Package openapi contains data structures for Swagger v2.0. // // We use these data structures to compare the API specification we // have here with the one of the server. package openapi // Schema is the schema of a specific parameter or // or the schema used by the response body type Schema struct { Properties map[string]*Schema `json:"properties,omitempty"` Items *Schema `json:"items,omitempty"` Type string `json:"type"` } // Parameter describes an input parameter, which could be in the // URL path, in the query string, or in the request body type Parameter struct { In string `json:"in"` Name string `json:"name"` Required bool `json:"required,omitempty"` Schema *Schema `json:"schema,omitempty"` Type string `json:"type,omitempty"` } // Body describes a response body type Body struct { Description interface{} `json:"description,omitempty"` Schema *Schema `json:"schema"` } // Responses describes the possible responses type Responses struct { Successful Body `json:"200"` } // RoundTrip describes an HTTP round trip with a given method and path type RoundTrip struct { Consumes []string `json:"consumes,omitempty"` Produces []string `json:"produces,omitempty"` Parameters []*Parameter `json:"parameters,omitempty"` Responses *Responses `json:"responses,omitempty"` } // Path describes a path served by the API type Path struct { Get *RoundTrip `json:"get,omitempty"` Post *RoundTrip `json:"post,omitempty"` } // API contains info about the API type API struct { Title string `json:"title"` Version string `json:"version"` } // Swagger is the toplevel structure type Swagger struct { Swagger string `json:"swagger"` Info API `json:"info"` Host string `json:"host"` BasePath string `json:"basePath"` Schemes []string `json:"schemes"` Paths map[string]*Path `json:"paths"` }
/* * @lc app=leetcode.cn id=131 lang=golang * * [131] 分割回文串 * * https://leetcode-cn.com/problems/palindrome-partitioning/description/ * * algorithms * Medium (61.94%) * Total Accepted: 3.7K * Total Submissions: 6K * Testcase Example: '"aab"' * * 给定一个字符串 s,将 s 分割成一些子串,使每个子串都是回文串。 * * 返回 s 所有可能的分割方案。 * * 示例: * * 输入: "aab" * 输出: * [ * ⁠ ["aa","b"], * ⁠ ["a","a","b"] * ] * */ // s 为回文,则返回 true func par(s string) bool { if len(s) <= 1 { return true } a, b := 0, len(s)-1 for a < b { if s[a] != s[b] { return false } a++ b-- } return true } func dfs(s string, i int, cur []string, result *[][]string) { if i == len(s) { //分割索引到达了结尾,一次划分结束 tmp := make([]string, len(cur)) copy(tmp, cur) *result = append(*result, tmp) return } for j := i; j < len(s); j++ { if par(s[i : j+1]) { dfs(s, j+1, append(cur, s[i:j+1]), result) } } } func partition(s string) [][]string { res := [][]string{} cur := make([]string, 0, len(s)) dfs(s, 0, cur, &res) return res }
package node_checker import ( "github.com/SkycoinPro/skywire-services-uptime/src/database/postgres" "time" "github.com/jinzhu/gorm" log "github.com/sirupsen/logrus" ) // store is node-checker related interface for dealing with database operations type store interface { findNodes() ([]Node, error) findNode(key string) (Node, error) createNode(node *Node) error updateUptime(uptime *Uptime) error createUptime(uptime *Uptime) error updateNodeOnlineStatus(node *Node, status bool, currentTime time.Time) error updateAllNodesOnlineStatus(currentTime time.Time) error getLastUptimeForNode(nodeKey string) (Uptime, error) createMonthlyUptime(monthlyUptime *MonthlyUptime) error } // data implements store interface which uses GORM library type data struct { db *gorm.DB } func DefaultData() data { return NewData(postgres.DB) } func NewData(database *gorm.DB) data { return data{ db: database, } } func (u data) getLastUptimeForNode(nodeKey string) (Uptime, error) { var ( uptime Uptime dbError error ) record := u.db.Where("node_id = ?", nodeKey).Last(&uptime) if record.RecordNotFound() { return Uptime{}, errCannotLoadDataFromDatabase } if errs := record.GetErrors(); len(errs) > 0 { for _, err := range errs { dbError = err log.Errorf("Error occurred while fetching uptime by key %v - %v", nodeKey, err) } return Uptime{}, dbError } return uptime, nil } func (u data) createUptime(uptime *Uptime) error { db := u.db.Begin() var dbError error for _, err := range db.Create(uptime).GetErrors() { dbError = err log.Error("Error while creating new uptime in DB %v", err) } if dbError != nil { db.Rollback() return dbError } db.Commit() return nil } func (u data) updateUptime(uptime *Uptime) error { db := u.db var dbError error for _, err := range db.Model(&uptime).Update("StartTime", uptime.StartTime).GetErrors() { dbError = err log.Error("Error while updating uptime in DB ", err) } if dbError != nil { return dbError } return nil } func (u data) updateNodeOnlineStatus(node *Node, status bool, currentTime time.Time) error { db := u.db.Begin() var dbError error for _, err := range db.Model(&node).UpdateColumns(Node{Online: status, LastCheck: currentTime, UpdatedAt: time.Now()}).GetErrors() { dbError = err log.Error("Error while updating node in DB ", err) } if dbError != nil { db.Rollback() return dbError } db.Commit() return nil } func (u data) createNode(node *Node) error { db := u.db.Begin() var dbError error for _, err := range db.Create(node).GetErrors() { dbError = err log.Error("Error while creating new node in DB ", err) } if dbError != nil { db.Rollback() return dbError } db.Commit() return nil } func (u data) findNodes() ([]Node, error) { var ( nodes []Node dbError error ) record := u.db.Order("key ASC").Find(&nodes) if record.RecordNotFound() { return nil, errCannotLoadDataFromDatabase } if errs := record.GetErrors(); len(errs) > 0 { for _, err := range errs { dbError = err log.Error("Error occurred while fetching nodes - ", err) } return nil, dbError } return nodes, nil } func (u data) findNode(key string) (Node, error) { var ( node Node dbError error ) record := u.db.Where("key = ?", key).Preload("MonthlyUptimes", func(db *gorm.DB) *gorm.DB { return db.Order("Monthly_Uptimes.id ASC") }).Preload("Uptimes", func(db *gorm.DB) *gorm.DB { return db.Order("Uptimes.id ASC") }).Find(&node) if record.RecordNotFound() { return Node{}, errCannotLoadDataFromDatabase } if errs := record.GetErrors(); len(errs) > 0 { for _, err := range errs { dbError = err log.Errorf("Error occurred while fetching node by key %v - %v", key, err) } return Node{}, dbError } return node, nil } func (u data) updateAllNodesOnlineStatus(currentTime time.Time) error { db := u.db.Begin() var dbError error for _, err := range db.Exec("UPDATE nodes set online=? where online=? and last_check < ?;", false, true, currentTime).GetErrors() { dbError = err log.Error("Error while updating nodes online status: ", err) } if dbError != nil { db.Rollback() return dbError } db.Commit() return nil } func (u data) createMonthlyUptime(monthlyUptime *MonthlyUptime) error { db := u.db.Begin() var dbError error for _, err := range db.Create(monthlyUptime).GetErrors() { dbError = err log.Error("Error while creating new monthly uptime in DB ", err) } if dbError != nil { db.Rollback() return dbError } db.Commit() return nil }
package model type Ewei_shop_live_goods_option struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Goodsid int `orm:"goodsid" json:"goodsid"` Optionid int `orm:"optionid" json:"optionid"` Liveid int `orm:"liveid" json:"liveid"` Liveprice float64 `orm:"liveprice" json:"liveprice"` } func (*Ewei_shop_live_goods_option) TableName() string { return "ewei_shop_live_goods_option" } type Ewei_shop_poster_scan struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Posterid int `orm:"posterid" json:"posterid"` Openid string `orm:"openid" json:"openid"` FromOpenid string `orm:"from_openid" json:"from_openid"` Scantime int `orm:"scantime" json:"scantime"` } func (*Ewei_shop_poster_scan) TableName() string { return "ewei_shop_poster_scan" } type Ewei_shop_quick_adv struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Merchid int `orm:"merchid" json:"merchid"` Advname string `orm:"advname" json:"advname"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` } func (*Ewei_shop_quick_adv) TableName() string { return "ewei_shop_quick_adv" } type Ewei_shop_task_extension struct { Id int `orm:"id" json:"id"` Taskname string `orm:"taskname" json:"taskname"` Taskclass string `orm:"taskclass" json:"taskclass"` Status int `orm:"status" json:"status"` Classify string `orm:"classify" json:"classify"` ClassifyName string `orm:"classify_name" json:"classify_name"` Verb string `orm:"verb" json:"verb"` Unit string `orm:"unit" json:"unit"` } func (*Ewei_shop_task_extension) TableName() string { return "ewei_shop_task_extension" } type Mc_mapping_ucenter struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Uid int `orm:"uid" json:"uid"` Centeruid int `orm:"centeruid" json:"centeruid"` } func (*Mc_mapping_ucenter) TableName() string { return "mc_mapping_ucenter" } type Rule_keyword struct { Id int `orm:"id" json:"id"` Rid int `orm:"rid" json:"rid"` Uniacid int `orm:"uniacid" json:"uniacid"` Module string `orm:"module" json:"module"` Content string `orm:"content" json:"content"` Type int `orm:"type" json:"type"` Displayorder int `orm:"displayorder" json:"displayorder"` Status int `orm:"status" json:"status"` } func (*Rule_keyword) TableName() string { return "rule_keyword" } type Stat_msg_history struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Rid int `orm:"rid" json:"rid"` Kid int `orm:"kid" json:"kid"` FromUser string `orm:"from_user" json:"from_user"` Module string `orm:"module" json:"module"` Message string `orm:"message" json:"message"` Type string `orm:"type" json:"type"` Createtime int `orm:"createtime" json:"createtime"` } func (*Stat_msg_history) TableName() string { return "stat_msg_history" } type Users_permission struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Uid int `orm:"uid" json:"uid"` Type string `orm:"type" json:"type"` Permission string `orm:"permission" json:"permission"` Url string `orm:"url" json:"url"` } func (*Users_permission) TableName() string { return "users_permission" } type Wxapp_versions struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Multiid int `orm:"multiid" json:"multiid"` Version string `orm:"version" json:"version"` Description string `orm:"description" json:"description"` Modules string `orm:"modules" json:"modules"` DesignMethod int `orm:"design_method" json:"design_method"` Template int `orm:"template" json:"template"` Quickmenu string `orm:"quickmenu" json:"quickmenu"` Createtime int `orm:"createtime" json:"createtime"` Redirect string `orm:"redirect" json:"redirect"` Connection string `orm:"connection" json:"connection"` Type int `orm:"type" json:"type"` EntryId int `orm:"entry_id" json:"entry_id"` Appjson string `orm:"appjson" json:"appjson"` DefaultAppjson string `orm:"default_appjson" json:"default_appjson"` UseDefault int `orm:"use_default" json:"use_default"` } func (*Wxapp_versions) TableName() string { return "wxapp_versions" } type Ewei_shop_area_config struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` NewArea int `orm:"new_area" json:"new_area"` AddressStreet int `orm:"address_street" json:"address_street"` Createtime int `orm:"createtime" json:"createtime"` } func (*Ewei_shop_area_config) TableName() string { return "ewei_shop_area_config" } type Ewei_shop_bargain_actor struct { Id int `orm:"id" json:"id"` GoodsId int `orm:"goods_id" json:"goods_id"` NowPrice float64 `orm:"now_price" json:"now_price"` CreatedTime string `orm:"created_time" json:"created_time"` UpdateTime string `orm:"update_time" json:"update_time"` BargainTimes int `orm:"bargain_times" json:"bargain_times"` Openid string `orm:"openid" json:"openid"` Nickname string `orm:"nickname" json:"nickname"` HeadImage string `orm:"head_image" json:"head_image"` BargainPrice float64 `orm:"bargain_price" json:"bargain_price"` Status int `orm:"status" json:"status"` AccountId int `orm:"account_id" json:"account_id"` Initiate int `orm:"initiate" json:"initiate"` Order int `orm:"order" json:"order"` } func (*Ewei_shop_bargain_actor) TableName() string { return "ewei_shop_bargain_actor" } type Ewei_shop_task_record struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Taskid int `orm:"taskid" json:"taskid"` Tasktitle string `orm:"tasktitle" json:"tasktitle"` Taskimage string `orm:"taskimage" json:"taskimage"` Tasktype string `orm:"tasktype" json:"tasktype"` TaskProgress int `orm:"task_progress" json:"task_progress"` TaskDemand int `orm:"task_demand" json:"task_demand"` Openid string `orm:"openid" json:"openid"` Nickname string `orm:"nickname" json:"nickname"` Picktime string `orm:"picktime" json:"picktime"` Stoptime string `orm:"stoptime" json:"stoptime"` Finishtime string `orm:"finishtime" json:"finishtime"` RewardData string `orm:"reward_data" json:"reward_data"` FollowrewardData string `orm:"followreward_data" json:"followreward_data"` DesignData string `orm:"design_data" json:"design_data"` DesignBg string `orm:"design_bg" json:"design_bg"` RequireGoods string `orm:"require_goods" json:"require_goods"` Level1 int `orm:"level1" json:"level1"` RewardData1 string `orm:"reward_data1" json:"reward_data1"` Level2 int `orm:"level2" json:"level2"` RewardData2 string `orm:"reward_data2" json:"reward_data2"` MemberGroup string `orm:"member_group" json:"member_group"` AutoPick int `orm:"auto_pick" json:"auto_pick"` } func (*Ewei_shop_task_record) TableName() string { return "ewei_shop_task_record" } type Uni_account_menus struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Menuid int `orm:"menuid" json:"menuid"` Type int `orm:"type" json:"type"` Title string `orm:"title" json:"title"` Sex int `orm:"sex" json:"sex"` GroupId int `orm:"group_id" json:"group_id"` ClientPlatformType int `orm:"client_platform_type" json:"client_platform_type"` Area string `orm:"area" json:"area"` Data string `orm:"data" json:"data"` Status int `orm:"status" json:"status"` Createtime int `orm:"createtime" json:"createtime"` Isdeleted int `orm:"isdeleted" json:"isdeleted"` } func (*Uni_account_menus) TableName() string { return "uni_account_menus" } type Ewei_shop_commission_log struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Applyid int `orm:"applyid" json:"applyid"` Mid int `orm:"mid" json:"mid"` Commission float64 `orm:"commission" json:"commission"` Createtime int `orm:"createtime" json:"createtime"` CommissionPay float64 `orm:"commission_pay" json:"commission_pay"` Realmoney float64 `orm:"realmoney" json:"realmoney"` Charge float64 `orm:"charge" json:"charge"` Deductionmoney float64 `orm:"deductionmoney" json:"deductionmoney"` Type int `orm:"type" json:"type"` } func (*Ewei_shop_commission_log) TableName() string { return "ewei_shop_commission_log" } type Ewei_shop_member_level struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Level int `orm:"level" json:"level"` Levelname string `orm:"levelname" json:"levelname"` Ordermoney float64 `orm:"ordermoney" json:"ordermoney"` Ordercount int `orm:"ordercount" json:"ordercount"` Discount float64 `orm:"discount" json:"discount"` Enabled int `orm:"enabled" json:"enabled"` Enabledadd int `orm:"enabledadd" json:"enabledadd"` Buygoods int `orm:"buygoods" json:"buygoods"` Goodsids string `orm:"goodsids" json:"goodsids"` } func (*Ewei_shop_member_level) TableName() string { return "ewei_shop_member_level" } type Ewei_shop_quick_cart struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Quickid int `orm:"quickid" json:"quickid"` Openid string `orm:"openid" json:"openid"` Goodsid int `orm:"goodsid" json:"goodsid"` Total int `orm:"total" json:"total"` Marketprice float64 `orm:"marketprice" json:"marketprice"` Deleted int `orm:"deleted" json:"deleted"` Optionid int `orm:"optionid" json:"optionid"` Createtime int `orm:"createtime" json:"createtime"` Diyformdataid int `orm:"diyformdataid" json:"diyformdataid"` Diyformdata string `orm:"diyformdata" json:"diyformdata"` Diyformfields string `orm:"diyformfields" json:"diyformfields"` Diyformid int `orm:"diyformid" json:"diyformid"` Selected int `orm:"selected" json:"selected"` Merchid int `orm:"merchid" json:"merchid"` Selectedadd int `orm:"selectedadd" json:"selectedadd"` } func (*Ewei_shop_quick_cart) TableName() string { return "ewei_shop_quick_cart" } type Ewei_shop_system_link struct { Id int `orm:"id" json:"id"` Name string `orm:"name" json:"name"` Url string `orm:"url" json:"url"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_system_link) TableName() string { return "ewei_shop_system_link" } type Site_slide struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Multiid int `orm:"multiid" json:"multiid"` Title string `orm:"title" json:"title"` Url string `orm:"url" json:"url"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` } func (*Site_slide) TableName() string { return "site_slide" } type Stat_rule struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Rid int `orm:"rid" json:"rid"` Hit int `orm:"hit" json:"hit"` Lastupdate int `orm:"lastupdate" json:"lastupdate"` Createtime int `orm:"createtime" json:"createtime"` } func (*Stat_rule) TableName() string { return "stat_rule" } type Ewei_shop_globonus_billo struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Billid int `orm:"billid" json:"billid"` Orderid int `orm:"orderid" json:"orderid"` Ordermoney float64 `orm:"ordermoney" json:"ordermoney"` } func (*Ewei_shop_globonus_billo) TableName() string { return "ewei_shop_globonus_billo" } type Ewei_shop_postera_qr struct { Id int `orm:"id" json:"id"` Acid int `orm:"acid" json:"acid"` Openid string `orm:"openid" json:"openid"` Posterid int `orm:"posterid" json:"posterid"` Type int `orm:"type" json:"type"` Sceneid int `orm:"sceneid" json:"sceneid"` Mediaid string `orm:"mediaid" json:"mediaid"` Ticket string `orm:"ticket" json:"ticket"` Url string `orm:"url" json:"url"` Createtime int `orm:"createtime" json:"createtime"` Goodsid int `orm:"goodsid" json:"goodsid"` Qrimg string `orm:"qrimg" json:"qrimg"` Expire int `orm:"expire" json:"expire"` Endtime int `orm:"endtime" json:"endtime"` Qrtime string `orm:"qrtime" json:"qrtime"` } func (*Ewei_shop_postera_qr) TableName() string { return "ewei_shop_postera_qr" } type Site_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Nid int `orm:"nid" json:"nid"` Name string `orm:"name" json:"name"` Parentid int `orm:"parentid" json:"parentid"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` Icon string `orm:"icon" json:"icon"` Description string `orm:"description" json:"description"` Styleid int `orm:"styleid" json:"styleid"` Linkurl string `orm:"linkurl" json:"linkurl"` Ishomepage int `orm:"ishomepage" json:"ishomepage"` Icontype int `orm:"icontype" json:"icontype"` Css string `orm:"css" json:"css"` Multiid int `orm:"multiid" json:"multiid"` } func (*Site_category) TableName() string { return "site_category" } type Uni_account struct { Uniacid int `orm:"uniacid" json:"uniacid"` Groupid int `orm:"groupid" json:"groupid"` Name string `orm:"name" json:"name"` Description string `orm:"description" json:"description"` DefaultAcid int `orm:"default_acid" json:"default_acid"` Rank int `orm:"rank" json:"rank"` TitleInitial string `orm:"title_initial" json:"title_initial"` } func (*Uni_account) TableName() string { return "uni_account" } type Uni_account_group struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Groupid int `orm:"groupid" json:"groupid"` } func (*Uni_account_group) TableName() string { return "uni_account_group" } type Ewei_shop_adv struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Advname string `orm:"advname" json:"advname"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` Shopid int `orm:"shopid" json:"shopid"` Iswxapp int `orm:"iswxapp" json:"iswxapp"` } func (*Ewei_shop_adv) TableName() string { return "ewei_shop_adv" } type Ewei_shop_system_plugingrant_adv struct { Id int `orm:"id" json:"id"` Advname string `orm:"advname" json:"advname"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` } func (*Ewei_shop_system_plugingrant_adv) TableName() string { return "ewei_shop_system_plugingrant_adv" } type Ewei_shop_system_setting struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Background string `orm:"background" json:"background"` Casebanner string `orm:"casebanner" json:"casebanner"` Contact string `orm:"contact" json:"contact"` } func (*Ewei_shop_system_setting) TableName() string { return "ewei_shop_system_setting" } type Ewei_shop_virtual_data struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Typeid int `orm:"typeid" json:"typeid"` Pvalue string `orm:"pvalue" json:"pvalue"` Fields string `orm:"fields" json:"fields"` Openid string `orm:"openid" json:"openid"` Usetime int `orm:"usetime" json:"usetime"` Orderid int `orm:"orderid" json:"orderid"` Ordersn string `orm:"ordersn" json:"ordersn"` Price float64 `orm:"price" json:"price"` Merchid int `orm:"merchid" json:"merchid"` Createtime int `orm:"createtime" json:"createtime"` } func (*Ewei_shop_virtual_data) TableName() string { return "ewei_shop_virtual_data" } type Voice_reply struct { Id int `orm:"id" json:"id"` Rid int `orm:"rid" json:"rid"` Title string `orm:"title" json:"title"` Mediaid string `orm:"mediaid" json:"mediaid"` Createtime int `orm:"createtime" json:"createtime"` } func (*Voice_reply) TableName() string { return "voice_reply" } type Account_wxapp struct { Acid int `orm:"acid" json:"acid"` Uniacid int `orm:"uniacid" json:"uniacid"` Token string `orm:"token" json:"token"` Encodingaeskey string `orm:"encodingaeskey" json:"encodingaeskey"` Level int `orm:"level" json:"level"` Account string `orm:"account" json:"account"` Original string `orm:"original" json:"original"` Key string `orm:"key" json:"key"` Secret string `orm:"secret" json:"secret"` Name string `orm:"name" json:"name"` Appdomain string `orm:"appdomain" json:"appdomain"` } func (*Account_wxapp) TableName() string { return "account_wxapp" } type Ewei_shop_banner struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Bannername string `orm:"bannername" json:"bannername"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` Shopid int `orm:"shopid" json:"shopid"` Iswxapp int `orm:"iswxapp" json:"iswxapp"` } func (*Ewei_shop_banner) TableName() string { return "ewei_shop_banner" } type Ewei_shop_sendticket struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Cpid string `orm:"cpid" json:"cpid"` Expiration int `orm:"expiration" json:"expiration"` Starttime int `orm:"starttime" json:"starttime"` Endtime int `orm:"endtime" json:"endtime"` Status int `orm:"status" json:"status"` Createtime int `orm:"createtime" json:"createtime"` Title string `orm:"title" json:"title"` } func (*Ewei_shop_sendticket) TableName() string { return "ewei_shop_sendticket" } type Activity_stores struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` BusinessName string `orm:"business_name" json:"business_name"` BranchName string `orm:"branch_name" json:"branch_name"` Category string `orm:"category" json:"category"` Province string `orm:"province" json:"province"` City string `orm:"city" json:"city"` District string `orm:"district" json:"district"` Address string `orm:"address" json:"address"` Longitude string `orm:"longitude" json:"longitude"` Latitude string `orm:"latitude" json:"latitude"` Telephone string `orm:"telephone" json:"telephone"` PhotoList string `orm:"photo_list" json:"photo_list"` AvgPrice int `orm:"avg_price" json:"avg_price"` Recommend string `orm:"recommend" json:"recommend"` Special string `orm:"special" json:"special"` Introduction string `orm:"introduction" json:"introduction"` OpenTime string `orm:"open_time" json:"open_time"` LocationId int `orm:"location_id" json:"location_id"` Status int `orm:"status" json:"status"` Source int `orm:"source" json:"source"` Message string `orm:"message" json:"message"` } func (*Activity_stores) TableName() string { return "activity_stores" } type Ewei_message_mass_template struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Title string `orm:"title" json:"title"` TemplateId string `orm:"template_id" json:"template_id"` First string `orm:"first" json:"first"` Firstcolor string `orm:"firstcolor" json:"firstcolor"` Data string `orm:"data" json:"data"` Remark string `orm:"remark" json:"remark"` Remarkcolor string `orm:"remarkcolor" json:"remarkcolor"` Url string `orm:"url" json:"url"` Createtime int `orm:"createtime" json:"createtime"` Sendtimes int `orm:"sendtimes" json:"sendtimes"` Sendcount int `orm:"sendcount" json:"sendcount"` Miniprogram int `orm:"miniprogram" json:"miniprogram"` Appid string `orm:"appid" json:"appid"` Pagepath string `orm:"pagepath" json:"pagepath"` } func (*Ewei_message_mass_template) TableName() string { return "ewei_message_mass_template" } type Ewei_shop_article_report struct { Id int `orm:"id" json:"id"` Mid int `orm:"mid" json:"mid"` Openid string `orm:"openid" json:"openid"` Aid int `orm:"aid" json:"aid"` Cate string `orm:"cate" json:"cate"` Cons string `orm:"cons" json:"cons"` Uniacid int `orm:"uniacid" json:"uniacid"` } func (*Ewei_shop_article_report) TableName() string { return "ewei_shop_article_report" } type Ewei_shop_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Thumb string `orm:"thumb" json:"thumb"` Parentid int `orm:"parentid" json:"parentid"` Isrecommand int `orm:"isrecommand" json:"isrecommand"` Description string `orm:"description" json:"description"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` Ishome int `orm:"ishome" json:"ishome"` Advimg string `orm:"advimg" json:"advimg"` Advurl string `orm:"advurl" json:"advurl"` Level int `orm:"level" json:"level"` } func (*Ewei_shop_category) TableName() string { return "ewei_shop_category" } type Ewei_shop_goods_comment struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Goodsid int `orm:"goodsid" json:"goodsid"` Openid string `orm:"openid" json:"openid"` Nickname string `orm:"nickname" json:"nickname"` Headimgurl string `orm:"headimgurl" json:"headimgurl"` Content string `orm:"content" json:"content"` Createtime int `orm:"createtime" json:"createtime"` } func (*Ewei_shop_goods_comment) TableName() string { return "ewei_shop_goods_comment" } type Ewei_shop_system_plugingrant_plugin struct { Id int `orm:"id" json:"id"` Pluginid int `orm:"pluginid" json:"pluginid"` Thumb string `orm:"thumb" json:"thumb"` Data string `orm:"data" json:"data"` State int `orm:"state" json:"state"` Content string `orm:"content" json:"content"` Sales int `orm:"sales" json:"sales"` Createtime int `orm:"createtime" json:"createtime"` Displayorder int `orm:"displayorder" json:"displayorder"` Plugintype int `orm:"plugintype" json:"plugintype"` Name string `orm:"name" json:"name"` } func (*Ewei_shop_system_plugingrant_plugin) TableName() string { return "ewei_shop_system_plugingrant_plugin" } type Ewei_shop_task_log struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` FromOpenid string `orm:"from_openid" json:"from_openid"` JoinId int `orm:"join_id" json:"join_id"` Taskid int `orm:"taskid" json:"taskid"` TaskType int `orm:"task_type" json:"task_type"` Subdata string `orm:"subdata" json:"subdata"` Recdata string `orm:"recdata" json:"recdata"` Createtime int `orm:"createtime" json:"createtime"` } func (*Ewei_shop_task_log) TableName() string { return "ewei_shop_task_log" } type Uni_account_users struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Uid int `orm:"uid" json:"uid"` Role string `orm:"role" json:"role"` Rank int `orm:"rank" json:"rank"` } func (*Uni_account_users) TableName() string { return "uni_account_users" } type Core_cron struct { Id int `orm:"id" json:"id"` Cloudid int `orm:"cloudid" json:"cloudid"` Module string `orm:"module" json:"module"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Name string `orm:"name" json:"name"` Filename string `orm:"filename" json:"filename"` Lastruntime int `orm:"lastruntime" json:"lastruntime"` Nextruntime int `orm:"nextruntime" json:"nextruntime"` Weekday int `orm:"weekday" json:"weekday"` Day int `orm:"day" json:"day"` Hour int `orm:"hour" json:"hour"` Minute string `orm:"minute" json:"minute"` Extra string `orm:"extra" json:"extra"` Status int `orm:"status" json:"status"` Createtime int `orm:"createtime" json:"createtime"` } func (*Core_cron) TableName() string { return "core_cron" } type Ewei_shop_diypage_plu struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Status int `orm:"status" json:"status"` Name string `orm:"name" json:"name"` Data string `orm:"data" json:"data"` Createtime int `orm:"createtime" json:"createtime"` Lastedittime int `orm:"lastedittime" json:"lastedittime"` Merch int `orm:"merch" json:"merch"` } func (*Ewei_shop_diypage_plu) TableName() string { return "ewei_shop_diypage_plu" } type Ewei_shop_system_category struct { Id int `orm:"id" json:"id"` Name string `orm:"name" json:"name"` Displayorder int `orm:"displayorder" json:"displayorder"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_system_category) TableName() string { return "ewei_shop_system_category" } type Wxapp_general_analysis struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` SessionCnt int `orm:"session_cnt" json:"session_cnt"` VisitPv int `orm:"visit_pv" json:"visit_pv"` VisitUv int `orm:"visit_uv" json:"visit_uv"` VisitUvNew int `orm:"visit_uv_new" json:"visit_uv_new"` Type int `orm:"type" json:"type"` StayTimeUv string `orm:"stay_time_uv" json:"stay_time_uv"` StayTimeSession string `orm:"stay_time_session" json:"stay_time_session"` VisitDepth string `orm:"visit_depth" json:"visit_depth"` RefDate string `orm:"ref_date" json:"ref_date"` } func (*Wxapp_general_analysis) TableName() string { return "wxapp_general_analysis" } type Activity_exchange_trades_shipping struct { Tid int `orm:"tid" json:"tid"` Uniacid int `orm:"uniacid" json:"uniacid"` Exid int `orm:"exid" json:"exid"` Uid int `orm:"uid" json:"uid"` Status int `orm:"status" json:"status"` Createtime int `orm:"createtime" json:"createtime"` Province string `orm:"province" json:"province"` City string `orm:"city" json:"city"` District string `orm:"district" json:"district"` Address string `orm:"address" json:"address"` Zipcode string `orm:"zipcode" json:"zipcode"` Mobile string `orm:"mobile" json:"mobile"` Name string `orm:"name" json:"name"` } func (*Activity_exchange_trades_shipping) TableName() string { return "activity_exchange_trades_shipping" } type Ewei_shop_coupon_goodsendtask struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Goodsid int `orm:"goodsid" json:"goodsid"` Couponid int `orm:"couponid" json:"couponid"` Starttime int `orm:"starttime" json:"starttime"` Endtime int `orm:"endtime" json:"endtime"` Sendnum int `orm:"sendnum" json:"sendnum"` Num int `orm:"num" json:"num"` Sendpoint int `orm:"sendpoint" json:"sendpoint"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_coupon_goodsendtask) TableName() string { return "ewei_shop_coupon_goodsendtask" } type Ewei_shop_express struct { Id int `orm:"id" json:"id"` Name string `orm:"name" json:"name"` Express string `orm:"express" json:"express"` Status int `orm:"status" json:"status"` Displayorder int `orm:"displayorder" json:"displayorder"` Code string `orm:"code" json:"code"` } func (*Ewei_shop_express) TableName() string { return "ewei_shop_express" } type Ewei_shop_pc_link struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Linkname string `orm:"linkname" json:"linkname"` Url string `orm:"url" json:"url"` Status int `orm:"status" json:"status"` Displayorder int `orm:"displayorder" json:"displayorder"` } func (*Ewei_shop_pc_link) TableName() string { return "ewei_shop_pc_link" } type Ewei_shop_sendticket_share struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Sharetitle string `orm:"sharetitle" json:"sharetitle"` Shareicon string `orm:"shareicon" json:"shareicon"` Sharedesc string `orm:"sharedesc" json:"sharedesc"` Expiration int `orm:"expiration" json:"expiration"` Starttime int `orm:"starttime" json:"starttime"` Endtime int `orm:"endtime" json:"endtime"` Paycpid1 int `orm:"paycpid1" json:"paycpid1"` Paycpid2 int `orm:"paycpid2" json:"paycpid2"` Paycpid3 int `orm:"paycpid3" json:"paycpid3"` Paycpnum1 int `orm:"paycpnum1" json:"paycpnum1"` Paycpnum2 int `orm:"paycpnum2" json:"paycpnum2"` Paycpnum3 int `orm:"paycpnum3" json:"paycpnum3"` Sharecpid1 int `orm:"sharecpid1" json:"sharecpid1"` Sharecpid2 int `orm:"sharecpid2" json:"sharecpid2"` Sharecpid3 int `orm:"sharecpid3" json:"sharecpid3"` Sharecpnum1 int `orm:"sharecpnum1" json:"sharecpnum1"` Sharecpnum2 int `orm:"sharecpnum2" json:"sharecpnum2"` Sharecpnum3 int `orm:"sharecpnum3" json:"sharecpnum3"` Status int `orm:"status" json:"status"` Createtime int `orm:"createtime" json:"createtime"` Order int `orm:"order" json:"order"` Enough float64 `orm:"enough" json:"enough"` Issync int `orm:"issync" json:"issync"` } func (*Ewei_shop_sendticket_share) TableName() string { return "ewei_shop_sendticket_share" } type Modules_recycle struct { Id int `orm:"id" json:"id"` Modulename string `orm:"modulename" json:"modulename"` } func (*Modules_recycle) TableName() string { return "modules_recycle" } type Ewei_shop_datatransfer struct { Id int `orm:"id" json:"id"` Fromuniacid int `orm:"fromuniacid" json:"fromuniacid"` Touniacid int `orm:"touniacid" json:"touniacid"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_datatransfer) TableName() string { return "ewei_shop_datatransfer" } type Ewei_shop_diypage_menu struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Data string `orm:"data" json:"data"` Createtime int `orm:"createtime" json:"createtime"` Lastedittime int `orm:"lastedittime" json:"lastedittime"` Merch int `orm:"merch" json:"merch"` } func (*Ewei_shop_diypage_menu) TableName() string { return "ewei_shop_diypage_menu" } type Ewei_shop_system_casecategory struct { Id int `orm:"id" json:"id"` Name string `orm:"name" json:"name"` Displayorder int `orm:"displayorder" json:"displayorder"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_system_casecategory) TableName() string { return "ewei_shop_system_casecategory" } type Activity_exchange_trades struct { Tid int `orm:"tid" json:"tid"` Uniacid int `orm:"uniacid" json:"uniacid"` Uid int `orm:"uid" json:"uid"` Exid int `orm:"exid" json:"exid"` Type int `orm:"type" json:"type"` Createtime int `orm:"createtime" json:"createtime"` } func (*Activity_exchange_trades) TableName() string { return "activity_exchange_trades" } type Ewei_shop_merch_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Catename string `orm:"catename" json:"catename"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` Displayorder int `orm:"displayorder" json:"displayorder"` Thumb string `orm:"thumb" json:"thumb"` Isrecommand int `orm:"isrecommand" json:"isrecommand"` } func (*Ewei_shop_merch_category) TableName() string { return "ewei_shop_merch_category" } type Ewei_shop_merch_clearing struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Merchid int `orm:"merchid" json:"merchid"` Clearno string `orm:"clearno" json:"clearno"` Goodsprice float64 `orm:"goodsprice" json:"goodsprice"` Dispatchprice float64 `orm:"dispatchprice" json:"dispatchprice"` Deductprice float64 `orm:"deductprice" json:"deductprice"` Deductcredit2 float64 `orm:"deductcredit2" json:"deductcredit2"` Discountprice float64 `orm:"discountprice" json:"discountprice"` Deductenough float64 `orm:"deductenough" json:"deductenough"` Merchdeductenough float64 `orm:"merchdeductenough" json:"merchdeductenough"` Isdiscountprice float64 `orm:"isdiscountprice" json:"isdiscountprice"` Price float64 `orm:"price" json:"price"` Createtime int `orm:"createtime" json:"createtime"` Starttime int `orm:"starttime" json:"starttime"` Endtime int `orm:"endtime" json:"endtime"` Status int `orm:"status" json:"status"` Realprice float64 `orm:"realprice" json:"realprice"` Realpricerate float64 `orm:"realpricerate" json:"realpricerate"` Finalprice float64 `orm:"finalprice" json:"finalprice"` Remark string `orm:"remark" json:"remark"` Paytime int `orm:"paytime" json:"paytime"` Payrate float64 `orm:"payrate" json:"payrate"` } func (*Ewei_shop_merch_clearing) TableName() string { return "ewei_shop_merch_clearing" } type Ewei_shop_exhelper_esheet_temp struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Esheetid int `orm:"esheetid" json:"esheetid"` Esheetname string `orm:"esheetname" json:"esheetname"` Customername string `orm:"customername" json:"customername"` Customerpwd string `orm:"customerpwd" json:"customerpwd"` Monthcode string `orm:"monthcode" json:"monthcode"` Sendsite string `orm:"sendsite" json:"sendsite"` Paytype int `orm:"paytype" json:"paytype"` Templatesize string `orm:"templatesize" json:"templatesize"` Isnotice int `orm:"isnotice" json:"isnotice"` Merchid int `orm:"merchid" json:"merchid"` Issend int `orm:"issend" json:"issend"` Isdefault int `orm:"isdefault" json:"isdefault"` } func (*Ewei_shop_exhelper_esheet_temp) TableName() string { return "ewei_shop_exhelper_esheet_temp" } type Ewei_shop_lottery_default struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Data string `orm:"data" json:"data"` Addtime int `orm:"addtime" json:"addtime"` } func (*Ewei_shop_lottery_default) TableName() string { return "ewei_shop_lottery_default" } type Ewei_shop_member_message_template_default struct { Id int `orm:"id" json:"id"` Typecode string `orm:"typecode" json:"typecode"` Uniacid int `orm:"uniacid" json:"uniacid"` Templateid string `orm:"templateid" json:"templateid"` } func (*Ewei_shop_member_message_template_default) TableName() string { return "ewei_shop_member_message_template_default" } type Userapi_cache struct { Id int `orm:"id" json:"id"` Key string `orm:"key" json:"key"` Content string `orm:"content" json:"content"` Lastupdate int `orm:"lastupdate" json:"lastupdate"` } func (*Userapi_cache) TableName() string { return "userapi_cache" } type Core_refundlog struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` RefundUniontid string `orm:"refund_uniontid" json:"refund_uniontid"` Reason string `orm:"reason" json:"reason"` Uniontid string `orm:"uniontid" json:"uniontid"` Fee float64 `orm:"fee" json:"fee"` Status int `orm:"status" json:"status"` } func (*Core_refundlog) TableName() string { return "core_refundlog" } type Ewei_shop_bargain_record struct { Id int `orm:"id" json:"id"` ActorId int `orm:"actor_id" json:"actor_id"` BargainPrice float64 `orm:"bargain_price" json:"bargain_price"` Openid string `orm:"openid" json:"openid"` Nickname string `orm:"nickname" json:"nickname"` HeadImage string `orm:"head_image" json:"head_image"` BargainTime string `orm:"bargain_time" json:"bargain_time"` } func (*Ewei_shop_bargain_record) TableName() string { return "ewei_shop_bargain_record" } type Ewei_shop_goods_spec_item struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Specid int `orm:"specid" json:"specid"` Title string `orm:"title" json:"title"` Thumb string `orm:"thumb" json:"thumb"` Show int `orm:"show" json:"show"` Displayorder int `orm:"displayorder" json:"displayorder"` ValueId string `orm:"valueId" json:"valueId"` Virtual int `orm:"virtual" json:"virtual"` } func (*Ewei_shop_goods_spec_item) TableName() string { return "ewei_shop_goods_spec_item" } type Ewei_shop_notice struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Displayorder int `orm:"displayorder" json:"displayorder"` Title string `orm:"title" json:"title"` Thumb string `orm:"thumb" json:"thumb"` Link string `orm:"link" json:"link"` Detail string `orm:"detail" json:"detail"` Status int `orm:"status" json:"status"` Createtime int `orm:"createtime" json:"createtime"` Shopid int `orm:"shopid" json:"shopid"` Iswxapp int `orm:"iswxapp" json:"iswxapp"` } func (*Ewei_shop_notice) TableName() string { return "ewei_shop_notice" } type Ewei_shop_sns_level struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Levelname string `orm:"levelname" json:"levelname"` Credit int `orm:"credit" json:"credit"` Enabled int `orm:"enabled" json:"enabled"` Post int `orm:"post" json:"post"` Color string `orm:"color" json:"color"` Bg string `orm:"bg" json:"bg"` } func (*Ewei_shop_sns_level) TableName() string { return "ewei_shop_sns_level" } type Ewei_shop_article struct { Id int `orm:"id" json:"id"` ArticleTitle string `orm:"article_title" json:"article_title"` RespDesc string `orm:"resp_desc" json:"resp_desc"` RespImg string `orm:"resp_img" json:"resp_img"` ArticleContent string `orm:"article_content" json:"article_content"` ArticleCategory int `orm:"article_category" json:"article_category"` ArticleDateV string `orm:"article_date_v" json:"article_date_v"` ArticleDate string `orm:"article_date" json:"article_date"` ArticleMp string `orm:"article_mp" json:"article_mp"` ArticleAuthor string `orm:"article_author" json:"article_author"` ArticleReadnumV int `orm:"article_readnum_v" json:"article_readnum_v"` ArticleReadnum int `orm:"article_readnum" json:"article_readnum"` ArticleLikenumV int `orm:"article_likenum_v" json:"article_likenum_v"` ArticleLikenum int `orm:"article_likenum" json:"article_likenum"` ArticleLinkurl string `orm:"article_linkurl" json:"article_linkurl"` ArticleRuleDaynum int `orm:"article_rule_daynum" json:"article_rule_daynum"` ArticleRuleAllnum int `orm:"article_rule_allnum" json:"article_rule_allnum"` ArticleRuleCredit int `orm:"article_rule_credit" json:"article_rule_credit"` ArticleRuleMoney float64 `orm:"article_rule_money" json:"article_rule_money"` PageSetOptionNocopy int `orm:"page_set_option_nocopy" json:"page_set_option_nocopy"` PageSetOptionNoshareTl int `orm:"page_set_option_noshare_tl" json:"page_set_option_noshare_tl"` PageSetOptionNoshareMsg int `orm:"page_set_option_noshare_msg" json:"page_set_option_noshare_msg"` ArticleKeyword string `orm:"article_keyword" json:"article_keyword"` ArticleReport int `orm:"article_report" json:"article_report"` ProductAdvsType int `orm:"product_advs_type" json:"product_advs_type"` ProductAdvsTitle string `orm:"product_advs_title" json:"product_advs_title"` ProductAdvsMore string `orm:"product_advs_more" json:"product_advs_more"` ProductAdvsLink string `orm:"product_advs_link" json:"product_advs_link"` ProductAdvs string `orm:"product_advs" json:"product_advs"` ArticleState int `orm:"article_state" json:"article_state"` NetworkAttachment string `orm:"network_attachment" json:"network_attachment"` Uniacid int `orm:"uniacid" json:"uniacid"` ArticleRuleCredittotal int `orm:"article_rule_credittotal" json:"article_rule_credittotal"` ArticleRuleMoneytotal float64 `orm:"article_rule_moneytotal" json:"article_rule_moneytotal"` ArticleRuleCredit2 int `orm:"article_rule_credit2" json:"article_rule_credit2"` ArticleRuleMoney2 float64 `orm:"article_rule_money2" json:"article_rule_money2"` ArticleRuleCreditm int `orm:"article_rule_creditm" json:"article_rule_creditm"` ArticleRuleMoneym float64 `orm:"article_rule_moneym" json:"article_rule_moneym"` ArticleRuleCreditm2 int `orm:"article_rule_creditm2" json:"article_rule_creditm2"` ArticleRuleMoneym2 float64 `orm:"article_rule_moneym2" json:"article_rule_moneym2"` ArticleReadtime int `orm:"article_readtime" json:"article_readtime"` ArticleAreas string `orm:"article_areas" json:"article_areas"` ArticleEndtime int `orm:"article_endtime" json:"article_endtime"` ArticleHasendtime int `orm:"article_hasendtime" json:"article_hasendtime"` Displayorder int `orm:"displayorder" json:"displayorder"` ArticleKeyword2 string `orm:"article_keyword2" json:"article_keyword2"` ArticleAdvance int `orm:"article_advance" json:"article_advance"` ArticleVirtualadd int `orm:"article_virtualadd" json:"article_virtualadd"` ArticleVisit int `orm:"article_visit" json:"article_visit"` ArticleVisitLevel string `orm:"article_visit_level" json:"article_visit_level"` ArticleVisitTip string `orm:"article_visit_tip" json:"article_visit_tip"` } func (*Ewei_shop_article) TableName() string { return "ewei_shop_article" } type Ewei_shop_author_billo struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Billid int `orm:"billid" json:"billid"` Authorid int `orm:"authorid" json:"authorid"` Orderid string `orm:"orderid" json:"orderid"` Ordermoney float64 `orm:"ordermoney" json:"ordermoney"` } func (*Ewei_shop_author_billo) TableName() string { return "ewei_shop_author_billo" } type Ewei_shop_commission_level struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Levelname string `orm:"levelname" json:"levelname"` Commission1 float64 `orm:"commission1" json:"commission1"` Commission2 float64 `orm:"commission2" json:"commission2"` Commission3 float64 `orm:"commission3" json:"commission3"` Commissionmoney float64 `orm:"commissionmoney" json:"commissionmoney"` Ordermoney float64 `orm:"ordermoney" json:"ordermoney"` Downcount string `orm:"downcount" json:"downcount"` Ordercount int `orm:"ordercount" json:"ordercount"` Withdraw float64 `orm:"withdraw" json:"withdraw"` Repurchase float64 `orm:"repurchase" json:"repurchase"` Goodsids string `orm:"goodsids" json:"goodsids"` } func (*Ewei_shop_commission_level) TableName() string { return "ewei_shop_commission_level" } type Ewei_shop_groups_paylog struct { Plid int `orm:"plid" json:"plid"` Type string `orm:"type" json:"type"` Uniacid int `orm:"uniacid" json:"uniacid"` Acid int `orm:"acid" json:"acid"` Openid string `orm:"openid" json:"openid"` Tid string `orm:"tid" json:"tid"` Credit int `orm:"credit" json:"credit"` Creditmoney float64 `orm:"creditmoney" json:"creditmoney"` Fee float64 `orm:"fee" json:"fee"` Status int `orm:"status" json:"status"` Module string `orm:"module" json:"module"` Tag string `orm:"tag" json:"tag"` IsUsecard int `orm:"is_usecard" json:"is_usecard"` CardType int `orm:"card_type" json:"card_type"` CardId string `orm:"card_id" json:"card_id"` CardFee float64 `orm:"card_fee" json:"card_fee"` EncryptCode string `orm:"encrypt_code" json:"encrypt_code"` Uniontid string `orm:"uniontid" json:"uniontid"` } func (*Ewei_shop_groups_paylog) TableName() string { return "ewei_shop_groups_paylog" } type Ewei_shop_member_mergelog struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Mergetime int `orm:"mergetime" json:"mergetime"` OpenidA string `orm:"openid_a" json:"openid_a"` OpenidB string `orm:"openid_b" json:"openid_b"` MidA int `orm:"mid_a" json:"mid_a"` MidB int `orm:"mid_b" json:"mid_b"` DetailA string `orm:"detail_a" json:"detail_a"` DetailB string `orm:"detail_b" json:"detail_b"` DetailC string `orm:"detail_c" json:"detail_c"` Fromuniacid int `orm:"fromuniacid" json:"fromuniacid"` } func (*Ewei_shop_member_mergelog) TableName() string { return "ewei_shop_member_mergelog" } type Ewei_shop_member_rank struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Status int `orm:"status" json:"status"` Num int `orm:"num" json:"num"` } func (*Ewei_shop_member_rank) TableName() string { return "ewei_shop_member_rank" } type Ewei_shop_virtual_type struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Cate int `orm:"cate" json:"cate"` Title string `orm:"title" json:"title"` Fields string `orm:"fields" json:"fields"` Usedata int `orm:"usedata" json:"usedata"` Alldata int `orm:"alldata" json:"alldata"` Merchid int `orm:"merchid" json:"merchid"` Linktext string `orm:"linktext" json:"linktext"` Linkurl string `orm:"linkurl" json:"linkurl"` Recycled int `orm:"recycled" json:"recycled"` } func (*Ewei_shop_virtual_type) TableName() string { return "ewei_shop_virtual_type" } type Mc_handsel struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Touid int `orm:"touid" json:"touid"` Fromuid string `orm:"fromuid" json:"fromuid"` Module string `orm:"module" json:"module"` Sign string `orm:"sign" json:"sign"` Action string `orm:"action" json:"action"` CreditValue int `orm:"credit_value" json:"credit_value"` Createtime int `orm:"createtime" json:"createtime"` } func (*Mc_handsel) TableName() string { return "mc_handsel" } type News_reply struct { Id int `orm:"id" json:"id"` Rid int `orm:"rid" json:"rid"` ParentId int `orm:"parent_id" json:"parent_id"` Title string `orm:"title" json:"title"` Author string `orm:"author" json:"author"` Description string `orm:"description" json:"description"` Thumb string `orm:"thumb" json:"thumb"` Content string `orm:"content" json:"content"` Url string `orm:"url" json:"url"` Displayorder int `orm:"displayorder" json:"displayorder"` Incontent int `orm:"incontent" json:"incontent"` Createtime int `orm:"createtime" json:"createtime"` MediaId string `orm:"media_id" json:"media_id"` } func (*News_reply) TableName() string { return "news_reply" } type Ewei_shop_diypage_template_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Merch int `orm:"merch" json:"merch"` } func (*Ewei_shop_diypage_template_category) TableName() string { return "ewei_shop_diypage_template_category" } type Ewei_shop_groups_goods_atlas struct { Id int `orm:"id" json:"id"` GId int `orm:"g_id" json:"g_id"` Thumb string `orm:"thumb" json:"thumb"` } func (*Ewei_shop_groups_goods_atlas) TableName() string { return "ewei_shop_groups_goods_atlas" } type Ewei_shop_sns_like struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Pid int `orm:"pid" json:"pid"` } func (*Ewei_shop_sns_like) TableName() string { return "ewei_shop_sns_like" } type Mc_fans_groups struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Acid int `orm:"acid" json:"acid"` Groups string `orm:"groups" json:"groups"` } func (*Mc_fans_groups) TableName() string { return "mc_fans_groups" } type Modules_bindings struct { Eid int `orm:"eid" json:"eid"` Module string `orm:"module" json:"module"` Entry string `orm:"entry" json:"entry"` Call string `orm:"call" json:"call"` Title string `orm:"title" json:"title"` Do string `orm:"do" json:"do"` State string `orm:"state" json:"state"` Direct int `orm:"direct" json:"direct"` Url string `orm:"url" json:"url"` Icon string `orm:"icon" json:"icon"` Displayorder int `orm:"displayorder" json:"displayorder"` } func (*Modules_bindings) TableName() string { return "modules_bindings" } type Ewei_shop_coupon_taskdata struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Taskid int `orm:"taskid" json:"taskid"` Couponid int `orm:"couponid" json:"couponid"` Sendnum int `orm:"sendnum" json:"sendnum"` Tasktype int `orm:"tasktype" json:"tasktype"` Orderid int `orm:"orderid" json:"orderid"` Parentorderid int `orm:"parentorderid" json:"parentorderid"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` Sendpoint int `orm:"sendpoint" json:"sendpoint"` } func (*Ewei_shop_coupon_taskdata) TableName() string { return "ewei_shop_coupon_taskdata" } type Ewei_shop_fullback_goods struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Goodsid int `orm:"goodsid" json:"goodsid"` Titles string `orm:"titles" json:"titles"` Thumb string `orm:"thumb" json:"thumb"` Marketprice float64 `orm:"marketprice" json:"marketprice"` Minallfullbackallprice float64 `orm:"minallfullbackallprice" json:"minallfullbackallprice"` Maxallfullbackallprice float64 `orm:"maxallfullbackallprice" json:"maxallfullbackallprice"` Minallfullbackallratio float64 `orm:"minallfullbackallratio" json:"minallfullbackallratio"` Maxallfullbackallratio float64 `orm:"maxallfullbackallratio" json:"maxallfullbackallratio"` Day int `orm:"day" json:"day"` Fullbackprice float64 `orm:"fullbackprice" json:"fullbackprice"` Fullbackratio float64 `orm:"fullbackratio" json:"fullbackratio"` Status int `orm:"status" json:"status"` Displayorder int `orm:"displayorder" json:"displayorder"` Hasoption int `orm:"hasoption" json:"hasoption"` Optionid string `orm:"optionid" json:"optionid"` Startday int `orm:"startday" json:"startday"` Refund int `orm:"refund" json:"refund"` } func (*Ewei_shop_fullback_goods) TableName() string { return "ewei_shop_fullback_goods" } type Ewei_shop_system_company_category struct { Id int `orm:"id" json:"id"` Name string `orm:"name" json:"name"` Displayorder int `orm:"displayorder" json:"displayorder"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_system_company_category) TableName() string { return "ewei_shop_system_company_category" } type Mc_member_fields struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Fieldid int `orm:"fieldid" json:"fieldid"` Title string `orm:"title" json:"title"` Available int `orm:"available" json:"available"` Displayorder int `orm:"displayorder" json:"displayorder"` } func (*Mc_member_fields) TableName() string { return "mc_member_fields" } type Menu_event struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Keyword string `orm:"keyword" json:"keyword"` Type string `orm:"type" json:"type"` Picmd5 string `orm:"picmd5" json:"picmd5"` Openid string `orm:"openid" json:"openid"` Createtime int `orm:"createtime" json:"createtime"` } func (*Menu_event) TableName() string { return "menu_event" } type Activity_clerk_menu struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Displayorder int `orm:"displayorder" json:"displayorder"` Pid int `orm:"pid" json:"pid"` GroupName string `orm:"group_name" json:"group_name"` Title string `orm:"title" json:"title"` Icon string `orm:"icon" json:"icon"` Url string `orm:"url" json:"url"` Type string `orm:"type" json:"type"` Permission string `orm:"permission" json:"permission"` System int `orm:"system" json:"system"` } func (*Activity_clerk_menu) TableName() string { return "activity_clerk_menu" } type Ewei_shop_package_goods_option struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Goodsid int `orm:"goodsid" json:"goodsid"` Optionid int `orm:"optionid" json:"optionid"` Pid int `orm:"pid" json:"pid"` Title string `orm:"title" json:"title"` Packageprice float64 `orm:"packageprice" json:"packageprice"` Marketprice float64 `orm:"marketprice" json:"marketprice"` Commission1 float64 `orm:"commission1" json:"commission1"` Commission2 float64 `orm:"commission2" json:"commission2"` Commission3 float64 `orm:"commission3" json:"commission3"` } func (*Ewei_shop_package_goods_option) TableName() string { return "ewei_shop_package_goods_option" } type Ewei_shop_system_plugingrant_setting struct { Id int `orm:"id" json:"id"` Com string `orm:"com" json:"com"` Adv string `orm:"adv" json:"adv"` Plugin string `orm:"plugin" json:"plugin"` Customer string `orm:"customer" json:"customer"` Contact string `orm:"contact" json:"contact"` Servertime string `orm:"servertime" json:"servertime"` Weixin int `orm:"weixin" json:"weixin"` Appid string `orm:"appid" json:"appid"` Mchid string `orm:"mchid" json:"mchid"` Apikey string `orm:"apikey" json:"apikey"` Alipay int `orm:"alipay" json:"alipay"` Account string `orm:"account" json:"account"` Partner string `orm:"partner" json:"partner"` Secret string `orm:"secret" json:"secret"` } func (*Ewei_shop_system_plugingrant_setting) TableName() string { return "ewei_shop_system_plugingrant_setting" } type Ewei_shop_virtual_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_virtual_category) TableName() string { return "ewei_shop_virtual_category" } type Account_webapp struct { Acid int `orm:"acid" json:"acid"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` } func (*Account_webapp) TableName() string { return "account_webapp" } type Coupon_activity struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` MsgId int `orm:"msg_id" json:"msg_id"` Status int `orm:"status" json:"status"` Title string `orm:"title" json:"title"` Type int `orm:"type" json:"type"` Thumb string `orm:"thumb" json:"thumb"` Coupons string `orm:"coupons" json:"coupons"` Description string `orm:"description" json:"description"` Members string `orm:"members" json:"members"` } func (*Coupon_activity) TableName() string { return "coupon_activity" } type Ewei_shop_commission_bank struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Bankname string `orm:"bankname" json:"bankname"` Content string `orm:"content" json:"content"` Status int `orm:"status" json:"status"` Displayorder int `orm:"displayorder" json:"displayorder"` } func (*Ewei_shop_commission_bank) TableName() string { return "ewei_shop_commission_bank" } type Ewei_shop_funbar struct { Id int `orm:"id" json:"id"` Uid int `orm:"uid" json:"uid"` Datas string `orm:"datas" json:"datas"` Uniacid int `orm:"uniacid" json:"uniacid"` } func (*Ewei_shop_funbar) TableName() string { return "ewei_shop_funbar" } type Ewei_shop_refund_address struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Title string `orm:"title" json:"title"` Name string `orm:"name" json:"name"` Tel string `orm:"tel" json:"tel"` Mobile string `orm:"mobile" json:"mobile"` Province string `orm:"province" json:"province"` City string `orm:"city" json:"city"` Area string `orm:"area" json:"area"` Address string `orm:"address" json:"address"` Isdefault int `orm:"isdefault" json:"isdefault"` Zipcode string `orm:"zipcode" json:"zipcode"` Content string `orm:"content" json:"content"` Deleted int `orm:"deleted" json:"deleted"` Openid string `orm:"openid" json:"openid"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_refund_address) TableName() string { return "ewei_shop_refund_address" } type Ewei_shop_sms struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Type string `orm:"type" json:"type"` Template int `orm:"template" json:"template"` Smstplid string `orm:"smstplid" json:"smstplid"` Smssign string `orm:"smssign" json:"smssign"` Content string `orm:"content" json:"content"` Data string `orm:"data" json:"data"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_sms) TableName() string { return "ewei_shop_sms" } type Modules struct { Mid int `orm:"mid" json:"mid"` Name string `orm:"name" json:"name"` Type string `orm:"type" json:"type"` Title string `orm:"title" json:"title"` Version string `orm:"version" json:"version"` Ability string `orm:"ability" json:"ability"` Description string `orm:"description" json:"description"` Author string `orm:"author" json:"author"` Url string `orm:"url" json:"url"` Settings int `orm:"settings" json:"settings"` Subscribes string `orm:"subscribes" json:"subscribes"` Handles string `orm:"handles" json:"handles"` Isrulefields int `orm:"isrulefields" json:"isrulefields"` Issystem int `orm:"issystem" json:"issystem"` Target int `orm:"target" json:"target"` Iscard int `orm:"iscard" json:"iscard"` Permissions string `orm:"permissions" json:"permissions"` TitleInitial string `orm:"title_initial" json:"title_initial"` WxappSupport int `orm:"wxapp_support" json:"wxapp_support"` AppSupport int `orm:"app_support" json:"app_support"` WelcomeSupport int `orm:"welcome_support" json:"welcome_support"` OauthType int `orm:"oauth_type" json:"oauth_type"` WebappSupport int `orm:"webapp_support" json:"webapp_support"` } func (*Modules) TableName() string { return "modules" } type Music_reply struct { Id int `orm:"id" json:"id"` Rid int `orm:"rid" json:"rid"` Title string `orm:"title" json:"title"` Description string `orm:"description" json:"description"` Url string `orm:"url" json:"url"` Hqurl string `orm:"hqurl" json:"hqurl"` } func (*Music_reply) TableName() string { return "music_reply" } type Ewei_shop_coupon struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Catid int `orm:"catid" json:"catid"` Couponname string `orm:"couponname" json:"couponname"` Gettype int `orm:"gettype" json:"gettype"` Getmax int `orm:"getmax" json:"getmax"` Usetype int `orm:"usetype" json:"usetype"` Returntype int `orm:"returntype" json:"returntype"` Bgcolor string `orm:"bgcolor" json:"bgcolor"` Enough float64 `orm:"enough" json:"enough"` Timelimit int `orm:"timelimit" json:"timelimit"` Coupontype int `orm:"coupontype" json:"coupontype"` Timedays int `orm:"timedays" json:"timedays"` Timestart int `orm:"timestart" json:"timestart"` Timeend int `orm:"timeend" json:"timeend"` Discount float64 `orm:"discount" json:"discount"` Deduct float64 `orm:"deduct" json:"deduct"` Backtype int `orm:"backtype" json:"backtype"` Backmoney string `orm:"backmoney" json:"backmoney"` Backcredit string `orm:"backcredit" json:"backcredit"` Backredpack string `orm:"backredpack" json:"backredpack"` Backwhen int `orm:"backwhen" json:"backwhen"` Thumb string `orm:"thumb" json:"thumb"` Desc string `orm:"desc" json:"desc"` Createtime int `orm:"createtime" json:"createtime"` Total int `orm:"total" json:"total"` Status int `orm:"status" json:"status"` Money float64 `orm:"money" json:"money"` Respdesc string `orm:"respdesc" json:"respdesc"` Respthumb string `orm:"respthumb" json:"respthumb"` Resptitle string `orm:"resptitle" json:"resptitle"` Respurl string `orm:"respurl" json:"respurl"` Credit int `orm:"credit" json:"credit"` Usecredit2 int `orm:"usecredit2" json:"usecredit2"` Remark string `orm:"remark" json:"remark"` Descnoset int `orm:"descnoset" json:"descnoset"` Pwdkey string `orm:"pwdkey" json:"pwdkey"` Pwdsuc string `orm:"pwdsuc" json:"pwdsuc"` Pwdfail string `orm:"pwdfail" json:"pwdfail"` Pwdurl string `orm:"pwdurl" json:"pwdurl"` Pwdask string `orm:"pwdask" json:"pwdask"` Pwdstatus int `orm:"pwdstatus" json:"pwdstatus"` Pwdtimes int `orm:"pwdtimes" json:"pwdtimes"` Pwdfull string `orm:"pwdfull" json:"pwdfull"` Pwdwords string `orm:"pwdwords" json:"pwdwords"` Pwdopen int `orm:"pwdopen" json:"pwdopen"` Pwdown string `orm:"pwdown" json:"pwdown"` Pwdexit string `orm:"pwdexit" json:"pwdexit"` Pwdexitstr string `orm:"pwdexitstr" json:"pwdexitstr"` Displayorder int `orm:"displayorder" json:"displayorder"` Pwdkey2 string `orm:"pwdkey2" json:"pwdkey2"` Merchid int `orm:"merchid" json:"merchid"` Limitgoodtype int `orm:"limitgoodtype" json:"limitgoodtype"` Limitgoodcatetype int `orm:"limitgoodcatetype" json:"limitgoodcatetype"` Limitgoodcateids string `orm:"limitgoodcateids" json:"limitgoodcateids"` Limitgoodids string `orm:"limitgoodids" json:"limitgoodids"` Islimitlevel int `orm:"islimitlevel" json:"islimitlevel"` Limitmemberlevels string `orm:"limitmemberlevels" json:"limitmemberlevels"` Limitagentlevels string `orm:"limitagentlevels" json:"limitagentlevels"` Limitpartnerlevels string `orm:"limitpartnerlevels" json:"limitpartnerlevels"` Limitaagentlevels string `orm:"limitaagentlevels" json:"limitaagentlevels"` Tagtitle string `orm:"tagtitle" json:"tagtitle"` Settitlecolor int `orm:"settitlecolor" json:"settitlecolor"` Titlecolor string `orm:"titlecolor" json:"titlecolor"` Limitdiscounttype int `orm:"limitdiscounttype" json:"limitdiscounttype"` Quickget int `orm:"quickget" json:"quickget"` } func (*Ewei_shop_coupon) TableName() string { return "ewei_shop_coupon" } type Ewei_shop_dispatch struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Dispatchname string `orm:"dispatchname" json:"dispatchname"` Dispatchtype int `orm:"dispatchtype" json:"dispatchtype"` Displayorder int `orm:"displayorder" json:"displayorder"` Firstprice float64 `orm:"firstprice" json:"firstprice"` Secondprice float64 `orm:"secondprice" json:"secondprice"` Firstweight int `orm:"firstweight" json:"firstweight"` Secondweight int `orm:"secondweight" json:"secondweight"` Express string `orm:"express" json:"express"` Areas string `orm:"areas" json:"areas"` Carriers string `orm:"carriers" json:"carriers"` Enabled int `orm:"enabled" json:"enabled"` Calculatetype int `orm:"calculatetype" json:"calculatetype"` Firstnum int `orm:"firstnum" json:"firstnum"` Secondnum int `orm:"secondnum" json:"secondnum"` Firstnumprice float64 `orm:"firstnumprice" json:"firstnumprice"` Secondnumprice float64 `orm:"secondnumprice" json:"secondnumprice"` Isdefault int `orm:"isdefault" json:"isdefault"` Shopid int `orm:"shopid" json:"shopid"` Merchid int `orm:"merchid" json:"merchid"` Nodispatchareas string `orm:"nodispatchareas" json:"nodispatchareas"` NodispatchareasCode string `orm:"nodispatchareas_code" json:"nodispatchareas_code"` Isdispatcharea int `orm:"isdispatcharea" json:"isdispatcharea"` Freeprice float64 `orm:"freeprice" json:"freeprice"` } func (*Ewei_shop_dispatch) TableName() string { return "ewei_shop_dispatch" } type Ewei_shop_diyform_type struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Cate int `orm:"cate" json:"cate"` Title string `orm:"title" json:"title"` Fields string `orm:"fields" json:"fields"` Usedata int `orm:"usedata" json:"usedata"` Alldata int `orm:"alldata" json:"alldata"` Status int `orm:"status" json:"status"` Savedata int `orm:"savedata" json:"savedata"` } func (*Ewei_shop_diyform_type) TableName() string { return "ewei_shop_diyform_type" } type Ewei_shop_merch_adv struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Advname string `orm:"advname" json:"advname"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_merch_adv) TableName() string { return "ewei_shop_merch_adv" } type Ewei_shop_qa_set struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Showmember int `orm:"showmember" json:"showmember"` Showtype int `orm:"showtype" json:"showtype"` Keyword string `orm:"keyword" json:"keyword"` EnterTitle string `orm:"enter_title" json:"enter_title"` EnterImg string `orm:"enter_img" json:"enter_img"` EnterDesc string `orm:"enter_desc" json:"enter_desc"` Share int `orm:"share" json:"share"` } func (*Ewei_shop_qa_set) TableName() string { return "ewei_shop_qa_set" } type Mc_mapping_fans struct { Fanid int `orm:"fanid" json:"fanid"` Acid int `orm:"acid" json:"acid"` Uniacid int `orm:"uniacid" json:"uniacid"` Uid int `orm:"uid" json:"uid"` Openid string `orm:"openid" json:"openid"` Nickname string `orm:"nickname" json:"nickname"` Groupid string `orm:"groupid" json:"groupid"` Salt string `orm:"salt" json:"salt"` Follow int `orm:"follow" json:"follow"` Followtime int `orm:"followtime" json:"followtime"` Unfollowtime int `orm:"unfollowtime" json:"unfollowtime"` Tag string `orm:"tag" json:"tag"` Updatetime int `orm:"updatetime" json:"updatetime"` Unionid string `orm:"unionid" json:"unionid"` } func (*Mc_mapping_fans) TableName() string { return "mc_mapping_fans" } type Article_news struct { Id int `orm:"id" json:"id"` Cateid int `orm:"cateid" json:"cateid"` Title string `orm:"title" json:"title"` Content string `orm:"content" json:"content"` Thumb string `orm:"thumb" json:"thumb"` Source string `orm:"source" json:"source"` Author string `orm:"author" json:"author"` Displayorder int `orm:"displayorder" json:"displayorder"` IsDisplay int `orm:"is_display" json:"is_display"` IsShowHome int `orm:"is_show_home" json:"is_show_home"` Createtime int `orm:"createtime" json:"createtime"` Click int `orm:"click" json:"click"` } func (*Article_news) TableName() string { return "article_news" } type Ewei_shop_coupon_usesendtasks struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Usecouponid int `orm:"usecouponid" json:"usecouponid"` Couponid int `orm:"couponid" json:"couponid"` Starttime int `orm:"starttime" json:"starttime"` Endtime int `orm:"endtime" json:"endtime"` Sendnum int `orm:"sendnum" json:"sendnum"` Num int `orm:"num" json:"num"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_coupon_usesendtasks) TableName() string { return "ewei_shop_coupon_usesendtasks" } type Ewei_shop_diyform_data struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Typeid int `orm:"typeid" json:"typeid"` Cid int `orm:"cid" json:"cid"` Diyformfields string `orm:"diyformfields" json:"diyformfields"` Fields string `orm:"fields" json:"fields"` Openid string `orm:"openid" json:"openid"` Type int `orm:"type" json:"type"` } func (*Ewei_shop_diyform_data) TableName() string { return "ewei_shop_diyform_data" } type Ewei_shop_groups_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` Advimg string `orm:"advimg" json:"advimg"` Advurl string `orm:"advurl" json:"advurl"` Isrecommand int `orm:"isrecommand" json:"isrecommand"` } func (*Ewei_shop_groups_category) TableName() string { return "ewei_shop_groups_category" } type Ewei_shop_lottery struct { LotteryId int `orm:"lottery_id" json:"lottery_id"` Uniacid int `orm:"uniacid" json:"uniacid"` LotteryTitle string `orm:"lottery_title" json:"lottery_title"` LotteryIcon string `orm:"lottery_icon" json:"lottery_icon"` LotteryBanner string `orm:"lottery_banner" json:"lottery_banner"` LotteryCannot string `orm:"lottery_cannot" json:"lottery_cannot"` LotteryType int `orm:"lottery_type" json:"lottery_type"` IsDelete int `orm:"is_delete" json:"is_delete"` Addtime int `orm:"addtime" json:"addtime"` LotteryData string `orm:"lottery_data" json:"lottery_data"` IsGoods int `orm:"is_goods" json:"is_goods"` LotteryDays int `orm:"lottery_days" json:"lottery_days"` TaskType int `orm:"task_type" json:"task_type"` TaskData string `orm:"task_data" json:"task_data"` StartTime int `orm:"start_time" json:"start_time"` EndTime int `orm:"end_time" json:"end_time"` AwardStart int `orm:"award_start" json:"award_start"` AwardEnd int `orm:"award_end" json:"award_end"` } func (*Ewei_shop_lottery) TableName() string { return "ewei_shop_lottery" } type Mc_member_address struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Uid int `orm:"uid" json:"uid"` Username string `orm:"username" json:"username"` Mobile string `orm:"mobile" json:"mobile"` Zipcode string `orm:"zipcode" json:"zipcode"` Province string `orm:"province" json:"province"` City string `orm:"city" json:"city"` District string `orm:"district" json:"district"` Address string `orm:"address" json:"address"` Isdefault int `orm:"isdefault" json:"isdefault"` } func (*Mc_member_address) TableName() string { return "mc_member_address" } type Core_cron_record struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Module string `orm:"module" json:"module"` Type string `orm:"type" json:"type"` Tid int `orm:"tid" json:"tid"` Note string `orm:"note" json:"note"` Tag string `orm:"tag" json:"tag"` Createtime int `orm:"createtime" json:"createtime"` } func (*Core_cron_record) TableName() string { return "core_cron_record" } type Custom_reply struct { Id int `orm:"id" json:"id"` Rid int `orm:"rid" json:"rid"` Start1 int `orm:"start1" json:"start1"` End1 int `orm:"end1" json:"end1"` Start2 int `orm:"start2" json:"start2"` End2 int `orm:"end2" json:"end2"` } func (*Custom_reply) TableName() string { return "custom_reply" } type Ewei_shop_coupon_sendshow struct { Id int `orm:"id" json:"id"` Showkey string `orm:"showkey" json:"showkey"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Coupondataid int `orm:"coupondataid" json:"coupondataid"` } func (*Ewei_shop_coupon_sendshow) TableName() string { return "ewei_shop_coupon_sendshow" } type Ewei_shop_creditshop_goods struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Displayorder int `orm:"displayorder" json:"displayorder"` Title string `orm:"title" json:"title"` Cate int `orm:"cate" json:"cate"` Thumb string `orm:"thumb" json:"thumb"` Price float64 `orm:"price" json:"price"` Type int `orm:"type" json:"type"` Credit int `orm:"credit" json:"credit"` Money float64 `orm:"money" json:"money"` Total int `orm:"total" json:"total"` Totalday int `orm:"totalday" json:"totalday"` Chance int `orm:"chance" json:"chance"` Chanceday int `orm:"chanceday" json:"chanceday"` Detail string `orm:"detail" json:"detail"` Rate1 int `orm:"rate1" json:"rate1"` Rate2 int `orm:"rate2" json:"rate2"` Endtime int `orm:"endtime" json:"endtime"` Joins int `orm:"joins" json:"joins"` Views int `orm:"views" json:"views"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` Deleted int `orm:"deleted" json:"deleted"` Showlevels string `orm:"showlevels" json:"showlevels"` Buylevels string `orm:"buylevels" json:"buylevels"` Showgroups string `orm:"showgroups" json:"showgroups"` Buygroups string `orm:"buygroups" json:"buygroups"` Vip int `orm:"vip" json:"vip"` Istop int `orm:"istop" json:"istop"` Isrecommand int `orm:"isrecommand" json:"isrecommand"` Istime int `orm:"istime" json:"istime"` Timestart int `orm:"timestart" json:"timestart"` Timeend int `orm:"timeend" json:"timeend"` ShareTitle string `orm:"share_title" json:"share_title"` ShareIcon string `orm:"share_icon" json:"share_icon"` ShareDesc string `orm:"share_desc" json:"share_desc"` Followneed int `orm:"followneed" json:"followneed"` Followtext string `orm:"followtext" json:"followtext"` Subtitle string `orm:"subtitle" json:"subtitle"` Subdetail string `orm:"subdetail" json:"subdetail"` Noticedetail string `orm:"noticedetail" json:"noticedetail"` Usedetail string `orm:"usedetail" json:"usedetail"` Goodsdetail string `orm:"goodsdetail" json:"goodsdetail"` Isendtime int `orm:"isendtime" json:"isendtime"` Usecredit2 int `orm:"usecredit2" json:"usecredit2"` Area string `orm:"area" json:"area"` Dispatch float64 `orm:"dispatch" json:"dispatch"` Storeids string `orm:"storeids" json:"storeids"` Noticeopenid string `orm:"noticeopenid" json:"noticeopenid"` Noticetype int `orm:"noticetype" json:"noticetype"` Isverify int `orm:"isverify" json:"isverify"` Goodstype int `orm:"goodstype" json:"goodstype"` Couponid int `orm:"couponid" json:"couponid"` Goodsid int `orm:"goodsid" json:"goodsid"` Merchid int `orm:"merchid" json:"merchid"` Productprice float64 `orm:"productprice" json:"productprice"` Mincredit float64 `orm:"mincredit" json:"mincredit"` Minmoney float64 `orm:"minmoney" json:"minmoney"` Maxcredit float64 `orm:"maxcredit" json:"maxcredit"` Maxmoney float64 `orm:"maxmoney" json:"maxmoney"` Dispatchtype int `orm:"dispatchtype" json:"dispatchtype"` Dispatchid int `orm:"dispatchid" json:"dispatchid"` Verifytype int `orm:"verifytype" json:"verifytype"` Verifynum int `orm:"verifynum" json:"verifynum"` Grant1 float64 `orm:"grant1" json:"grant1"` Grant2 float64 `orm:"grant2" json:"grant2"` Goodssn string `orm:"goodssn" json:"goodssn"` Productsn string `orm:"productsn" json:"productsn"` Weight int `orm:"weight" json:"weight"` Showtotal int `orm:"showtotal" json:"showtotal"` Totalcnf int `orm:"totalcnf" json:"totalcnf"` Usetime int `orm:"usetime" json:"usetime"` Hasoption int `orm:"hasoption" json:"hasoption"` Noticedetailshow int `orm:"noticedetailshow" json:"noticedetailshow"` Detailshow int `orm:"detailshow" json:"detailshow"` Packetmoney float64 `orm:"packetmoney" json:"packetmoney"` Surplusmoney float64 `orm:"surplusmoney" json:"surplusmoney"` Packetlimit float64 `orm:"packetlimit" json:"packetlimit"` Packettype int `orm:"packettype" json:"packettype"` Minpacketmoney float64 `orm:"minpacketmoney" json:"minpacketmoney"` Packettotal int `orm:"packettotal" json:"packettotal"` Packetsurplus int `orm:"packetsurplus" json:"packetsurplus"` Maxpacketmoney float64 `orm:"maxpacketmoney" json:"maxpacketmoney"` } func (*Ewei_shop_creditshop_goods) TableName() string { return "ewei_shop_creditshop_goods" } type Ewei_shop_polyapi_key struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Merchid int `orm:"merchid" json:"merchid"` Appkey string `orm:"appkey" json:"appkey"` Token string `orm:"token" json:"token"` Appsecret string `orm:"appsecret" json:"appsecret"` Createtime int `orm:"createtime" json:"createtime"` Updatetime int `orm:"updatetime" json:"updatetime"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_polyapi_key) TableName() string { return "ewei_shop_polyapi_key" } type Ewei_shop_poster_log struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Posterid int `orm:"posterid" json:"posterid"` FromOpenid string `orm:"from_openid" json:"from_openid"` Subcredit int `orm:"subcredit" json:"subcredit"` Submoney float64 `orm:"submoney" json:"submoney"` Reccredit int `orm:"reccredit" json:"reccredit"` Recmoney float64 `orm:"recmoney" json:"recmoney"` Createtime int `orm:"createtime" json:"createtime"` Reccouponid int `orm:"reccouponid" json:"reccouponid"` Reccouponnum int `orm:"reccouponnum" json:"reccouponnum"` Subcouponid int `orm:"subcouponid" json:"subcouponid"` Subcouponnum int `orm:"subcouponnum" json:"subcouponnum"` } func (*Ewei_shop_poster_log) TableName() string { return "ewei_shop_poster_log" } type Ewei_shop_qa_adv struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Advname string `orm:"advname" json:"advname"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` } func (*Ewei_shop_qa_adv) TableName() string { return "ewei_shop_qa_adv" } type Ewei_shop_seckill_task_room struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Displayorder int `orm:"displayorder" json:"displayorder"` Taskid int `orm:"taskid" json:"taskid"` Title string `orm:"title" json:"title"` Enabled int `orm:"enabled" json:"enabled"` PageTitle string `orm:"page_title" json:"page_title"` ShareTitle string `orm:"share_title" json:"share_title"` ShareDesc string `orm:"share_desc" json:"share_desc"` ShareIcon string `orm:"share_icon" json:"share_icon"` Oldshow int `orm:"oldshow" json:"oldshow"` Tag string `orm:"tag" json:"tag"` Createtime int `orm:"createtime" json:"createtime"` Diypage int `orm:"diypage" json:"diypage"` } func (*Ewei_shop_seckill_task_room) TableName() string { return "ewei_shop_seckill_task_room" } type Images_reply struct { Id int `orm:"id" json:"id"` Rid int `orm:"rid" json:"rid"` Title string `orm:"title" json:"title"` Description string `orm:"description" json:"description"` Mediaid string `orm:"mediaid" json:"mediaid"` Createtime int `orm:"createtime" json:"createtime"` } func (*Images_reply) TableName() string { return "images_reply" } type Mc_member_property struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Property string `orm:"property" json:"property"` } func (*Mc_member_property) TableName() string { return "mc_member_property" } type Site_styles struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Templateid int `orm:"templateid" json:"templateid"` Name string `orm:"name" json:"name"` } func (*Site_styles) TableName() string { return "site_styles" } type Stat_fans struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` New int `orm:"new" json:"new"` Cancel int `orm:"cancel" json:"cancel"` Cumulate int `orm:"cumulate" json:"cumulate"` Date string `orm:"date" json:"date"` } func (*Stat_fans) TableName() string { return "stat_fans" } type Coupon_location struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Acid int `orm:"acid" json:"acid"` Sid int `orm:"sid" json:"sid"` LocationId int `orm:"location_id" json:"location_id"` BusinessName string `orm:"business_name" json:"business_name"` BranchName string `orm:"branch_name" json:"branch_name"` Category string `orm:"category" json:"category"` Province string `orm:"province" json:"province"` City string `orm:"city" json:"city"` District string `orm:"district" json:"district"` Address string `orm:"address" json:"address"` Longitude string `orm:"longitude" json:"longitude"` Latitude string `orm:"latitude" json:"latitude"` Telephone string `orm:"telephone" json:"telephone"` PhotoList string `orm:"photo_list" json:"photo_list"` AvgPrice int `orm:"avg_price" json:"avg_price"` OpenTime string `orm:"open_time" json:"open_time"` Recommend string `orm:"recommend" json:"recommend"` Special string `orm:"special" json:"special"` Introduction string `orm:"introduction" json:"introduction"` OffsetType int `orm:"offset_type" json:"offset_type"` Status int `orm:"status" json:"status"` Message string `orm:"message" json:"message"` } func (*Coupon_location) TableName() string { return "coupon_location" } type Ewei_shop_creditshop_option struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Goodsid int `orm:"goodsid" json:"goodsid"` Title string `orm:"title" json:"title"` Thumb string `orm:"thumb" json:"thumb"` Credit int `orm:"credit" json:"credit"` Money float64 `orm:"money" json:"money"` Total int `orm:"total" json:"total"` Weight float64 `orm:"weight" json:"weight"` Displayorder int `orm:"displayorder" json:"displayorder"` Specs string `orm:"specs" json:"specs"` SkuId string `orm:"skuId" json:"skuId"` Goodssn string `orm:"goodssn" json:"goodssn"` Productsn string `orm:"productsn" json:"productsn"` Virtual int `orm:"virtual" json:"virtual"` ExchangeStock int `orm:"exchange_stock" json:"exchange_stock"` } func (*Ewei_shop_creditshop_option) TableName() string { return "ewei_shop_creditshop_option" } type Ewei_shop_exchange_code struct { Id int `orm:"id" json:"id"` Groupid int `orm:"groupid" json:"groupid"` Uniacid int `orm:"uniacid" json:"uniacid"` Endtime string `orm:"endtime" json:"endtime"` Status int `orm:"status" json:"status"` Openid string `orm:"openid" json:"openid"` Count int `orm:"count" json:"count"` Key string `orm:"key" json:"key"` Type int `orm:"type" json:"type"` Scene int `orm:"scene" json:"scene"` QrcodeUrl string `orm:"qrcode_url" json:"qrcode_url"` Serial string `orm:"serial" json:"serial"` Balancestatus int `orm:"balancestatus" json:"balancestatus"` Redstatus int `orm:"redstatus" json:"redstatus"` Scorestatus int `orm:"scorestatus" json:"scorestatus"` Couponstatus int `orm:"couponstatus" json:"couponstatus"` Goodsstatus int `orm:"goodsstatus" json:"goodsstatus"` Repeatcount int `orm:"repeatcount" json:"repeatcount"` } func (*Ewei_shop_exchange_code) TableName() string { return "ewei_shop_exchange_code" } type Ewei_shop_groups_adv struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Advname string `orm:"advname" json:"advname"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` } func (*Ewei_shop_groups_adv) TableName() string { return "ewei_shop_groups_adv" } type Ewei_shop_order_goods struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Orderid int `orm:"orderid" json:"orderid"` Goodsid int `orm:"goodsid" json:"goodsid"` Price float64 `orm:"price" json:"price"` Total int `orm:"total" json:"total"` Optionid int `orm:"optionid" json:"optionid"` Createtime int `orm:"createtime" json:"createtime"` Optionname string `orm:"optionname" json:"optionname"` Commission1 string `orm:"commission1" json:"commission1"` Applytime1 int `orm:"applytime1" json:"applytime1"` Checktime1 int `orm:"checktime1" json:"checktime1"` Paytime1 int `orm:"paytime1" json:"paytime1"` Invalidtime1 int `orm:"invalidtime1" json:"invalidtime1"` Deletetime1 int `orm:"deletetime1" json:"deletetime1"` Status1 int `orm:"status1" json:"status1"` Content1 string `orm:"content1" json:"content1"` Commission2 string `orm:"commission2" json:"commission2"` Applytime2 int `orm:"applytime2" json:"applytime2"` Checktime2 int `orm:"checktime2" json:"checktime2"` Paytime2 int `orm:"paytime2" json:"paytime2"` Invalidtime2 int `orm:"invalidtime2" json:"invalidtime2"` Deletetime2 int `orm:"deletetime2" json:"deletetime2"` Status2 int `orm:"status2" json:"status2"` Content2 string `orm:"content2" json:"content2"` Commission3 string `orm:"commission3" json:"commission3"` Applytime3 int `orm:"applytime3" json:"applytime3"` Checktime3 int `orm:"checktime3" json:"checktime3"` Paytime3 int `orm:"paytime3" json:"paytime3"` Invalidtime3 int `orm:"invalidtime3" json:"invalidtime3"` Deletetime3 int `orm:"deletetime3" json:"deletetime3"` Status3 int `orm:"status3" json:"status3"` Content3 string `orm:"content3" json:"content3"` Realprice float64 `orm:"realprice" json:"realprice"` Goodssn string `orm:"goodssn" json:"goodssn"` Productsn string `orm:"productsn" json:"productsn"` Nocommission int `orm:"nocommission" json:"nocommission"` Changeprice float64 `orm:"changeprice" json:"changeprice"` Oldprice float64 `orm:"oldprice" json:"oldprice"` Commissions string `orm:"commissions" json:"commissions"` Diyformid int `orm:"diyformid" json:"diyformid"` Diyformdataid int `orm:"diyformdataid" json:"diyformdataid"` Diyformdata string `orm:"diyformdata" json:"diyformdata"` Diyformfields string `orm:"diyformfields" json:"diyformfields"` Openid string `orm:"openid" json:"openid"` Printstate int `orm:"printstate" json:"printstate"` Printstate2 int `orm:"printstate2" json:"printstate2"` Rstate int `orm:"rstate" json:"rstate"` Refundtime int `orm:"refundtime" json:"refundtime"` Merchid int `orm:"merchid" json:"merchid"` Parentorderid int `orm:"parentorderid" json:"parentorderid"` Merchsale int `orm:"merchsale" json:"merchsale"` Isdiscountprice float64 `orm:"isdiscountprice" json:"isdiscountprice"` Canbuyagain int `orm:"canbuyagain" json:"canbuyagain"` Seckill int `orm:"seckill" json:"seckill"` SeckillTaskid int `orm:"seckill_taskid" json:"seckill_taskid"` SeckillRoomid int `orm:"seckill_roomid" json:"seckill_roomid"` SeckillTimeid int `orm:"seckill_timeid" json:"seckill_timeid"` IsMake int `orm:"is_make" json:"is_make"` Sendtype int `orm:"sendtype" json:"sendtype"` Expresscom string `orm:"expresscom" json:"expresscom"` Expresssn string `orm:"expresssn" json:"expresssn"` Express string `orm:"express" json:"express"` Sendtime int `orm:"sendtime" json:"sendtime"` Finishtime int `orm:"finishtime" json:"finishtime"` Remarksend string `orm:"remarksend" json:"remarksend"` Prohibitrefund int `orm:"prohibitrefund" json:"prohibitrefund"` Storeid string `orm:"storeid" json:"storeid"` TradeTime int `orm:"trade_time" json:"trade_time"` Optime string `orm:"optime" json:"optime"` TdateTime int `orm:"tdate_time" json:"tdate_time"` Dowpayment float64 `orm:"dowpayment" json:"dowpayment"` Peopleid int `orm:"peopleid" json:"peopleid"` Esheetprintnum int `orm:"esheetprintnum" json:"esheetprintnum"` Ordercode string `orm:"ordercode" json:"ordercode"` } func (*Ewei_shop_order_goods) TableName() string { return "ewei_shop_order_goods" } type Ewei_shop_quick struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Title string `orm:"title" json:"title"` Keyword string `orm:"keyword" json:"keyword"` Datas string `orm:"datas" json:"datas"` Cart int `orm:"cart" json:"cart"` Createtime int `orm:"createtime" json:"createtime"` Lasttime int `orm:"lasttime" json:"lasttime"` ShareTitle string `orm:"share_title" json:"share_title"` ShareDesc string `orm:"share_desc" json:"share_desc"` ShareIcon string `orm:"share_icon" json:"share_icon"` EnterTitle string `orm:"enter_title" json:"enter_title"` EnterDesc string `orm:"enter_desc" json:"enter_desc"` EnterIcon string `orm:"enter_icon" json:"enter_icon"` Status int `orm:"status" json:"status"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_quick) TableName() string { return "ewei_shop_quick" } type Ewei_shop_sns_adv struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Advname string `orm:"advname" json:"advname"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` } func (*Ewei_shop_sns_adv) TableName() string { return "ewei_shop_sns_adv" } type Ewei_shop_sns_complain struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Postsid int `orm:"postsid" json:"postsid"` Defendant string `orm:"defendant" json:"defendant"` Complainant string `orm:"complainant" json:"complainant"` ComplaintType int `orm:"complaint_type" json:"complaint_type"` ComplaintText string `orm:"complaint_text" json:"complaint_text"` Images string `orm:"images" json:"images"` Createtime int `orm:"createtime" json:"createtime"` Checkedtime int `orm:"checkedtime" json:"checkedtime"` Checked int `orm:"checked" json:"checked"` CheckedNote string `orm:"checked_note" json:"checked_note"` Deleted int `orm:"deleted" json:"deleted"` } func (*Ewei_shop_sns_complain) TableName() string { return "ewei_shop_sns_complain" } type Ewei_shop_system_site struct { Id int `orm:"id" json:"id"` Type string `orm:"type" json:"type"` Content string `orm:"content" json:"content"` } func (*Ewei_shop_system_site) TableName() string { return "ewei_shop_system_site" } type Mc_fans_tag_mapping struct { Id int `orm:"id" json:"id"` Fanid int `orm:"fanid" json:"fanid"` Tagid int `orm:"tagid" json:"tagid"` } func (*Mc_fans_tag_mapping) TableName() string { return "mc_fans_tag_mapping" } type Business struct { Id int `orm:"id" json:"id"` Weid int `orm:"weid" json:"weid"` Title string `orm:"title" json:"title"` Thumb string `orm:"thumb" json:"thumb"` Content string `orm:"content" json:"content"` Phone string `orm:"phone" json:"phone"` Qq string `orm:"qq" json:"qq"` Province string `orm:"province" json:"province"` City string `orm:"city" json:"city"` Dist string `orm:"dist" json:"dist"` Address string `orm:"address" json:"address"` Lng string `orm:"lng" json:"lng"` Lat string `orm:"lat" json:"lat"` Industry1 string `orm:"industry1" json:"industry1"` Industry2 string `orm:"industry2" json:"industry2"` Createtime int `orm:"createtime" json:"createtime"` } func (*Business) TableName() string { return "business" } type Core_menu struct { Id int `orm:"id" json:"id"` Pid int `orm:"pid" json:"pid"` Title string `orm:"title" json:"title"` Name string `orm:"name" json:"name"` Url string `orm:"url" json:"url"` AppendTitle string `orm:"append_title" json:"append_title"` AppendUrl string `orm:"append_url" json:"append_url"` Displayorder int `orm:"displayorder" json:"displayorder"` Type string `orm:"type" json:"type"` IsDisplay int `orm:"is_display" json:"is_display"` IsSystem int `orm:"is_system" json:"is_system"` PermissionName string `orm:"permission_name" json:"permission_name"` GroupName string `orm:"group_name" json:"group_name"` Icon string `orm:"icon" json:"icon"` } func (*Core_menu) TableName() string { return "core_menu" } type Ewei_shop_member_favorite struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Goodsid int `orm:"goodsid" json:"goodsid"` Openid string `orm:"openid" json:"openid"` Deleted int `orm:"deleted" json:"deleted"` Createtime int `orm:"createtime" json:"createtime"` Merchid int `orm:"merchid" json:"merchid"` Type int `orm:"type" json:"type"` } func (*Ewei_shop_member_favorite) TableName() string { return "ewei_shop_member_favorite" } type Ewei_shop_print struct { Id int `orm:"id" json:"id"` Status int `orm:"status" json:"status"` Name string `orm:"name" json:"name"` PrintNo string `orm:"print_no" json:"print_no"` Key string `orm:"key" json:"key"` PrintNums int `orm:"print_nums" json:"print_nums"` Uniacid int `orm:"uniacid" json:"uniacid"` Sid int `orm:"sid" json:"sid"` PrintType int `orm:"print_type" json:"print_type"` QrcodeLink string `orm:"qrcode_link" json:"qrcode_link"` } func (*Ewei_shop_print) TableName() string { return "ewei_shop_print" } type Ewei_shop_sns_post struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Bid int `orm:"bid" json:"bid"` Pid int `orm:"pid" json:"pid"` Rpid int `orm:"rpid" json:"rpid"` Openid string `orm:"openid" json:"openid"` Avatar string `orm:"avatar" json:"avatar"` Nickname string `orm:"nickname" json:"nickname"` Title string `orm:"title" json:"title"` Content string `orm:"content" json:"content"` Images string `orm:"images" json:"images"` Voice string `orm:"voice" json:"voice"` Createtime int `orm:"createtime" json:"createtime"` Replytime int `orm:"replytime" json:"replytime"` Credit int `orm:"credit" json:"credit"` Views int `orm:"views" json:"views"` Islock int `orm:"islock" json:"islock"` Istop int `orm:"istop" json:"istop"` Isboardtop int `orm:"isboardtop" json:"isboardtop"` Isbest int `orm:"isbest" json:"isbest"` Isboardbest int `orm:"isboardbest" json:"isboardbest"` Deleted int `orm:"deleted" json:"deleted"` Deletedtime int `orm:"deletedtime" json:"deletedtime"` Checked int `orm:"checked" json:"checked"` Checktime int `orm:"checktime" json:"checktime"` Isadmin int `orm:"isadmin" json:"isadmin"` } func (*Ewei_shop_sns_post) TableName() string { return "ewei_shop_sns_post" } type Ewei_shop_system_plugingrant_package struct { Id int `orm:"id" json:"id"` Pluginid string `orm:"pluginid" json:"pluginid"` Text string `orm:"text" json:"text"` Thumb string `orm:"thumb" json:"thumb"` Data string `orm:"data" json:"data"` State int `orm:"state" json:"state"` Rec int `orm:"rec" json:"rec"` Desc string `orm:"desc" json:"desc"` Content string `orm:"content" json:"content"` Displayorder int `orm:"displayorder" json:"displayorder"` } func (*Ewei_shop_system_plugingrant_package) TableName() string { return "ewei_shop_system_plugingrant_package" } type Ewei_shop_cashier_clearing struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Cashierid int `orm:"cashierid" json:"cashierid"` Clearno string `orm:"clearno" json:"clearno"` Status int `orm:"status" json:"status"` Money float64 `orm:"money" json:"money"` Realmoney float64 `orm:"realmoney" json:"realmoney"` Remark string `orm:"remark" json:"remark"` Orderids string `orm:"orderids" json:"orderids"` Createtime int `orm:"createtime" json:"createtime"` Paytime int `orm:"paytime" json:"paytime"` Deleted int `orm:"deleted" json:"deleted"` Paytype int `orm:"paytype" json:"paytype"` Payinfo string `orm:"payinfo" json:"payinfo"` Charge float64 `orm:"charge" json:"charge"` } func (*Ewei_shop_cashier_clearing) TableName() string { return "ewei_shop_cashier_clearing" } type Ewei_shop_coupon_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Displayorder int `orm:"displayorder" json:"displayorder"` Status int `orm:"status" json:"status"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_coupon_category) TableName() string { return "ewei_shop_coupon_category" } type Ewei_shop_exchange_group struct { Id int `orm:"id" json:"id"` Title string `orm:"title" json:"title"` Type int `orm:"type" json:"type"` Endtime string `orm:"endtime" json:"endtime"` Mode int `orm:"mode" json:"mode"` Status int `orm:"status" json:"status"` Max int `orm:"max" json:"max"` Value float64 `orm:"value" json:"value"` Uniacid int `orm:"uniacid" json:"uniacid"` Starttime string `orm:"starttime" json:"starttime"` Goods string `orm:"goods" json:"goods"` Score int `orm:"score" json:"score"` Coupon string `orm:"coupon" json:"coupon"` Use int `orm:"use" json:"use"` Total int `orm:"total" json:"total"` Red float64 `orm:"red" json:"red"` Balance float64 `orm:"balance" json:"balance"` BalanceLeft float64 `orm:"balance_left" json:"balance_left"` BalanceRight float64 `orm:"balance_right" json:"balance_right"` RedLeft float64 `orm:"red_left" json:"red_left"` RedRight float64 `orm:"red_right" json:"red_right"` ScoreLeft int `orm:"score_left" json:"score_left"` ScoreRight int `orm:"score_right" json:"score_right"` BalanceType int `orm:"balance_type" json:"balance_type"` RedType int `orm:"red_type" json:"red_type"` ScoreType int `orm:"score_type" json:"score_type"` TitleReply string `orm:"title_reply" json:"title_reply"` Img string `orm:"img" json:"img"` Content string `orm:"content" json:"content"` Rule string `orm:"rule" json:"rule"` CouponType string `orm:"coupon_type" json:"coupon_type"` BasicContent string `orm:"basic_content" json:"basic_content"` ReplyType int `orm:"reply_type" json:"reply_type"` CodeType int `orm:"code_type" json:"code_type"` Binding int `orm:"binding" json:"binding"` Showcount int `orm:"showcount" json:"showcount"` Postage float64 `orm:"postage" json:"postage"` PostageType int `orm:"postage_type" json:"postage_type"` Banner string `orm:"banner" json:"banner"` KeywordReply int `orm:"keyword_reply" json:"keyword_reply"` ReplyStatus int `orm:"reply_status" json:"reply_status"` ReplyKeyword string `orm:"reply_keyword" json:"reply_keyword"` InputBanner string `orm:"input_banner" json:"input_banner"` Diypage int `orm:"diypage" json:"diypage"` Sendname string `orm:"sendname" json:"sendname"` Wishing string `orm:"wishing" json:"wishing"` Actname string `orm:"actname" json:"actname"` Remark string `orm:"remark" json:"remark"` Repeat int `orm:"repeat" json:"repeat"` Koulingstart string `orm:"koulingstart" json:"koulingstart"` Koulingend string `orm:"koulingend" json:"koulingend"` Kouling int `orm:"kouling" json:"kouling"` Chufa string `orm:"chufa" json:"chufa"` Chufaend string `orm:"chufaend" json:"chufaend"` } func (*Ewei_shop_exchange_group) TableName() string { return "ewei_shop_exchange_group" } type Ewei_shop_system_copyright struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Copyright string `orm:"copyright" json:"copyright"` Bgcolor string `orm:"bgcolor" json:"bgcolor"` Ismanage int `orm:"ismanage" json:"ismanage"` Logo string `orm:"logo" json:"logo"` Title string `orm:"title" json:"title"` } func (*Ewei_shop_system_copyright) TableName() string { return "ewei_shop_system_copyright" } type Site_nav struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Multiid int `orm:"multiid" json:"multiid"` Section int `orm:"section" json:"section"` Module string `orm:"module" json:"module"` Displayorder int `orm:"displayorder" json:"displayorder"` Name string `orm:"name" json:"name"` Description string `orm:"description" json:"description"` Position int `orm:"position" json:"position"` Url string `orm:"url" json:"url"` Icon string `orm:"icon" json:"icon"` Css string `orm:"css" json:"css"` Status int `orm:"status" json:"status"` Categoryid int `orm:"categoryid" json:"categoryid"` } func (*Site_nav) TableName() string { return "site_nav" } type Ewei_shop_seckill_task_goods struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Displayorder int `orm:"displayorder" json:"displayorder"` Taskid int `orm:"taskid" json:"taskid"` Roomid int `orm:"roomid" json:"roomid"` Timeid int `orm:"timeid" json:"timeid"` Goodsid int `orm:"goodsid" json:"goodsid"` Optionid int `orm:"optionid" json:"optionid"` Price float64 `orm:"price" json:"price"` Total int `orm:"total" json:"total"` Maxbuy int `orm:"maxbuy" json:"maxbuy"` Totalmaxbuy int `orm:"totalmaxbuy" json:"totalmaxbuy"` Commission1 float64 `orm:"commission1" json:"commission1"` Commission2 float64 `orm:"commission2" json:"commission2"` Commission3 float64 `orm:"commission3" json:"commission3"` } func (*Ewei_shop_seckill_task_goods) TableName() string { return "ewei_shop_seckill_task_goods" } type Ewei_shop_task_set struct { Uniacid int `orm:"uniacid" json:"uniacid"` Entrance int `orm:"entrance" json:"entrance"` Keyword string `orm:"keyword" json:"keyword"` CoverTitle string `orm:"cover_title" json:"cover_title"` CoverImg string `orm:"cover_img" json:"cover_img"` CoverDesc string `orm:"cover_desc" json:"cover_desc"` MsgPick string `orm:"msg_pick" json:"msg_pick"` MsgProgress string `orm:"msg_progress" json:"msg_progress"` MsgFinish string `orm:"msg_finish" json:"msg_finish"` MsgFollow string `orm:"msg_follow" json:"msg_follow"` Isnew int `orm:"isnew" json:"isnew"` BgImg string `orm:"bg_img" json:"bg_img"` TopNotice int `orm:"top_notice" json:"top_notice"` } func (*Ewei_shop_task_set) TableName() string { return "ewei_shop_task_set" } type Mobilenumber struct { Id int `orm:"id" json:"id"` Rid int `orm:"rid" json:"rid"` Enabled int `orm:"enabled" json:"enabled"` Dateline int `orm:"dateline" json:"dateline"` } func (*Mobilenumber) TableName() string { return "mobilenumber" } type Basic_reply struct { Id int `orm:"id" json:"id"` Rid int `orm:"rid" json:"rid"` Content string `orm:"content" json:"content"` } func (*Basic_reply) TableName() string { return "basic_reply" } type Ewei_shop_customer struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` KfId string `orm:"kf_id" json:"kf_id"` KfAccount string `orm:"kf_account" json:"kf_account"` KfNick string `orm:"kf_nick" json:"kf_nick"` KfPwd string `orm:"kf_pwd" json:"kf_pwd"` KfHeadimgurl string `orm:"kf_headimgurl" json:"kf_headimgurl"` Createtime int `orm:"createtime" json:"createtime"` } func (*Ewei_shop_customer) TableName() string { return "ewei_shop_customer" } type Ewei_shop_globonus_billp struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Billid int `orm:"billid" json:"billid"` Openid string `orm:"openid" json:"openid"` Payno string `orm:"payno" json:"payno"` Paytype int `orm:"paytype" json:"paytype"` Bonus float64 `orm:"bonus" json:"bonus"` Money float64 `orm:"money" json:"money"` Realmoney float64 `orm:"realmoney" json:"realmoney"` Paymoney float64 `orm:"paymoney" json:"paymoney"` Charge float64 `orm:"charge" json:"charge"` Chargemoney float64 `orm:"chargemoney" json:"chargemoney"` Status int `orm:"status" json:"status"` Reason string `orm:"reason" json:"reason"` Paytime int `orm:"paytime" json:"paytime"` } func (*Ewei_shop_globonus_billp) TableName() string { return "ewei_shop_globonus_billp" } type Ewei_shop_goods_param struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Goodsid int `orm:"goodsid" json:"goodsid"` Title string `orm:"title" json:"title"` Value string `orm:"value" json:"value"` Displayorder int `orm:"displayorder" json:"displayorder"` } func (*Ewei_shop_goods_param) TableName() string { return "ewei_shop_goods_param" } type Ewei_shop_poster struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Title string `orm:"title" json:"title"` Bg string `orm:"bg" json:"bg"` Data string `orm:"data" json:"data"` Keyword string `orm:"keyword" json:"keyword"` Times int `orm:"times" json:"times"` Follows int `orm:"follows" json:"follows"` Isdefault int `orm:"isdefault" json:"isdefault"` Resptitle string `orm:"resptitle" json:"resptitle"` Respthumb string `orm:"respthumb" json:"respthumb"` Createtime int `orm:"createtime" json:"createtime"` Respdesc string `orm:"respdesc" json:"respdesc"` Respurl string `orm:"respurl" json:"respurl"` Waittext string `orm:"waittext" json:"waittext"` Oktext string `orm:"oktext" json:"oktext"` Subcredit int `orm:"subcredit" json:"subcredit"` Submoney float64 `orm:"submoney" json:"submoney"` Reccredit int `orm:"reccredit" json:"reccredit"` Recmoney float64 `orm:"recmoney" json:"recmoney"` Paytype int `orm:"paytype" json:"paytype"` Scantext string `orm:"scantext" json:"scantext"` Subtext string `orm:"subtext" json:"subtext"` Beagent int `orm:"beagent" json:"beagent"` Bedown int `orm:"bedown" json:"bedown"` Isopen int `orm:"isopen" json:"isopen"` Opentext string `orm:"opentext" json:"opentext"` Openurl string `orm:"openurl" json:"openurl"` Templateid string `orm:"templateid" json:"templateid"` Subpaycontent string `orm:"subpaycontent" json:"subpaycontent"` Recpaycontent string `orm:"recpaycontent" json:"recpaycontent"` Entrytext string `orm:"entrytext" json:"entrytext"` Reccouponid int `orm:"reccouponid" json:"reccouponid"` Reccouponnum int `orm:"reccouponnum" json:"reccouponnum"` Subcouponid int `orm:"subcouponid" json:"subcouponid"` Subcouponnum int `orm:"subcouponnum" json:"subcouponnum"` Resptype int `orm:"resptype" json:"resptype"` Resptext string `orm:"resptext" json:"resptext"` Keyword2 string `orm:"keyword2" json:"keyword2"` Resptext11 string `orm:"resptext11" json:"resptext11"` RewardTotle string `orm:"reward_totle" json:"reward_totle"` Ismembergroup int `orm:"ismembergroup" json:"ismembergroup"` Membergroupid int `orm:"membergroupid" json:"membergroupid"` } func (*Ewei_shop_poster) TableName() string { return "ewei_shop_poster" } type Ewei_shop_task_default struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Data string `orm:"data" json:"data"` Addtime int `orm:"addtime" json:"addtime"` Bgimg string `orm:"bgimg" json:"bgimg"` Open int `orm:"open" json:"open"` } func (*Ewei_shop_task_default) TableName() string { return "ewei_shop_task_default" } type Uni_settings struct { Uniacid int `orm:"uniacid" json:"uniacid"` Passport string `orm:"passport" json:"passport"` Oauth string `orm:"oauth" json:"oauth"` JsauthAcid int `orm:"jsauth_acid" json:"jsauth_acid"` Uc string `orm:"uc" json:"uc"` Notify string `orm:"notify" json:"notify"` Creditnames string `orm:"creditnames" json:"creditnames"` Creditbehaviors string `orm:"creditbehaviors" json:"creditbehaviors"` Welcome string `orm:"welcome" json:"welcome"` Default string `orm:"default" json:"default"` DefaultMessage string `orm:"default_message" json:"default_message"` Payment string `orm:"payment" json:"payment"` Stat string `orm:"stat" json:"stat"` DefaultSite int `orm:"default_site" json:"default_site"` Sync int `orm:"sync" json:"sync"` Recharge string `orm:"recharge" json:"recharge"` Tplnotice string `orm:"tplnotice" json:"tplnotice"` Grouplevel int `orm:"grouplevel" json:"grouplevel"` Mcplugin string `orm:"mcplugin" json:"mcplugin"` ExchangeEnable int `orm:"exchange_enable" json:"exchange_enable"` CouponType int `orm:"coupon_type" json:"coupon_type"` Menuset string `orm:"menuset" json:"menuset"` Shortcuts string `orm:"shortcuts" json:"shortcuts"` Statistics string `orm:"statistics" json:"statistics"` BindDomain string `orm:"bind_domain" json:"bind_domain"` } func (*Uni_settings) TableName() string { return "uni_settings" } type Core_cache struct { Key string `orm:"key" json:"key"` Value string `orm:"value" json:"value"` } func (*Core_cache) TableName() string { return "core_cache" } type Core_sessions struct { Sid string `orm:"sid" json:"sid"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Data string `orm:"data" json:"data"` Expiretime int `orm:"expiretime" json:"expiretime"` } func (*Core_sessions) TableName() string { return "core_sessions" } type Coupon_groups struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Couponid string `orm:"couponid" json:"couponid"` Groupid int `orm:"groupid" json:"groupid"` } func (*Coupon_groups) TableName() string { return "coupon_groups" } type Ewei_shop_diypage_template struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Name string `orm:"name" json:"name"` Data string `orm:"data" json:"data"` Preview string `orm:"preview" json:"preview"` Tplid int `orm:"tplid" json:"tplid"` Cate int `orm:"cate" json:"cate"` Deleted int `orm:"deleted" json:"deleted"` Merch int `orm:"merch" json:"merch"` } func (*Ewei_shop_diypage_template) TableName() string { return "ewei_shop_diypage_template" } type Ewei_shop_goods_spec struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Goodsid int `orm:"goodsid" json:"goodsid"` Title string `orm:"title" json:"title"` Description string `orm:"description" json:"description"` Displaytype int `orm:"displaytype" json:"displaytype"` Content string `orm:"content" json:"content"` Displayorder int `orm:"displayorder" json:"displayorder"` PropId string `orm:"propId" json:"propId"` } func (*Ewei_shop_goods_spec) TableName() string { return "ewei_shop_goods_spec" } type Ewei_shop_invitation_log struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` InvitationId int `orm:"invitation_id" json:"invitation_id"` Openid string `orm:"openid" json:"openid"` InvitationOpenid string `orm:"invitation_openid" json:"invitation_openid"` ScanTime int `orm:"scan_time" json:"scan_time"` Follow int `orm:"follow" json:"follow"` } func (*Ewei_shop_invitation_log) TableName() string { return "ewei_shop_invitation_log" } type Ewei_shop_order_comment struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Orderid int `orm:"orderid" json:"orderid"` Goodsid int `orm:"goodsid" json:"goodsid"` Openid string `orm:"openid" json:"openid"` Nickname string `orm:"nickname" json:"nickname"` Headimgurl string `orm:"headimgurl" json:"headimgurl"` Level int `orm:"level" json:"level"` Content string `orm:"content" json:"content"` Images string `orm:"images" json:"images"` Createtime int `orm:"createtime" json:"createtime"` Deleted int `orm:"deleted" json:"deleted"` AppendContent string `orm:"append_content" json:"append_content"` AppendImages string `orm:"append_images" json:"append_images"` ReplyContent string `orm:"reply_content" json:"reply_content"` ReplyImages string `orm:"reply_images" json:"reply_images"` AppendReplyContent string `orm:"append_reply_content" json:"append_reply_content"` AppendReplyImages string `orm:"append_reply_images" json:"append_reply_images"` Istop int `orm:"istop" json:"istop"` Checked int `orm:"checked" json:"checked"` Replychecked int `orm:"replychecked" json:"replychecked"` } func (*Ewei_shop_order_comment) TableName() string { return "ewei_shop_order_comment" } type Ewei_shop_store struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Storename string `orm:"storename" json:"storename"` Address string `orm:"address" json:"address"` Tel string `orm:"tel" json:"tel"` Lat string `orm:"lat" json:"lat"` Lng string `orm:"lng" json:"lng"` Status int `orm:"status" json:"status"` Realname string `orm:"realname" json:"realname"` Mobile string `orm:"mobile" json:"mobile"` Fetchtime string `orm:"fetchtime" json:"fetchtime"` Type int `orm:"type" json:"type"` Logo string `orm:"logo" json:"logo"` Saletime string `orm:"saletime" json:"saletime"` Desc string `orm:"desc" json:"desc"` Displayorder int `orm:"displayorder" json:"displayorder"` OrderPrinter string `orm:"order_printer" json:"order_printer"` OrderTemplate int `orm:"order_template" json:"order_template"` Ordertype string `orm:"ordertype" json:"ordertype"` Banner string `orm:"banner" json:"banner"` Label string `orm:"label" json:"label"` Tag string `orm:"tag" json:"tag"` Classify int `orm:"classify" json:"classify"` Perms string `orm:"perms" json:"perms"` Citycode string `orm:"citycode" json:"citycode"` Opensend int `orm:"opensend" json:"opensend"` Province string `orm:"province" json:"province"` City string `orm:"city" json:"city"` Area string `orm:"area" json:"area"` Provincecode string `orm:"provincecode" json:"provincecode"` Areacode string `orm:"areacode" json:"areacode"` Diypage int `orm:"diypage" json:"diypage"` DiypageIspage int `orm:"diypage_ispage" json:"diypage_ispage"` DiypageList string `orm:"diypage_list" json:"diypage_list"` Storegroupid int `orm:"storegroupid" json:"storegroupid"` Cates string `orm:"cates" json:"cates"` } func (*Ewei_shop_store) TableName() string { return "ewei_shop_store" } type Ewei_shop_wxapp_page struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Name string `orm:"name" json:"name"` Data string `orm:"data" json:"data"` Createtime int `orm:"createtime" json:"createtime"` Lasttime int `orm:"lasttime" json:"lasttime"` Status int `orm:"status" json:"status"` Isdefault int `orm:"isdefault" json:"isdefault"` } func (*Ewei_shop_wxapp_page) TableName() string { return "ewei_shop_wxapp_page" } type Mc_cash_record struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Uid int `orm:"uid" json:"uid"` ClerkId int `orm:"clerk_id" json:"clerk_id"` StoreId int `orm:"store_id" json:"store_id"` ClerkType int `orm:"clerk_type" json:"clerk_type"` Fee float64 `orm:"fee" json:"fee"` FinalFee float64 `orm:"final_fee" json:"final_fee"` Credit1 int `orm:"credit1" json:"credit1"` Credit1Fee float64 `orm:"credit1_fee" json:"credit1_fee"` Credit2 float64 `orm:"credit2" json:"credit2"` Cash float64 `orm:"cash" json:"cash"` ReturnCash float64 `orm:"return_cash" json:"return_cash"` FinalCash float64 `orm:"final_cash" json:"final_cash"` Remark string `orm:"remark" json:"remark"` Createtime int `orm:"createtime" json:"createtime"` TradeType string `orm:"trade_type" json:"trade_type"` } func (*Mc_cash_record) TableName() string { return "mc_cash_record" } type Mc_credits_recharge struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Uid int `orm:"uid" json:"uid"` Openid string `orm:"openid" json:"openid"` Tid string `orm:"tid" json:"tid"` Transid string `orm:"transid" json:"transid"` Fee string `orm:"fee" json:"fee"` Type string `orm:"type" json:"type"` Tag string `orm:"tag" json:"tag"` Status int `orm:"status" json:"status"` Createtime int `orm:"createtime" json:"createtime"` Backtype int `orm:"backtype" json:"backtype"` } func (*Mc_credits_recharge) TableName() string { return "mc_credits_recharge" } type Modules_plugin struct { Id int `orm:"id" json:"id"` Name string `orm:"name" json:"name"` MainModule string `orm:"main_module" json:"main_module"` } func (*Modules_plugin) TableName() string { return "modules_plugin" } type Uni_verifycode struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Receiver string `orm:"receiver" json:"receiver"` Verifycode string `orm:"verifycode" json:"verifycode"` Total int `orm:"total" json:"total"` Createtime int `orm:"createtime" json:"createtime"` } func (*Uni_verifycode) TableName() string { return "uni_verifycode" } type Account_wechats struct { Acid int `orm:"acid" json:"acid"` Uniacid int `orm:"uniacid" json:"uniacid"` Token string `orm:"token" json:"token"` Encodingaeskey string `orm:"encodingaeskey" json:"encodingaeskey"` Level int `orm:"level" json:"level"` Name string `orm:"name" json:"name"` Account string `orm:"account" json:"account"` Original string `orm:"original" json:"original"` Signature string `orm:"signature" json:"signature"` Country string `orm:"country" json:"country"` Province string `orm:"province" json:"province"` City string `orm:"city" json:"city"` Username string `orm:"username" json:"username"` Password string `orm:"password" json:"password"` Lastupdate int `orm:"lastupdate" json:"lastupdate"` Key string `orm:"key" json:"key"` Secret string `orm:"secret" json:"secret"` Styleid int `orm:"styleid" json:"styleid"` Subscribeurl string `orm:"subscribeurl" json:"subscribeurl"` AuthRefreshToken string `orm:"auth_refresh_token" json:"auth_refresh_token"` AccessToken string `orm:"access_token" json:"access_token"` } func (*Account_wechats) TableName() string { return "account_wechats" } type Ewei_shop_article_sys struct { Uniacid int `orm:"uniacid" json:"uniacid"` ArticleMessage string `orm:"article_message" json:"article_message"` ArticleTitle string `orm:"article_title" json:"article_title"` ArticleImage string `orm:"article_image" json:"article_image"` ArticleShownum int `orm:"article_shownum" json:"article_shownum"` ArticleKeyword string `orm:"article_keyword" json:"article_keyword"` ArticleTemp int `orm:"article_temp" json:"article_temp"` ArticleSource string `orm:"article_source" json:"article_source"` } func (*Ewei_shop_article_sys) TableName() string { return "ewei_shop_article_sys" } type Ewei_shop_author_level struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Levelname string `orm:"levelname" json:"levelname"` Bonus float64 `orm:"bonus" json:"bonus"` Ordermoney float64 `orm:"ordermoney" json:"ordermoney"` Ordercount int `orm:"ordercount" json:"ordercount"` Commissionmoney float64 `orm:"commissionmoney" json:"commissionmoney"` Bonusmoney float64 `orm:"bonusmoney" json:"bonusmoney"` Downcount int `orm:"downcount" json:"downcount"` BonusFg string `orm:"bonus_fg" json:"bonus_fg"` } func (*Ewei_shop_author_level) TableName() string { return "ewei_shop_author_level" } type Ewei_shop_seckill_task struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Cateid int `orm:"cateid" json:"cateid"` Title string `orm:"title" json:"title"` Enabled int `orm:"enabled" json:"enabled"` PageTitle string `orm:"page_title" json:"page_title"` ShareTitle string `orm:"share_title" json:"share_title"` ShareDesc string `orm:"share_desc" json:"share_desc"` ShareIcon string `orm:"share_icon" json:"share_icon"` Tag string `orm:"tag" json:"tag"` Closesec int `orm:"closesec" json:"closesec"` Oldshow int `orm:"oldshow" json:"oldshow"` Times string `orm:"times" json:"times"` Createtime int `orm:"createtime" json:"createtime"` Overtimes int `orm:"overtimes" json:"overtimes"` } func (*Ewei_shop_seckill_task) TableName() string { return "ewei_shop_seckill_task" } type Article_notice struct { Id int `orm:"id" json:"id"` Cateid int `orm:"cateid" json:"cateid"` Title string `orm:"title" json:"title"` Content string `orm:"content" json:"content"` Displayorder int `orm:"displayorder" json:"displayorder"` IsDisplay int `orm:"is_display" json:"is_display"` IsShowHome int `orm:"is_show_home" json:"is_show_home"` Createtime int `orm:"createtime" json:"createtime"` Click int `orm:"click" json:"click"` Style string `orm:"style" json:"style"` } func (*Article_notice) TableName() string { return "article_notice" } type Ewei_shop_cashier_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Catename string `orm:"catename" json:"catename"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` Displayorder int `orm:"displayorder" json:"displayorder"` } func (*Ewei_shop_cashier_category) TableName() string { return "ewei_shop_cashier_category" } type Ewei_shop_creditshop_adv struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Advname string `orm:"advname" json:"advname"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_creditshop_adv) TableName() string { return "ewei_shop_creditshop_adv" } type Ewei_shop_live_status struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Roomid int `orm:"roomid" json:"roomid"` Starttime int `orm:"starttime" json:"starttime"` Endtime int `orm:"endtime" json:"endtime"` } func (*Ewei_shop_live_status) TableName() string { return "ewei_shop_live_status" } type Ewei_shop_pc_menu struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Displayorder int `orm:"displayorder" json:"displayorder"` Title string `orm:"title" json:"title"` Link string `orm:"link" json:"link"` Enabled int `orm:"enabled" json:"enabled"` Createtime int `orm:"createtime" json:"createtime"` } func (*Ewei_shop_pc_menu) TableName() string { return "ewei_shop_pc_menu" } type Ewei_shop_sign_records struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Time int `orm:"time" json:"time"` Openid string `orm:"openid" json:"openid"` Credit int `orm:"credit" json:"credit"` Log string `orm:"log" json:"log"` Type int `orm:"type" json:"type"` Day int `orm:"day" json:"day"` } func (*Ewei_shop_sign_records) TableName() string { return "ewei_shop_sign_records" } type Qrcode struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Acid int `orm:"acid" json:"acid"` Type string `orm:"type" json:"type"` Extra int `orm:"extra" json:"extra"` Qrcid int `orm:"qrcid" json:"qrcid"` SceneStr string `orm:"scene_str" json:"scene_str"` Name string `orm:"name" json:"name"` Keyword string `orm:"keyword" json:"keyword"` Model int `orm:"model" json:"model"` Ticket string `orm:"ticket" json:"ticket"` Url string `orm:"url" json:"url"` Expire int `orm:"expire" json:"expire"` Subnum int `orm:"subnum" json:"subnum"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` } func (*Qrcode) TableName() string { return "qrcode" } type Stat_visit struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Module string `orm:"module" json:"module"` Count int `orm:"count" json:"count"` Date int `orm:"date" json:"date"` } func (*Stat_visit) TableName() string { return "stat_visit" } type Wechat_news struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` AttachId int `orm:"attach_id" json:"attach_id"` ThumbMediaId string `orm:"thumb_media_id" json:"thumb_media_id"` ThumbUrl string `orm:"thumb_url" json:"thumb_url"` Title string `orm:"title" json:"title"` Author string `orm:"author" json:"author"` Digest string `orm:"digest" json:"digest"` Content string `orm:"content" json:"content"` ContentSourceUrl string `orm:"content_source_url" json:"content_source_url"` ShowCoverPic int `orm:"show_cover_pic" json:"show_cover_pic"` Url string `orm:"url" json:"url"` Displayorder int `orm:"displayorder" json:"displayorder"` } func (*Wechat_news) TableName() string { return "wechat_news" } type Ewei_shop_cashier_qrcode struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Cashierid int `orm:"cashierid" json:"cashierid"` Title string `orm:"title" json:"title"` Goodstitle string `orm:"goodstitle" json:"goodstitle"` Money float64 `orm:"money" json:"money"` Createtime int `orm:"createtime" json:"createtime"` } func (*Ewei_shop_cashier_qrcode) TableName() string { return "ewei_shop_cashier_qrcode" } type Ewei_shop_diyform_temp struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Typeid int `orm:"typeid" json:"typeid"` Cid int `orm:"cid" json:"cid"` Diyformfields string `orm:"diyformfields" json:"diyformfields"` Fields string `orm:"fields" json:"fields"` Openid string `orm:"openid" json:"openid"` Type int `orm:"type" json:"type"` Diyformid int `orm:"diyformid" json:"diyformid"` Diyformdata string `orm:"diyformdata" json:"diyformdata"` CarrierRealname string `orm:"carrier_realname" json:"carrier_realname"` CarrierMobile string `orm:"carrier_mobile" json:"carrier_mobile"` } func (*Ewei_shop_diyform_temp) TableName() string { return "ewei_shop_diyform_temp" } type Ewei_shop_merch_bill struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Applyno string `orm:"applyno" json:"applyno"` Merchid int `orm:"merchid" json:"merchid"` Orderids string `orm:"orderids" json:"orderids"` Realprice float64 `orm:"realprice" json:"realprice"` Realpricerate float64 `orm:"realpricerate" json:"realpricerate"` Finalprice float64 `orm:"finalprice" json:"finalprice"` Payrateprice float64 `orm:"payrateprice" json:"payrateprice"` Payrate float64 `orm:"payrate" json:"payrate"` Money float64 `orm:"money" json:"money"` Applytime int `orm:"applytime" json:"applytime"` Checktime int `orm:"checktime" json:"checktime"` Paytime int `orm:"paytime" json:"paytime"` Invalidtime int `orm:"invalidtime" json:"invalidtime"` Refusetime int `orm:"refusetime" json:"refusetime"` Remark string `orm:"remark" json:"remark"` Status int `orm:"status" json:"status"` Ordernum int `orm:"ordernum" json:"ordernum"` Orderprice float64 `orm:"orderprice" json:"orderprice"` Price float64 `orm:"price" json:"price"` Passrealprice float64 `orm:"passrealprice" json:"passrealprice"` Passrealpricerate float64 `orm:"passrealpricerate" json:"passrealpricerate"` Passorderids string `orm:"passorderids" json:"passorderids"` Passordernum int `orm:"passordernum" json:"passordernum"` Passorderprice float64 `orm:"passorderprice" json:"passorderprice"` Alipay string `orm:"alipay" json:"alipay"` Bankname string `orm:"bankname" json:"bankname"` Bankcard string `orm:"bankcard" json:"bankcard"` Applyrealname string `orm:"applyrealname" json:"applyrealname"` Applytype int `orm:"applytype" json:"applytype"` Handpay int `orm:"handpay" json:"handpay"` } func (*Ewei_shop_merch_bill) TableName() string { return "ewei_shop_merch_bill" } type Ewei_shop_saler struct { Id int `orm:"id" json:"id"` Storeid int `orm:"storeid" json:"storeid"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Status int `orm:"status" json:"status"` Salername string `orm:"salername" json:"salername"` Username string `orm:"username" json:"username"` Pwd string `orm:"pwd" json:"pwd"` Salt string `orm:"salt" json:"salt"` Lastvisit string `orm:"lastvisit" json:"lastvisit"` Lastip string `orm:"lastip" json:"lastip"` Isfounder int `orm:"isfounder" json:"isfounder"` Mobile string `orm:"mobile" json:"mobile"` Getmessage int `orm:"getmessage" json:"getmessage"` Getnotice int `orm:"getnotice" json:"getnotice"` Roleid int `orm:"roleid" json:"roleid"` } func (*Ewei_shop_saler) TableName() string { return "ewei_shop_saler" } type Ewei_shop_task_joiner struct { CompleteId int `orm:"complete_id" json:"complete_id"` Uniacid int `orm:"uniacid" json:"uniacid"` TaskUser string `orm:"task_user" json:"task_user"` JoinerId string `orm:"joiner_id" json:"joiner_id"` JoinId int `orm:"join_id" json:"join_id"` TaskId int `orm:"task_id" json:"task_id"` TaskType int `orm:"task_type" json:"task_type"` JoinStatus int `orm:"join_status" json:"join_status"` Addtime int `orm:"addtime" json:"addtime"` } func (*Ewei_shop_task_joiner) TableName() string { return "ewei_shop_task_joiner" } type Ewei_shop_wxcard struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` CardId string `orm:"card_id" json:"card_id"` Displayorder int `orm:"displayorder" json:"displayorder"` Catid int `orm:"catid" json:"catid"` CardType string `orm:"card_type" json:"card_type"` LogoUrl string `orm:"logo_url" json:"logo_url"` Wxlogourl string `orm:"wxlogourl" json:"wxlogourl"` BrandName string `orm:"brand_name" json:"brand_name"` CodeType string `orm:"code_type" json:"code_type"` Title string `orm:"title" json:"title"` Color string `orm:"color" json:"color"` Notice string `orm:"notice" json:"notice"` ServicePhone string `orm:"service_phone" json:"service_phone"` Description string `orm:"description" json:"description"` Datetype string `orm:"datetype" json:"datetype"` BeginTimestamp int `orm:"begin_timestamp" json:"begin_timestamp"` EndTimestamp int `orm:"end_timestamp" json:"end_timestamp"` FixedTerm int `orm:"fixed_term" json:"fixed_term"` FixedBeginTerm int `orm:"fixed_begin_term" json:"fixed_begin_term"` Quantity int `orm:"quantity" json:"quantity"` TotalQuantity string `orm:"total_quantity" json:"total_quantity"` UseLimit int `orm:"use_limit" json:"use_limit"` GetLimit int `orm:"get_limit" json:"get_limit"` UseCustomCode int `orm:"use_custom_code" json:"use_custom_code"` BindOpenid int `orm:"bind_openid" json:"bind_openid"` CanShare int `orm:"can_share" json:"can_share"` CanGiveFriend int `orm:"can_give_friend" json:"can_give_friend"` CenterTitle string `orm:"center_title" json:"center_title"` CenterSubTitle string `orm:"center_sub_title" json:"center_sub_title"` CenterUrl string `orm:"center_url" json:"center_url"` Setcustom int `orm:"setcustom" json:"setcustom"` CustomUrlName string `orm:"custom_url_name" json:"custom_url_name"` CustomUrlSubTitle string `orm:"custom_url_sub_title" json:"custom_url_sub_title"` CustomUrl string `orm:"custom_url" json:"custom_url"` Setpromotion int `orm:"setpromotion" json:"setpromotion"` PromotionUrlName string `orm:"promotion_url_name" json:"promotion_url_name"` PromotionUrlSubTitle string `orm:"promotion_url_sub_title" json:"promotion_url_sub_title"` PromotionUrl string `orm:"promotion_url" json:"promotion_url"` Source string `orm:"source" json:"source"` CanUseWithOtherDiscount int `orm:"can_use_with_other_discount" json:"can_use_with_other_discount"` Setabstract int `orm:"setabstract" json:"setabstract"` Abstract string `orm:"abstract" json:"abstract"` Abstractimg string `orm:"abstractimg" json:"abstractimg"` IconUrlList string `orm:"icon_url_list" json:"icon_url_list"` AcceptCategory string `orm:"accept_category" json:"accept_category"` RejectCategory string `orm:"reject_category" json:"reject_category"` LeastCost float64 `orm:"least_cost" json:"least_cost"` ReduceCost float64 `orm:"reduce_cost" json:"reduce_cost"` Discount float64 `orm:"discount" json:"discount"` Limitgoodtype int `orm:"limitgoodtype" json:"limitgoodtype"` Limitgoodcatetype int `orm:"limitgoodcatetype" json:"limitgoodcatetype"` Limitgoodcateids string `orm:"limitgoodcateids" json:"limitgoodcateids"` Limitgoodids string `orm:"limitgoodids" json:"limitgoodids"` Limitdiscounttype int `orm:"limitdiscounttype" json:"limitdiscounttype"` Merchid int `orm:"merchid" json:"merchid"` Gettype int `orm:"gettype" json:"gettype"` Islimitlevel int `orm:"islimitlevel" json:"islimitlevel"` Limitmemberlevels string `orm:"limitmemberlevels" json:"limitmemberlevels"` Limitagentlevels string `orm:"limitagentlevels" json:"limitagentlevels"` Limitpartnerlevels string `orm:"limitpartnerlevels" json:"limitpartnerlevels"` Limitaagentlevels string `orm:"limitaagentlevels" json:"limitaagentlevels"` Settitlecolor int `orm:"settitlecolor" json:"settitlecolor"` Titlecolor string `orm:"titlecolor" json:"titlecolor"` Tagtitle string `orm:"tagtitle" json:"tagtitle"` UseCondition int `orm:"use_condition" json:"use_condition"` } func (*Ewei_shop_wxcard) TableName() string { return "ewei_shop_wxcard" } type Stat_keyword struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Rid string `orm:"rid" json:"rid"` Kid int `orm:"kid" json:"kid"` Hit int `orm:"hit" json:"hit"` Lastupdate int `orm:"lastupdate" json:"lastupdate"` Createtime int `orm:"createtime" json:"createtime"` } func (*Stat_keyword) TableName() string { return "stat_keyword" } type Core_settings struct { Key string `orm:"key" json:"key"` Value string `orm:"value" json:"value"` } func (*Core_settings) TableName() string { return "core_settings" } type Ewei_shop_abonus_level struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Levelname string `orm:"levelname" json:"levelname"` Bonus1 float64 `orm:"bonus1" json:"bonus1"` Bonus2 float64 `orm:"bonus2" json:"bonus2"` Bonus3 float64 `orm:"bonus3" json:"bonus3"` Ordermoney float64 `orm:"ordermoney" json:"ordermoney"` Ordercount int `orm:"ordercount" json:"ordercount"` Bonusmoney float64 `orm:"bonusmoney" json:"bonusmoney"` Downcount int `orm:"downcount" json:"downcount"` } func (*Ewei_shop_abonus_level) TableName() string { return "ewei_shop_abonus_level" } type Ewei_shop_designer_menu struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Menuname string `orm:"menuname" json:"menuname"` Isdefault int `orm:"isdefault" json:"isdefault"` Createtime int `orm:"createtime" json:"createtime"` Menus string `orm:"menus" json:"menus"` Params string `orm:"params" json:"params"` } func (*Ewei_shop_designer_menu) TableName() string { return "ewei_shop_designer_menu" } type Ewei_shop_live_adv struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Merchid int `orm:"merchid" json:"merchid"` Advname string `orm:"advname" json:"advname"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` } func (*Ewei_shop_live_adv) TableName() string { return "ewei_shop_live_adv" } type Ewei_shop_member_log struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Type int `orm:"type" json:"type"` Logno string `orm:"logno" json:"logno"` Title string `orm:"title" json:"title"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` Money float64 `orm:"money" json:"money"` Rechargetype string `orm:"rechargetype" json:"rechargetype"` Gives float64 `orm:"gives" json:"gives"` Couponid int `orm:"couponid" json:"couponid"` Transid string `orm:"transid" json:"transid"` Realmoney float64 `orm:"realmoney" json:"realmoney"` Charge float64 `orm:"charge" json:"charge"` Deductionmoney float64 `orm:"deductionmoney" json:"deductionmoney"` Isborrow int `orm:"isborrow" json:"isborrow"` Borrowopenid string `orm:"borrowopenid" json:"borrowopenid"` Remark string `orm:"remark" json:"remark"` Apppay int `orm:"apppay" json:"apppay"` Alipay string `orm:"alipay" json:"alipay"` Bankname string `orm:"bankname" json:"bankname"` Bankcard string `orm:"bankcard" json:"bankcard"` Realname string `orm:"realname" json:"realname"` Applytype int `orm:"applytype" json:"applytype"` Sendmoney float64 `orm:"sendmoney" json:"sendmoney"` Senddata string `orm:"senddata" json:"senddata"` } func (*Ewei_shop_member_log) TableName() string { return "ewei_shop_member_log" } type Ewei_shop_merch_perm_role struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Merchid int `orm:"merchid" json:"merchid"` Rolename string `orm:"rolename" json:"rolename"` Status int `orm:"status" json:"status"` Perms string `orm:"perms" json:"perms"` Deleted int `orm:"deleted" json:"deleted"` } func (*Ewei_shop_merch_perm_role) TableName() string { return "ewei_shop_merch_perm_role" } type Ewei_shop_seckill_adv struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Advname string `orm:"advname" json:"advname"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` } func (*Ewei_shop_seckill_adv) TableName() string { return "ewei_shop_seckill_adv" } type Ewei_shop_system_adv struct { Id int `orm:"id" json:"id"` Title string `orm:"title" json:"title"` Thumb string `orm:"thumb" json:"thumb"` Url string `orm:"url" json:"url"` Createtime int `orm:"createtime" json:"createtime"` Displayorder int `orm:"displayorder" json:"displayorder"` Module string `orm:"module" json:"module"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_system_adv) TableName() string { return "ewei_shop_system_adv" } type Message_notice_log struct { Id int `orm:"id" json:"id"` Message string `orm:"message" json:"message"` IsRead int `orm:"is_read" json:"is_read"` Uid int `orm:"uid" json:"uid"` Sign string `orm:"sign" json:"sign"` Type int `orm:"type" json:"type"` Status int `orm:"status" json:"status"` CreateTime int `orm:"create_time" json:"create_time"` EndTime int `orm:"end_time" json:"end_time"` } func (*Message_notice_log) TableName() string { return "message_notice_log" } type Ewei_shop_author_bill struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Billno string `orm:"billno" json:"billno"` Paytype int `orm:"paytype" json:"paytype"` Year int `orm:"year" json:"year"` Month int `orm:"month" json:"month"` Week int `orm:"week" json:"week"` Ordercount int `orm:"ordercount" json:"ordercount"` Ordermoney float64 `orm:"ordermoney" json:"ordermoney"` Bonusordermoney float64 `orm:"bonusordermoney" json:"bonusordermoney"` Bonusrate float64 `orm:"bonusrate" json:"bonusrate"` Bonusmoney float64 `orm:"bonusmoney" json:"bonusmoney"` BonusmoneySend float64 `orm:"bonusmoney_send" json:"bonusmoney_send"` BonusmoneyPay float64 `orm:"bonusmoney_pay" json:"bonusmoney_pay"` Paytime int `orm:"paytime" json:"paytime"` Partnercount int `orm:"partnercount" json:"partnercount"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` Starttime int `orm:"starttime" json:"starttime"` Endtime int `orm:"endtime" json:"endtime"` Confirmtime int `orm:"confirmtime" json:"confirmtime"` } func (*Ewei_shop_author_bill) TableName() string { return "ewei_shop_author_bill" } type Ewei_shop_commission_repurchase struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Year int `orm:"year" json:"year"` Month int `orm:"month" json:"month"` Repurchase float64 `orm:"repurchase" json:"repurchase"` Applyid int `orm:"applyid" json:"applyid"` } func (*Ewei_shop_commission_repurchase) TableName() string { return "ewei_shop_commission_repurchase" } type Ewei_shop_lottery_join struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` JoinUser string `orm:"join_user" json:"join_user"` LotteryId int `orm:"lottery_id" json:"lottery_id"` LotteryNum int `orm:"lottery_num" json:"lottery_num"` LotteryTag string `orm:"lottery_tag" json:"lottery_tag"` Addtime int `orm:"addtime" json:"addtime"` } func (*Ewei_shop_lottery_join) TableName() string { return "ewei_shop_lottery_join" } type Ewei_shop_perm_log struct { Id int `orm:"id" json:"id"` Uid int `orm:"uid" json:"uid"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Type string `orm:"type" json:"type"` Op string `orm:"op" json:"op"` Createtime int `orm:"createtime" json:"createtime"` Ip string `orm:"ip" json:"ip"` } func (*Ewei_shop_perm_log) TableName() string { return "ewei_shop_perm_log" } type Users_failed_login struct { Id int `orm:"id" json:"id"` Ip string `orm:"ip" json:"ip"` Username string `orm:"username" json:"username"` Count int `orm:"count" json:"count"` Lastupdate int `orm:"lastupdate" json:"lastupdate"` } func (*Users_failed_login) TableName() string { return "users_failed_login" } type Ewei_message_mass_task struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Title string `orm:"title" json:"title"` Status int `orm:"status" json:"status"` Processnum int `orm:"processnum" json:"processnum"` Sendnum int `orm:"sendnum" json:"sendnum"` Messagetype int `orm:"messagetype" json:"messagetype"` Templateid int `orm:"templateid" json:"templateid"` Resptitle string `orm:"resptitle" json:"resptitle"` Respthumb string `orm:"respthumb" json:"respthumb"` Respdesc string `orm:"respdesc" json:"respdesc"` Respurl string `orm:"respurl" json:"respurl"` Sendlimittype int `orm:"sendlimittype" json:"sendlimittype"` SendOpenid string `orm:"send_openid" json:"send_openid"` SendLevel int `orm:"send_level" json:"send_level"` SendGroup int `orm:"send_group" json:"send_group"` SendAgentlevel int `orm:"send_agentlevel" json:"send_agentlevel"` Customertype int `orm:"customertype" json:"customertype"` Resdesc2 string `orm:"resdesc2" json:"resdesc2"` Pagecount int `orm:"pagecount" json:"pagecount"` Successnum int `orm:"successnum" json:"successnum"` Failnum int `orm:"failnum" json:"failnum"` } func (*Ewei_message_mass_task) TableName() string { return "ewei_message_mass_task" } type Ewei_shop_author_billp struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Billid int `orm:"billid" json:"billid"` Openid string `orm:"openid" json:"openid"` Payno string `orm:"payno" json:"payno"` Paytype int `orm:"paytype" json:"paytype"` Bonus float64 `orm:"bonus" json:"bonus"` Money float64 `orm:"money" json:"money"` Realmoney float64 `orm:"realmoney" json:"realmoney"` Paymoney float64 `orm:"paymoney" json:"paymoney"` Charge float64 `orm:"charge" json:"charge"` Chargemoney float64 `orm:"chargemoney" json:"chargemoney"` Status int `orm:"status" json:"status"` Reason string `orm:"reason" json:"reason"` Paytime int `orm:"paytime" json:"paytime"` } func (*Ewei_shop_author_billp) TableName() string { return "ewei_shop_author_billp" } type Ewei_shop_cashier_user struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Storeid int `orm:"storeid" json:"storeid"` Merchid int `orm:"merchid" json:"merchid"` Setmeal int `orm:"setmeal" json:"setmeal"` Title string `orm:"title" json:"title"` Logo string `orm:"logo" json:"logo"` Manageopenid string `orm:"manageopenid" json:"manageopenid"` IsopenCommission int `orm:"isopen_commission" json:"isopen_commission"` Name string `orm:"name" json:"name"` Mobile string `orm:"mobile" json:"mobile"` Categoryid int `orm:"categoryid" json:"categoryid"` WechatStatus int `orm:"wechat_status" json:"wechat_status"` Wechatpay string `orm:"wechatpay" json:"wechatpay"` AlipayStatus int `orm:"alipay_status" json:"alipay_status"` Alipay string `orm:"alipay" json:"alipay"` Withdraw float64 `orm:"withdraw" json:"withdraw"` Openid string `orm:"openid" json:"openid"` Diyformfields string `orm:"diyformfields" json:"diyformfields"` Diyformdata string `orm:"diyformdata" json:"diyformdata"` Createtime int `orm:"createtime" json:"createtime"` Username string `orm:"username" json:"username"` Password string `orm:"password" json:"password"` Salt string `orm:"salt" json:"salt"` Lifetimestart int `orm:"lifetimestart" json:"lifetimestart"` Lifetimeend int `orm:"lifetimeend" json:"lifetimeend"` Status int `orm:"status" json:"status"` Set string `orm:"set" json:"set"` Deleted int `orm:"deleted" json:"deleted"` CanWithdraw int `orm:"can_withdraw" json:"can_withdraw"` ShowPaytype int `orm:"show_paytype" json:"show_paytype"` Couponid string `orm:"couponid" json:"couponid"` Management string `orm:"management" json:"management"` NoticeOpenids string `orm:"notice_openids" json:"notice_openids"` } func (*Ewei_shop_cashier_user) TableName() string { return "ewei_shop_cashier_user" } type Ewei_shop_commission_shop struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Mid int `orm:"mid" json:"mid"` Name string `orm:"name" json:"name"` Logo string `orm:"logo" json:"logo"` Img string `orm:"img" json:"img"` Desc string `orm:"desc" json:"desc"` Selectgoods int `orm:"selectgoods" json:"selectgoods"` Selectcategory int `orm:"selectcategory" json:"selectcategory"` Goodsids string `orm:"goodsids" json:"goodsids"` } func (*Ewei_shop_commission_shop) TableName() string { return "ewei_shop_commission_shop" } type Ewei_shop_exchange_query struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Querykey string `orm:"querykey" json:"querykey"` Querytime int `orm:"querytime" json:"querytime"` Unfreeze int `orm:"unfreeze" json:"unfreeze"` Errorcount int `orm:"errorcount" json:"errorcount"` } func (*Ewei_shop_exchange_query) TableName() string { return "ewei_shop_exchange_query" } type Ewei_shop_exhelper_express struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Expressname string `orm:"expressname" json:"expressname"` Expresscom string `orm:"expresscom" json:"expresscom"` Express string `orm:"express" json:"express"` Width float64 `orm:"width" json:"width"` Datas string `orm:"datas" json:"datas"` Height float64 `orm:"height" json:"height"` Bg string `orm:"bg" json:"bg"` Isdefault int `orm:"isdefault" json:"isdefault"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_exhelper_express) TableName() string { return "ewei_shop_exhelper_express" } type Ewei_shop_goods struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Pcate int `orm:"pcate" json:"pcate"` Ccate int `orm:"ccate" json:"ccate"` Type int `orm:"type" json:"type"` Status int `orm:"status" json:"status"` Displayorder int `orm:"displayorder" json:"displayorder"` Title string `orm:"title" json:"title"` Thumb string `orm:"thumb" json:"thumb"` Unit string `orm:"unit" json:"unit"` Description string `orm:"description" json:"description"` Content string `orm:"content" json:"content"` Goodssn string `orm:"goodssn" json:"goodssn"` Productsn string `orm:"productsn" json:"productsn"` Productprice float64 `orm:"productprice" json:"productprice"` Marketprice float64 `orm:"marketprice" json:"marketprice"` Costprice float64 `orm:"costprice" json:"costprice"` Originalprice float64 `orm:"originalprice" json:"originalprice"` Total int `orm:"total" json:"total"` Totalcnf int `orm:"totalcnf" json:"totalcnf"` Sales int `orm:"sales" json:"sales"` Salesreal int `orm:"salesreal" json:"salesreal"` Spec string `orm:"spec" json:"spec"` Createtime int `orm:"createtime" json:"createtime"` Weight float64 `orm:"weight" json:"weight"` Credit string `orm:"credit" json:"credit"` Maxbuy int `orm:"maxbuy" json:"maxbuy"` Usermaxbuy int `orm:"usermaxbuy" json:"usermaxbuy"` Hasoption int `orm:"hasoption" json:"hasoption"` Dispatch int `orm:"dispatch" json:"dispatch"` ThumbUrl string `orm:"thumb_url" json:"thumb_url"` Isnew int `orm:"isnew" json:"isnew"` Ishot int `orm:"ishot" json:"ishot"` Isdiscount int `orm:"isdiscount" json:"isdiscount"` Isrecommand int `orm:"isrecommand" json:"isrecommand"` Issendfree int `orm:"issendfree" json:"issendfree"` Istime int `orm:"istime" json:"istime"` Iscomment int `orm:"iscomment" json:"iscomment"` Timestart int `orm:"timestart" json:"timestart"` Timeend int `orm:"timeend" json:"timeend"` Viewcount int `orm:"viewcount" json:"viewcount"` Deleted int `orm:"deleted" json:"deleted"` Hascommission int `orm:"hascommission" json:"hascommission"` Commission1Rate float64 `orm:"commission1_rate" json:"commission1_rate"` Commission1Pay float64 `orm:"commission1_pay" json:"commission1_pay"` Commission2Rate float64 `orm:"commission2_rate" json:"commission2_rate"` Commission2Pay float64 `orm:"commission2_pay" json:"commission2_pay"` Commission3Rate float64 `orm:"commission3_rate" json:"commission3_rate"` Commission3Pay float64 `orm:"commission3_pay" json:"commission3_pay"` Score float64 `orm:"score" json:"score"` Taobaoid string `orm:"taobaoid" json:"taobaoid"` Taotaoid string `orm:"taotaoid" json:"taotaoid"` Taobaourl string `orm:"taobaourl" json:"taobaourl"` Updatetime int `orm:"updatetime" json:"updatetime"` ShareTitle string `orm:"share_title" json:"share_title"` ShareIcon string `orm:"share_icon" json:"share_icon"` Cash int `orm:"cash" json:"cash"` CommissionThumb string `orm:"commission_thumb" json:"commission_thumb"` Isnodiscount int `orm:"isnodiscount" json:"isnodiscount"` Showlevels string `orm:"showlevels" json:"showlevels"` Buylevels string `orm:"buylevels" json:"buylevels"` Showgroups string `orm:"showgroups" json:"showgroups"` Buygroups string `orm:"buygroups" json:"buygroups"` Isverify int `orm:"isverify" json:"isverify"` Storeids string `orm:"storeids" json:"storeids"` Noticeopenid string `orm:"noticeopenid" json:"noticeopenid"` Tcate int `orm:"tcate" json:"tcate"` Noticetype string `orm:"noticetype" json:"noticetype"` Needfollow int `orm:"needfollow" json:"needfollow"` Followtip string `orm:"followtip" json:"followtip"` Followurl string `orm:"followurl" json:"followurl"` Deduct float64 `orm:"deduct" json:"deduct"` Virtual int `orm:"virtual" json:"virtual"` Ccates string `orm:"ccates" json:"ccates"` Discounts string `orm:"discounts" json:"discounts"` Nocommission int `orm:"nocommission" json:"nocommission"` Hidecommission int `orm:"hidecommission" json:"hidecommission"` Pcates string `orm:"pcates" json:"pcates"` Tcates string `orm:"tcates" json:"tcates"` Cates string `orm:"cates" json:"cates"` Artid int `orm:"artid" json:"artid"` DetailLogo string `orm:"detail_logo" json:"detail_logo"` DetailShopname string `orm:"detail_shopname" json:"detail_shopname"` DetailBtntext1 string `orm:"detail_btntext1" json:"detail_btntext1"` DetailBtnurl1 string `orm:"detail_btnurl1" json:"detail_btnurl1"` DetailBtntext2 string `orm:"detail_btntext2" json:"detail_btntext2"` DetailBtnurl2 string `orm:"detail_btnurl2" json:"detail_btnurl2"` DetailTotaltitle string `orm:"detail_totaltitle" json:"detail_totaltitle"` Saleupdate42392 int `orm:"saleupdate42392" json:"saleupdate42392"` Deduct2 float64 `orm:"deduct2" json:"deduct2"` Ednum int `orm:"ednum" json:"ednum"` Edmoney float64 `orm:"edmoney" json:"edmoney"` Edareas string `orm:"edareas" json:"edareas"` Diyformtype int `orm:"diyformtype" json:"diyformtype"` Diyformid int `orm:"diyformid" json:"diyformid"` Diymode int `orm:"diymode" json:"diymode"` Dispatchtype int `orm:"dispatchtype" json:"dispatchtype"` Dispatchid int `orm:"dispatchid" json:"dispatchid"` Dispatchprice float64 `orm:"dispatchprice" json:"dispatchprice"` Manydeduct int `orm:"manydeduct" json:"manydeduct"` Shorttitle string `orm:"shorttitle" json:"shorttitle"` IsdiscountTitle string `orm:"isdiscount_title" json:"isdiscount_title"` IsdiscountTime int `orm:"isdiscount_time" json:"isdiscount_time"` IsdiscountDiscounts string `orm:"isdiscount_discounts" json:"isdiscount_discounts"` Commission string `orm:"commission" json:"commission"` Saleupdate37975 int `orm:"saleupdate37975" json:"saleupdate37975"` Shopid int `orm:"shopid" json:"shopid"` Allcates string `orm:"allcates" json:"allcates"` Minbuy int `orm:"minbuy" json:"minbuy"` Invoice int `orm:"invoice" json:"invoice"` Repair int `orm:"repair" json:"repair"` Seven int `orm:"seven" json:"seven"` Money string `orm:"money" json:"money"` Minprice float64 `orm:"minprice" json:"minprice"` Maxprice float64 `orm:"maxprice" json:"maxprice"` Province string `orm:"province" json:"province"` City string `orm:"city" json:"city"` Buyshow int `orm:"buyshow" json:"buyshow"` Buycontent string `orm:"buycontent" json:"buycontent"` Saleupdate51117 int `orm:"saleupdate51117" json:"saleupdate51117"` Virtualsend int `orm:"virtualsend" json:"virtualsend"` Virtualsendcontent string `orm:"virtualsendcontent" json:"virtualsendcontent"` Verifytype int `orm:"verifytype" json:"verifytype"` Diyfields string `orm:"diyfields" json:"diyfields"` Diysaveid int `orm:"diysaveid" json:"diysaveid"` Diysave int `orm:"diysave" json:"diysave"` Quality int `orm:"quality" json:"quality"` Groupstype int `orm:"groupstype" json:"groupstype"` Showtotal int `orm:"showtotal" json:"showtotal"` Subtitle string `orm:"subtitle" json:"subtitle"` Minpriceupdated int `orm:"minpriceupdated" json:"minpriceupdated"` Sharebtn int `orm:"sharebtn" json:"sharebtn"` Catesinit3 string `orm:"catesinit3" json:"catesinit3"` Showtotaladd int `orm:"showtotaladd" json:"showtotaladd"` Merchid int `orm:"merchid" json:"merchid"` Checked int `orm:"checked" json:"checked"` ThumbFirst int `orm:"thumb_first" json:"thumb_first"` Merchsale int `orm:"merchsale" json:"merchsale"` Keywords string `orm:"keywords" json:"keywords"` CatchId string `orm:"catch_id" json:"catch_id"` CatchUrl string `orm:"catch_url" json:"catch_url"` CatchSource string `orm:"catch_source" json:"catch_source"` Saleupdate40170 int `orm:"saleupdate40170" json:"saleupdate40170"` Saleupdate35843 int `orm:"saleupdate35843" json:"saleupdate35843"` Labelname string `orm:"labelname" json:"labelname"` Autoreceive int `orm:"autoreceive" json:"autoreceive"` Cannotrefund int `orm:"cannotrefund" json:"cannotrefund"` Saleupdate33219 int `orm:"saleupdate33219" json:"saleupdate33219"` Bargain int `orm:"bargain" json:"bargain"` Buyagain float64 `orm:"buyagain" json:"buyagain"` BuyagainIslong int `orm:"buyagain_islong" json:"buyagain_islong"` BuyagainCondition int `orm:"buyagain_condition" json:"buyagain_condition"` BuyagainSale int `orm:"buyagain_sale" json:"buyagain_sale"` BuyagainCommission string `orm:"buyagain_commission" json:"buyagain_commission"` Saleupdate32484 int `orm:"saleupdate32484" json:"saleupdate32484"` Saleupdate36586 int `orm:"saleupdate36586" json:"saleupdate36586"` Diypage int `orm:"diypage" json:"diypage"` Cashier int `orm:"cashier" json:"cashier"` Saleupdate53481 int `orm:"saleupdate53481" json:"saleupdate53481"` Saleupdate30424 int `orm:"saleupdate30424" json:"saleupdate30424"` Isendtime int `orm:"isendtime" json:"isendtime"` Usetime int `orm:"usetime" json:"usetime"` Endtime int `orm:"endtime" json:"endtime"` Merchdisplayorder int `orm:"merchdisplayorder" json:"merchdisplayorder"` ExchangeStock int `orm:"exchange_stock" json:"exchange_stock"` ExchangePostage float64 `orm:"exchange_postage" json:"exchange_postage"` Ispresell int `orm:"ispresell" json:"ispresell"` Presellprice float64 `orm:"presellprice" json:"presellprice"` Presellover int `orm:"presellover" json:"presellover"` Presellovertime int `orm:"presellovertime" json:"presellovertime"` Presellstart int `orm:"presellstart" json:"presellstart"` Preselltimestart int `orm:"preselltimestart" json:"preselltimestart"` Presellend int `orm:"presellend" json:"presellend"` Preselltimeend int `orm:"preselltimeend" json:"preselltimeend"` Presellsendtype int `orm:"presellsendtype" json:"presellsendtype"` Presellsendstatrttime int `orm:"presellsendstatrttime" json:"presellsendstatrttime"` Presellsendtime int `orm:"presellsendtime" json:"presellsendtime"` EdareasCode string `orm:"edareas_code" json:"edareas_code"` UniteTotal int `orm:"unite_total" json:"unite_total"` BuyagainPrice float64 `orm:"buyagain_price" json:"buyagain_price"` Threen string `orm:"threen" json:"threen"` Intervalfloor int `orm:"intervalfloor" json:"intervalfloor"` Intervalprice string `orm:"intervalprice" json:"intervalprice"` Isfullback int `orm:"isfullback" json:"isfullback"` Isstatustime int `orm:"isstatustime" json:"isstatustime"` Statustimestart int `orm:"statustimestart" json:"statustimestart"` Statustimeend int `orm:"statustimeend" json:"statustimeend"` Nosearch int `orm:"nosearch" json:"nosearch"` Showsales int `orm:"showsales" json:"showsales"` Islive int `orm:"islive" json:"islive"` Liveprice float64 `orm:"liveprice" json:"liveprice"` Opencard int `orm:"opencard" json:"opencard"` Cardid string `orm:"cardid" json:"cardid"` Verifygoodsnum int `orm:"verifygoodsnum" json:"verifygoodsnum"` Verifygoodsdays int `orm:"verifygoodsdays" json:"verifygoodsdays"` Verifygoodslimittype int `orm:"verifygoodslimittype" json:"verifygoodslimittype"` Verifygoodslimitdate int `orm:"verifygoodslimitdate" json:"verifygoodslimitdate"` Minliveprice float64 `orm:"minliveprice" json:"minliveprice"` Maxliveprice float64 `orm:"maxliveprice" json:"maxliveprice"` Dowpayment float64 `orm:"dowpayment" json:"dowpayment"` Tempid int `orm:"tempid" json:"tempid"` Isstoreprice int `orm:"isstoreprice" json:"isstoreprice"` Beforehours int `orm:"beforehours" json:"beforehours"` Saleupdate int `orm:"saleupdate" json:"saleupdate"` Newgoods int `orm:"newgoods" json:"newgoods"` Video string `orm:"video" json:"video"` Officthumb string `orm:"officthumb" json:"officthumb"` } func (*Ewei_shop_goods) TableName() string { return "ewei_shop_goods" } type Ewei_shop_live_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` Advimg string `orm:"advimg" json:"advimg"` Advurl string `orm:"advurl" json:"advurl"` Isrecommand int `orm:"isrecommand" json:"isrecommand"` } func (*Ewei_shop_live_category) TableName() string { return "ewei_shop_live_category" } type Ewei_shop_merch_category_swipe struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Title string `orm:"title" json:"title"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` Displayorder int `orm:"displayorder" json:"displayorder"` Thumb string `orm:"thumb" json:"thumb"` } func (*Ewei_shop_merch_category_swipe) TableName() string { return "ewei_shop_merch_category_swipe" } type Cover_reply struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Multiid int `orm:"multiid" json:"multiid"` Rid int `orm:"rid" json:"rid"` Module string `orm:"module" json:"module"` Do string `orm:"do" json:"do"` Title string `orm:"title" json:"title"` Description string `orm:"description" json:"description"` Thumb string `orm:"thumb" json:"thumb"` Url string `orm:"url" json:"url"` } func (*Cover_reply) TableName() string { return "cover_reply" } type Ewei_shop_cashier_goods_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Cashierid int `orm:"cashierid" json:"cashierid"` Catename string `orm:"catename" json:"catename"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` Displayorder int `orm:"displayorder" json:"displayorder"` } func (*Ewei_shop_cashier_goods_category) TableName() string { return "ewei_shop_cashier_goods_category" } type Ewei_shop_cashier_order struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Ordersn string `orm:"ordersn" json:"ordersn"` Price float64 `orm:"price" json:"price"` Openid string `orm:"openid" json:"openid"` Payopenid string `orm:"payopenid" json:"payopenid"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` Paytime int `orm:"paytime" json:"paytime"` } func (*Ewei_shop_cashier_order) TableName() string { return "ewei_shop_cashier_order" } type Ewei_shop_creditshop_spec struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Goodsid int `orm:"goodsid" json:"goodsid"` Title string `orm:"title" json:"title"` Description string `orm:"description" json:"description"` Displaytype int `orm:"displaytype" json:"displaytype"` Content string `orm:"content" json:"content"` Displayorder int `orm:"displayorder" json:"displayorder"` PropId string `orm:"propId" json:"propId"` } func (*Ewei_shop_creditshop_spec) TableName() string { return "ewei_shop_creditshop_spec" } type Ewei_shop_customer_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` } func (*Ewei_shop_customer_category) TableName() string { return "ewei_shop_customer_category" } type Ewei_shop_postera struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Days int `orm:"days" json:"days"` Title string `orm:"title" json:"title"` Bg string `orm:"bg" json:"bg"` Data string `orm:"data" json:"data"` Keyword string `orm:"keyword" json:"keyword"` Isdefault int `orm:"isdefault" json:"isdefault"` Resptitle string `orm:"resptitle" json:"resptitle"` Respthumb string `orm:"respthumb" json:"respthumb"` Createtime int `orm:"createtime" json:"createtime"` Respdesc string `orm:"respdesc" json:"respdesc"` Respurl string `orm:"respurl" json:"respurl"` Waittext string `orm:"waittext" json:"waittext"` Oktext string `orm:"oktext" json:"oktext"` Subcredit int `orm:"subcredit" json:"subcredit"` Submoney float64 `orm:"submoney" json:"submoney"` Reccredit int `orm:"reccredit" json:"reccredit"` Recmoney float64 `orm:"recmoney" json:"recmoney"` Scantext string `orm:"scantext" json:"scantext"` Subtext string `orm:"subtext" json:"subtext"` Beagent int `orm:"beagent" json:"beagent"` Bedown int `orm:"bedown" json:"bedown"` Isopen int `orm:"isopen" json:"isopen"` Opentext string `orm:"opentext" json:"opentext"` Openurl string `orm:"openurl" json:"openurl"` Paytype int `orm:"paytype" json:"paytype"` Subpaycontent string `orm:"subpaycontent" json:"subpaycontent"` Recpaycontent string `orm:"recpaycontent" json:"recpaycontent"` Templateid string `orm:"templateid" json:"templateid"` Entrytext string `orm:"entrytext" json:"entrytext"` Reccouponid int `orm:"reccouponid" json:"reccouponid"` Reccouponnum int `orm:"reccouponnum" json:"reccouponnum"` Subcouponid int `orm:"subcouponid" json:"subcouponid"` Subcouponnum int `orm:"subcouponnum" json:"subcouponnum"` Timestart int `orm:"timestart" json:"timestart"` Timeend int `orm:"timeend" json:"timeend"` Status int `orm:"status" json:"status"` Goodsid int `orm:"goodsid" json:"goodsid"` Starttext string `orm:"starttext" json:"starttext"` Endtext string `orm:"endtext" json:"endtext"` Resptype int `orm:"resptype" json:"resptype"` Resptext string `orm:"resptext" json:"resptext"` Testflag int `orm:"testflag" json:"testflag"` Keyword2 string `orm:"keyword2" json:"keyword2"` RewardTotle string `orm:"reward_totle" json:"reward_totle"` } func (*Ewei_shop_postera) TableName() string { return "ewei_shop_postera" } type Ewei_shop_task_adv struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Advname string `orm:"advname" json:"advname"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` } func (*Ewei_shop_task_adv) TableName() string { return "ewei_shop_task_adv" } type Ewei_shop_version struct { Id int `orm:"id" json:"id"` Uid int `orm:"uid" json:"uid"` Type int `orm:"type" json:"type"` Uniacid int `orm:"uniacid" json:"uniacid"` Version int `orm:"version" json:"version"` } func (*Ewei_shop_version) TableName() string { return "ewei_shop_version" } type Site_store_order struct { Id int `orm:"id" json:"id"` Orderid string `orm:"orderid" json:"orderid"` Goodsid int `orm:"goodsid" json:"goodsid"` Duration int `orm:"duration" json:"duration"` Buyer string `orm:"buyer" json:"buyer"` Buyerid int `orm:"buyerid" json:"buyerid"` Amount float64 `orm:"amount" json:"amount"` Type int `orm:"type" json:"type"` Changeprice int `orm:"changeprice" json:"changeprice"` Createtime int `orm:"createtime" json:"createtime"` Uniacid int `orm:"uniacid" json:"uniacid"` Endtime int `orm:"endtime" json:"endtime"` Wxapp int `orm:"wxapp" json:"wxapp"` } func (*Site_store_order) TableName() string { return "site_store_order" } type Core_sendsms_log struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Mobile string `orm:"mobile" json:"mobile"` Content string `orm:"content" json:"content"` Result string `orm:"result" json:"result"` Createtime int `orm:"createtime" json:"createtime"` } func (*Core_sendsms_log) TableName() string { return "core_sendsms_log" } type Ewei_shop_article_log struct { Id int `orm:"id" json:"id"` Aid int `orm:"aid" json:"aid"` Read int `orm:"read" json:"read"` Like int `orm:"like" json:"like"` Openid string `orm:"openid" json:"openid"` Uniacid int `orm:"uniacid" json:"uniacid"` } func (*Ewei_shop_article_log) TableName() string { return "ewei_shop_article_log" } type Ewei_shop_goodscode_good struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Goodsid int `orm:"goodsid" json:"goodsid"` Title string `orm:"title" json:"title"` Thumb string `orm:"thumb" json:"thumb"` Qrcode string `orm:"qrcode" json:"qrcode"` Status int `orm:"status" json:"status"` Displayorder int `orm:"displayorder" json:"displayorder"` } func (*Ewei_shop_goodscode_good) TableName() string { return "ewei_shop_goodscode_good" } type Ewei_shop_member_history struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Goodsid int `orm:"goodsid" json:"goodsid"` Openid string `orm:"openid" json:"openid"` Deleted int `orm:"deleted" json:"deleted"` Createtime int `orm:"createtime" json:"createtime"` Times int `orm:"times" json:"times"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_member_history) TableName() string { return "ewei_shop_member_history" } type Core_performance struct { Id int `orm:"id" json:"id"` Type int `orm:"type" json:"type"` Runtime string `orm:"runtime" json:"runtime"` Runurl string `orm:"runurl" json:"runurl"` Runsql string `orm:"runsql" json:"runsql"` Createtime int `orm:"createtime" json:"createtime"` } func (*Core_performance) TableName() string { return "core_performance" } type Ewei_shop_express_cache struct { Id int `orm:"id" json:"id"` Expresssn string `orm:"expresssn" json:"expresssn"` Express string `orm:"express" json:"express"` Lasttime int `orm:"lasttime" json:"lasttime"` Datas string `orm:"datas" json:"datas"` } func (*Ewei_shop_express_cache) TableName() string { return "ewei_shop_express_cache" } type Ewei_shop_goods_label struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Label string `orm:"label" json:"label"` Labelname string `orm:"labelname" json:"labelname"` Status int `orm:"status" json:"status"` Displayorder int `orm:"displayorder" json:"displayorder"` } func (*Ewei_shop_goods_label) TableName() string { return "ewei_shop_goods_label" } type Ewei_shop_member_message_template struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Title string `orm:"title" json:"title"` TemplateId string `orm:"template_id" json:"template_id"` First string `orm:"first" json:"first"` Firstcolor string `orm:"firstcolor" json:"firstcolor"` Data string `orm:"data" json:"data"` Remark string `orm:"remark" json:"remark"` Remarkcolor string `orm:"remarkcolor" json:"remarkcolor"` Url string `orm:"url" json:"url"` Createtime int `orm:"createtime" json:"createtime"` Sendtimes int `orm:"sendtimes" json:"sendtimes"` Sendcount int `orm:"sendcount" json:"sendcount"` Typecode string `orm:"typecode" json:"typecode"` Messagetype int `orm:"messagetype" json:"messagetype"` SendDesc string `orm:"send_desc" json:"send_desc"` } func (*Ewei_shop_member_message_template) TableName() string { return "ewei_shop_member_message_template" } type Ewei_shop_merch_notice struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Displayorder int `orm:"displayorder" json:"displayorder"` Title string `orm:"title" json:"title"` Thumb string `orm:"thumb" json:"thumb"` Link string `orm:"link" json:"link"` Detail string `orm:"detail" json:"detail"` Status int `orm:"status" json:"status"` Createtime int `orm:"createtime" json:"createtime"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_merch_notice) TableName() string { return "ewei_shop_merch_notice" } type Ewei_shop_poster_qr struct { Id int `orm:"id" json:"id"` Acid int `orm:"acid" json:"acid"` Openid string `orm:"openid" json:"openid"` Type int `orm:"type" json:"type"` Sceneid int `orm:"sceneid" json:"sceneid"` Mediaid string `orm:"mediaid" json:"mediaid"` Ticket string `orm:"ticket" json:"ticket"` Url string `orm:"url" json:"url"` Createtime int `orm:"createtime" json:"createtime"` Goodsid int `orm:"goodsid" json:"goodsid"` Qrimg string `orm:"qrimg" json:"qrimg"` Scenestr string `orm:"scenestr" json:"scenestr"` Posterid int `orm:"posterid" json:"posterid"` } func (*Ewei_shop_poster_qr) TableName() string { return "ewei_shop_poster_qr" } type Ewei_shop_sendticket_draw struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Cpid string `orm:"cpid" json:"cpid"` Openid string `orm:"openid" json:"openid"` Createtime int `orm:"createtime" json:"createtime"` } func (*Ewei_shop_sendticket_draw) TableName() string { return "ewei_shop_sendticket_draw" } type Ewei_shop_goods_cards struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` CardId string `orm:"card_id" json:"card_id"` CardTitle string `orm:"card_title" json:"card_title"` CardBrandName string `orm:"card_brand_name" json:"card_brand_name"` CardTotalquantity int `orm:"card_totalquantity" json:"card_totalquantity"` CardQuantity int `orm:"card_quantity" json:"card_quantity"` CardLogoimg string `orm:"card_logoimg" json:"card_logoimg"` CardLogowxurl string `orm:"card_logowxurl" json:"card_logowxurl"` CardBackgroundtype int `orm:"card_backgroundtype" json:"card_backgroundtype"` Color string `orm:"color" json:"color"` CardBackgroundimg string `orm:"card_backgroundimg" json:"card_backgroundimg"` CardBackgroundwxurl string `orm:"card_backgroundwxurl" json:"card_backgroundwxurl"` Prerogative string `orm:"prerogative" json:"prerogative"` CardDescription string `orm:"card_description" json:"card_description"` Freewifi int `orm:"freewifi" json:"freewifi"` Withpet int `orm:"withpet" json:"withpet"` Freepark int `orm:"freepark" json:"freepark"` Deliver int `orm:"deliver" json:"deliver"` CustomCell1 int `orm:"custom_cell1" json:"custom_cell1"` CustomCell1Name string `orm:"custom_cell1_name" json:"custom_cell1_name"` CustomCell1Tips string `orm:"custom_cell1_tips" json:"custom_cell1_tips"` CustomCell1Url string `orm:"custom_cell1_url" json:"custom_cell1_url"` Color2 string `orm:"color2" json:"color2"` } func (*Ewei_shop_goods_cards) TableName() string { return "ewei_shop_goods_cards" } type Ewei_shop_groups_order_refund struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Orderid int `orm:"orderid" json:"orderid"` Refundno string `orm:"refundno" json:"refundno"` Refundstatus int `orm:"refundstatus" json:"refundstatus"` Refundaddressid int `orm:"refundaddressid" json:"refundaddressid"` Refundaddress string `orm:"refundaddress" json:"refundaddress"` Content string `orm:"content" json:"content"` Reason string `orm:"reason" json:"reason"` Images string `orm:"images" json:"images"` Applytime string `orm:"applytime" json:"applytime"` Applycredit int `orm:"applycredit" json:"applycredit"` Applyprice float64 `orm:"applyprice" json:"applyprice"` Reply string `orm:"reply" json:"reply"` Refundtype string `orm:"refundtype" json:"refundtype"` Rtype int `orm:"rtype" json:"rtype"` Refundtime string `orm:"refundtime" json:"refundtime"` Endtime string `orm:"endtime" json:"endtime"` Message string `orm:"message" json:"message"` Operatetime string `orm:"operatetime" json:"operatetime"` Realcredit int `orm:"realcredit" json:"realcredit"` Realmoney float64 `orm:"realmoney" json:"realmoney"` Express string `orm:"express" json:"express"` Expresscom string `orm:"expresscom" json:"expresscom"` Expresssn string `orm:"expresssn" json:"expresssn"` Sendtime string `orm:"sendtime" json:"sendtime"` Returntime int `orm:"returntime" json:"returntime"` Rexpress string `orm:"rexpress" json:"rexpress"` Rexpresscom string `orm:"rexpresscom" json:"rexpresscom"` Rexpresssn string `orm:"rexpresssn" json:"rexpresssn"` } func (*Ewei_shop_groups_order_refund) TableName() string { return "ewei_shop_groups_order_refund" } type Ewei_shop_payment struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Title string `orm:"title" json:"title"` Type int `orm:"type" json:"type"` Appid string `orm:"appid" json:"appid"` MchId string `orm:"mch_id" json:"mch_id"` Apikey string `orm:"apikey" json:"apikey"` SubAppid string `orm:"sub_appid" json:"sub_appid"` SubAppsecret string `orm:"sub_appsecret" json:"sub_appsecret"` SubMchId string `orm:"sub_mch_id" json:"sub_mch_id"` CertFile string `orm:"cert_file" json:"cert_file"` KeyFile string `orm:"key_file" json:"key_file"` RootFile string `orm:"root_file" json:"root_file"` IsRaw int `orm:"is_raw" json:"is_raw"` Createtime int `orm:"createtime" json:"createtime"` Paytype int `orm:"paytype" json:"paytype"` Alitype int `orm:"alitype" json:"alitype"` AlipaySec string `orm:"alipay_sec" json:"alipay_sec"` } func (*Ewei_shop_payment) TableName() string { return "ewei_shop_payment" } type Ewei_shop_seckill_task_time struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Taskid int `orm:"taskid" json:"taskid"` Time int `orm:"time" json:"time"` } func (*Ewei_shop_seckill_task_time) TableName() string { return "ewei_shop_seckill_task_time" } type Ewei_shop_sign_user struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Order int `orm:"order" json:"order"` Orderday int `orm:"orderday" json:"orderday"` Sum int `orm:"sum" json:"sum"` Signdate string `orm:"signdate" json:"signdate"` Isminiprogram int `orm:"isminiprogram" json:"isminiprogram"` } func (*Ewei_shop_sign_user) TableName() string { return "ewei_shop_sign_user" } type Ewei_shop_task_poster_qr struct { Id int `orm:"id" json:"id"` Acid int `orm:"acid" json:"acid"` Openid string `orm:"openid" json:"openid"` Posterid int `orm:"posterid" json:"posterid"` Type int `orm:"type" json:"type"` Sceneid int `orm:"sceneid" json:"sceneid"` Mediaid string `orm:"mediaid" json:"mediaid"` Ticket string `orm:"ticket" json:"ticket"` Url string `orm:"url" json:"url"` Createtime int `orm:"createtime" json:"createtime"` Qrimg string `orm:"qrimg" json:"qrimg"` Expire int `orm:"expire" json:"expire"` Endtime int `orm:"endtime" json:"endtime"` } func (*Ewei_shop_task_poster_qr) TableName() string { return "ewei_shop_task_poster_qr" } type Paycenter_order struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Uid int `orm:"uid" json:"uid"` Pid int `orm:"pid" json:"pid"` ClerkId int `orm:"clerk_id" json:"clerk_id"` StoreId int `orm:"store_id" json:"store_id"` ClerkType int `orm:"clerk_type" json:"clerk_type"` Uniontid string `orm:"uniontid" json:"uniontid"` TransactionId string `orm:"transaction_id" json:"transaction_id"` Type string `orm:"type" json:"type"` TradeType string `orm:"trade_type" json:"trade_type"` Body string `orm:"body" json:"body"` Fee string `orm:"fee" json:"fee"` FinalFee float64 `orm:"final_fee" json:"final_fee"` Credit1 int `orm:"credit1" json:"credit1"` Credit1Fee float64 `orm:"credit1_fee" json:"credit1_fee"` Credit2 float64 `orm:"credit2" json:"credit2"` Cash float64 `orm:"cash" json:"cash"` Remark string `orm:"remark" json:"remark"` AuthCode string `orm:"auth_code" json:"auth_code"` Openid string `orm:"openid" json:"openid"` Nickname string `orm:"nickname" json:"nickname"` Follow int `orm:"follow" json:"follow"` Status int `orm:"status" json:"status"` CreditStatus int `orm:"credit_status" json:"credit_status"` Paytime int `orm:"paytime" json:"paytime"` Createtime int `orm:"createtime" json:"createtime"` } func (*Paycenter_order) TableName() string { return "paycenter_order" } type Article_category struct { Id int `orm:"id" json:"id"` Title string `orm:"title" json:"title"` Displayorder int `orm:"displayorder" json:"displayorder"` Type string `orm:"type" json:"type"` } func (*Article_category) TableName() string { return "article_category" } type Core_queue struct { Qid int `orm:"qid" json:"qid"` Uniacid int `orm:"uniacid" json:"uniacid"` Acid int `orm:"acid" json:"acid"` Message string `orm:"message" json:"message"` Params string `orm:"params" json:"params"` Keyword string `orm:"keyword" json:"keyword"` Response string `orm:"response" json:"response"` Module string `orm:"module" json:"module"` Type int `orm:"type" json:"type"` Dateline int `orm:"dateline" json:"dateline"` } func (*Core_queue) TableName() string { return "core_queue" } type Ewei_shop_cashier_goods struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Cashierid int `orm:"cashierid" json:"cashierid"` Createtime int `orm:"createtime" json:"createtime"` Title string `orm:"title" json:"title"` Image string `orm:"image" json:"image"` Categoryid int `orm:"categoryid" json:"categoryid"` Price float64 `orm:"price" json:"price"` Total int `orm:"total" json:"total"` Status int `orm:"status" json:"status"` Goodssn string `orm:"goodssn" json:"goodssn"` } func (*Ewei_shop_cashier_goods) TableName() string { return "ewei_shop_cashier_goods" } type Ewei_shop_coupon_sendtasks struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Enough float64 `orm:"enough" json:"enough"` Couponid int `orm:"couponid" json:"couponid"` Starttime int `orm:"starttime" json:"starttime"` Endtime int `orm:"endtime" json:"endtime"` Sendnum int `orm:"sendnum" json:"sendnum"` Num int `orm:"num" json:"num"` Sendpoint int `orm:"sendpoint" json:"sendpoint"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_coupon_sendtasks) TableName() string { return "ewei_shop_coupon_sendtasks" } type Ewei_shop_newstore_category struct { Id int `orm:"id" json:"id"` Name string `orm:"name" json:"name"` Uniacid int `orm:"uniacid" json:"uniacid"` } func (*Ewei_shop_newstore_category) TableName() string { return "ewei_shop_newstore_category" } type Activity_exchange struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Title string `orm:"title" json:"title"` Description string `orm:"description" json:"description"` Thumb string `orm:"thumb" json:"thumb"` Type int `orm:"type" json:"type"` Extra string `orm:"extra" json:"extra"` Credit int `orm:"credit" json:"credit"` Credittype string `orm:"credittype" json:"credittype"` Pretotal int `orm:"pretotal" json:"pretotal"` Num int `orm:"num" json:"num"` Total int `orm:"total" json:"total"` Status int `orm:"status" json:"status"` Starttime int `orm:"starttime" json:"starttime"` Endtime int `orm:"endtime" json:"endtime"` } func (*Activity_exchange) TableName() string { return "activity_exchange" } type Core_attachment struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Uid int `orm:"uid" json:"uid"` Filename string `orm:"filename" json:"filename"` Attachment string `orm:"attachment" json:"attachment"` Type int `orm:"type" json:"type"` Createtime int `orm:"createtime" json:"createtime"` ModuleUploadDir string `orm:"module_upload_dir" json:"module_upload_dir"` } func (*Core_attachment) TableName() string { return "core_attachment" } type Ewei_shop_merch_saler struct { Id int `orm:"id" json:"id"` Storeid int `orm:"storeid" json:"storeid"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Status int `orm:"status" json:"status"` Salername string `orm:"salername" json:"salername"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_merch_saler) TableName() string { return "ewei_shop_merch_saler" } type Ewei_shop_merch_store struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Storename string `orm:"storename" json:"storename"` Address string `orm:"address" json:"address"` Tel string `orm:"tel" json:"tel"` Lat string `orm:"lat" json:"lat"` Lng string `orm:"lng" json:"lng"` Status int `orm:"status" json:"status"` Type int `orm:"type" json:"type"` Realname string `orm:"realname" json:"realname"` Mobile string `orm:"mobile" json:"mobile"` Fetchtime string `orm:"fetchtime" json:"fetchtime"` Logo string `orm:"logo" json:"logo"` Saletime string `orm:"saletime" json:"saletime"` Desc string `orm:"desc" json:"desc"` Displayorder int `orm:"displayorder" json:"displayorder"` CommissionTotal float64 `orm:"commission_total" json:"commission_total"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_merch_store) TableName() string { return "ewei_shop_merch_store" } type Ewei_shop_order struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Agentid int `orm:"agentid" json:"agentid"` Ordersn string `orm:"ordersn" json:"ordersn"` Price float64 `orm:"price" json:"price"` Goodsprice float64 `orm:"goodsprice" json:"goodsprice"` Discountprice float64 `orm:"discountprice" json:"discountprice"` Status int `orm:"status" json:"status"` Paytype int `orm:"paytype" json:"paytype"` Transid string `orm:"transid" json:"transid"` Remark string `orm:"remark" json:"remark"` Addressid int `orm:"addressid" json:"addressid"` Dispatchprice float64 `orm:"dispatchprice" json:"dispatchprice"` Dispatchid int `orm:"dispatchid" json:"dispatchid"` Createtime int `orm:"createtime" json:"createtime"` Dispatchtype int `orm:"dispatchtype" json:"dispatchtype"` Carrier string `orm:"carrier" json:"carrier"` Refundid int `orm:"refundid" json:"refundid"` Iscomment int `orm:"iscomment" json:"iscomment"` Creditadd int `orm:"creditadd" json:"creditadd"` Deleted int `orm:"deleted" json:"deleted"` Userdeleted int `orm:"userdeleted" json:"userdeleted"` Finishtime int `orm:"finishtime" json:"finishtime"` Paytime int `orm:"paytime" json:"paytime"` Expresscom string `orm:"expresscom" json:"expresscom"` Expresssn string `orm:"expresssn" json:"expresssn"` Express string `orm:"express" json:"express"` Sendtime int `orm:"sendtime" json:"sendtime"` Fetchtime int `orm:"fetchtime" json:"fetchtime"` Cash int `orm:"cash" json:"cash"` Canceltime int `orm:"canceltime" json:"canceltime"` Cancelpaytime int `orm:"cancelpaytime" json:"cancelpaytime"` Refundtime int `orm:"refundtime" json:"refundtime"` Isverify int `orm:"isverify" json:"isverify"` Verified int `orm:"verified" json:"verified"` Verifyopenid string `orm:"verifyopenid" json:"verifyopenid"` Verifycode string `orm:"verifycode" json:"verifycode"` Verifytime int `orm:"verifytime" json:"verifytime"` Verifystoreid int `orm:"verifystoreid" json:"verifystoreid"` Deductprice float64 `orm:"deductprice" json:"deductprice"` Deductcredit int `orm:"deductcredit" json:"deductcredit"` Deductcredit2 float64 `orm:"deductcredit2" json:"deductcredit2"` Deductenough float64 `orm:"deductenough" json:"deductenough"` Virtual int `orm:"virtual" json:"virtual"` VirtualInfo string `orm:"virtual_info" json:"virtual_info"` VirtualStr string `orm:"virtual_str" json:"virtual_str"` Address string `orm:"address" json:"address"` Sysdeleted int `orm:"sysdeleted" json:"sysdeleted"` Ordersn2 int `orm:"ordersn2" json:"ordersn2"` Changeprice float64 `orm:"changeprice" json:"changeprice"` Changedispatchprice float64 `orm:"changedispatchprice" json:"changedispatchprice"` Oldprice float64 `orm:"oldprice" json:"oldprice"` Olddispatchprice float64 `orm:"olddispatchprice" json:"olddispatchprice"` Isvirtual int `orm:"isvirtual" json:"isvirtual"` Couponid int `orm:"couponid" json:"couponid"` Couponprice float64 `orm:"couponprice" json:"couponprice"` Diyformdata string `orm:"diyformdata" json:"diyformdata"` Diyformfields string `orm:"diyformfields" json:"diyformfields"` Diyformid int `orm:"diyformid" json:"diyformid"` Storeid int `orm:"storeid" json:"storeid"` Printstate int `orm:"printstate" json:"printstate"` Printstate2 int `orm:"printstate2" json:"printstate2"` AddressSend string `orm:"address_send" json:"address_send"` Refundstate int `orm:"refundstate" json:"refundstate"` Closereason string `orm:"closereason" json:"closereason"` Remarksaler string `orm:"remarksaler" json:"remarksaler"` Remarkclose string `orm:"remarkclose" json:"remarkclose"` Remarksend string `orm:"remarksend" json:"remarksend"` Ismr int `orm:"ismr" json:"ismr"` Isdiscountprice float64 `orm:"isdiscountprice" json:"isdiscountprice"` Isvirtualsend int `orm:"isvirtualsend" json:"isvirtualsend"` VirtualsendInfo string `orm:"virtualsend_info" json:"virtualsend_info"` Verifyinfo string `orm:"verifyinfo" json:"verifyinfo"` Verifytype int `orm:"verifytype" json:"verifytype"` Verifycodes string `orm:"verifycodes" json:"verifycodes"` Invoicename string `orm:"invoicename" json:"invoicename"` Merchid int `orm:"merchid" json:"merchid"` Ismerch int `orm:"ismerch" json:"ismerch"` Parentid int `orm:"parentid" json:"parentid"` Isparent int `orm:"isparent" json:"isparent"` Grprice float64 `orm:"grprice" json:"grprice"` Merchshow int `orm:"merchshow" json:"merchshow"` Merchdeductenough float64 `orm:"merchdeductenough" json:"merchdeductenough"` Couponmerchid int `orm:"couponmerchid" json:"couponmerchid"` Isglobonus int `orm:"isglobonus" json:"isglobonus"` Merchapply int `orm:"merchapply" json:"merchapply"` Isabonus int `orm:"isabonus" json:"isabonus"` Isborrow int `orm:"isborrow" json:"isborrow"` Borrowopenid string `orm:"borrowopenid" json:"borrowopenid"` Merchisdiscountprice float64 `orm:"merchisdiscountprice" json:"merchisdiscountprice"` Apppay int `orm:"apppay" json:"apppay"` Coupongoodprice float64 `orm:"coupongoodprice" json:"coupongoodprice"` Buyagainprice float64 `orm:"buyagainprice" json:"buyagainprice"` Authorid int `orm:"authorid" json:"authorid"` Isauthor int `orm:"isauthor" json:"isauthor"` Ispackage int `orm:"ispackage" json:"ispackage"` Packageid int `orm:"packageid" json:"packageid"` Taskdiscountprice float64 `orm:"taskdiscountprice" json:"taskdiscountprice"` Seckilldiscountprice float64 `orm:"seckilldiscountprice" json:"seckilldiscountprice"` Verifyendtime int `orm:"verifyendtime" json:"verifyendtime"` Willcancelmessage int `orm:"willcancelmessage" json:"willcancelmessage"` Sendtype int `orm:"sendtype" json:"sendtype"` Lotterydiscountprice float64 `orm:"lotterydiscountprice" json:"lotterydiscountprice"` Contype int `orm:"contype" json:"contype"` Wxid int `orm:"wxid" json:"wxid"` Wxcardid string `orm:"wxcardid" json:"wxcardid"` Wxcode string `orm:"wxcode" json:"wxcode"` Dispatchkey string `orm:"dispatchkey" json:"dispatchkey"` Quickid int `orm:"quickid" json:"quickid"` Istrade int `orm:"istrade" json:"istrade"` Isnewstore int `orm:"isnewstore" json:"isnewstore"` Liveid int `orm:"liveid" json:"liveid"` OrdersnTrade string `orm:"ordersn_trade" json:"ordersn_trade"` Tradestatus int `orm:"tradestatus" json:"tradestatus"` Tradepaytype int `orm:"tradepaytype" json:"tradepaytype"` Tradepaytime int `orm:"tradepaytime" json:"tradepaytime"` Dowpayment float64 `orm:"dowpayment" json:"dowpayment"` Betweenprice float64 `orm:"betweenprice" json:"betweenprice"` Isshare int `orm:"isshare" json:"isshare"` Officcode string `orm:"officcode" json:"officcode"` WxappPrepayId string `orm:"wxapp_prepay_id" json:"wxapp_prepay_id"` Cashtime int `orm:"cashtime" json:"cashtime"` Iswxappcreate int `orm:"iswxappcreate" json:"iswxappcreate"` RandomCode string `orm:"random_code" json:"random_code"` PrintTemplate string `orm:"print_template" json:"print_template"` CityExpressState int `orm:"city_express_state" json:"city_express_state"` } func (*Ewei_shop_order) TableName() string { return "ewei_shop_order" } type Ewei_shop_sns_board_follow struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Bid int `orm:"bid" json:"bid"` Openid string `orm:"openid" json:"openid"` Createtime int `orm:"createtime" json:"createtime"` } func (*Ewei_shop_sns_board_follow) TableName() string { return "ewei_shop_sns_board_follow" } type Ewei_shop_system_copyright_notice struct { Id int `orm:"id" json:"id"` Title string `orm:"title" json:"title"` Author string `orm:"author" json:"author"` Content string `orm:"content" json:"content"` Createtime int `orm:"createtime" json:"createtime"` Displayorder int `orm:"displayorder" json:"displayorder"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_system_copyright_notice) TableName() string { return "ewei_shop_system_copyright_notice" } type Ewei_shop_system_guestbook struct { Id int `orm:"id" json:"id"` Title string `orm:"title" json:"title"` Content string `orm:"content" json:"content"` Nickname string `orm:"nickname" json:"nickname"` Createtime int `orm:"createtime" json:"createtime"` Email string `orm:"email" json:"email"` Clientip string `orm:"clientip" json:"clientip"` Mobile string `orm:"mobile" json:"mobile"` } func (*Ewei_shop_system_guestbook) TableName() string { return "ewei_shop_system_guestbook" } type Ewei_shop_task_reward struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Taskid int `orm:"taskid" json:"taskid"` Tasktitle string `orm:"tasktitle" json:"tasktitle"` Tasktype string `orm:"tasktype" json:"tasktype"` Taskowner string `orm:"taskowner" json:"taskowner"` Ownernickname string `orm:"ownernickname" json:"ownernickname"` Recordid int `orm:"recordid" json:"recordid"` Nickname string `orm:"nickname" json:"nickname"` Headimg string `orm:"headimg" json:"headimg"` Openid string `orm:"openid" json:"openid"` RewardType string `orm:"reward_type" json:"reward_type"` RewardTitle string `orm:"reward_title" json:"reward_title"` RewardData float64 `orm:"reward_data" json:"reward_data"` Get int `orm:"get" json:"get"` Sent int `orm:"sent" json:"sent"` Gettime string `orm:"gettime" json:"gettime"` Senttime string `orm:"senttime" json:"senttime"` Isjoiner int `orm:"isjoiner" json:"isjoiner"` Price float64 `orm:"price" json:"price"` Level int `orm:"level" json:"level"` Read int `orm:"read" json:"read"` } func (*Ewei_shop_task_reward) TableName() string { return "ewei_shop_task_reward" } type Coupon_record struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Acid int `orm:"acid" json:"acid"` CardId string `orm:"card_id" json:"card_id"` Openid string `orm:"openid" json:"openid"` FriendOpenid string `orm:"friend_openid" json:"friend_openid"` Givebyfriend int `orm:"givebyfriend" json:"givebyfriend"` Code string `orm:"code" json:"code"` Hash string `orm:"hash" json:"hash"` Addtime int `orm:"addtime" json:"addtime"` Usetime int `orm:"usetime" json:"usetime"` Status int `orm:"status" json:"status"` ClerkName string `orm:"clerk_name" json:"clerk_name"` ClerkId int `orm:"clerk_id" json:"clerk_id"` StoreId int `orm:"store_id" json:"store_id"` ClerkType int `orm:"clerk_type" json:"clerk_type"` Couponid int `orm:"couponid" json:"couponid"` Uid int `orm:"uid" json:"uid"` Grantmodule string `orm:"grantmodule" json:"grantmodule"` Remark string `orm:"remark" json:"remark"` } func (*Coupon_record) TableName() string { return "coupon_record" } type Ewei_shop_cashier_pay_log struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Cashierid int `orm:"cashierid" json:"cashierid"` Operatorid int `orm:"operatorid" json:"operatorid"` Openid string `orm:"openid" json:"openid"` Paytype int `orm:"paytype" json:"paytype"` Logno string `orm:"logno" json:"logno"` Title string `orm:"title" json:"title"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` Money float64 `orm:"money" json:"money"` Paytime int `orm:"paytime" json:"paytime"` IsApplypay int `orm:"is_applypay" json:"is_applypay"` Randommoney float64 `orm:"randommoney" json:"randommoney"` Enough float64 `orm:"enough" json:"enough"` Mobile string `orm:"mobile" json:"mobile"` Deduction float64 `orm:"deduction" json:"deduction"` Discountmoney float64 `orm:"discountmoney" json:"discountmoney"` Discount float64 `orm:"discount" json:"discount"` Isgoods int `orm:"isgoods" json:"isgoods"` Orderid int `orm:"orderid" json:"orderid"` Orderprice float64 `orm:"orderprice" json:"orderprice"` Goodsprice float64 `orm:"goodsprice" json:"goodsprice"` Couponpay float64 `orm:"couponpay" json:"couponpay"` Payopenid string `orm:"payopenid" json:"payopenid"` Nosalemoney float64 `orm:"nosalemoney" json:"nosalemoney"` Coupon int `orm:"coupon" json:"coupon"` Usecoupon int `orm:"usecoupon" json:"usecoupon"` Usecouponprice float64 `orm:"usecouponprice" json:"usecouponprice"` PresentCredit1 int `orm:"present_credit1" json:"present_credit1"` Refundsn string `orm:"refundsn" json:"refundsn"` Refunduser int `orm:"refunduser" json:"refunduser"` } func (*Ewei_shop_cashier_pay_log) TableName() string { return "ewei_shop_cashier_pay_log" } type Ewei_shop_customer_guestbook struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Realname string `orm:"realname" json:"realname"` Mobile string `orm:"mobile" json:"mobile"` Weixin string `orm:"weixin" json:"weixin"` Images string `orm:"images" json:"images"` Content string `orm:"content" json:"content"` Remark string `orm:"remark" json:"remark"` Status int `orm:"status" json:"status"` Createtime int `orm:"createtime" json:"createtime"` Deleted int `orm:"deleted" json:"deleted"` } func (*Ewei_shop_customer_guestbook) TableName() string { return "ewei_shop_customer_guestbook" } type Ewei_shop_diypage struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Name string `orm:"name" json:"name"` Data string `orm:"data" json:"data"` Createtime int `orm:"createtime" json:"createtime"` Lastedittime int `orm:"lastedittime" json:"lastedittime"` Keyword string `orm:"keyword" json:"keyword"` Diymenu int `orm:"diymenu" json:"diymenu"` Merch int `orm:"merch" json:"merch"` Diyadv int `orm:"diyadv" json:"diyadv"` } func (*Ewei_shop_diypage) TableName() string { return "ewei_shop_diypage" } type Ewei_shop_fullback_log struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Orderid int `orm:"orderid" json:"orderid"` Price float64 `orm:"price" json:"price"` Priceevery float64 `orm:"priceevery" json:"priceevery"` Day int `orm:"day" json:"day"` Fullbackday int `orm:"fullbackday" json:"fullbackday"` Createtime int `orm:"createtime" json:"createtime"` Fullbacktime int `orm:"fullbacktime" json:"fullbacktime"` Isfullback int `orm:"isfullback" json:"isfullback"` Goodsid int `orm:"goodsid" json:"goodsid"` } func (*Ewei_shop_fullback_log) TableName() string { return "ewei_shop_fullback_log" } type Ewei_shop_invitation struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Title string `orm:"title" json:"title"` Data string `orm:"data" json:"data"` Scan int `orm:"scan" json:"scan"` Follow int `orm:"follow" json:"follow"` Qrcode int `orm:"qrcode" json:"qrcode"` Status int `orm:"status" json:"status"` Createtime int `orm:"createtime" json:"createtime"` } func (*Ewei_shop_invitation) TableName() string { return "ewei_shop_invitation" } type Ewei_shop_sns_manage struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Bid int `orm:"bid" json:"bid"` Openid string `orm:"openid" json:"openid"` Enabled int `orm:"enabled" json:"enabled"` } func (*Ewei_shop_sns_manage) TableName() string { return "ewei_shop_sns_manage" } type Mc_credits_record struct { Id int `orm:"id" json:"id"` Uid int `orm:"uid" json:"uid"` Uniacid int `orm:"uniacid" json:"uniacid"` Credittype string `orm:"credittype" json:"credittype"` Num float64 `orm:"num" json:"num"` Operator int `orm:"operator" json:"operator"` Module string `orm:"module" json:"module"` ClerkId int `orm:"clerk_id" json:"clerk_id"` StoreId int `orm:"store_id" json:"store_id"` ClerkType int `orm:"clerk_type" json:"clerk_type"` Createtime int `orm:"createtime" json:"createtime"` Remark string `orm:"remark" json:"remark"` } func (*Mc_credits_record) TableName() string { return "mc_credits_record" } type Profile_fields struct { Id int `orm:"id" json:"id"` Field string `orm:"field" json:"field"` Available int `orm:"available" json:"available"` Title string `orm:"title" json:"title"` Description string `orm:"description" json:"description"` Displayorder int `orm:"displayorder" json:"displayorder"` Required int `orm:"required" json:"required"` Unchangeable int `orm:"unchangeable" json:"unchangeable"` Showinregister int `orm:"showinregister" json:"showinregister"` FieldLength int `orm:"field_length" json:"field_length"` } func (*Profile_fields) TableName() string { return "profile_fields" } type Qrcode_stat struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Acid int `orm:"acid" json:"acid"` Qid int `orm:"qid" json:"qid"` Openid string `orm:"openid" json:"openid"` Type int `orm:"type" json:"type"` Qrcid int `orm:"qrcid" json:"qrcid"` SceneStr string `orm:"scene_str" json:"scene_str"` Name string `orm:"name" json:"name"` Createtime int `orm:"createtime" json:"createtime"` } func (*Qrcode_stat) TableName() string { return "qrcode_stat" } type Users_founder_group struct { Id int `orm:"id" json:"id"` Name string `orm:"name" json:"name"` Package string `orm:"package" json:"package"` Maxaccount int `orm:"maxaccount" json:"maxaccount"` Maxsubaccount int `orm:"maxsubaccount" json:"maxsubaccount"` Timelimit int `orm:"timelimit" json:"timelimit"` Maxwxapp int `orm:"maxwxapp" json:"maxwxapp"` Maxwebapp int `orm:"maxwebapp" json:"maxwebapp"` } func (*Users_founder_group) TableName() string { return "users_founder_group" } type Ewei_message_mass_sign struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Nickname string `orm:"nickname" json:"nickname"` Taskid int `orm:"taskid" json:"taskid"` Status int `orm:"status" json:"status"` Log string `orm:"log" json:"log"` } func (*Ewei_message_mass_sign) TableName() string { return "ewei_message_mass_sign" } type Ewei_shop_abonus_bill struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Billno string `orm:"billno" json:"billno"` Paytype int `orm:"paytype" json:"paytype"` Year int `orm:"year" json:"year"` Month int `orm:"month" json:"month"` Week int `orm:"week" json:"week"` Ordercount int `orm:"ordercount" json:"ordercount"` Ordermoney float64 `orm:"ordermoney" json:"ordermoney"` Paytime int `orm:"paytime" json:"paytime"` Aagentcount1 int `orm:"aagentcount1" json:"aagentcount1"` Aagentcount2 int `orm:"aagentcount2" json:"aagentcount2"` Aagentcount3 int `orm:"aagentcount3" json:"aagentcount3"` Bonusmoney1 float64 `orm:"bonusmoney1" json:"bonusmoney1"` BonusmoneySend1 float64 `orm:"bonusmoney_send1" json:"bonusmoney_send1"` BonusmoneyPay1 float64 `orm:"bonusmoney_pay1" json:"bonusmoney_pay1"` Bonusmoney2 float64 `orm:"bonusmoney2" json:"bonusmoney2"` BonusmoneySend2 float64 `orm:"bonusmoney_send2" json:"bonusmoney_send2"` BonusmoneyPay2 float64 `orm:"bonusmoney_pay2" json:"bonusmoney_pay2"` Bonusmoney3 float64 `orm:"bonusmoney3" json:"bonusmoney3"` BonusmoneySend3 float64 `orm:"bonusmoney_send3" json:"bonusmoney_send3"` BonusmoneyPay3 float64 `orm:"bonusmoney_pay3" json:"bonusmoney_pay3"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` Starttime int `orm:"starttime" json:"starttime"` Endtime int `orm:"endtime" json:"endtime"` Confirmtime int `orm:"confirmtime" json:"confirmtime"` Ceshi int `orm:"ceshi" json:"ceshi"` } func (*Ewei_shop_abonus_bill) TableName() string { return "ewei_shop_abonus_bill" } type Ewei_shop_author_team struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Teamno string `orm:"teamno" json:"teamno"` Year int `orm:"year" json:"year"` Month int `orm:"month" json:"month"` TeamCount int `orm:"team_count" json:"team_count"` TeamIds string `orm:"team_ids" json:"team_ids"` Status int `orm:"status" json:"status"` Createtime int `orm:"createtime" json:"createtime"` Paytime int `orm:"paytime" json:"paytime"` } func (*Ewei_shop_author_team) TableName() string { return "ewei_shop_author_team" } type Ewei_shop_commission_clickcount struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` FromOpenid string `orm:"from_openid" json:"from_openid"` Clicktime int `orm:"clicktime" json:"clicktime"` } func (*Ewei_shop_commission_clickcount) TableName() string { return "ewei_shop_commission_clickcount" } type Ewei_shop_pc_slide struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Type int `orm:"type" json:"type"` Advname string `orm:"advname" json:"advname"` Link string `orm:"link" json:"link"` Thumb string `orm:"thumb" json:"thumb"` Backcolor string `orm:"backcolor" json:"backcolor"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` Shopid int `orm:"shopid" json:"shopid"` } func (*Ewei_shop_pc_slide) TableName() string { return "ewei_shop_pc_slide" } type Rule struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Module string `orm:"module" json:"module"` Displayorder int `orm:"displayorder" json:"displayorder"` Status int `orm:"status" json:"status"` Containtype string `orm:"containtype" json:"containtype"` ReplyType int `orm:"reply_type" json:"reply_type"` } func (*Rule) TableName() string { return "rule" } type Users_bind struct { Id int `orm:"id" json:"id"` Uid int `orm:"uid" json:"uid"` BindSign string `orm:"bind_sign" json:"bind_sign"` ThirdType int `orm:"third_type" json:"third_type"` ThirdNickname string `orm:"third_nickname" json:"third_nickname"` } func (*Users_bind) TableName() string { return "users_bind" } type Wechat_attachment struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Acid int `orm:"acid" json:"acid"` Uid int `orm:"uid" json:"uid"` Filename string `orm:"filename" json:"filename"` Attachment string `orm:"attachment" json:"attachment"` MediaId string `orm:"media_id" json:"media_id"` Width int `orm:"width" json:"width"` Height int `orm:"height" json:"height"` Type string `orm:"type" json:"type"` Model string `orm:"model" json:"model"` Tag string `orm:"tag" json:"tag"` Createtime int `orm:"createtime" json:"createtime"` ModuleUploadDir string `orm:"module_upload_dir" json:"module_upload_dir"` } func (*Wechat_attachment) TableName() string { return "wechat_attachment" } type Coupon_store struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Couponid string `orm:"couponid" json:"couponid"` Storeid int `orm:"storeid" json:"storeid"` } func (*Coupon_store) TableName() string { return "coupon_store" } type Ewei_shop_cashier_operator struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Cashierid int `orm:"cashierid" json:"cashierid"` Title string `orm:"title" json:"title"` Manageopenid string `orm:"manageopenid" json:"manageopenid"` Username string `orm:"username" json:"username"` Password string `orm:"password" json:"password"` Salt string `orm:"salt" json:"salt"` Perm string `orm:"perm" json:"perm"` Createtime int `orm:"createtime" json:"createtime"` } func (*Ewei_shop_cashier_operator) TableName() string { return "ewei_shop_cashier_operator" } type Ewei_shop_exchange_cart struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Goodsid int `orm:"goodsid" json:"goodsid"` Total int `orm:"total" json:"total"` Marketprice float64 `orm:"marketprice" json:"marketprice"` Optionid int `orm:"optionid" json:"optionid"` Selected int `orm:"selected" json:"selected"` Deleted int `orm:"deleted" json:"deleted"` Merchid int `orm:"merchid" json:"merchid"` Title string `orm:"title" json:"title"` Groupid int `orm:"groupid" json:"groupid"` Serial string `orm:"serial" json:"serial"` } func (*Ewei_shop_exchange_cart) TableName() string { return "ewei_shop_exchange_cart" } type Ewei_shop_live_setting struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Ismember int `orm:"ismember" json:"ismember"` ShareTitle string `orm:"share_title" json:"share_title"` ShareIcon string `orm:"share_icon" json:"share_icon"` ShareDesc string `orm:"share_desc" json:"share_desc"` ShareUrl string `orm:"share_url" json:"share_url"` Livenoticetime int `orm:"livenoticetime" json:"livenoticetime"` } func (*Ewei_shop_live_setting) TableName() string { return "ewei_shop_live_setting" } type Ewei_shop_merch_nav struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Navname string `orm:"navname" json:"navname"` Icon string `orm:"icon" json:"icon"` Url string `orm:"url" json:"url"` Displayorder int `orm:"displayorder" json:"displayorder"` Status int `orm:"status" json:"status"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_merch_nav) TableName() string { return "ewei_shop_merch_nav" } type Ewei_shop_perm_role struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Rolename string `orm:"rolename" json:"rolename"` Status int `orm:"status" json:"status"` Perms string `orm:"perms" json:"perms"` Deleted int `orm:"deleted" json:"deleted"` Perms2 string `orm:"perms2" json:"perms2"` } func (*Ewei_shop_perm_role) TableName() string { return "ewei_shop_perm_role" } type Ewei_shop_postera_log struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Posterid int `orm:"posterid" json:"posterid"` FromOpenid string `orm:"from_openid" json:"from_openid"` Subcredit int `orm:"subcredit" json:"subcredit"` Submoney float64 `orm:"submoney" json:"submoney"` Reccredit int `orm:"reccredit" json:"reccredit"` Recmoney float64 `orm:"recmoney" json:"recmoney"` Createtime int `orm:"createtime" json:"createtime"` Reccouponid int `orm:"reccouponid" json:"reccouponid"` Reccouponnum int `orm:"reccouponnum" json:"reccouponnum"` Subcouponid int `orm:"subcouponid" json:"subcouponid"` Subcouponnum int `orm:"subcouponnum" json:"subcouponnum"` } func (*Ewei_shop_postera_log) TableName() string { return "ewei_shop_postera_log" } type Ewei_shop_qa_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` Isrecommand int `orm:"isrecommand" json:"isrecommand"` } func (*Ewei_shop_qa_category) TableName() string { return "ewei_shop_qa_category" } type Ewei_shop_system_banner struct { Id int `orm:"id" json:"id"` Title string `orm:"title" json:"title"` Thumb string `orm:"thumb" json:"thumb"` Url string `orm:"url" json:"url"` Createtime int `orm:"createtime" json:"createtime"` Displayorder int `orm:"displayorder" json:"displayorder"` Status int `orm:"status" json:"status"` Background string `orm:"background" json:"background"` } func (*Ewei_shop_system_banner) TableName() string { return "ewei_shop_system_banner" } type Site_article struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Rid int `orm:"rid" json:"rid"` Kid int `orm:"kid" json:"kid"` Iscommend int `orm:"iscommend" json:"iscommend"` Ishot int `orm:"ishot" json:"ishot"` Pcate int `orm:"pcate" json:"pcate"` Ccate int `orm:"ccate" json:"ccate"` Template string `orm:"template" json:"template"` Title string `orm:"title" json:"title"` Description string `orm:"description" json:"description"` Content string `orm:"content" json:"content"` Thumb string `orm:"thumb" json:"thumb"` Incontent int `orm:"incontent" json:"incontent"` Source string `orm:"source" json:"source"` Author string `orm:"author" json:"author"` Displayorder int `orm:"displayorder" json:"displayorder"` Linkurl string `orm:"linkurl" json:"linkurl"` Createtime int `orm:"createtime" json:"createtime"` Edittime int `orm:"edittime" json:"edittime"` Click int `orm:"click" json:"click"` Type string `orm:"type" json:"type"` Credit string `orm:"credit" json:"credit"` } func (*Site_article) TableName() string { return "site_article" } type Users_invitation struct { Id int `orm:"id" json:"id"` Code string `orm:"code" json:"code"` Fromuid int `orm:"fromuid" json:"fromuid"` Inviteuid int `orm:"inviteuid" json:"inviteuid"` Createtime int `orm:"createtime" json:"createtime"` } func (*Users_invitation) TableName() string { return "users_invitation" } type Ewei_shop_live_favorite struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Roomid int `orm:"roomid" json:"roomid"` Openid string `orm:"openid" json:"openid"` Deleted int `orm:"deleted" json:"deleted"` Createtime int `orm:"createtime" json:"createtime"` } func (*Ewei_shop_live_favorite) TableName() string { return "ewei_shop_live_favorite" } type Ewei_shop_pc_adv struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Advname string `orm:"advname" json:"advname"` Title string `orm:"title" json:"title"` Src string `orm:"src" json:"src"` Alt string `orm:"alt" json:"alt"` Enabled int `orm:"enabled" json:"enabled"` Link string `orm:"link" json:"link"` Width int `orm:"width" json:"width"` Height int `orm:"height" json:"height"` } func (*Ewei_shop_pc_adv) TableName() string { return "ewei_shop_pc_adv" } type Ewei_shop_task_list struct { Status int `orm:"status" json:"status"` Displayorder int `orm:"displayorder" json:"displayorder"` Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Title string `orm:"title" json:"title"` Image string `orm:"image" json:"image"` Type string `orm:"type" json:"type"` Starttime string `orm:"starttime" json:"starttime"` Endtime string `orm:"endtime" json:"endtime"` Demand int `orm:"demand" json:"demand"` Requiregoods string `orm:"requiregoods" json:"requiregoods"` Picktype int `orm:"picktype" json:"picktype"` StopType int `orm:"stop_type" json:"stop_type"` StopLimit int `orm:"stop_limit" json:"stop_limit"` StopTime string `orm:"stop_time" json:"stop_time"` StopCycle int `orm:"stop_cycle" json:"stop_cycle"` RepeatType int `orm:"repeat_type" json:"repeat_type"` RepeatInterval int `orm:"repeat_interval" json:"repeat_interval"` RepeatCycle int `orm:"repeat_cycle" json:"repeat_cycle"` Reward string `orm:"reward" json:"reward"` Followreward string `orm:"followreward" json:"followreward"` GoodsLimit int `orm:"goods_limit" json:"goods_limit"` Notice string `orm:"notice" json:"notice"` DesignData string `orm:"design_data" json:"design_data"` DesignBg string `orm:"design_bg" json:"design_bg"` NativeData string `orm:"native_data" json:"native_data"` NativeData2 string `orm:"native_data2" json:"native_data2"` NativeData3 string `orm:"native_data3" json:"native_data3"` Reward2 string `orm:"reward2" json:"reward2"` Reward3 string `orm:"reward3" json:"reward3"` Level2 int `orm:"level2" json:"level2"` Level3 int `orm:"level3" json:"level3"` MemberGroup string `orm:"member_group" json:"member_group"` AutoPick int `orm:"auto_pick" json:"auto_pick"` KeywordPick string `orm:"keyword_pick" json:"keyword_pick"` Verb string `orm:"verb" json:"verb"` Unit string `orm:"unit" json:"unit"` MemberLevel int `orm:"member_level" json:"member_level"` } func (*Ewei_shop_task_list) TableName() string { return "ewei_shop_task_list" } type Ewei_shop_wxapp_tmessage struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Templateid string `orm:"templateid" json:"templateid"` Datas string `orm:"datas" json:"datas"` EmphasisKeyword int `orm:"emphasis_keyword" json:"emphasis_keyword"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_wxapp_tmessage) TableName() string { return "ewei_shop_wxapp_tmessage" } type Activity_clerks struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Uid int `orm:"uid" json:"uid"` Storeid int `orm:"storeid" json:"storeid"` Name string `orm:"name" json:"name"` Password string `orm:"password" json:"password"` Mobile string `orm:"mobile" json:"mobile"` Openid string `orm:"openid" json:"openid"` Nickname string `orm:"nickname" json:"nickname"` } func (*Activity_clerks) TableName() string { return "activity_clerks" } type Ewei_shop_city_express struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Merchid int `orm:"merchid" json:"merchid"` StartFee float64 `orm:"start_fee" json:"start_fee"` StartKm int `orm:"start_km" json:"start_km"` PreKm int `orm:"pre_km" json:"pre_km"` PreKmFee float64 `orm:"pre_km_fee" json:"pre_km_fee"` FixedKm int `orm:"fixed_km" json:"fixed_km"` FixedFee float64 `orm:"fixed_fee" json:"fixed_fee"` ReceiveGoods int `orm:"receive_goods" json:"receive_goods"` Lng string `orm:"lng" json:"lng"` Lat string `orm:"lat" json:"lat"` Range int `orm:"range" json:"range"` Zoom int `orm:"zoom" json:"zoom"` ExpressType int `orm:"express_type" json:"express_type"` Config string `orm:"config" json:"config"` Tel1 string `orm:"tel1" json:"tel1"` Tel2 string `orm:"tel2" json:"tel2"` IsSum int `orm:"is_sum" json:"is_sum"` IsDispatch int `orm:"is_dispatch" json:"is_dispatch"` Enabled int `orm:"enabled" json:"enabled"` GeoKey string `orm:"geo_key" json:"geo_key"` } func (*Ewei_shop_city_express) TableName() string { return "ewei_shop_city_express" } type Ewei_shop_exchange_record struct { Id int `orm:"id" json:"id"` Key string `orm:"key" json:"key"` Uniacid int `orm:"uniacid" json:"uniacid"` Goods string `orm:"goods" json:"goods"` Orderid string `orm:"orderid" json:"orderid"` Time int `orm:"time" json:"time"` Openid string `orm:"openid" json:"openid"` Mode int `orm:"mode" json:"mode"` Balance float64 `orm:"balance" json:"balance"` Red float64 `orm:"red" json:"red"` Coupon string `orm:"coupon" json:"coupon"` Score int `orm:"score" json:"score"` Nickname string `orm:"nickname" json:"nickname"` Groupid int `orm:"groupid" json:"groupid"` Title string `orm:"title" json:"title"` Serial string `orm:"serial" json:"serial"` Ordersn string `orm:"ordersn" json:"ordersn"` GoodsTitle string `orm:"goods_title" json:"goods_title"` } func (*Ewei_shop_exchange_record) TableName() string { return "ewei_shop_exchange_record" } type Ewei_shop_member_cart struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Goodsid int `orm:"goodsid" json:"goodsid"` Total int `orm:"total" json:"total"` Marketprice float64 `orm:"marketprice" json:"marketprice"` Deleted int `orm:"deleted" json:"deleted"` Optionid int `orm:"optionid" json:"optionid"` Createtime int `orm:"createtime" json:"createtime"` Diyformdataid int `orm:"diyformdataid" json:"diyformdataid"` Diyformdata string `orm:"diyformdata" json:"diyformdata"` Diyformfields string `orm:"diyformfields" json:"diyformfields"` Diyformid int `orm:"diyformid" json:"diyformid"` Selected int `orm:"selected" json:"selected"` Selectedadd int `orm:"selectedadd" json:"selectedadd"` Merchid int `orm:"merchid" json:"merchid"` Isnewstore int `orm:"isnewstore" json:"isnewstore"` } func (*Ewei_shop_member_cart) TableName() string { return "ewei_shop_member_cart" } type Ewei_shop_sale_coupon_data struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Couponid int `orm:"couponid" json:"couponid"` Gettime int `orm:"gettime" json:"gettime"` Gettype int `orm:"gettype" json:"gettype"` Usedtime int `orm:"usedtime" json:"usedtime"` Orderid int `orm:"orderid" json:"orderid"` } func (*Ewei_shop_sale_coupon_data) TableName() string { return "ewei_shop_sale_coupon_data" } type Ewei_shop_sns_member struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Level int `orm:"level" json:"level"` Createtime int `orm:"createtime" json:"createtime"` Credit int `orm:"credit" json:"credit"` Sign string `orm:"sign" json:"sign"` Isblack int `orm:"isblack" json:"isblack"` Notupgrade int `orm:"notupgrade" json:"notupgrade"` } func (*Ewei_shop_sns_member) TableName() string { return "ewei_shop_sns_member" } type Video_reply struct { Id int `orm:"id" json:"id"` Rid int `orm:"rid" json:"rid"` Title string `orm:"title" json:"title"` Description string `orm:"description" json:"description"` Mediaid string `orm:"mediaid" json:"mediaid"` Createtime int `orm:"createtime" json:"createtime"` } func (*Video_reply) TableName() string { return "video_reply" } type Core_paylog struct { Plid int `orm:"plid" json:"plid"` Type string `orm:"type" json:"type"` Uniacid int `orm:"uniacid" json:"uniacid"` Acid int `orm:"acid" json:"acid"` Openid string `orm:"openid" json:"openid"` Uniontid string `orm:"uniontid" json:"uniontid"` Tid string `orm:"tid" json:"tid"` Fee float64 `orm:"fee" json:"fee"` Status int `orm:"status" json:"status"` Module string `orm:"module" json:"module"` Tag string `orm:"tag" json:"tag"` IsUsecard int `orm:"is_usecard" json:"is_usecard"` CardType int `orm:"card_type" json:"card_type"` CardId string `orm:"card_id" json:"card_id"` CardFee float64 `orm:"card_fee" json:"card_fee"` EncryptCode string `orm:"encrypt_code" json:"encrypt_code"` } func (*Core_paylog) TableName() string { return "core_paylog" } type Ewei_shop_bargain_account struct { Id int `orm:"id" json:"id"` MallName string `orm:"mall_name" json:"mall_name"` Banner string `orm:"banner" json:"banner"` MallTitle string `orm:"mall_title" json:"mall_title"` MallContent string `orm:"mall_content" json:"mall_content"` MallLogo string `orm:"mall_logo" json:"mall_logo"` Message int `orm:"message" json:"message"` Partin int `orm:"partin" json:"partin"` Rule string `orm:"rule" json:"rule"` EndMessage int `orm:"end_message" json:"end_message"` FollowSwi int `orm:"follow_swi" json:"follow_swi"` Sharestyle int `orm:"sharestyle" json:"sharestyle"` } func (*Ewei_shop_bargain_account) TableName() string { return "ewei_shop_bargain_account" } type Ewei_shop_creditshop_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` Advimg string `orm:"advimg" json:"advimg"` Advurl string `orm:"advurl" json:"advurl"` Isrecommand int `orm:"isrecommand" json:"isrecommand"` } func (*Ewei_shop_creditshop_category) TableName() string { return "ewei_shop_creditshop_category" } type Ewei_shop_exhelper_esheet struct { Id int `orm:"id" json:"id"` Name string `orm:"name" json:"name"` Express string `orm:"express" json:"express"` Code string `orm:"code" json:"code"` Datas string `orm:"datas" json:"datas"` } func (*Ewei_shop_exhelper_esheet) TableName() string { return "ewei_shop_exhelper_esheet" } type Ewei_shop_exhelper_sys struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Ip string `orm:"ip" json:"ip"` Port int `orm:"port" json:"port"` IpCloud string `orm:"ip_cloud" json:"ip_cloud"` PortCloud int `orm:"port_cloud" json:"port_cloud"` IsCloud int `orm:"is_cloud" json:"is_cloud"` Merchid int `orm:"merchid" json:"merchid"` Ebusiness string `orm:"ebusiness" json:"ebusiness"` Apikey string `orm:"apikey" json:"apikey"` } func (*Ewei_shop_exhelper_sys) TableName() string { return "ewei_shop_exhelper_sys" } type Ewei_shop_live_coupon struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Roomid int `orm:"roomid" json:"roomid"` Couponid int `orm:"couponid" json:"couponid"` Coupontotal int `orm:"coupontotal" json:"coupontotal"` Couponlimit int `orm:"couponlimit" json:"couponlimit"` } func (*Ewei_shop_live_coupon) TableName() string { return "ewei_shop_live_coupon" } type Ewei_shop_merch_perm_log struct { Id int `orm:"id" json:"id"` Uid int `orm:"uid" json:"uid"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Type string `orm:"type" json:"type"` Op string `orm:"op" json:"op"` Ip string `orm:"ip" json:"ip"` Createtime int `orm:"createtime" json:"createtime"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_merch_perm_log) TableName() string { return "ewei_shop_merch_perm_log" } type Ewei_shop_verifygoods_log struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Verifygoodsid int `orm:"verifygoodsid" json:"verifygoodsid"` Salerid int `orm:"salerid" json:"salerid"` Storeid int `orm:"storeid" json:"storeid"` Verifynum int `orm:"verifynum" json:"verifynum"` Verifydate int `orm:"verifydate" json:"verifydate"` Remarks string `orm:"remarks" json:"remarks"` } func (*Ewei_shop_verifygoods_log) TableName() string { return "ewei_shop_verifygoods_log" } type Ewei_shop_member_group struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Groupname string `orm:"groupname" json:"groupname"` Description string `orm:"description" json:"description"` } func (*Ewei_shop_member_group) TableName() string { return "ewei_shop_member_group" } type Ewei_shop_member_printer struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Title string `orm:"title" json:"title"` Type int `orm:"type" json:"type"` PrintData string `orm:"print_data" json:"print_data"` Createtime int `orm:"createtime" json:"createtime"` Merchid int `orm:"merchid" json:"merchid"` } func (*Ewei_shop_member_printer) TableName() string { return "ewei_shop_member_printer" } type Ewei_shop_merch_billo struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Billid int `orm:"billid" json:"billid"` Orderid int `orm:"orderid" json:"orderid"` Ordermoney float64 `orm:"ordermoney" json:"ordermoney"` } func (*Ewei_shop_merch_billo) TableName() string { return "ewei_shop_merch_billo" } type Ewei_shop_nav struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Navname string `orm:"navname" json:"navname"` Icon string `orm:"icon" json:"icon"` Url string `orm:"url" json:"url"` Displayorder int `orm:"displayorder" json:"displayorder"` Status int `orm:"status" json:"status"` Iswxapp int `orm:"iswxapp" json:"iswxapp"` } func (*Ewei_shop_nav) TableName() string { return "ewei_shop_nav" } type Ewei_shop_system_article struct { Id int `orm:"id" json:"id"` Title string `orm:"title" json:"title"` Author string `orm:"author" json:"author"` Thumb string `orm:"thumb" json:"thumb"` Content string `orm:"content" json:"content"` Createtime int `orm:"createtime" json:"createtime"` Displayorder int `orm:"displayorder" json:"displayorder"` Cate int `orm:"cate" json:"cate"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_system_article) TableName() string { return "ewei_shop_system_article" } type Ewei_shop_verifygoods struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Openid string `orm:"openid" json:"openid"` Orderid int `orm:"orderid" json:"orderid"` Ordergoodsid int `orm:"ordergoodsid" json:"ordergoodsid"` Storeid int `orm:"storeid" json:"storeid"` Starttime int `orm:"starttime" json:"starttime"` Limitdays int `orm:"limitdays" json:"limitdays"` Limitnum int `orm:"limitnum" json:"limitnum"` Used int `orm:"used" json:"used"` Verifycode string `orm:"verifycode" json:"verifycode"` Codeinvalidtime int `orm:"codeinvalidtime" json:"codeinvalidtime"` Invalid int `orm:"invalid" json:"invalid"` Getcard int `orm:"getcard" json:"getcard"` Activecard int `orm:"activecard" json:"activecard"` Cardcode string `orm:"cardcode" json:"cardcode"` Limittype int `orm:"limittype" json:"limittype"` Limitdate int `orm:"limitdate" json:"limitdate"` } func (*Ewei_shop_verifygoods) TableName() string { return "ewei_shop_verifygoods" } type Ewei_shop_wxapp_startadv struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Status int `orm:"status" json:"status"` Name string `orm:"name" json:"name"` Data string `orm:"data" json:"data"` Createtime int `orm:"createtime" json:"createtime"` Lastedittime int `orm:"lastedittime" json:"lastedittime"` } func (*Ewei_shop_wxapp_startadv) TableName() string { return "ewei_shop_wxapp_startadv" } type Ewei_shop_abonus_billp struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Billid int `orm:"billid" json:"billid"` Openid string `orm:"openid" json:"openid"` Payno string `orm:"payno" json:"payno"` Paytype int `orm:"paytype" json:"paytype"` Bonus1 float64 `orm:"bonus1" json:"bonus1"` Bonus2 float64 `orm:"bonus2" json:"bonus2"` Bonus3 float64 `orm:"bonus3" json:"bonus3"` Money1 float64 `orm:"money1" json:"money1"` Realmoney1 float64 `orm:"realmoney1" json:"realmoney1"` Paymoney1 float64 `orm:"paymoney1" json:"paymoney1"` Money2 float64 `orm:"money2" json:"money2"` Realmoney2 float64 `orm:"realmoney2" json:"realmoney2"` Paymoney2 float64 `orm:"paymoney2" json:"paymoney2"` Money3 float64 `orm:"money3" json:"money3"` Realmoney3 float64 `orm:"realmoney3" json:"realmoney3"` Paymoney3 float64 `orm:"paymoney3" json:"paymoney3"` Chargemoney1 float64 `orm:"chargemoney1" json:"chargemoney1"` Chargemoney2 float64 `orm:"chargemoney2" json:"chargemoney2"` Chargemoney3 float64 `orm:"chargemoney3" json:"chargemoney3"` Charge float64 `orm:"charge" json:"charge"` Status int `orm:"status" json:"status"` Reason string `orm:"reason" json:"reason"` Paytime int `orm:"paytime" json:"paytime"` } func (*Ewei_shop_abonus_billp) TableName() string { return "ewei_shop_abonus_billp" } type Ewei_shop_seckill_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` } func (*Ewei_shop_seckill_category) TableName() string { return "ewei_shop_seckill_category" } type Ewei_shop_sns_category struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Name string `orm:"name" json:"name"` Thumb string `orm:"thumb" json:"thumb"` Displayorder int `orm:"displayorder" json:"displayorder"` Enabled int `orm:"enabled" json:"enabled"` Advimg string `orm:"advimg" json:"advimg"` Advurl string `orm:"advurl" json:"advurl"` Isrecommand int `orm:"isrecommand" json:"isrecommand"` } func (*Ewei_shop_sns_category) TableName() string { return "ewei_shop_sns_category" } type Ewei_shop_system_company_article struct { Id int `orm:"id" json:"id"` Title string `orm:"title" json:"title"` Author string `orm:"author" json:"author"` Thumb string `orm:"thumb" json:"thumb"` Content string `orm:"content" json:"content"` Createtime int `orm:"createtime" json:"createtime"` Displayorder int `orm:"displayorder" json:"displayorder"` Cate int `orm:"cate" json:"cate"` Status int `orm:"status" json:"status"` } func (*Ewei_shop_system_company_article) TableName() string { return "ewei_shop_system_company_article" } type Site_multi struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Title string `orm:"title" json:"title"` Styleid int `orm:"styleid" json:"styleid"` SiteInfo string `orm:"site_info" json:"site_info"` Status int `orm:"status" json:"status"` Bindhost string `orm:"bindhost" json:"bindhost"` } func (*Site_multi) TableName() string { return "site_multi" } type Site_page struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Multiid int `orm:"multiid" json:"multiid"` Title string `orm:"title" json:"title"` Description string `orm:"description" json:"description"` Params string `orm:"params" json:"params"` Html string `orm:"html" json:"html"` Multipage string `orm:"multipage" json:"multipage"` Type int `orm:"type" json:"type"` Status int `orm:"status" json:"status"` Createtime int `orm:"createtime" json:"createtime"` Goodnum int `orm:"goodnum" json:"goodnum"` } func (*Site_page) TableName() string { return "site_page" } type Ewei_shop_author_team_pay struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Teamid int `orm:"teamid" json:"teamid"` Mid int `orm:"mid" json:"mid"` Payno string `orm:"payno" json:"payno"` Money float64 `orm:"money" json:"money"` Paymoney float64 `orm:"paymoney" json:"paymoney"` Paytime int `orm:"paytime" json:"paytime"` } func (*Ewei_shop_author_team_pay) TableName() string { return "ewei_shop_author_team_pay" } type Ewei_shop_globonus_bill struct { Id int `orm:"id" json:"id"` Uniacid int `orm:"uniacid" json:"uniacid"` Billno string `orm:"billno" json:"billno"` Paytype int `orm:"paytype" json:"paytype"` Year int `orm:"year" json:"year"` Month int `orm:"month" json:"month"` Week int `orm:"week" json:"week"` Ordercount int `orm:"ordercount" json:"ordercount"` Ordermoney float64 `orm:"ordermoney" json:"ordermoney"` Bonusmoney float64 `orm:"bonusmoney" json:"bonusmoney"` BonusmoneySend float64 `orm:"bonusmoney_send" json:"bonusmoney_send"` BonusmoneyPay float64 `orm:"bonusmoney_pay" json:"bonusmoney_pay"` Paytime int `orm:"paytime" json:"paytime"` Partnercount int `orm:"partnercount" json:"partnercount"` Createtime int `orm:"createtime" json:"createtime"` Status int `orm:"status" json:"status"` Starttime int `orm:"starttime" json:"starttime"` Endtime int `orm:"endtime" json:"endtime"` Confirmtime int `orm:"confirmtime" json:"confirmtime"` Bonusordermoney float64 `orm:"bonusordermoney" json:"bonusordermoney"` Bonusrate float64 `orm:"bonusrate" json:"bonusrate"` } func (*Ewei_shop_globonus_bill) TableName() string { return "ewei_shop_globonus_bill" } type Mc_members struct { Uid int `orm:"uid" json:"uid"` Uniacid int `orm:"uniacid" json:"uniacid"` Mobile string `orm:"mobile" json:"mobile"` Email string `orm:"email" json:"email"` Password string `orm:"password" json:"password"` Salt string `orm:"salt" json:"salt"` Groupid int `orm:"groupid" json:"groupid"` Credit1 float64 `orm:"credit1" json:"credit1"` Credit2 float64 `orm:"credit2" json:"credit2"` Credit3 float64 `orm:"credit3" json:"credit3"` Credit4 float64 `orm:"credit4" json:"credit4"` Credit5 float64 `orm:"credit5" json:"credit5"` Credit6 float64 `orm:"credit6" json:"credit6"` Createtime int `orm:"createtime" json:"createtime"` Realname string `orm:"realname" json:"realname"` Nickname string `orm:"nickname" json:"nickname"` Avatar string `orm:"avatar" json:"avatar"` Qq string `orm:"qq" json:"qq"` Vip int `orm:"vip" json:"vip"` Gender int `orm:"gender" json:"gender"` Birthyear int `orm:"birthyear" json:"birthyear"` Birthmonth int `orm:"birthmonth" json:"birthmonth"` Birthday int `orm:"birthday" json:"birthday"` Constellation string `orm:"constellation" json:"constellation"` Zodiac string `orm:"zodiac" json:"zodiac"` Telephone string `orm:"telephone" json:"telephone"` Idcard string `orm:"idcard" json:"idcard"` Studentid string `orm:"studentid" json:"studentid"` Grade string `orm:"grade" json:"grade"` Address string `orm:"address" json:"address"` Zipcode string `orm:"zipcode" json:"zipcode"` Nationality string `orm:"nationality" json:"nationality"` Resideprovince string `orm:"resideprovince" json:"resideprovince"` Residecity string `orm:"residecity" json:"residecity"` Residedist string `orm:"residedist" json:"residedist"` Graduateschool string `orm:"graduateschool" json:"graduateschool"` Company string `orm:"company" json:"company"` Education string `orm:"education" json:"education"` Occupation string `orm:"occupation" json:"occupation"` Position string `orm:"position" json:"position"` Revenue