45 lines
2.0 KiB
Go
45 lines
2.0 KiB
Go
package delivery
|
|
|
|
import "git.apinb.com/heqiapp/platforms/backend/api/internal/logic/common"
|
|
|
|
type ResourceContract struct {
|
|
Domain string `json:"domain"`
|
|
Name string `json:"name"`
|
|
Path string `json:"path"`
|
|
PageKind string `json:"pageKind"`
|
|
Mode string `json:"mode"`
|
|
SearchFields []common.KeywordSearchField `json:"searchFields,omitempty"`
|
|
}
|
|
|
|
func ExpectedResources() []ResourceContract {
|
|
items := []ResourceContract{
|
|
resourceContract("profile", "delivery_profile", "readonly"),
|
|
resourceContract("staff", "staff_account", "writable"),
|
|
resourceContract("staff", "staff_credential", "writable"),
|
|
resourceContract("user", "user_account", "writable"),
|
|
resourceContract("user", "user_address", "writable"),
|
|
resourceContract("contract", "gasorder_contract", "managed"),
|
|
resourceContract("contract", "gasorder_contract_product", "append_only"),
|
|
resourceContract("contract", "gasorder_contract_revision", "readonly"),
|
|
resourceContract("contract", "product_info", "readonly"),
|
|
resourceContract("gasorder", "gasorder_basic", "append_only"),
|
|
resourceContract("finance", "wallet_basic", "readonly"),
|
|
resourceContract("finance", "wallet_bank", "readonly"),
|
|
resourceContract("finance", "payment_order", "readonly"),
|
|
resourceContract("finance", "wallet_record", "readonly"),
|
|
resourceContract("finance", "payment_refund", "readonly"),
|
|
resourceContract("finance", "wallet_recharge", "append_only"),
|
|
resourceContract("finance", "wallet_apply_cash", "append_only"),
|
|
resourceContract("finance", "fin_settlement", "readonly"),
|
|
}
|
|
return items
|
|
}
|
|
|
|
// resourceContract 创建配送端标准资源契约,并附加显式搜索字段。
|
|
func resourceContract(domain, name, mode string) ResourceContract {
|
|
return ResourceContract{
|
|
Domain: domain, Name: name, Path: "/" + name, PageKind: "list", Mode: mode,
|
|
SearchFields: resourceSearchFields(name),
|
|
}
|
|
}
|