staffscore

This commit is contained in:
jiangyong 2026-07-01 23:54:43 +08:00
parent 6fa0b3b8af
commit e50a565e80
1 changed files with 6 additions and 6 deletions

View File

@ -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