Bläddra i källkod

update

tags/v0.0.2
dengbiao 1 vecka sedan
förälder
incheckning
8bdce78686
8 ändrade filer med 51 tillägg och 8 borttagningar
  1. +5
    -2
      src/dao/egg_energy_available_energy_flow_dao.go
  2. +5
    -2
      src/dao/egg_energy_community_dividends_dao.go
  3. +5
    -1
      src/dao/egg_energy_core_data_dao.go
  4. +8
    -0
      src/implement/egg_energy_available_energy_flow_implement.go
  5. +8
    -0
      src/implement/egg_energy_community_dividends_implement.go
  6. +16
    -0
      src/implement/egg_energy_data_implement.go
  7. +2
    -1
      src/model/egg_energy_community_dividends.go
  8. +2
    -2
      src/model/user_relate.go

+ 5
- 2
src/dao/egg_energy_available_energy_flow_dao.go Visa fil

@@ -1,8 +1,11 @@
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"
import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"xorm.io/xorm"
)

type EggEnergyAvailableEnergyFlowDao interface {
//TODO:: You can add specific method definitions here
EggEnergyAvailableEnergyFlowFindAndCount(kind, page, pageSize int, startAt, endAt string) ([]*model.EggEnergyAvailableEnergyFlow, int64, error)
EggEnergyAvailableEnergyFlowInsertBySession(session *xorm.Session, eggEnergyAvailableEnergyFlow *model.EggEnergyAvailableEnergyFlow) (int64, error)
}

+ 5
- 2
src/dao/egg_energy_community_dividends_dao.go Visa fil

@@ -1,9 +1,12 @@
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"
import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"xorm.io/xorm"
)

type EggEnergyCommunityDividendsDao interface {
//TODO:: You can add specific method definitions here
EggEnergyCommunityDividendsFindAndCount(page, limit int, startAt, endAt string, startNums, endNums int64) ([]*model.EggEnergyCommunityDividends, int64, error)
EggEnergyCommunityDividendsInsert(EggEnergyCommunityDividends *model.EggEnergyCommunityDividends) (int, error)
EggEnergyCommunityDividendsInsertBySession(session *xorm.Session, eggEnergyCommunityDividends *model.EggEnergyCommunityDividends) (int, error)
}

+ 5
- 1
src/dao/egg_energy_core_data_dao.go Visa fil

@@ -1,7 +1,11 @@
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"
import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
"xorm.io/xorm"
)

type EggEnergyCoreDataDao interface {
EggEnergyCoreDataGet() (*model.EggEnergyCoreData, error)
EggEnergyCoreDataUpdateBySession(session *xorm.Session, id interface{}, eggEnergyCoreData *model.EggEnergyCoreData, forceColums ...string) (int64, error)
}

+ 8
- 0
src/implement/egg_energy_available_energy_flow_implement.go Visa fil

@@ -15,6 +15,14 @@ type EggEnergyAvailableEnergyFlowDb struct {
Db *xorm.Engine
}

func (e EggEnergyAvailableEnergyFlowDb) EggEnergyAvailableEnergyFlowInsertBySession(session *xorm.Session, eggEnergyAvailableEnergyFlow *model.EggEnergyAvailableEnergyFlow) (int64, error) {
_, err := session.InsertOne(eggEnergyAvailableEnergyFlow)
if err != nil {
return 0, err
}
return eggEnergyAvailableEnergyFlow.Id, nil
}

func (e EggEnergyAvailableEnergyFlowDb) EggEnergyAvailableEnergyFlowFindAndCount(kind, page, pageSize int, startAt, endAt string) ([]*model.EggEnergyAvailableEnergyFlow, int64, error) {
var m []*model.EggEnergyAvailableEnergyFlow
session := e.Db.Where("")


+ 8
- 0
src/implement/egg_energy_community_dividends_implement.go Visa fil

@@ -15,6 +15,14 @@ type EggEnergyCommunityDividendsDb struct {
Db *xorm.Engine
}

func (e EggEnergyCommunityDividendsDb) EggEnergyCommunityDividendsInsertBySession(session *xorm.Session, eggEnergyCommunityDividends *model.EggEnergyCommunityDividends) (int, error) {
_, err := session.InsertOne(eggEnergyCommunityDividends)
if err != nil {
return 0, err
}
return eggEnergyCommunityDividends.Id, nil
}

func (e EggEnergyCommunityDividendsDb) EggEnergyCommunityDividendsFindAndCount(page, limit int, startAt, endAt string, startNums, endNums int64) ([]*model.EggEnergyCommunityDividends, int64, error) {
var m []*model.EggEnergyCommunityDividends
session := e.Db.Where("")


+ 16
- 0
src/implement/egg_energy_data_implement.go Visa fil

@@ -15,6 +15,22 @@ type EggEnergyCoreDataDb struct {
Db *xorm.Engine
}

func (e EggEnergyCoreDataDb) EggEnergyCoreDataUpdateBySession(session *xorm.Session, id interface{}, eggEnergyCoreData *model.EggEnergyCoreData, forceColums ...string) (int64, error) {
var (
affected int64
err error
)
if forceColums != nil {
affected, err = session.Where("id=?", id).Cols(forceColums...).Update(eggEnergyCoreData)
} else {
affected, err = session.Where("id=?", id).Update(eggEnergyCoreData)
}
if err != nil {
return 0, err
}
return affected, nil
}

func (e EggEnergyCoreDataDb) EggEnergyCoreDataGet() (*model.EggEnergyCoreData, error) {
var m model.EggEnergyCoreData
if has, err := e.Db.Where("id >= 1").Get(&m); err != nil || has == false {


+ 2
- 1
src/model/egg_energy_community_dividends.go Visa fil

@@ -2,7 +2,8 @@ package model

type EggEnergyCommunityDividends struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Nums int `json:"nums" xorm:"not null default 0 comment('分红数量') INT(11)"`
Nums string `json:"nums" xorm:"not null default 0 comment('分红数量') INT(11)"`
Amount string `json:"amount" xorm:"not null default 0 comment('分红金额') INT(11)"`
Name string `json:"name" xorm:"not null default '' comment('名称') VARCHAR(255)"`
CoinId int `json:"coin_id" xorm:"not null default 0 comment('虚拟币id') INT(11)"`
PersonsNum int `json:"persons_num" xorm:"not null default 0 comment('分红人数') INT(11)"`


+ 2
- 2
src/model/user_relate.go Visa fil

@@ -6,8 +6,8 @@ import (

type UserRelate struct {
Id int64 `json:"id" xorm:"pk autoincr comment('主键') BIGINT(10)"`
ParentUid int `json:"parent_uid" xorm:"not null default 0 comment('上级会员ID') unique(idx_union_u_p_id) INT(20)"`
Uid int `json:"uid" xorm:"not null default 0 comment('关联UserID') unique(idx_union_u_p_id) INT(20)"`
ParentUid int64 `json:"parent_uid" xorm:"not null default 0 comment('上级会员ID') unique(idx_union_u_p_id) INT(20)"`
Uid int64 `json:"uid" xorm:"not null default 0 comment('关联UserID') unique(idx_union_u_p_id) INT(20)"`
Level int `json:"level" xorm:"not null default 1 comment('推广等级(1直属,大于1非直属)') INT(10)"`
InviteTime time.Time `json:"invite_time" xorm:"default 'CURRENT_TIMESTAMP' comment('邀请时间') TIMESTAMP"`
}

Laddar…
Avbryt
Spara