188 lines
5.0 KiB
Go
188 lines
5.0 KiB
Go
|
package entity
|
||
|
|
||
|
import "errors"
|
||
|
|
||
|
var (
|
||
|
NotFoundErr = errors.New("not found")
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
ACCOUNT_ID_HEADER_KEY = "X-Consumer-Custom-Id"
|
||
|
SDKKEY_HEADER_KEY = "mop-sdk-key"
|
||
|
SDKEY_VER_HEADER_KEY = "mop-sdk-version"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
APP_MARKET_TYPE_FINANCE = "金融"
|
||
|
APP_MARKET_TYPE_TOOL = "工具"
|
||
|
APP_MARKET_TYPE_INFORMATION = "资讯"
|
||
|
APP_MARKET_TYPE_OTHER = "其他"
|
||
|
)
|
||
|
const (
|
||
|
AppTypeBot = "Bot"
|
||
|
AppTypeWeb = "Web"
|
||
|
AppTypeApplet = "Applet"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
ErrFake = "fake error"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
ENV_UAT = "mop-uat"
|
||
|
ENV_PRIVATE = "mop-private"
|
||
|
ENV_FDEP = "mop-fdep"
|
||
|
ENV_COMMUNITY = "mop-community"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
ScopeUserInfo = "user-info"
|
||
|
ScopeMessageSending = "message-sending"
|
||
|
ScopeProfile = "profile"
|
||
|
ScopeEmail = "email"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
StKeyPublishingApprovalStatus = "publishingApprovalStatus"
|
||
|
StKeyUnpublishingApprovalStatus = "unpublishingApprovalStatus"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
OpCreate = "Create"
|
||
|
OpUpdate = "Update"
|
||
|
OpDelete = "Delete"
|
||
|
|
||
|
OpSubmitPublishReq = "Submit publish request"
|
||
|
OpWithdrawPublishReq = "Withdraw publish request"
|
||
|
OpPublish = "Publish"
|
||
|
OpApprovePublishReq = "Approve publish request"
|
||
|
OpRejectPublishReq = "Reject publish request"
|
||
|
|
||
|
OpSubmitUnpublishReq = "Submit unpublish request"
|
||
|
OpWithdrawUnpublishReq = "Withdraw unpublish request"
|
||
|
OpUnpublish = "Unpublish"
|
||
|
OpApproveUnpublishReq = "Approve unpublish request"
|
||
|
OpRejectUnpublishReq = "Reject unpublish request"
|
||
|
)
|
||
|
|
||
|
var AppOperationMap = map[string]string{
|
||
|
OpCreate: "创建应用",
|
||
|
OpUpdate: "更新应用",
|
||
|
OpDelete: "删除应用",
|
||
|
OpSubmitPublishReq: "提交上架申请",
|
||
|
OpWithdrawPublishReq: "撤回上架申请",
|
||
|
OpPublish: "上架",
|
||
|
OpApprovePublishReq: "通过上架申请",
|
||
|
OpRejectPublishReq: "驳回上架申请",
|
||
|
OpSubmitUnpublishReq: "提交下架申请",
|
||
|
OpWithdrawUnpublishReq: "撤回下架申请",
|
||
|
OpUnpublish: "下架",
|
||
|
OpApproveUnpublishReq: "通过下架申请",
|
||
|
OpRejectUnpublishReq: "驳回下架申请",
|
||
|
}
|
||
|
|
||
|
const (
|
||
|
OpBindingAssociate = "Associate"
|
||
|
OpBindBundle = "BindBundle"
|
||
|
OpUpdateBundle = "UpdateBundle"
|
||
|
|
||
|
OpBindingDisassociate = "Disassociate"
|
||
|
OpBindingRecooperate = "Recooperate"
|
||
|
OpBindingDiscooperate = "Discooperate"
|
||
|
OpBindingModifyName = "ModifyName"
|
||
|
|
||
|
OpBindingApplyAssociate = "ApplyAssociate"
|
||
|
|
||
|
OpBindingAutoBind = "AutoBind"
|
||
|
OpBindingHiddenBundle = "HiddenBundle"
|
||
|
|
||
|
OpBindingReviewAdd = "add"
|
||
|
OpBindingReviewRemove = "remove"
|
||
|
|
||
|
OpMoveBundle = "MoveBundle"
|
||
|
)
|
||
|
|
||
|
var BindingOperationMap = map[string]string{
|
||
|
OpBindingAssociate: "关联小程序",
|
||
|
OpBindingDisassociate: "取消关联小程序",
|
||
|
OpBindingRecooperate: "恢复合作",
|
||
|
OpBindingDiscooperate: "取消合作",
|
||
|
OpBindingModifyName: "修改应用名称",
|
||
|
|
||
|
OpBindingApplyAssociate: "申请关联小程序",
|
||
|
}
|
||
|
|
||
|
const (
|
||
|
StLinkAuditApplying = "Applying"
|
||
|
StLinkAuditRejected = "Rejected"
|
||
|
StLinkAuditApplied = "Applied"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
StLinkAuditAssociate = "Associated"
|
||
|
StLinkAuditUnAssociate = "UnAssociated"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
StBindValid = "Valid"
|
||
|
StBindInvalid = "Invalid"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
BuildInfoTypeTrial = "trial"
|
||
|
BuildInfoTypeTemporary = "temporary"
|
||
|
BuildInfoTypeReview = "review"
|
||
|
BuildInfoTypeRelease = "release"
|
||
|
BuildInfoTypeDevelopment = "development"
|
||
|
BuildInfoTypeRomoteDebug = "remoteDebug" //真机调试版
|
||
|
)
|
||
|
|
||
|
var BindingStatusMap = map[string]string{
|
||
|
StBindValid: "已合作",
|
||
|
StBindInvalid: "已取消合作",
|
||
|
}
|
||
|
|
||
|
const (
|
||
|
StInDevelopment = "InDevelopment" // 开发中,客户端不感知
|
||
|
StPublishing = "Publishing" // 上架审核中
|
||
|
StPublishWithdrawed = "PublishWithdrawed" // 上架审核已撤回
|
||
|
StPublishApproved = "PublishApproved" // 上架审核已通过
|
||
|
StPublishRejected = "PublishRejected" // 上架审核已拒绝
|
||
|
StPublished = "Published" // 已上架
|
||
|
StUnpublishing = "Unpublishing" // 下架审核中
|
||
|
StUnpublishApproved = "UnpublishApproved" // 下架审核已通过
|
||
|
StUnpublishRejected = "UnpublishRejected" // 下架审核已拒绝
|
||
|
StUnpublished = "Unpublished" // 已下架
|
||
|
StDeleted = "Deleted" // 已删除,客户端不感知
|
||
|
StGrayPublished = "StGrayPublished" //灰度发布中
|
||
|
)
|
||
|
|
||
|
var AppStatusMap = map[string]string{
|
||
|
StInDevelopment: "开发中",
|
||
|
StPublishing: "上架申请审核中",
|
||
|
StPublishWithdrawed: "上架申请已撤回",
|
||
|
StPublishApproved: "上架申请已通过",
|
||
|
StPublishRejected: "上架申请已驳回",
|
||
|
StPublished: "已上架",
|
||
|
StUnpublishing: "下架申请审核中",
|
||
|
StUnpublishApproved: "下架申请已通过",
|
||
|
StUnpublishRejected: "下架申请已驳回",
|
||
|
StUnpublished: "已下架",
|
||
|
StDeleted: "已删除",
|
||
|
}
|
||
|
|
||
|
const (
|
||
|
StOwnershipInstalled = "Installed"
|
||
|
StOwnershipUninstalled = "Uninstalled"
|
||
|
)
|
||
|
|
||
|
const (
|
||
|
PLATFORM_ANDROID = "android"
|
||
|
PLATFORM_IOS = "ios"
|
||
|
PLATFROM_IOS_ANDROID = "ios_android"
|
||
|
)
|
||
|
|
||
|
func NotFound(err error) bool {
|
||
|
return err == ErrNotFound
|
||
|
}
|