-
Notifications
You must be signed in to change notification settings - Fork 0
/
work-server.go
53 lines (41 loc) · 1.23 KB
/
work-server.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package component_shipinlv
import (
"errors"
"fmt"
//component_shipinlv_lib "component_shipinlv/lib"
component_shipinlv_lib "github.com/tangwenru/go-component-shipinlv/lib"
)
type WorkServer struct {
}
type WorkServerDetail struct {
Id int64 `json:"id"`
Title string `json:"title"`
Domain string `json:"domain"`
DomainProtocol string `json:"domainProtocol"`
Port int64 `json:"port"`
WorkType string `json:"workType"`
}
type WorkServerDetailQuery struct {
WorkType string `json:"workType"`
}
type WorkServerDetailResult struct {
Success bool `json:"success"`
Message string `json:"message"`
Data WorkServerDetail `json:"data"`
}
func init() {
}
func (this *WorkServer) RandDetail(userId int64, workType string) (*WorkServerDetail, error) {
query := WorkServerDetailQuery{
WorkType: workType,
}
vipListResult := WorkServerDetailResult{}
bytesResult, err := component_shipinlv_lib.MainSystem(userId, "workServer/randDetail", &query, &vipListResult)
if err != nil {
fmt.Println("Work Server RandDetail err:", string(bytesResult), err)
}
if !vipListResult.Success {
return nil, errors.New(vipListResult.Message)
}
return &vipListResult.Data, err
}