service

package
v0.0.0-...-c8dbcfe Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const DomainAdminRole = "admin"

Variables

View Source
var AgentConfigSet = wire.NewSet(wire.Struct(new(AgentConfigSrv), "*"))
View Source
var AgentSet = wire.NewSet(wire.Struct(new(AgentSrv), "*"))
View Source
var DomainSet = wire.NewSet(wire.Struct(new(DomainSrv), "*"))
View Source
var LoginSet = wire.NewSet(wire.Struct(new(LoginSrv), "*"))
View Source
var MemberSet = wire.NewSet(wire.Struct(new(MemberSrv), "*"))
View Source
var MenuSet = wire.NewSet(wire.Struct(new(MenuSrv), "*"))
View Source
var RoleSet = wire.NewSet(wire.Struct(new(RoleSrv), "*"))
View Source
var UserSet = wire.NewSet(wire.Struct(new(UserSrv), "*"))
View Source
var UsertagSet = wire.NewSet(wire.Struct(new(UsertagSrv), "*"))

Functions

func AddUserInTeethlink(user schema.User) (uint64, error)
func CreateOrderInTeethlink(item schema.AccountChange, id uint64, memberID uint64) error
func UpdateUserAccountInTeethlink(id uint64, userAccount UserAccount) error

Types

type AgentConfigSrv

type AgentConfigSrv struct {
	TransRepo       *dao.TransRepo
	AgentConfigRepo *dao.AgentConfigRepo
}

func (*AgentConfigSrv) Create

func (*AgentConfigSrv) Delete

func (a *AgentConfigSrv) Delete(ctx context.Context, userID uint64) error

func (*AgentConfigSrv) Get

func (*AgentConfigSrv) Update

func (a *AgentConfigSrv) Update(ctx context.Context, id uint64, item schema.AgentConfig) error

func (*AgentConfigSrv) UpdateStatus

func (a *AgentConfigSrv) UpdateStatus(ctx context.Context, id uint64, status int) error

type AgentSrv

type AgentSrv struct {
	TransRepo       *dao.TransRepo
	MemberRepo      *dao.MemberRepo
	UserRepo        *dao.UserRepo
	AgentConfigRepo *dao.AgentConfigRepo
}

func (*AgentSrv) QueryOrderInfoFromClient

func (a *AgentSrv) QueryOrderInfoFromClient(members schema.Members) (map[uint64]*schema.AgentOrderStatistic, error)

func (*AgentSrv) QueryShow

type DomainSrv

type DomainSrv struct {
	Enforcer       *casbin.SyncedEnforcer
	RoleSrv        *RoleSrv
	MemberSrv      *MemberSrv
	TransRepo      *dao.TransRepo
	DomainRepo     *dao.DomainRepo
	MenuActionRepo *dao.MenuActionRepo
	MemberRoleRepo *dao.MemberRoleRepo
}

func (*DomainSrv) Create

func (a *DomainSrv) Create(ctx context.Context, item schema.Domain) (*schema.IDResult, error)

func (*DomainSrv) Delete

func (a *DomainSrv) Delete(ctx context.Context, id uint64) error

func (*DomainSrv) Get

func (*DomainSrv) Query

func (*DomainSrv) Update

func (a *DomainSrv) Update(ctx context.Context, id uint64, item schema.Domain) error

func (*DomainSrv) UpdateStatus

func (a *DomainSrv) UpdateStatus(ctx context.Context, id uint64, status int) error

type IDResult

type IDResult struct {
	ID uint64 `json:"id,string"`
}

type LoginSrv

type LoginSrv struct {
	Auth           auth.Auther
	MemberRepo     *dao.MemberRepo
	MemberRoleRepo *dao.MemberRoleRepo
	RoleRepo       *dao.RoleRepo
	RoleMenuRepo   *dao.RoleMenuRepo
	MenuRepo       *dao.MenuRepo
	DomainRepo     *dao.DomainRepo
	MenuActionRepo *dao.MenuActionRepo
}

func (*LoginSrv) DestroyToken

func (a *LoginSrv) DestroyToken(ctx context.Context, tokenString string) error

func (*LoginSrv) GenerateToken

func (a *LoginSrv) GenerateToken(ctx context.Context, memberID string) (*schema.LoginTokenInfo, error)

func (*LoginSrv) GetCaptcha

func (a *LoginSrv) GetCaptcha(ctx context.Context, length int) (*schema.LoginCaptcha, error)

func (*LoginSrv) GetLoginInfo

func (a *LoginSrv) GetLoginInfo(ctx context.Context, memberID uint64) (*schema.MemberLoginInfo, error)

func (*LoginSrv) QueryMemberMenuTree

func (a *LoginSrv) QueryMemberMenuTree(ctx context.Context, memberID, domainID uint64) (schema.MenuTrees, error)

func (*LoginSrv) ResCaptcha

func (a *LoginSrv) ResCaptcha(ctx context.Context, w http.ResponseWriter, captchaID string, width, height int) error

func (*LoginSrv) UpdatePassword

func (a *LoginSrv) UpdatePassword(ctx context.Context, userID uint64, params schema.UpdatePasswordParam) error

func (*LoginSrv) Verify

func (a *LoginSrv) Verify(ctx context.Context, memberName, password string, domainID uint64) (*schema.Member, error)

type MemberSrv

type MemberSrv struct {
	Enforcer       *casbin.SyncedEnforcer
	TransRepo      *dao.TransRepo
	MemberRepo     *dao.MemberRepo
	MemberRoleRepo *dao.MemberRoleRepo
	RoleRepo       *dao.RoleRepo
}

func (*MemberSrv) Create

func (a *MemberSrv) Create(ctx context.Context, item schema.Member) (*schema.IDResult, error)

func (*MemberSrv) Delete

func (a *MemberSrv) Delete(ctx context.Context, userID, domainID uint64) error

func (*MemberSrv) DeleteByDomainID

func (a *MemberSrv) DeleteByDomainID(ctx context.Context, id uint64) error

func (*MemberSrv) Get

func (*MemberSrv) Query

func (*MemberSrv) QueryShow

func (*MemberSrv) Update

func (a *MemberSrv) Update(ctx context.Context, id uint64, item schema.Member) error

func (*MemberSrv) UpdateAgentPart

func (a *MemberSrv) UpdateAgentPart(ctx context.Context, id uint64, item schema.AgentUpdate) error

UpdateAgentPart 更新agent部分的数据

func (*MemberSrv) UpdateStatus

func (a *MemberSrv) UpdateStatus(ctx context.Context, id, domainID uint64, status int) error
type MenuSrv struct {
	TransRepo              *dao.TransRepo
	MenuRepo               *dao.MenuRepo
	MenuActionRepo         *dao.MenuActionRepo
	MenuActionResourceRepo *dao.MenuActionResourceRepo
}
func (a *MenuSrv) Create(ctx context.Context, item schema.Menu) (*schema.IDResult, error)
func (a *MenuSrv) Delete(ctx context.Context, id uint64) error
func (a *MenuSrv) Get(ctx context.Context, id uint64, opts ...schema.MenuQueryOptions) (*schema.Menu, error)
func (a *MenuSrv) InitData(ctx context.Context, dataFile string) error
func (a *MenuSrv) QueryActions(ctx context.Context, id uint64) (schema.MenuActions, error)
func (a *MenuSrv) Update(ctx context.Context, id uint64, item schema.Menu) error
func (a *MenuSrv) UpdateStatus(ctx context.Context, id uint64, status int) error

type Order

type Order struct {
	Id          uint64    `json:"id,string"`                             // 唯一标识
	Status      *int      `json:"status" binding:"required,max=1,min=0"` // 用户状态(1:启用 0:停用)
	PayTypeCode string    `json:"pay_type_code"`                         //支付产品编码
	PayTypeName string    `json:"pay_type_name"`                         //支付产品名称
	OrderKind   OrderType `json:"order_kind"`                            //订单类型
	OrderAmount float32   `json:"order_amount"`                          //订单提交的金额
	FactAmount  float64   `json:"fact_amount"`                           //用户实际支付金额
	Discount    float64   `json:"discount"`                              // 该订单的折扣
	CreatedAt   time.Time `json:"created_at"`                            // 创建时间
	ReturnUrl   string    `json:"return_url"`                            //支付完跳转地址
	AccountID   uint64    `json:"account_id,string"`                     //账户ID
	MemberID    uint64    `json:"member_id"`                             // 产生订单时,他的经销商ID
	OrderStaus  string    `json:"order_staus"`                           //订单的状态
	Origin      *int      `json:"origin" form:"origin"`                  // origin 0. 自己;1. 其他平台
}

type OrderType

type OrderType int
const (
	OrderConsume OrderType = 2
	OrderCharge  OrderType = 1
)

type RoleSrv

type RoleSrv struct {
	Enforcer               *casbin.SyncedEnforcer
	TransRepo              *dao.TransRepo
	RoleRepo               *dao.RoleRepo
	RoleMenuRepo           *dao.RoleMenuRepo
	UserRepo               *dao.MemberRepo
	MenuActionResourceRepo *dao.MenuActionResourceRepo
	RoleMemberRepo         *dao.MemberRoleRepo
}

func (*RoleSrv) Create

func (a *RoleSrv) Create(ctx context.Context, item schema.Role) (*schema.IDResult, error)

func (*RoleSrv) Delete

func (a *RoleSrv) Delete(ctx context.Context, id, domainID uint64) error

func (*RoleSrv) DeleteByDomainID

func (a *RoleSrv) DeleteByDomainID(ctx context.Context, id uint64) error

func (*RoleSrv) Get

func (a *RoleSrv) Get(ctx context.Context, id, domainID uint64, opts ...schema.RoleQueryOptions) (*schema.Role, error)

func (*RoleSrv) Query

func (*RoleSrv) QueryRoleMenus

func (a *RoleSrv) QueryRoleMenus(ctx context.Context, roleID uint64) (schema.RoleMenus, error)

func (*RoleSrv) QueryShows

func (*RoleSrv) Update

func (a *RoleSrv) Update(ctx context.Context, id, domainID uint64, item schema.Role) error

func (*RoleSrv) UpdateStatus

func (a *RoleSrv) UpdateStatus(ctx context.Context, id, domainID uint64, status int) error

type UserAccount

type UserAccount struct {
	Mobile   string   `form:"mobile" json:"mobile" binding:"required"`
	UserName string   `form:"username" json:"username" binding:"required"`
	Passwd   string   `form:"passwd" json:"passwd" binding:"max=20,min=0"`
	Money    *float32 `form:"money" json:"money"  binding:"numeric"`
	Origin   *int     `json:"origin" form:"origin" binding:"numeric"` // origin 0. 自己;1. 其他平台
	Status   *int     `json:"status" form:"money" binding:"numeric"`
	MemberID uint64   `json:"member_id" form:"member_id"`
}

type UserMobile

type UserMobile struct {
	Mobile   string   `form:"mobile" json:"mobile" binding:"required"`
	UserName string   `form:"username" json:"username" binding:"required"`
	Passwd   string   `form:"passwd" json:"passwd" binding:"required,max=20,min=6"`
	Code     string   `form:"code" json:"code" binding:"required,len=6"`
	Type     *int     `form:"type" json:"type"  binding:"numeric"`
	Country  string   `form:"country" json:"country" binding:"required"`
	Money    *float32 `form:"money" json:"money"  binding:"numeric"`
	Origin   *int     `json:"origin" form:"origin" binding:"numeric"` // origin 0. 自己;1. 其他平台
	MemberID uint64   `json:"member_id,string" form:"member_id"`
}

UserMobile 这个实际是copy自teethlink,考虑要不要import

type UserSrv

type UserSrv struct {
	TransRepo   *dao.TransRepo
	UserRepo    *dao.UserRepo
	UsertagRepo *dao.UsertagRepo
}

func (*UserSrv) Create

func (a *UserSrv) Create(ctx context.Context, item schema.User) (*schema.IDResult, error)

func (*UserSrv) Delete

func (a *UserSrv) Delete(ctx context.Context, userID uint64) error

func (*UserSrv) Get

func (a *UserSrv) Get(ctx context.Context, id uint64, opts ...schema.UserQueryOptions) (*schema.User, error)

func (*UserSrv) GetByTeethlinkID

func (a *UserSrv) GetByTeethlinkID(ctx context.Context, id uint64) (*schema.User, error)

func (*UserSrv) Query

func (*UserSrv) Update

func (a *UserSrv) Update(ctx context.Context, id uint64, item schema.User) error

func (*UserSrv) UpdateAccount

func (a *UserSrv) UpdateAccount(ctx context.Context, id uint64, item schema.AccountChange) error

func (*UserSrv) UpdateStatus

func (a *UserSrv) UpdateStatus(ctx context.Context, id uint64, status int) error

type UsertagSrv

type UsertagSrv struct {
	Enforcer    *casbin.SyncedEnforcer
	TransRepo   *dao.TransRepo
	UsertagRepo *dao.UsertagRepo
}

func (*UsertagSrv) Create

func (a *UsertagSrv) Create(ctx context.Context, item schema.Usertag) (*schema.IDResult, error)

func (*UsertagSrv) Delete

func (a *UsertagSrv) Delete(ctx context.Context, userID uint64) error

func (*UsertagSrv) Get

func (*UsertagSrv) Query

func (*UsertagSrv) Update

func (a *UsertagSrv) Update(ctx context.Context, id uint64, item schema.Usertag) error

func (*UsertagSrv) UpdateStatus

func (a *UsertagSrv) UpdateStatus(ctx context.Context, id uint64, status int) error

Jump to

Keyboard shortcuts

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