RemoteUserModService.java 2.4 KB
package cn.brotop.api.user;

import cn.brotop.api.user.DTO.UserDTO;
import cn.brotop.api.user.factory.RemoteUserModFallbackFactory;
import cn.brotop.common.core.constant.ServiceNameConstants;
import cn.brotop.common.core.domain.R;
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;

/**
 * 用户模块API服务
 * @author 啊雷
 * @version 1.0
 * @date 2021/1/20 9:47
 */
@FeignClient(contextId = "remoteUserModService", value = ServiceNameConstants.USER_SERVICE, fallbackFactory = RemoteUserModFallbackFactory.class)
public interface RemoteUserModService {

    /**
     * 根据用户id 查询用户信息
     * @param userId 用户id
     * @return R<UserDTO>
     */
    @GetMapping(value = "/remote_user/getUser")
    R<UserDTO> getUser(@RequestParam("userId") Long userId);

    /**
     * 根据手机 查询用户信息
     * @param mobile 手机号
     * @return R<UserDTO>
     */
    @GetMapping(value = "/remote_user/findByMobile")
    R<UserDTO> findByMobile(@RequestParam("mobile") String mobile);

    /**
     * 新增
     * @param userDTO userDTO
     * @return R<?>
     */
    @PostMapping(value = "/remote_hospital/save")
    R<?> save(@RequestBody UserDTO userDTO);

    /**
     * 根据openId查询用户信息
     * @param openid openid
     * @return R<UserDTO>
     */
    @GetMapping(value = "/remote_user/findByOpenId")
    R<UserDTO> findByOpenId(@RequestParam("openid") String openid);

    /**
     * 根据unionid查询用户信息
     * @param unionid unionid
     * @return  R<UserDTO>
     */
    @GetMapping(value = "/remote_user/findByUnionid")
    R<UserDTO> findByUnionid(@RequestParam("unionid") String unionid);

    /**
     * 根据id 查询用户di
     * @param userId userID
     * @return R<UserDTO>>
     */
    @GetMapping(value = "/remote_user/findById")
    R<UserDTO> findById(@RequestParam("userId") Long userId);

    /**
     * 更新用户信息
     * @param data data
     */
    @PostMapping(value = "/remote_hospital/updateById")
    R<?> updateById(@RequestBody UserDTO data);
    /**
     * 删除用户信息
     * @param
     */
    @GetMapping(value = "/remote_user/deleteUser")
    R<Integer> deleteUser(@RequestParam("id") Long id);


}