Beispiel #1
0
	TransferOutWithBank    = 3

	RiseStateOk      int = 1 //OK
	RiseStateDefault int = 0 //默认状态
)

const (
	RiseTypeTransferIn       int = 1 + iota //转入
	RiseTypeTransferOut                     //转出
	RiseTypeGenerateInterest                //计算利息
	RiseTypeMonthSettle                     //月结算,红利再投资
	RiseTypeAdjust                          //人工调整
)

var (
	ErrIncorrectAmount *domain.DomainError = domain.NewDomainError(
		"err_balance_amount", "金额错误")
	ErrIncorrectTransfer *domain.DomainError = domain.NewDomainError(
		"err_incorrent_transfer", "已确认或非转入(转出)操作")
	ErrNoSuchRiseInfo *domain.DomainError = domain.NewDomainError(
		"err_no_such_rise_info", "未开通该功能")
	ErrHasSettled *domain.DomainError = domain.NewDomainError(
		"err_has_settled", "已经结算")
	ErrUnixDate *domain.DomainError = domain.NewDomainError(
		"err_unix_date", "错误的日期时间戳")
	ErrRatio *domain.DomainError = domain.NewDomainError(
		"err_ratio", "利率不正确")
	ErrLessThanMinTransferIn *domain.DomainError = domain.NewDomainError(
		"err_less_than_min_transfer_in", "转入金额最低%s")
	ErrLessThanMinTransferOut *domain.DomainError = domain.NewDomainError(
		"err_less_than_min_transfer_out", "转出金额最低%s")
	ErrMustAllTransferOut *domain.DomainError = domain.NewDomainError(
Beispiel #2
0
/**
 * Copyright 2014 @ z3q.net.
 * name :
 * author : jarryliu
 * date : 2014-02-04 20:39
 * description :
 * history :
 */
package sale

import (
	"go2o/core/infrastructure/domain"
)

var (
	ErrGoodsNum *domain.DomainError = domain.NewDomainError(
		"err_goods_num", "商品数量错误")

	ErrOutOfSalePrice *domain.DomainError = domain.NewDomainError(
		"out_of_sale_price", "超出商品售价")

	ErrOutOfStock *domain.DomainError = domain.NewDomainError(
		"err_out_of_stock", "库存不足")

	ErrFullOfStock *domain.DomainError = domain.NewDomainError(
		"err_full_of_stock", "商品已经售完")

	ErrInternalDisallow *domain.DomainError = domain.NewDomainError(
		"err_sale_tag_internal_disallow", "不允许删除内置销售标签!")

	ErrCanNotDeleteItem *domain.DomainError = domain.NewDomainError(
		"err_goods_can_not_delete_item", "已售出货品只允许下架。")
Beispiel #3
0
 * Copyright 2015 @ z3q.net.
 * name : goods
 * author : jarryliu
 * date : 2016-06-28 23:54
 * description :
 * history :
 */
package goods

import (
	"go2o/core/domain/interface/valueobject"
	"go2o/core/infrastructure/domain"
)

var (
	ErrNoSuchGoods *domain.DomainError = domain.NewDomainError(
		"no_such_goods", "商品不存在")

	ErrLatestSnapshot *domain.DomainError = domain.NewDomainError(
		"latest_snapshot", "已经是最新的快照")

	ErrNoSuchSnapshot *domain.DomainError = domain.NewDomainError(
		"no_such_snapshot", "商品快照不存在")

	ErrNotOnShelves *domain.DomainError = domain.NewDomainError(
		"not_on_shelves", "商品未上架")
)

type (
	// 商品仓储
	IGoodsRep interface {
		// 获取商品
Beispiel #4
0
package shipment

import "go2o/core/infrastructure/domain"

const (
	// 等待发货
	StatAwaitingShipment = 1 + iota
	// 已发货
	StatShipped
	// 已完成
	StatCompleted
)

var (
	ErrMissingSpInfo *domain.DomainError = domain.NewDomainError(
		"err_shipment_missing_spinfo", "物流信息不完整、无法进行发货!",
	)
)

type (
	IShipmentOrder interface {
		// 获取聚合根编号
		GetAggregateRootId() int
		// 获取值
		Value() ShipmentOrder
		// 发货
		Ship(spId int, spOrderNo string) error
		// 发货完成
		Completed() error
		// 更新快递记录
		UpdateLog() error
Beispiel #5
0
/**
 * Copyright 2015 @ z3q.net.
 * name : error
 * author : jarryliu
 * date : 2016-02-27 20:03
 * description :
 * history :
 */
package domain

import "go2o/core/infrastructure/domain"

var (
	ErrState *domain.DomainError = domain.NewDomainError(
		"err_state", "state error")

	ErrReviewed *domain.DomainError = domain.NewDomainError(
		"err_reviewed", "已经审核通过")

	ErrPwdCannotSame *domain.DomainError = domain.NewDomainError(
		"Err_Pwd_Can_not_Same", "新密码不能与旧密码相同")

	ErrPwdOldPwdNotRight *domain.DomainError = domain.NewDomainError(
		"Err_Pwd_Pld_Pwd_Not_Right", "原密码不正确")
)
Beispiel #6
0
 */
package notify

import (
	"errors"
	"go2o/core/infrastructure/domain"
)

const (
	TypeSiteMessage = 1 + iota
	TypeEmailMessage
	TypePhoneMessage
)

var (
	ErrNoSuchNotifyItem *domain.DomainError = domain.NewDomainError(
		"err_no_such_notify_item", "通知项不存在")

	// 类型字典
	NotifyTypeMap = map[int]string{
		TypeSiteMessage:  "站内信",
		TypeEmailMessage: "邮件",
		TypePhoneMessage: "短信",
	}

	// 类型顺序
	NotifyTypeIndex = []int{
		TypeSiteMessage,
		TypeEmailMessage,
		TypePhoneMessage,
	}
Beispiel #7
0
 * Copyright 2014 @ z3q.net.
 * name :
 * author : jarryliu
 * date : 2013-12-12 16:53
 * description :
 * history :
 */

package merchant

import (
	"go2o/core/infrastructure/domain"
)

var (
	ErrMerchantDisabled *domain.DomainError = domain.NewDomainError(
		"err_merchant_disabled", "商户权限已被取消")

	ErrEnabledFxSales *domain.DomainError = domain.NewDomainError(
		"err_enabled_fx_sales", "系统当前不允许启用分销")

	ErrMerchantExpires *domain.DomainError = domain.NewDomainError(
		"err_merchant_expires", "商户合作已过期")

	ErrNoSuchMerchant *domain.DomainError = domain.NewDomainError(
		"no_such_partner", "商户不存在")

	ErrNoSuchShop *domain.DomainError = domain.NewDomainError(
		"no_such_shop", "门店不存在")

	ErrMerchantNotMatch *domain.DomainError = domain.NewDomainError(
		"not_match", "商户不匹配")
Beispiel #8
0
/**
 * Copyright 2015 @ z3q.net.
 * name : content.go
 * author : jarryliu
 * date : -- :
 * description :
 * history :
 */
package content

import "go2o/core/infrastructure/domain"

var (
	ErrCategoryContainArchive *domain.DomainError = domain.NewDomainError(
		"err_category_contain_archive", "栏目包含文章,不允许删除")

	ErrCategoryAliasExists *domain.DomainError = domain.NewDomainError(
		"err_category_alias_exists", "已存在相同标识的栏目")

	NotSetCategory *domain.DomainError = domain.NewDomainError(
		"err_not_set_category", "请选择分类")
)

type (
	IContent interface {
		// 获取聚合根编号
		GetAggregateRootId() int

		// 文章服务
		ArticleManager() IArticleManager
Beispiel #9
0
/**
 * Copyright 2015 @ z3q.net.
 * name : express
 * author : jarryliu
 * date : 2016-07-05 14:30
 * description :
 * history :
 */
package express

import "go2o/core/infrastructure/domain"

var (
	ErrNotFullExpressTemplate *domain.DomainError = domain.NewDomainError(
		"err_not_full_express_template", "不完整的运费模板")
	ErrExpressTemplateMissingAreaCode *domain.DomainError = domain.NewDomainError(
		"err_express_template_missing_area_code", "运费模板未指定地区")
	ErrExistsAreaTemplateSet *domain.DomainError = domain.NewDomainError(
		"err_express_exists_area_template_set", "地区已存在运费模板设置")
	ErrNoSuchTemplate *domain.DomainError = domain.NewDomainError(
		"err_express_no_such_template", "运费模板不存在")
	ErrNotSupportProvider *domain.DomainError = domain.NewDomainError(
		"err_express_no_support_provider", "不支持该物流服务商")
)

const (
	//根据重量计算面积
	BasisByWeight = 1
	//根据件数计算运费,通常大件物品,可以按件收费
	BasisByNumber = 2
)
Beispiel #10
0
	// 允许余额抵扣
	OptBalanceDiscount = 1 << iota
	// 允许积分抵扣
	OptIntegralDiscount
	// 允许系统支付
	OptSystemPayment
	// 允许使用优惠券
	OptUseCoupon

	// 全部支付权限
	OptPerm = OptBalanceDiscount | OptIntegralDiscount |
		OptSystemPayment | OptUseCoupon
)

var (
	ErrNoSuchPaymentOrder *domain.DomainError = domain.NewDomainError(
		"err_no_such_payment_order", "支付单不存在")

	ErrPaymentNotSave *domain.DomainError = domain.NewDomainError(
		"err_payment_not_save", "支付单需保存后才能执行操作")

	ErrOrderPayed *domain.DomainError = domain.NewDomainError(
		"err_payment_order_payed", "订单已支付")

	ErrOrderHasCancel *domain.DomainError = domain.NewDomainError(
		"err_payment_order_has_cancel", "订单已经取消")

	ErrOrderNotPayed *domain.DomainError = domain.NewDomainError(
		"err_payment_order_not_payed", "订单未支付")

	ErrCanNotUseBalance *domain.DomainError = domain.NewDomainError(
		"err_can_not_use_balance", "不能使用余额支付")
Beispiel #11
0
/**
 * Copyright 2014 @ z3q.net.
 * name :
 * author : jarryliu
 * date : 2013-12-12 16:53
 * description :
 * history :
 */

package promotion

import (
	"go2o/core/infrastructure/domain"
)

var (
	ErrCanNotApplied *domain.DomainError = domain.NewDomainError(
		"name_exists", "无法应用此优惠")

	ErrExistsSamePromotionFlag *domain.DomainError = domain.NewDomainError(
		"exists_same_promotion_flag", "已存在相同的促销")

	ErrNoSuchPromotion *domain.DomainError = domain.NewDomainError(
		"no_such_promotion", "促销不存在")

	ErrNoDetailsPromotion *domain.DomainError = domain.NewDomainError(
		"no_details_promotion", "促销信息不完整")
)
Beispiel #12
0
 */

package cart

import (
	"go2o/core/domain/interface/member"
	"go2o/core/domain/interface/merchant/shop"
	"go2o/core/domain/interface/sale"
	"go2o/core/domain/interface/sale/goods"
	"go2o/core/dto"
	"go2o/core/infrastructure/domain"
	"go2o/core/infrastructure/format"
)

var (
	ErrEmptyShoppingCart *domain.DomainError = domain.NewDomainError(
		"empty_shopping_cart", "购物车没有商品")

	ErrCartBuyerBinded *domain.DomainError = domain.NewDomainError(
		"cart_buyer_binded ", "购物车已绑定")

	ErrDisallowBindForCart *domain.DomainError = domain.NewDomainError(
		"cart_disallow_bind ", "无法为购物车绑定订单")
)

type (
	ICart interface {
		// 获取聚合根编号
		GetAggregateRootId() int

		// 获取购物车的KEY
		Key() string
Beispiel #13
0
 * author : jarryliu
 * date : 2013-12-08 10:49
 * description :
 * history :
 */

package sale

import (
	"go2o/core/infrastructure/domain"
	"sort"
)

var (
	ErrReadonlyCategory *domain.DomainError = domain.NewDomainError(
		"err_readonly_category", "无权修改系统分类",
	)
	ErrCategoryNotExist *domain.DomainError = domain.NewDomainError(
		"err_category_not_exist", "分类不存在",
	)
	ErrHasChildCategories *domain.DomainError = domain.NewDomainError(
		"err_has_child_categories", "分类包含子分类,无法删除",
	)
	ErrCategoryContainGoods *domain.DomainError = domain.NewDomainError(
		"err_category_contain_goods", "分类包含商品,无法删除",
	)
)

type (
	ICategory interface {
		// 获取领域编号
Beispiel #14
0
/**
 * Copyright 2014 @ z3q.net.
 * name :
 * author : jarryliu
 * date : 2014-02-05 20:12
 * description :
 * history :
 */
package member

import (
	"go2o/core/infrastructure/domain"
)

var (
	ErrInvitationCode *domain.DomainError = domain.NewDomainError(
		"member_err_invation_code", "CODE:1011,邀请码错误")

	ErrRegOff *domain.DomainError = domain.NewDomainError(
		"err_reg_off", "CODE:1011,系统未开放注册")

	ErrRegMustInvitation *domain.DomainError = domain.NewDomainError(
		"err_reg_must_invitation", "CODE:1011,系统只允许邀请注册")

	ErrRegOffInvitation *domain.DomainError = domain.NewDomainError(
		"err_reg_off_invitation", "CODE:1011,系统关闭邀请注册")

	ErrSessionTimeout *domain.DomainError = domain.NewDomainError(
		"member_session_time_out", "会员会话超时")

	ErrCheckCodeError *domain.DomainError = domain.NewDomainError(
		"err_member_check_code_err", "校验码不正确")
Beispiel #15
0
)

type LogType int

func (this LogType) String() string {
	switch this {
	case LogSetup:
		return "流程"
	case LogChangePrice:
		return "调价"
	}
	return ""
}

var (
	ErrRequireCart *domain.DomainError = domain.NewDomainError(
		"err_require_cart", "订单已生成,无法引入购物车")

	ErrNoSuchOrder *domain.DomainError = domain.NewDomainError(
		"err_no_such_order", "订单不存在")

	ErrOrderPayed *domain.DomainError = domain.NewDomainError(
		"err_order_payed ", "订单已支付")

	ErrNoYetCreated *domain.DomainError = domain.NewDomainError(
		"err_order_not_yet_created ", "订单尚未生成")

	ErrUnusualOrder *domain.DomainError = domain.NewDomainError(
		"err_unusual_order", "订单异常")

	ErrUnusualOrderStat *domain.DomainError = domain.NewDomainError(
		"err_except_order_stat", "订单状态不匹配、无法执行此操作!")
Beispiel #16
0
/**
 * Copyright 2014 @ z3q.net.
 * name :
 * author : jarryliu
 * date : 2013-12-12 16:53
 * description :
 * history :
 */

package delivery

import (
	"go2o/core/infrastructure/domain"
)

var (
	ErrNotCoveragedArea *domain.DomainError = domain.NewDomainError(
		"not_coveraged_area", "未覆盖的配送区域")
)
Beispiel #17
0
 * Copyright 2015 @ z3q.net.
 * name : item
 * author : jarryliu
 * date : 2016-06-29 09:31
 * description :
 * history :
 */
package item

import (
	"go2o/core/domain/interface/valueobject"
	"go2o/core/infrastructure/domain"
)

var (
	ErrNotBeReview *domain.DomainError = domain.NewDomainError(
		"err_not_be_review", "商品还未通过审核")
)

type (
	IItemRep interface {
		// 获取货品
		GetValueItem(itemId int) *Item

		// 根据id获取货品
		GetItemByIds(ids ...int) ([]*Item, error)

		SaveValueItem(*Item) (int, error)

		// 获取在货架上的商品
		GetPagedOnShelvesItem(supplierId int, catIds []int, start, end int) (total int, goods []*Item)
Beispiel #18
0
 * author : jarryliu
 * date : 2015-07-26 21:30
 * description :
 * history :
 */
package mss

import (
	"go2o/core/domain/interface/mss/notify"
	"go2o/core/infrastructure/domain"
)

//todo: waiting refactor

var (
	ErrNotSupportMessageType *domain.DomainError = domain.NewDomainError(
		"err_not_support_message_type", "不支持的消息类型")

	ErrNotEnabled *domain.DomainError = domain.NewDomainError(
		"err_template_not_enabled", "模板未启用")

	ErrTemplateUsed *domain.DomainError = domain.NewDomainError(
		"err_template_used", "模板被使用,无法删除")

	ErrMessageUpdate *domain.DomainError = domain.NewDomainError(
		"err_message_update", "消息不需要更新")

	ErrMessageNotSave *domain.DomainError = domain.NewDomainError(
		"err_message_not_save", "请在消息发送前保存")

	ErrUnknownMessageUseFor *domain.DomainError = domain.NewDomainError(
		"err_unknown_message_use_for", "未知的消息用途")
Beispiel #19
0
 * Copyright 2015 @ z3q.net.
 * name : shop
 * author : jarryliu
 * date : 2016-05-29 11:12
 * description :
 * history :
 */
package shop

import (
	"go2o/core/infrastructure/domain"
	"strconv"
)

var (
	ErrNotSetAlias *domain.DomainError = domain.NewDomainError(
		"err_not_set_alias", "请设置商城别名")
	ErrShopAliasUsed *domain.DomainError = domain.NewDomainError(
		"err_shop_alias_used", "商城别名已被占用")
)

const (
	// 线上商店
	TypeOnlineShop = 1
	// 线下实体店
	TypeOfflineShop = 2
)

const (
	// 停用状态
	StateStopped = 0
	// 待审核状态
Beispiel #20
0
 * Copyright 2014 @ z3q.net.
 * name :
 * author : jarryliu
 * date : 2013-12-12 16:53
 * description :
 * history :
 */

package ad

import (
	"go2o/core/infrastructure/domain"
)

var (
	ErrInternalDisallow *domain.DomainError = domain.NewDomainError(
		"err_internal_disallow", "不允许修改系统内置广告")

	ErrNoSuchAd *domain.DomainError = domain.NewDomainError(
		"err_no_such_ad", "广告不存在")

	ErrNoSuchAdGroup *domain.DomainError = domain.NewDomainError(
		"err_no_such_ad_group", "广告组不存在")

	ErrNoSuchAdPosition *domain.DomainError = domain.NewDomainError(
		"err_no_such_ad_position", "广告位不存在")

	ErrDisallowModifyAdType *domain.DomainError = domain.NewDomainError(
		"err_disallow_modify_ad_type", "广告创建后不允许修改类型")

	ErrKeyExists *domain.DomainError = domain.NewDomainError(
		"err_key_exists", "广告位KEY已存在")