import "../base.api"

type (
    // The data of label tagging information | LabelTagging信息
    LabelTaggingInfo {
        BaseIDInfo

        // Status 1: normal 2: ban | 状态 1 正常 2 禁用 
        Status  *uint8 `json:"status,optional"`

        // 机构 ID
        OrganizationId  *uint64 `json:"organizationId,optional"`

        // 标签类型：1好友，2群组，3公众号，4企业微信联系人
        Type  *int `json:"type,optional"`

        // 关键词 
        Conditions  string `json:"conditions,optional"`

        // 命中后需要打的标签 
        ActionLabelAdd  []uint64 `json:"actionLabelAdd,optional"`

        // 命中后需要移除的标签 
        ActionLabelDel  []uint64 `json:"actionLabelDel,optional"`

        LabelAddInfo  []string `json:"labelAddInfo,optional"`
    }

    // The response data of label tagging list | LabelTagging信息列表数据
    LabelTaggingListResp {
        BaseDataInfo

        // The label tagging list data | LabelTagging信息列表数据
        Data LabelTaggingListInfo `json:"data"`
    }

    // The label tagging list data | LabelTagging信息列表数据
    LabelTaggingListInfo {
        BaseListInfo

        // The label tagging list data | LabelTagging信息列表数据
        Data  []LabelTaggingInfo  `json:"data"`
    }

    // Get label tagging list request params | LabelTagging信息列表请求参数
    LabelTaggingListReq {
        PageInfo
    }

    // The label tagging information response | LabelTagging信息返回体
    LabelTaggingInfoResp {
        BaseDataInfo

        // label tagging information | LabelTagging信息数据
        Data LabelTaggingInfo `json:"data"`
    }
)

@server(
    jwt: Auth
    group: label_tagging
    middleware: Authority
)

service Wechat {
    // Create label tagging information | 创建LabelTagging信息
    @handler createLabelTagging
    post /label_tagging/create (LabelTaggingInfo) returns (BaseMsgResp)

    // Update label tagging information | 更新LabelTagging信息
    @handler updateLabelTagging
    post /label_tagging/update (LabelTaggingInfo) returns (BaseMsgResp)

    // Delete label tagging information | 删除LabelTagging信息
    @handler deleteLabelTagging
    post /label_tagging/delete (IDReq) returns (BaseMsgResp)

    // Get label tagging list | 获取LabelTagging信息列表
    @handler getLabelTaggingList
    post /label_tagging/list (LabelTaggingListReq) returns (LabelTaggingListResp)

    // Get label tagging by ID | 通过ID获取LabelTagging信息
    @handler getLabelTaggingById
    post /label_tagging (IDReq) returns (LabelTaggingInfoResp)
}
