Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
package dao
import (
"context"
"fmt"
"net/url"
"github.com/pkg/errors"
)
// AddTags add tags from http request.
func (d *Dao) AddTags(c context.Context, tags string, ip string) (err error) {
var res struct {
Code int `json:"code"`
}
params := url.Values{}
params.Set("tag_name", tags)
if err = d.client.Post(c, d.actURLAddTags, ip, params, &res); err != nil {
err = errors.Wrapf(err, "d.client.Post(%s)", d.actURLAddTags)
return
}
if res.Code != 0 {
err = fmt.Errorf("res code(%v)", res)
}
return
}