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