ImAccountService.java 2.47 KB
package cn.fw.hermes.sdk.api;

import cn.fw.data.base.domain.common.Message;
import cn.fw.hermes.sdk.api.para.AccountCondition;
import cn.fw.hermes.sdk.api.result.AccountResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author: Chenery
 * @Date: 2021/2/2 15:48
 */
@FeignClient(value = "fw-herms")
public interface ImAccountService {
    /**
     * 用户注册
     *
     * @param accountCondition 注册用户对象
     * @return 注册后的账户对象
     */
     @PostMapping("/api/account/register")
     Message<AccountResult> userRegister(@RequestBody AccountCondition accountCondition);


    /**
     * 注册
     *
     * 过时的方法 {@link this#userRegister(AccountCondition)}
     * @param userId   用户id
     * @param userName 用户名
     * @param faceUrl  用户头像
     * @param isStaff  是否是工作人员
     * @return 返回用户账号信息单位 秒
     */
    @Deprecated
    @GetMapping("/api/im/register")
    Message<AccountResult> register(@RequestParam("userId") Long userId, @RequestParam("userName") String userName,
                                    @RequestParam(value = "faceUrl", required = false) String faceUrl,
                                    @RequestParam("isStaff") boolean isStaff);


    /**
     * 获取签名
     *
     * @param userId  用户id
     * @param expire  签名过期时间(单位:秒 默认10天)签名未过期不生效
     * @param isStaff 是否是app使用人员(false则为会员)
     * @return
     */
    @Deprecated
    @GetMapping("/api/im/getSig")
    Message<AccountResult> getSig(@RequestParam("userId") Long userId, @RequestParam(value = "expire", required = false) Long expire,
                                  @RequestParam("isStaff") boolean isStaff);

    /**
     * 踢下线接口
     *
     * @param userId 用户ID
     * @return
     */
    @Deprecated
    @GetMapping("/api/im/kick")
    Message<Boolean> kick(@RequestParam("userId") Long userId);

    /**
     * 获取IM账号
     *
     * @param userId  用户id
     * @param isStaff 是否是业务人员
     * @return
     */
    @GetMapping("/api/im/getIdentifier")
    Message<String> getIdentifier(@RequestParam("userId") Long userId, @RequestParam("isStaff") boolean isStaff);

}