depend

package module
v0.0.0-...-9b22249 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2018 License: Apache-2.0 Imports: 20 Imported by: 0

README

depend

对其他服务的依赖,相当于是一个SDK包

Documentation

Index

Constants

View Source
const (
	OpTypeAdd = iota
	OpTypeUpdate
	OpTypeDel
)
View Source
const (
	ProjectCms = iota
	ProjectZhimazg
	ProjectSupply
	ProjectDriver
)

Variables

View Source
var ServiceFailErr = errors.New("remote service return code is not 0")

Functions

func CancelExpress

func CancelExpress(ctx context.Context, expressSn int64, project, cancelType int, cancelReason string) error

CancelExpress 取消物流单

func CancelOrder

func CancelOrder(ctx context.Context, orderSn int64, project, cancelType int, cancelReason string) error

CancelOrder 取消订单,如果有物流单,一起取消; 主要为了方便,可以一次性全部取消或者还没有物流单时候的取消

func ChangeCredits

func ChangeCredits(ctx context.Context, uid, creditNum int, remark string) error

ChangeCredits 变更用户积分

func Init

func Init(_from string, _isPro bool)

Init 调用方需要先调用该方法,初始化 depend

func IsChannelUser

func IsChannelUser(ctx context.Context, mobile string) bool

IsChannelUser 判断手机号是否是渠道用户(预注册过)

func IsChannelUserByUid

func IsChannelUserByUid(ctx context.Context, uid int) bool

IsChannelUser 判断UID是否是渠道用户(预注册过)

func LoadServicesConf

func LoadServicesConf()

LoadServicesConf 装载所有服务配置

func ProcessNotInterruptErr

func ProcessNotInterruptErr(ctx context.Context, idName string, idVal interface{}, err error)

ProcessNotInterruptErr 处理一些非中断型错误,一般不会出现。 这些错误发生时,程序依然往下执行,这里只是记录错误,同时报警

func ReadUser

func ReadUser(ctx context.Context, uid int) *simplejson.Json

ReadUser 获取用户信息

func ReadUserDevice

func ReadUserDevice(ctx context.Context, uid int) *simplejson.Json

ReadUserDevice 获取用户设备信息,用于推送,比如 client_id,client_source

func RecordAddOp

func RecordAddOp(ctx context.Context, engine *xorm.Engine, bean interface{}, opUser string) error

RecordAddOp 记录新增操作

func RecordDelOp

func RecordDelOp(ctx context.Context, engine *xorm.Engine, bean interface{}, opUser string) error

RecordDelOp 记录删除操作

func RecordOperate

func RecordOperate(ctx context.Context, opType int, opRecord map[string]interface{}) error

RecordOperate 记录操作

func RecordUpdateOp

func RecordUpdateOp(ctx context.Context, engine *xorm.Engine, bean interface{}, changeVals map[string]interface{}, opUser string) error

RecordUpdateOp 记录修改操作

func RecordUserOrder

func RecordUserOrder(ctx context.Context, uid, orderId, storeId int) error

RecordUserOrder 记录用户完成的订单

func RefundCredits

func RefundCredits(ctx context.Context, uid, creditNum int, remark string) error

RefundCredits 退还用户积分

func ReturnVoucher

func ReturnVoucher(ctx context.Context, voucherID, merchantID int) error

ReturnVoucher 返回优惠券:一般指订单取消后

func SendAppMsg

func SendAppMsg(ctx context.Context, userid, content, iosMsg, destType string) error

SendAppMsg App push destType: driver 司机端;supply 供货宝;shopper 芝麻掌柜

func SendDingtalkBotMsg

func SendDingtalkBotMsg(ctx context.Context, webhook, title, content, msgtype string, extra ...string) error

SendDingtalkBotMsg 通过机器人给群发送钉钉消息 参考:https://open-doc.dingtalk.com/docs/doc.htm?spm=a219a.7629140.0.0.karFPe&treeId=257&articleId=105735&docType=1

func SendDingtalkMsg

func SendDingtalkMsg(ctx context.Context, userid, agentid, content string, msgtypes ...string) error

SendDingtalkMsg 给员工发送钉钉消息

func SendEmail

func SendEmail(ctx context.Context, subject, content, tos string) error

func SendSms

func SendSms(ctx context.Context, mobile, content string, smsTypes ...string) error

SendSms 给用户发送短信,smsTypes 默认发送通知。支持的值:00-验证码;01-通知;02-营销

func SendVoucher

func SendVoucher(uid, typ, state int) error

SendVoucher 给用户发送优惠券

func ServiceWarning

func ServiceWarning(ctx context.Context, emailInfo map[string]string, smsContent string) error

ServiceWarning 技术服务报警

func ThirdOrderCancel

func ThirdOrderCancel(ctx context.Context, orderId, reason string) error

ThirdOrderCancel 取消

func ThirdOrderConfirm

func ThirdOrderConfirm(ctx context.Context, orderId string) error

ThirdConfirm 第三方订单确认

func ThirdOrderDelivering

func ThirdOrderDelivering(ctx context.Context, orderId string) error

ThirdConfirm 配送中

func ThirdOrderFinish

func ThirdOrderFinish(ctx context.Context, orderId string) error

ThirdOrderFinish 完成

Types

type TableSchema

type TableSchema struct {
	Field   string `xorm:"Field"`
	Comment string `xorm:"Comment"`
}

Jump to

Keyboard shortcuts

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