Skip to content

Commit

Permalink
fix: fix GetUserPayments() parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
hsluoyz committed Oct 31, 2023
1 parent 7874e42 commit 16737ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 12 deletions.
3 changes: 0 additions & 3 deletions casdoorsdk/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// TODO: add enforcer, syncer, subscription, session, resource, record, product,
// pricing, plan, payment, model, message, account, group, chat, cert, adapter,

package casdoorsdk

import (
Expand Down
11 changes: 4 additions & 7 deletions casdoorsdk/payment.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,11 @@ func (c *Client) GetPayment(name string) (*Payment, error) {
return payment, nil
}

func (c *Client) GetUserPayments() ([]*Payment, error) {
return nil, errors.New("Not implemented")
func (c *Client) GetUserPayments(userName string) ([]*Payment, error) {
queryMap := map[string]string{
"owner": c.OrganizationName,
"orgnization": c.OrganizationName,
// TODO: get user name
//"user": c.

"owner": c.OrganizationName,
"organization": c.OrganizationName,
"user": userName,
}

url := c.GetUrl("get-user-payments", queryMap)
Expand Down
4 changes: 2 additions & 2 deletions casdoorsdk/payment_global.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ func GetPayment(name string) (*Payment, error) {
return globalClient.GetPayment(name)
}

func GetUserPayments() ([]*Payment, error) {
return globalClient.GetUserPayments()
func GetUserPayments(userName string) ([]*Payment, error) {
return globalClient.GetUserPayments(userName)
}

func UpdatePayment(payment *Payment) (bool, error) {
Expand Down

0 comments on commit 16737ae

Please sign in to comment.