mirror of https://github.com/openspug/spug
A api update
parent
cf5bfc81bb
commit
f9365b3e37
|
@ -4,5 +4,5 @@ from .views import *
|
|||
|
||||
urlpatterns = [
|
||||
path('request/', RequestView.as_view()),
|
||||
path('request/<int:r_id>/', do_deploy),
|
||||
path('request/<int:r_id>/', RequestDetailView.as_view()),
|
||||
]
|
||||
|
|
|
@ -58,7 +58,19 @@ class RequestView(View):
|
|||
return json_response(error=error)
|
||||
|
||||
|
||||
def do_deploy(request, r_id):
|
||||
class RequestDetailView(View):
|
||||
def get(self, request, r_id):
|
||||
req = DeployRequest.objects.filter(pk=r_id).first()
|
||||
if not req:
|
||||
return json_response(error='为找到指定发布申请')
|
||||
return json_response({
|
||||
'app_name': req.app.name,
|
||||
'env_name': req.app.env.name,
|
||||
'status': req.status,
|
||||
'status_alias': req.get_status_display()
|
||||
})
|
||||
|
||||
def post(self, request, r_id):
|
||||
req = DeployRequest.objects.filter(pk=r_id).first()
|
||||
if not req:
|
||||
return json_response(error='未找到指定发布申请')
|
||||
|
|
Loading…
Reference in New Issue