| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- package qualitycheck
- //Licensed under the Apache License, Version 2.0 (the "License");
- //you may not use this file except in compliance with the License.
- //You may obtain a copy of the License at
- //
- //http://www.apache.org/licenses/LICENSE-2.0
- //
- //Unless required by applicable law or agreed to in writing, software
- //distributed under the License is distributed on an "AS IS" BASIS,
- //WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- //See the License for the specific language governing permissions and
- //limitations under the License.
- //
- // Code generated by Alibaba Cloud SDK Code Generator.
- // Changes may cause incorrect behavior and will be lost if the code is regenerated.
- import (
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
- "github.com/aliyun/alibaba-cloud-sdk-go/sdk/responses"
- )
- func (client *Client) GetResult(request *GetResultRequest) (response *GetResultResponse, err error) {
- response = CreateGetResultResponse()
- err = client.DoAction(request, response)
- return
- }
- func (client *Client) GetResultWithChan(request *GetResultRequest) (<-chan *GetResultResponse, <-chan error) {
- responseChan := make(chan *GetResultResponse, 1)
- errChan := make(chan error, 1)
- err := client.AddAsyncTask(func() {
- defer close(responseChan)
- defer close(errChan)
- response, err := client.GetResult(request)
- responseChan <- response
- errChan <- err
- })
- if err != nil {
- errChan <- err
- close(responseChan)
- close(errChan)
- }
- return responseChan, errChan
- }
- func (client *Client) GetResultWithCallback(request *GetResultRequest, callback func(response *GetResultResponse, err error)) <-chan int {
- result := make(chan int, 1)
- err := client.AddAsyncTask(func() {
- var response *GetResultResponse
- var err error
- defer close(result)
- response, err = client.GetResult(request)
- callback(response, err)
- result <- 1
- })
- if err != nil {
- defer close(result)
- callback(nil, err)
- result <- 0
- }
- return result
- }
- type GetResultRequest struct {
- *requests.RpcRequest
- JsonStr string `position:"Query" name:"JsonStr"`
- }
- type GetResultResponse struct {
- *responses.BaseResponse
- RequestId string `json:"requestId" xml:"requestId"`
- Success bool `json:"success" xml:"success"`
- Code string `json:"code" xml:"code"`
- Message string `json:"message" xml:"message"`
- Count int `json:"count" xml:"count"`
- Data []struct {
- Tid string `json:"tid" xml:"tid"`
- Score int `json:"score" xml:"score"`
- ReviewStatus int `json:"reviewStatus" xml:"reviewStatus"`
- HitId string `json:"hitId" xml:"hitId"`
- Rules []struct {
- HitStatus int `json:"hitStatus" xml:"hitStatus"`
- Rid string `json:"rid" xml:"rid"`
- Hit []struct {
- HitCids []string `json:"hitCids" xml:"hitCids"`
- Phrase struct {
- Role string `json:"role" xml:"role"`
- Identity string `json:"identity" xml:"identity"`
- Words string `json:"words" xml:"words"`
- Begin int64 `json:"begin" xml:"begin"`
- End int64 `json:"end" xml:"end"`
- BeginTime string `json:"beginTime" xml:"beginTime"`
- HourMinSec string `json:"hourMinSec" xml:"hourMinSec"`
- } `json:"phrase" xml:"phrase"`
- HitKeyWords []struct {
- Val string `json:"val" xml:"val"`
- Pid int `json:"pid" xml:"pid"`
- From int `json:"from" xml:"from"`
- To int `json:"to" xml:"to"`
- Tid string `json:"tid" xml:"tid"`
- } `json:"hitKeyWords" xml:"hitKeyWords"`
- } `json:"hit" xml:"hit"`
- ConditionInfo []struct {
- ConditionInfoCid string `json:"conditionInfoCid" xml:"conditionInfoCid"`
- Lambda string `json:"lambda" xml:"lambda"`
- CheckRange struct {
- Role string `json:"role" xml:"role"`
- Anchor struct {
- AnchorCid string `json:"anchorCid" xml:"anchorCid"`
- Location string `json:"location" xml:"location"`
- HitTime int `json:"hitTime" xml:"hitTime"`
- } `json:"anchor" xml:"anchor"`
- Range struct {
- From int `json:"from" xml:"from"`
- To int `json:"to" xml:"to"`
- } `json:"range" xml:"range"`
- } `json:"checkRange" xml:"checkRange"`
- Operators []struct {
- Oid string `json:"oid" xml:"oid"`
- Type string `json:"type" xml:"type"`
- Name string `json:"name" xml:"name"`
- Param struct {
- Regex string `json:"regex" xml:"regex"`
- Phrase string `json:"phrase" xml:"phrase"`
- Interval int `json:"interval" xml:"interval"`
- Threshold float64 `json:"threshold" xml:"threshold"`
- InSentence bool `json:"inSentence" xml:"inSentence"`
- Target int `json:"target" xml:"target"`
- FromEnd bool `json:"fromEnd" xml:"fromEnd"`
- DifferentRole bool `json:"differentRole" xml:"differentRole"`
- TargetRole string `json:"targetRole" xml:"targetRole"`
- OperKeyWords []string `json:"operKeyWords" xml:"operKeyWords"`
- References []string `json:"references" xml:"references"`
- } `json:"param" xml:"param"`
- } `json:"operators" xml:"operators"`
- } `json:"conditionInfo" xml:"conditionInfo"`
- } `json:"rules" xml:"rules"`
- } `json:"data" xml:"data"`
- }
- func CreateGetResultRequest() (request *GetResultRequest) {
- request = &GetResultRequest{
- RpcRequest: &requests.RpcRequest{},
- }
- request.InitWithApiInfo("Qualitycheck", "2016-08-01", "GetResult", "", "")
- return
- }
- func CreateGetResultResponse() (response *GetResultResponse) {
- response = &GetResultResponse{
- BaseResponse: &responses.BaseResponse{},
- }
- return
- }
|