service

package
v0.0.0-...-8587cce Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressService

type AddressService interface {
	// 保存或修改
	SaveOrUpdate(address *model.Address) error

	// 根据id查询
	GetByID(id uint64) *model.Address

	// 根据userId查询
	GetByUserID(userId uint64) []*model.Address

	// 通过userId获取该用户的地址
	GetAddressByAddressId(addressId uint64, UserID uint64) *model.Address

	SetDefaultAddress(addressId uint64, UserID uint64) error

	GetDefaultAddressByUserID(userId uint64) *model.Address

	// 根据 id 删除
	DeleteByID(id uint64) error

	// 查询所有
	GetAll(userId uint64) []*model.Address

	// 分页查询
	GetPage(page int, pageSize int, user *model.Address) *helper.PageBean
}

Address service 接口

func AddressServiceInstance

func AddressServiceInstance(repo repositories.AddressRepository) AddressService

type AreaService

type AreaService interface {
	// 保存或修改
	SaveOrUpdate(area *model.Area) error

	// 根据id查询
	GetByID(id uint64) *model.Area

	// 根据userId查询
	GetByUserID(userId uint64) []*model.Area

	// 通过userId获取该用户的商品分类
	GetAreaByUserID(userId uint64) []*model.Area

	// 根据 id 删除
	DeleteByID(id uint64) error

	// 查询所有
	GetAll(cityCode uint64) []*model.Area

	// 分页查询
	GetPage(page int, pageSize int, user *model.Area) *helper.PageBean
}

service 接口

func AreaServiceInstance

func AreaServiceInstance(repo repositories.AreaRepository) AreaService

type BannerService

type BannerService interface {
	/** 保存或修改 */
	SaveOrUpdate(banner *model.Banner) error

	Save(banner *model.Banner) error

	Update(banner *model.Banner) error

	/** 根据 banner_id 查询 */
	GetByBannerID(bannerId uint64) *model.Banner

	/** */
	GetAllByShopId(shopId uint64) []*model.Banner

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	DeleteByBannerID(bannerId uint64) error

	/** 查询所有  */
	GetAll() []*model.Banner

	/** 分页查询 */
	GetPage(page int, pageSize int, banner *model.Banner) *helper.PageBean
}

banner_service 接口

func BannerServiceInstance

func BannerServiceInstance(repo repositories.BannerRepository) BannerService

获取 bannerService 实例

type BaseService

type BaseService interface {
	IsPlatformOfficial(shop *model.Shop) bool
}

base service 接口

func BaseServiceInstance

func BaseServiceInstance(repo repositories.BaseRepository) BaseService

type CategoryService

type CategoryService interface {
	// 保存或修改
	SaveOrUpdate(category *model.Category) error

	// 根据id查询
	GetByID(id uint64) *model.Category

	// 根据userId查询
	GetByUserID(userId uint64) []*model.Category

	// 通过userId获取该用户的商品分类
	GetCategoryByUserID(userId uint64) []*model.Category

	// 根据 id 删除
	DeleteByID(id uint64) error

	// 查询所有
	GetAll(shopId uint64) []*model.Category

	// 分页查询
	GetPage(page int, pageSize int, user *model.Category) *helper.PageBean
}

Category service 接口

type CityService

type CityService interface {
	// 保存或修改
	SaveOrUpdate(city *model.City) error

	// 根据id查询
	GetByID(id uint64) *model.City

	// 根据userId查询
	GetByUserID(userId uint64) []*model.City

	// 通过userId获取该用户的商品分类
	GetCityByUserID(userId uint64) []*model.City

	// 根据 id 删除
	DeleteByID(id uint64) error

	// 查询所有
	GetAll(provinceCode uint64) []*model.City

	// 分页查询
	GetPage(page int, pageSize int, user *model.City) *helper.PageBean
}

service 接口

func CityServiceInstance

func CityServiceInstance(repo repositories.CityRepository) CityService

type DemoService

type DemoService interface {
	// 保存或修改
	SaveOrUpdate(demo *model.Demo) error

	// 根据id查询
	GetByID(id uint64) *model.Demo

	// 根据userId查询
	GetByUserID(userId uint64) []*model.Demo

	// 通过userId获取该用户的商品分类
	GetDemoByUserID(userId uint64) []*model.Demo

	// 根据 id 删除
	DeleteByID(id uint64) error

	// 查询所有
	GetAll(shopId uint64) []*model.Demo

	// 分页查询
	GetPage(page int, pageSize int, user *model.Demo) *helper.PageBean
}

Demo service 接口

func DemoServiceInstance

func DemoServiceInstance(repo repositories.DemoRepository) DemoService

type FeedbackService

type FeedbackService interface {
	/** 保存或修改 */
	SaveOrUpdate(feedback *model.Feedback) error

	Update(feedback *model.Feedback) error

	/** 根据 id 查询 */
	GetByID(id uint64) *model.Feedback

	/** 根据 feedbackId 查询 */
	GetByFeedbackID(feedbackId uint64) *model.Feedback

	/** 根据title查询 */
	GetByTitle(title string) *model.Feedback

	GetAllByUserID(userId uint64) []*model.Feedback

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	/** 查询所有  */
	GetAll() []*model.Feedback

	/** 分页查询 */
	GetPage(page int, pageSize int, feedback *model.Feedback) *helper.PageBean
}

feedback_service 接口

func FeedbackServiceInstance

func FeedbackServiceInstance(repo repositories.FeedbackRepository) FeedbackService

获取 feedbackService 实例

type FunctionService

type FunctionService interface {
	// 保存或修改
	SaveOrUpdate(function *model.Function) error

	// 根据id查询
	GetByID(id uint64) *model.Function

	// 根据功能权限名称查询
	GetByFunName(funName string) *model.Function

	// 根据 id 删除
	DeleteByID(id uint64) error

	// 查询所有
	GetAll() []*model.Function

	// 分页查询
	GetPage(page int, pageSize int, user *model.Function) *helper.PageBean
}

function service 接口

type MerchantOrderDetailService

type MerchantOrderDetailService interface {
	/** 保存或修改 */
	SaveOrUpdate(merchantOrderDetail *model.MerchantOrderDetail) error

	Save(merchantOrderDetail *model.MerchantOrderDetail) error

	Update(merchantOrderDetail *model.MerchantOrderDetail) error

	/** 根据 id 查询 */
	GetByMerchantOrderDetailID(id uint64) *model.MerchantOrderDetail

	GetByOrderId(outTradNo uint64) *model.MerchantOrderDetail

	Liquidate(userId, shopIds []uint64) error

	LiquidateTotal(userId []uint64, shopIds []uint64) (*model.TotalResult, error)

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	/** 查询所有  */
	GetAll() []*model.MerchantOrderDetail

	/** 分页查询 */
	GetPage(page int, pageSize int, merchantOrderDetail *model.MerchantOrderDetail) *helper.PageBean

	/**  按商户id merchantOrderDetail 列表*/
	GetPageByMerchantIds(page int, pageSize int, merchantOrderDetail *model.MerchantOrderDetail) *helper.PageBean

	GetPageByShopIds(merchantOrderDetailPage *model.MerchantOrderDetailPage, merchantOrderDetail *model.MerchantOrderDetail, shopIDs []uint64) *helper.PageBean

	GetPageByCheckUserID(page int, pageSize int, merchantOrderDetail *model.MerchantOrderDetail) *helper.PageBean
}

merchantOrderDetail_service 接口

func MerchantOrderDetailServiceInstance

func MerchantOrderDetailServiceInstance(repo repositories.MerchantOrderDetailRepository) MerchantOrderDetailService

获取 merchantOrderDetailService 实例

type MerchantService

type MerchantService interface {
	/** 保存或修改 */
	SaveOrUpdate(merchant *model.Merchant) error

	Save(merchant *model.Merchant) error

	Update(merchant *model.Merchant) error

	/** 根据 merchant_id 查询 */
	GetByMerchantId(merchantId uint64) *model.Merchant

	/** 根据 user_id 查询 */
	GetByUserID(userId uint64) []*model.Merchant

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	/** 查询所有  */
	GetAll() []*model.Merchant

	/** 分页查询 */
	GetPage(page int, pageSize int, merchant *model.Merchant) *helper.PageBean

	ShopList(page int, pageSize int, merchantId string) *helper.PageBean
}

merchant_service 接口

func MerchantServiceInstance

func MerchantServiceInstance(repo repositories.MerchantRepository) MerchantService

获取 merchantService 实例

type MoneyLogService

type MoneyLogService interface {
	/** 保存或修改 */
	SaveOrUpdate(moneyLog *model.MoneyLog) error

	Save(moneyLog *model.MoneyLog) error

	Update(moneyLog *model.MoneyLog) error

	/** 根据 moneyLog_id 查询 */
	GetByMoneyLogID(moneyLogId uint64) *model.MoneyLog

	/** */
	GetAllByShopId(shopId uint64) []*model.MoneyLog

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	DeleteByMoneyLogID(moneyLogId uint64) error

	/** 查询所有  */
	GetAll() []*model.MoneyLog

	/** 分页查询 */
	GetPage(page int, pageSize int, moneyLog *model.MoneyLog) *helper.PageBean

	GetPageByMonth(pageOjb *model.PageObject, moneyLog *model.MoneyLog) *helper.PageBean

	GetPageByMonthWithMerchant(pageOjb *model.PageObject, moneyLog *model.MoneyLog) *helper.PageBean
}

moneyLog_service 接口

func MoneyLogServiceInstance

func MoneyLogServiceInstance(repo repositories.MoneyLogRepository) MoneyLogService

获取 moneyLogService 实例

type OptionService

type OptionService interface {
	// 保存或修改
	SaveOrUpdate(option *model.Option) error

	// 根据id查询
	GetByID(id uint64) *model.Option

	// 根据userId查询
	GetByUserID(userId uint64) []*model.Option

	// 通过userId获取该用户的商品分类
	GetOptionByUserID(userId uint64) []*model.Option

	// 根据 id 删除
	DeleteByID(id uint64) error

	// 查询所有
	GetAll(shopId uint64) []*model.Option

	// 分页查询
	GetPage(page int, pageSize int, user *model.Option) *helper.PageBean
}

Option service 接口

func OptionServiceInstance

func OptionServiceInstance(repo repositories.OptionRepository) OptionService

type OrderProductService

type OrderProductService interface {
	// 保存或修改
	SaveOrUpdate(orderProduct *model.OrderProduct) error

	// 根据id查询
	GetByID(id uint64) *model.OrderProduct

	GetByOrderProductId(orderId uint64) *model.OrderProduct

	UpdateOrderProductByOrderId(orderId uint64) error

	Update(order *model.OrderProduct) error

	GetOrderItemsByOrderId(orderProductId uint64) []*model.OrderProduct

	BatchInsert(data []model.OrderProduct) error

	// 根据 id 删除
	DeleteByID(id uint64) error

	// 查询所有
	GetAll(shopId uint64) []*model.OrderProduct

	// 分页查询
	GetPage(page int, pageSize int, user *model.OrderProduct) *helper.PageBean
}

OrderProduct service 接口

type OrderService

type OrderService interface {
	/** 保存或修改 */
	SaveOrUpdate(order *model.Order) error

	Save(order *model.Order) error

	Update(order *model.Order) error

	/** 根据 id 查询 */
	GetByOrderId(id uint64) *model.Order

	GetByOrderIdAndUserId(id uint64, userId uint64) *model.Order

	GetLevelOrder(userId uint64) *model.Order

	GetByOutTradNo(outTradNo string) *model.Order

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	/** 查询所有  */
	GetAll() []*model.Order

	GetByUserId(userId uint64) []*model.Order

	GetByUserIdAndStatus(userId uint64, status int8) []*model.Order

	Statistics(userId uint64) []*model.Order

	/** 分页查询 */
	GetPage(page int, pageSize int, order *model.Order) *helper.PageBean

	/**  按月份取 order 列表*/
	GetPageByMonth(page int, pageSize int, order *model.Order, month string) *helper.PageBean
}

order_service 接口

func OrderServiceInstance

func OrderServiceInstance(repo repositories.OrderRepository) OrderService

获取 orderService 实例

type ProductOptionService

type ProductOptionService interface {
	// 保存或修改
	SaveOrUpdate(productOption *model.ProductOption) error

	// 根据id查询
	GetByID(id uint64) *model.ProductOption

	// 根据userId查询
	GetByUserID(userId uint64) []*model.ProductOption

	// 通过userId获取该用户的商品分类
	GetProductOptionByUserID(userId uint64) []*model.ProductOption

	// 根据 id 删除
	DeleteByID(id uint64) error

	// 查询所有
	GetAll(productId uint64) []*model.ProductOption

	// 查询所有,并按类型归类
	GetAllGroupByType(productId uint64) map[uint8][]*model.ProductOption

	// 分页查询
	GetPage(page int, pageSize int, user *model.ProductOption) *helper.PageBean
}

ProductOption service 接口

type ProductService

type ProductService interface {
	/** 保存或修改 */
	SaveOrUpdate(product *model.Product) error

	Save(product *model.Product) error

	Update(product *model.Product) error

	/** 根据 id 查询 */
	GetByID(id uint64) *model.Product

	/** 根据 product_id 查询 */
	GetByProductId(productId uint64) *model.Product

	GetListByProductIds(productId []uint64) []*model.Product

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	/** 查询所有  */
	GetAll() []*model.Product

	/** 分页查询 */
	GetPage(page int, pageSize int, product *model.Product) *helper.PageBean

	GetListByShopId(page int, pageSize int, shopId string) *helper.PageBean
}

product_service 接口

func ProductServiceInstance

func ProductServiceInstance(repo repositories.ProductRepository) ProductService

获取 productService 实例

type ProvinceService

type ProvinceService interface {
	// 保存或修改
	SaveOrUpdate(province *model.Province) error

	// 根据id查询
	GetByID(id uint64) *model.Province

	// 根据userId查询
	GetByUserID(userId uint64) []*model.Province

	// 通过userId获取该用户的商品分类
	GetProvinceByUserID(userId uint64) []*model.Province

	// 根据 id 删除
	DeleteByID(id uint64) error

	// 查询所有
	GetAll(shopId uint64) []*model.Province

	// 分页查询
	GetPage(page int, pageSize int, user *model.Province) *helper.PageBean
}

service 接口

type RoleService

type RoleService interface {
	// 保存或修改
	SaveOrUpdate(role *model.Role) error

	// 根据id
	GetByID(id uint64) *model.Role

	/** 根据角色名称查询 */
	GetByRoleName(roleName string) *model.Role

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	/** 查询所有 */
	GetAll() []*model.Role

	/** 分页查询 */
	GetPage(page int, pageSize int, role *model.Role) *helper.PageBean
}

role service 接口

func RoleServiceInstance

func RoleServiceInstance(repo repositories.RoleRepository) RoleService

获取 roleService实例

type ShopService

type ShopService interface {
	/** 保存或修改 */
	SaveOrUpdate(shop *model.Shop) error

	Save(shop *model.Shop) error

	Update(shop *model.Shop) error

	/** 根据 shop_id 查询 */
	GetByShopId(shopId uint64) *model.Shop

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	/** 查询所有  */
	GetAll() []*model.Shop

	GetShopsByMerchantIds(merchantIds []uint64) []*model.Shop

	GetShopsByShopIds(shopIds []uint64) []*model.Shop

	/** 分页查询 */
	GetPage(page int, pageSize int, shop *model.Shop) *helper.PageBean

	ShopListNearby(page int, pageSize int, shop *model.ShopDetailDistance) *helper.PageBean

	ProductList(page int, pageSize int, shopId string) *helper.PageBean

	RawSqlInsert(shop *model.Shop) error

	RawSqlUpdate(shop *model.Shop) error

	AddAttention(shop *model.Shop) error
}

shop_service 接口

func ShopServiceInstance

func ShopServiceInstance(repo repositories.ShopRepository) ShopService

获取 shopService 实例

type ShoppingCartService

type ShoppingCartService interface {
	/** 保存或修改 */
	SaveOrUpdate(shoppingCart *model.ShoppingCart) error

	SaveByApp(shoppingCart *model.ShoppingCart) error

	UpdateByApp(shoppingCart *model.ShoppingCart) error

	/** 根据 id 查询 */
	GetByID(id uint64) *model.ShoppingCart

	/** 根据 shoppingCartId 查询 */
	GetByShoppingCartId(shoppingCartId uint64) *model.ShoppingCart

	GetShoppingCartItem(userId uint64, productId uint64, skuId uint64) *model.ShoppingCart

	/* 根据 UserID 查询*/
	GetShoppingCartByUserID(userId uint64) []*model.ShoppingCart

	GetShoppingCartByUserIDCartIds(userId uint64, cartIds []uint64) []*model.ShoppingCart

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	/** 查询所有  */
	GetAll() []*model.ShoppingCart
}

shopping_cart_service 接口

func ShoppingCartServiceInstance

func ShoppingCartServiceInstance(repo repositories.ShoppingCartRepository) ShoppingCartService

获取 shoppingCartService 实例

type SkuService

type SkuService interface {
	// 保存或修改
	SaveOrUpdate(sku *model.Sku) error

	// 根据id查询
	GetByID(id uint64) *model.Sku

	// 根据userId查询
	GetByUserID(userId uint64) []*model.Sku

	// 通过productIdCombineId获取该商品sku
	GetByProductIdCombineId(productId uint64, combineId string) *model.Sku

	// 根据 id 删除
	DeleteByID(id uint64) error

	// 查询所有
	GetAll(shopId uint64) []*model.Sku

	// 分页查询
	GetPage(page int, pageSize int, user *model.Sku) *helper.PageBean
}

Sku service 接口

func SkuServiceInstance

func SkuServiceInstance(repo repositories.SkuRepository) SkuService

type UserOrderDetailService

type UserOrderDetailService interface {
	/** 保存或修改 */
	SaveOrUpdate(merchantUserOrderDetailDetail *model.UserOrderDetail) error

	Save(merchantUserOrderDetailDetail *model.UserOrderDetail) error

	Update(merchantUserOrderDetailDetail *model.UserOrderDetail) error

	/** 根据 id 查询 */
	GetByUserOrderDetailID(id uint64) *model.UserOrderDetail

	GetByOrderId(outTradNo uint64) *model.UserOrderDetail

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	/** 查询所有  */
	GetAll() []*model.UserOrderDetail

	/** 分页查询 */
	GetPage(page int, pageSize int, merchantUserOrderDetailDetail *model.UserOrderDetail) *helper.PageBean

	/**  按月份取 merchantUserOrderDetailDetail 列表*/
	GetPageByMonth(page int, pageSize int, merchantUserOrderDetailDetail *model.UserOrderDetail, month string) *helper.PageBean
}

merchantUserOrderDetailDetail_service 接口

func UserOrderDetailServiceInstance

func UserOrderDetailServiceInstance(repo repositories.UserOrderDetailRepository) UserOrderDetailService

获取 merchantUserOrderDetailDetailService 实例

type UserService

type UserService interface {
	/** 保存或修改 */
	SaveOrUpdate(user *model.User) error

	SaveByApp(user *model.User) error

	UpdateByApp(user *model.User) error

	/** 根据 id 查询 */
	GetByID(id uint64) *model.User

	/** 根据 userId 查询 */
	GetByUserID(userId uint64) *model.User

	/** 根据用户名查询 */
	GetByUsername(username string) *model.User

	/* 根据UnionId查询*/
	GetByUserUnionId(UnionId string) *model.User

	GetByUserOpenId(OpenId string) *model.User

	// 根据电话号码查询
	GetByPhone(phone string) *model.User

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	/** 查询所有  */
	GetAll() []*model.User

	/** 分页查询 */
	GetPage(page int, pageSize int, user *model.User) *helper.PageBean
}

user_service 接口

func UserServiceInstance

func UserServiceInstance(repo repositories.UserRepository) UserService

获取 userService 实例

type UserShopService

type UserShopService interface {
	/** 保存或修改 */
	SaveOrUpdate(userShop *model.UserShop) error

	Save(userShop *model.UserShop) error

	Update(userShop *model.UserShop) error

	GetByUserIDShopId(userId uint64, shopId string) *model.UserShop

	GetByShopId(id uint64) []*model.UserShop

	GetByUserID(id uint64) []*model.UserShop

	/** 根据 id 删除 */
	DeleteByID(id uint64) error

	/** 查询所有  */
	GetAll() []*model.UserShop

	/** 分页查询 */
	GetPage(page int, pageSize int, userShop *model.UserShop) *helper.PageBean

	/**  按月份取 userShop 列表*/
	GetPageByMonth(page int, pageSize int, userShop *model.UserShop, month string) *helper.PageBean
}

userShop_service 接口

func UserShopServiceInstance

func UserShopServiceInstance(repo repositories.UserShopRepository) UserShopService

获取 userShopService 实例

type WalletService

type WalletService interface {
	// 保存或修改
	SaveOrUpdate(wallet *model.Wallet) error

	//初始化个人钱包
	InitMyWallet(userId uint64) error

	// 根据id查询
	GetByID(id uint64) *model.Wallet

	// 根据userId查询
	GetByUserID(userId uint64) *model.Wallet

	// 通过userId获取用户积分
	GetScoreByUserID(userId uint64) uint64

	// 扣除用户积分
	ReduceScoreByUserID(userId uint64, score uint64) error

	AddScoreByUserID(userId uint64, score uint64) error

	ReduceMoneyByUserID(userId uint64, money uint64) error

	AddMoneyByUserID(userId uint64, money uint64) error

	AddGrowthByUserID(userId uint64, money uint64) error

	ReduceGrowthByUserID(userId uint64, money uint64) error

	// 根据 id 删除
	DeleteByID(id uint64) error

	// 查询所有
	GetAll() []*model.Wallet

	// 分页查询
	GetPage(page int, pageSize int, user *model.Wallet) *helper.PageBean
}

Wallet service 接口

func WalletServiceInstance

func WalletServiceInstance(repo repositories.WalletRepository) WalletService

Jump to

Keyboard shortcuts

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