Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
RESTAPI和URI中实体的顺序_Rest_Uri - Fatal编程技术网

RESTAPI和URI中实体的顺序

RESTAPI和URI中实体的顺序,rest,uri,Rest,Uri,RESTAPI和URI中实体的顺序 UC 1: 获取过去60或90年间为给定customerId执行的服务列表。。。或365天 如何定义uri;在uri、Customer或ContactInfo中应首先指定哪个实体 www.example.com/operations/customers/{CustomerId}/services?noOfDaysInPast=60 www.example.com/operations/services/customers/{customerId}?noOfDa

RESTAPI和URI中实体的顺序

UC 1:

获取过去60或90年间为给定customerId执行的服务列表。。。或365天

如何定义uri;在uri、Customer或ContactInfo中应首先指定哪个实体

www.example.com/operations/customers/{CustomerId}/services?noOfDaysInPast=60
www.example.com/operations/services/customers/{customerId}?noOfDaysInPast=60
www.example.com/operations/services/{customerId}?noOfDaysInPast=60
www.example.com/operations/services/?customerId=12345&noOfDaysInPast=60
www.example.com/operations/customers/{CustomerId}/contactInfo?addressType=SERVICE
www.example.com/operations/contactInfo/customers/{customerId}?addressType=SERVICE
UC 2:

获取给定customerid的联系信息(contantInfo=姓名+服务地址)

如何定义uri 在uri、Customer或ContactInfo中应首先指定哪个实体

www.example.com/operations/customers/{CustomerId}/services?noOfDaysInPast=60
www.example.com/operations/services/customers/{customerId}?noOfDaysInPast=60
www.example.com/operations/services/{customerId}?noOfDaysInPast=60
www.example.com/operations/services/?customerId=12345&noOfDaysInPast=60
www.example.com/operations/customers/{CustomerId}/contactInfo?addressType=SERVICE
www.example.com/operations/contactInfo/customers/{customerId}?addressType=SERVICE
获取过去60或90年间为给定customerId执行的服务列表。。。或365天

让我们分步骤看一下:

获取服务列表

为给定的customerId执行

在过去的60天里

好了

www.example.com/operations/services/?customerId=12345&noOfDaysInPast=60