You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2020/10/16 11:09:53 UTC

[GitHub] [apisix-dashboard] nic-chen opened a new pull request #561: feat: compatible with PUT method of `admin api` and nodes of upstream

nic-chen opened a new pull request #561:
URL: https://github.com/apache/apisix-dashboard/pull/561


   Please answer these questions before submitting a pull request
   
   - Why submit this pull request?
   - [ ] Bug fix
   - [x] New feature provided
   - [ ] Improve performance
   
   
   ___
   ### New feature or improvement
   
   compatible with PUT method of `admin api` and nodes of upstream
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] juzhiyuan merged pull request #561: feat: compatible with PUT method of `admin api` and nodes of upstream

Posted by GitBox <gi...@apache.org>.
juzhiyuan merged pull request #561:
URL: https://github.com/apache/apisix-dashboard/pull/561


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [apisix-dashboard] ShiningRush commented on a change in pull request #561: feat: compatible with PUT method of `admin api` and nodes of upstream

Posted by GitBox <gi...@apache.org>.
ShiningRush commented on a change in pull request #561:
URL: https://github.com/apache/apisix-dashboard/pull/561#discussion_r507012891



##########
File path: api/internal/core/store/store.go
##########
@@ -256,7 +263,7 @@ func (s *GenericStore) Create(ctx context.Context, obj interface{}) error {
 	return nil
 }
 
-func (s *GenericStore) Update(ctx context.Context, obj interface{}) error {
+func (s *GenericStore) Update(ctx context.Context, obj interface{}, createOnFail bool) error {

Review comment:
       `createOnFail` is confusing, it is just a existing check, `isReplace` or `isPut` would be better

##########
File path: api/internal/core/store/store.go
##########
@@ -267,6 +274,9 @@ func (s *GenericStore) Update(ctx context.Context, obj interface{}) error {
 	}
 	oldObj, ok := s.cache.Load(key)
 	if !ok {
+		if createOnFail {
+			return s.Create(ctx, obj)

Review comment:
       We should init `create_time`、`update_time`  and `id`,Hmmm,we can add two function for baseinfo: `creating` and `updating` to do some logic about `BaseInfo`, then add `BaseInfoSetter` interface to use it. 




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org