package com.chinaweal.aiccs.outside.api;

import com.chinaweal.aiccs.door.entity.TUserportal;
import com.chinaweal.aiccs.outside.interceptor.DoorInterceptor;
import com.chinaweal.aiccs.outside.util.DoorResult;
import com.chinaweal.aiccs.outside.vo.DoorTask;
import com.dtflys.forest.annotation.*;
import com.dtflys.forest.http.ForestResponse;

import java.util.List;
import java.util.Map;

/**
 * 门户的接口
 */
@BaseRequest(baseURL = "${doorBaseUrl}", interceptor = DoorInterceptor.class)
public interface DoorApi {

    /**
     * cas 获取单点登录票据校验 (统一门户)
     */
    @GetRequest(url = "/cas/serviceValidate?service={service}&ticket={ticket}", headers = "Content-Type:application/x-www-form-urlencoded")
    ForestResponse<String> casServiceValidate_Unite(@Var("service") String service, @Var("ticket") String ticket);

    // 待办推送-统一门户
    @Post(url = "/sjj-tacs/api/portal/tasks/send", async = true)
    void tasksSend(@JSONBody DoorTask doorTask);

    // 待办更新-统一门户
    @Post(url = "/sjj-tacs/api/portal/tasks/update", async = true)
    void tasksSendUpdate(@JSONBody DoorTask doorTask);

    // 获取所有用户-统一门户
    @Get(url = "/sjj-tacs/api/portal/users/all")
    ForestResponse<DoorResult<List<TUserportal>>> usersAll();

    // 根据id获取用户信息-统一门户
    @Get(url = "/sjj-tacs/api/portal/users/queryById")
    ForestResponse<DoorResult<TUserportal>> queryById(@Query("id") String id);
}
