dao

package
v0.0.0-...-e6e6a7d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package models 为项目所需的模型对象定义.

Index

Constants

View Source
const (
	UserInit    = 0
	UserActived = 1
	UserBanned  = 2
)
View Source
const AccessTokenExpireInterval = 7 * 24 * 60 * 60
View Source
const AccessTokenIss = "github.com/i2eco/egoshop"
View Source
const AccessTokenKey = "ecologysK#xo"
View Source
const ComplainTimeLimit = 24 * 60 * 60 * 7
View Source
const (
	GenreWechatMini = 3
)
View Source
const ORDER_EVALUATE_TIME = 1296000 // todo 需要可修改

Variables

View Source
var (
	ComSpecValue  *comSpecValue
	Com           *com
	User          *user
	Signin        *signin
	Order         *order
	Address       *address
	Freight       *freight
	ComSpec       *comSpec
	PointLimit    *pointLimit
	ComSku        *comSku
	OrderLog      *orderLog
	OrderGoods    *orderGoods
	ComImage      *comImage
	AdminUser     *adminUser
	OrderExtend   *orderExtend
	AddressType   *addressType
	Attachment    *attachment
	Image         *image
	PointLog      *pointLog
	ComRelateCate *comRelateCate
	SigninLog     *signinLog
	ComStore      *comStore
	Comment       *comment
	UserGoods     *userGoods
	Cart          *cart
	AccessToken   *accessToken
	UserOpen      *userOpen
	ComCate       *comCate
	OrderPay      *orderPay
)
View Source
var (
	// ErrMemberNoExist 用户不存在.
	ErrMemberNoExist             = errors.New("用户不存在")
	ErrMemberExist               = errors.New("用户已存在")
	ErrMemberDisabled            = errors.New("用户被禁用")
	ErrMemberEmailEmpty          = errors.New("用户邮箱不能为空")
	ErrMemberEmailExist          = errors.New("用户邮箱已被使用")
	ErrMemberDescriptionTooLong  = errors.New("用户描述必须小于500字")
	ErrMemberEmailFormatError    = errors.New("邮箱格式不正确")
	ErrMemberPasswordFormatError = errors.New("密码必须在6-50个字符之间")
	ErrMemberAccountFormatError  = errors.New("账号只能由英文字母数字组成,且在3-50个字符")
	ErrMemberRoleError           = errors.New("用户权限不正确")
	// ErrorMemberPasswordError 密码错误.
	ErrorMemberPasswordError = errors.New("用户密码错误")
	//ErrorMemberAuthMethodInvalid 不支持此认证方式
	ErrMemberAuthMethodInvalid = errors.New("不支持此认证方式")
	//ErrLDAPConnect 无法连接到LDAP服务器
	ErrLDAPConnect = errors.New("无法连接到LDAP服务器")
	//ErrLDAPFirstBind 第一次LDAP绑定失败
	ErrLDAPFirstBind = errors.New("第一次LDAP绑定失败")
	//ErrLDAPSearch LDAP搜索失败
	ErrLDAPSearch = errors.New("LDAP搜索失败")
	//ErrLDAPUserNotFoundOrTooMany
	ErrLDAPUserNotFoundOrTooMany = errors.New("LDAP用户不存在或者多于一个")

	// ErrDataNotExist 指定的服务已存在.
	ErrDataNotExist = errors.New("数据不存在")

	// ErrInvalidParameter 参数错误.
	ErrInvalidParameter = errors.New("Invalid parameter")

	ErrPermissionDenied = errors.New("Permission denied")

	ErrCommentClosed          = errors.New("评论已关闭")
	ErrCommentContentNotEmpty = errors.New("评论内容不能为空")
)
View Source
var (
	WechatUser *wechatUser
)

Functions

func InitAccessToken

func InitAccessToken(logger *logger.Client, db *gorm.DB) *accessToken

func InitAddress

func InitAddress(logger *logger.Client, db *gorm.DB) *address

func InitAddressType

func InitAddressType(logger *logger.Client, db *gorm.DB) *addressType

func InitAdminUser

func InitAdminUser(logger *logger.Client, db *gorm.DB) *adminUser

func InitAttachment

func InitAttachment(logger *logger.Client, db *gorm.DB) *attachment

func InitBanner

func InitBanner(logger *logger.Client, db *gorm.DB) *banner

func InitCart

func InitCart(logger *logger.Client, db *gorm.DB) *cart

func InitCom

func InitCom(logger *logger.Client, db *gorm.DB) *com

func InitComCate

func InitComCate(logger *logger.Client, db *gorm.DB) *comCate

func InitComImage

func InitComImage(logger *logger.Client, db *gorm.DB) *comImage

func InitComRelateCate

func InitComRelateCate(logger *logger.Client, db *gorm.DB) *comRelateCate

func InitComSku

func InitComSku(logger *logger.Client, db *gorm.DB) *comSku

func InitComSpec

func InitComSpec(logger *logger.Client, db *gorm.DB) *comSpec

func InitComSpecValue

func InitComSpecValue(logger *logger.Client, db *gorm.DB) *comSpecValue

func InitComStore

func InitComStore(logger *logger.Client, db *gorm.DB) *comStore

func InitComment

func InitComment(logger *logger.Client, db *gorm.DB) *comment

func InitFreight

func InitFreight(logger *logger.Client, db *gorm.DB) *freight

func InitImage

func InitImage(logger *logger.Client, db *gorm.DB) *image

func InitOrder

func InitOrder(logger *logger.Client, db *gorm.DB) *order

func InitOrderExtend

func InitOrderExtend(logger *logger.Client, db *gorm.DB) *orderExtend

func InitOrderGoods

func InitOrderGoods(logger *logger.Client, db *gorm.DB) *orderGoods

func InitOrderLog

func InitOrderLog(logger *logger.Client, db *gorm.DB) *orderLog

func InitOrderPay

func InitOrderPay(logger *logger.Client, db *gorm.DB) *orderPay

func InitPointLimit

func InitPointLimit(logger *logger.Client, db *gorm.DB) *pointLimit

func InitPointLog

func InitPointLog(logger *logger.Client, db *gorm.DB) *pointLog

func InitSignin

func InitSignin(logger *logger.Client, db *gorm.DB) *signin

func InitSigninLog

func InitSigninLog(logger *logger.Client, db *gorm.DB) *signinLog

func InitUser

func InitUser(logger *logger.Client, db *gorm.DB) *user

func InitUserGoods

func InitUserGoods(logger *logger.Client, db *gorm.DB) *userGoods

func InitUserOpen

func InitUserOpen(logger *logger.Client, db *gorm.DB) *userOpen

func InitWechatUser

func InitWechatUser() *wechatUser

Types

type AccessTokenTicket

type AccessTokenTicket struct {
	AccessToken string `json:"accessToken"`
	ExpiresIn   int64  `json:"expiresIn"`
}

type OrderCondition

type OrderCondition struct {
	// 新增信息
	IsCancel       bool `json:"isCancel"`
	IsPay          bool `json:"isPay"`
	IsRefundCancel bool `json:"isRefundCancel"`
	IsComplain     bool `json:"isComplain"`
	IsReceive      bool `json:"isReceive"`
	IsLock         bool `json:"isLock"`
	IsDeliver      bool `json:"isDeliver"`
	IsEvaluate     bool `json:"isEvaluate"`
}

type OrderFull

type OrderFull struct {
	Order          mysql.Order       `json:"order"`
	StateDesc      string            `json:"stateDesc"`
	GroupStateDesc string            `json:"groupStateDesc"`
	PaymentName    string            `json:"paymentName"`
	UserOpen       mysql.UserOpen    `json:"userOpen"`
	OrderExtend    mysql.OrderExtend `json:"orderExtend"`
	OrderGoods     []OrderGoodsJson  `json:"orderGoods"`
	// 新增信息
	IsCancel       bool `json:"isCancel"`
	IsPay          bool `json:"isPay"`
	IsRefundCancel bool `json:"isRefundCancel"`
	IsComplain     bool `json:"isComplain"`
	IsReceive      bool `json:"isReceive"`
	IsLock         bool `json:"isLock"`
	IsDeliver      bool `json:"isDeliver"`
	IsEvaluate     bool `json:"isEvaluate"`
}

type OrderGoodsJson

type OrderGoodsJson struct {
	mysql.OrderGoods
	IsRefund bool `json:"isRefund"`
}

type RespOrderInfo

type RespOrderInfo struct {
	Info              mysql.Order        `gorm:"not null;"json:"info"`
	OrderCondition    OrderCondition     `gorm:"not null;"json:"orderCondition"`
	OrderLog          []mysql.OrderLog   `gorm:"not null;"json:"orderLog"`
	ExtendOrderExtend mysql.OrderExtend  `gorm:"not null;"json:"extendOrderExtend"`
	ExtendOrderCom    []mysql.OrderGoods `gorm:"not null;"json:"extendOrderCom"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL