staffscore
This commit is contained in:
parent
6fa0b3b8af
commit
e50a565e80
|
|
@ -7,11 +7,11 @@ import (
|
|||
"github.com/tidwall/gjson"
|
||||
)
|
||||
|
||||
type StaffTarget struct {
|
||||
type StaffScore struct {
|
||||
Erp
|
||||
}
|
||||
|
||||
type StaffTargetCreate struct {
|
||||
type StaffScoreCreate struct {
|
||||
Username string `json:"username"`
|
||||
Month string `json:"month"`
|
||||
Day string `json:"day"`
|
||||
|
|
@ -19,8 +19,8 @@ type StaffTargetCreate struct {
|
|||
Comment string `json:"comment"`
|
||||
}
|
||||
|
||||
func NewStaffTarget(baseUrl, token string) *StaffTarget {
|
||||
return &StaffTarget{
|
||||
func NewStaffScore(baseUrl, token string) *StaffScore {
|
||||
return &StaffScore{
|
||||
Erp: Erp{
|
||||
baseUrl: baseUrl,
|
||||
token: token,
|
||||
|
|
@ -28,8 +28,8 @@ func NewStaffTarget(baseUrl, token string) *StaffTarget {
|
|||
}
|
||||
}
|
||||
|
||||
func (e *StaffTarget) Create(req *StaffTargetCreate) error {
|
||||
reqUrl := e.GetBaseUrl() + "/ext/staff/target"
|
||||
func (e *StaffScore) Create(req *StaffScoreCreate) error {
|
||||
reqUrl := e.GetBaseUrl() + "/ext/staff/score"
|
||||
body, err := goutil.HttpPost(reqUrl, e.GetHeader(), []byte(goutil.EncodeJSON(req)))
|
||||
if err != nil {
|
||||
return err
|
||||
Loading…
Reference in New Issue