Skip to content

Commit a138dcf

Browse files
committed
[UPD] Rework structure
1 parent 950f77d commit a138dcf

23 files changed

+158
-60
lines changed

api/article.go

Lines changed: 0 additions & 1 deletion
This file was deleted.

api/article_list.go

Lines changed: 0 additions & 1 deletion
This file was deleted.

api/article_status.go

Lines changed: 0 additions & 1 deletion
This file was deleted.

api/authenticate.go

Lines changed: 0 additions & 50 deletions
This file was deleted.

api/file_import.go

Lines changed: 0 additions & 1 deletion
This file was deleted.

api/file_status.go

Lines changed: 0 additions & 1 deletion
This file was deleted.

api/models/article.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package models
2+
3+
const ArticlePath = "article"
4+
5+
type ArticleRequest struct {
6+
OrderNo string `json:"orderNo"`
7+
}
8+
9+
type ArticleResponse struct {
10+
Status string `json:"status"`
11+
Message string `json:"message,omitempty"`
12+
}

api/models/article_list.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package models
2+
3+
const ArticleListPath = "article_list"
4+
5+
type ArticleListRequest struct {
6+
Field string `json:"field"`
7+
ShowPrice bool `json:"showPrice"`
8+
ShowStock bool `json:"showStock"`
9+
MediaType byte `json:"mediaType,omitempty"`
10+
}
11+
12+
type ArticleListResponse struct {
13+
Status string `json:"status"`
14+
Message string `json:"message,omitempty"`
15+
ArticleList []string `json:"value,omitempty"`
16+
}

api/models/article_status.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package models
2+
3+
const ArticleStatusPath = "article_status"
4+
5+
type ArticleStatusRequest struct {
6+
OrderNo string `json:"orderNo"`
7+
}
8+
9+
type ArticleStatusResponse struct {
10+
Status string `json:"status"`
11+
Message string `json:"message,omitempty"`
12+
}

api/models/authenticate.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package models
2+
3+
// Every other endpoint expects a token (?token=REST_API_TOKEN) obtained by authentication
4+
const AuthenticatePath = "authenticate"
5+
6+
type AuthenticateRequest struct {
7+
APIKey string `json:"apiKey"`
8+
}
9+
10+
type AuthenticateResponse struct {
11+
Status string `json:"status"`
12+
Message string `json:"message,omitempty"`
13+
Token string `json:"token,omitempty"`
14+
}

0 commit comments

Comments
 (0)