package mkt import ( "crypto/md5" "encoding/hex" "fmt" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/requests" "golib.gaore.com/GaoreGo/gaore-common-sdk-go/sdk/responses" "time" ) const appKey = "fc1f841#@de!!08" type SubjectListRequest struct { *requests.RpcRequest Token string `json:"token"` Ts int64 `json:"ts"` State int `json:"state"` } type SubjectListResponse struct { *responses.BaseResponse Code int `json:"code"` Msg string `json:"msg"` Data struct { List []Data `json:"list"` } `json:"data"` } type Data struct { Abbr string `json:"abbr"` AbbrSign string `json:"abbr_sign"` Id int `json:"id"` Name string `json:"name"` State int `json:"state"` System string `json:"system"` Type int `json:"type"` } // CreateSubjectListRequest 公司列表请求 func CreateSubjectListRequest(state int) (req *SubjectListRequest) { ts := time.Now().Unix() hash := md5.New() hash.Write([]byte(fmt.Sprintf("%v%v", ts, appKey))) hashBytes := hash.Sum(nil) token := hex.EncodeToString(hashBytes) req = &SubjectListRequest{ RpcRequest: &requests.RpcRequest{}, State: state, Token: token, Ts: ts, } req.InitWithApiInfo(HOST, VERSION, fmt.Sprintf("/api/subject/list")) req.Method = requests.POST return } // CreateSubjectListResponse 公司列表请求响应 func CreateSubjectListResponse() (response *SubjectListResponse) { response = &SubjectListResponse{ BaseResponse: &responses.BaseResponse{}, } return }