Quellcode durchsuchen

Merge remote-tracking branch 'origin/master'

master
huangjiajun vor 1 Tag
Ursprung
Commit
e13f870d5c
8 geänderte Dateien mit 135 neuen und 0 gelöschten Zeilen
  1. +1
    -0
      src/dao/admin_dao.go
  2. +10
    -0
      src/dao/egg_friend_circle_basic_dao.go
  3. +9
    -0
      src/dao/egg_friend_circle_user_black_list_dao.go
  4. +19
    -0
      src/implement/admin_implement.go
  5. +44
    -0
      src/implement/egg_friend_circle_basic_implement.go
  6. +31
    -0
      src/implement/egg_friend_circle_user_black_list_implement.go
  7. +11
    -0
      src/model/egg_friend_circle_basic.go
  8. +10
    -0
      src/model/egg_friend_circle_user_black_list.go

+ 1
- 0
src/dao/admin_dao.go Datei anzeigen

@@ -16,6 +16,7 @@ type AdminDao interface {
UpdateAdmin(m *model.Admin, columns ...string) (int64, error)
AdminInsert(m *model.Admin) (int64, error)
FindAdminRolePermissionGroup(admId int) (list []*AdminRolePermissionGroup, total int64, err error)
AdminFindByParams(params map[string]interface{}) ([]model.Admin, error)
}

type AdminRolePermissionGroup struct {


+ 10
- 0
src/dao/egg_friend_circle_basic_dao.go Datei anzeigen

@@ -0,0 +1,10 @@
package dao

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"

type EggFriendCircleBasicDao interface {
//TODO:: You can add specific method definitions here
EggFriendCircleBasicGetOne() (*model.EggFriendCircleBasic, error)
EggFriendCircleBasicInsert(m *model.EggFriendCircleBasic) (int, error)
UpdateEggFriendCircleBasic(m *model.EggFriendCircleBasic, columns ...string) (int64, error)
}

+ 9
- 0
src/dao/egg_friend_circle_user_black_list_dao.go Datei anzeigen

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

import "code.fnuoos.com/EggPlanet/egg_models.git/src/model"

type EggFriendCircleUserBlackListDao interface {
//TODO:: You can add specific method definitions here
EggFriendCircleUserBlackListInsert(m *model.EggFriendCircleUserBlackList) (int, error)
EggFriendCircleUserBlackListDeleteById(id int) (int64, error)
}

+ 19
- 0
src/implement/admin_implement.go Datei anzeigen

@@ -3,7 +3,9 @@ package implement
import (
"code.fnuoos.com/EggPlanet/egg_models.git/src/dao"
"code.fnuoos.com/EggPlanet/egg_models.git/src/model"
zhios_order_relate_utils "code.fnuoos.com/EggPlanet/egg_models.git/utils"
zhios_order_relate_logx "code.fnuoos.com/EggPlanet/egg_models.git/utils/logx"
"fmt"
"reflect"
"xorm.io/xorm"
)
@@ -124,3 +126,20 @@ func (a AdminDb) FindAdminRolePermissionGroup(admId int) (list []*dao.AdminRoleP
FindAndCount(&list)
return
}

func (a AdminDb) AdminFindByParams(params map[string]interface{}) ([]model.Admin, error) {
var m []model.Admin
if reflect.TypeOf(params["value"]).Kind() == reflect.Slice {
//指定In查询
if err := a.Db.In(zhios_order_relate_utils.AnyToString(params["key"]), params["value"]).Find(&m); err != nil {
return nil, zhios_order_relate_logx.Warn(err)
}
} else {
var query = fmt.Sprintf("%s =?", params["key"])
err := a.Db.Where(query, params["value"]).Find(&m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err)
}
}
return m, nil
}

+ 44
- 0
src/implement/egg_friend_circle_basic_implement.go Datei anzeigen

@@ -0,0 +1,44 @@
package implement

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

func NewEggFriendCircleBasicDb(engine *xorm.Engine) dao.EggFriendCircleBasicDao {
return &EggFriendCircleBasicDb{Db: engine}
}

type EggFriendCircleBasicDb struct {
Db *xorm.Engine
}

func (e EggFriendCircleBasicDb) EggFriendCircleBasicGetOne() (*model.EggFriendCircleBasic, error) {
var m model.EggFriendCircleBasic
has, err := e.Db.Where("id >= ?", 1).Get(&m)
if err != nil {
return nil, zhios_order_relate_logx.Error(err.Error())
}
if has == false {
return nil, nil
}
return &m, nil
}

func (e EggFriendCircleBasicDb) EggFriendCircleBasicInsert(m *model.EggFriendCircleBasic) (int, error) {
_, err := e.Db.InsertOne(m)
if err != nil {
return 0, err
}
return m.Id, nil
}

func (e EggFriendCircleBasicDb) UpdateEggFriendCircleBasic(m *model.EggFriendCircleBasic, columns ...string) (int64, error) {
affected, err := e.Db.Where("id =?", m.Id).Cols(columns...).Update(m)
if err != nil {
return 0, err
}
return affected, nil
}

+ 31
- 0
src/implement/egg_friend_circle_user_black_list_implement.go Datei anzeigen

@@ -0,0 +1,31 @@
package implement

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

func NewEggFriendCircleUserBlackListDb(engine *xorm.Engine) dao.EggFriendCircleUserBlackListDao {
return &EggFriendCircleUserBlackListDb{Db: engine}
}

type EggFriendCircleUserBlackListDb struct {
Db *xorm.Engine
}

func (e EggFriendCircleUserBlackListDb) EggFriendCircleUserBlackListInsert(m *model.EggFriendCircleUserBlackList) (int, error) {
_, err := e.Db.InsertOne(m)
if err != nil {
return 0, zhios_order_relate_logx.Error(err.Error())
}
return m.Id, nil
}
func (e EggFriendCircleUserBlackListDb) EggFriendCircleUserBlackListDeleteById(id int) (int64, error) {
affected, err := e.Db.Where("id = ? ", id).Delete(model.EggFriendCircleUserBlackList{})
if err != nil {
return 0, zhios_order_relate_logx.Error(err.Error())
}
return affected, nil
}

+ 11
- 0
src/model/egg_friend_circle_basic.go Datei anzeigen

@@ -0,0 +1,11 @@
package model

type EggFriendCircleBasic struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
CommentIsRealName int `json:"comment_is_real_name" xorm:"not null default 1 comment('评论是否需要实名认证(1:是 2:否)') TINYINT(1)"`
PublishIsRealName int `json:"publish_is_real_name" xorm:"not null default 1 comment('发布是否需要实名认证(1:是 2:否)') TINYINT(1)"`
CommentNumsEveryDay int `json:"comment_nums_every_day" xorm:"not null default 0 comment('评论每天次数') INT(11)"`
PublishNumsEveryDay int `json:"publish_nums_every_day" xorm:"not null default 0 comment('发布每天次数') INT(11)"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

+ 10
- 0
src/model/egg_friend_circle_user_black_list.go Datei anzeigen

@@ -0,0 +1,10 @@
package model

type EggFriendCircleUserBlackList struct {
Id int `json:"id" xorm:"not null pk autoincr INT(11)"`
Uid int64 `json:"uid" xorm:"not null default 1 comment('用户id') BIGINT(20)"`
AdmId int `json:"adm_id" xorm:"not null default 1 comment('管理员id') INT(11)"`
Memo string `json:"memo" xorm:"not null comment('备注') TEXT"`
CreateAt string `json:"create_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
UpdateAt string `json:"update_at" xorm:"not null default 'CURRENT_TIMESTAMP' DATETIME"`
}

Laden…
Abbrechen
Speichern