MemberFeignClient.java 1.8 KB
Newer Older
H
haoxr 已提交
1
package com.youlai.mall.ums.api;
H
haoxr 已提交
2

3
import com.youlai.common.result.Result;
G
Gadfly 已提交
4
import com.youlai.mall.pms.pojo.vo.ProductHistoryVO;
H
haoxr 已提交
5
import com.youlai.mall.ums.pojo.dto.MemberDTO;
G
Gadfly 已提交
6
import com.youlai.mall.ums.pojo.entity.UmsMember;
H
haoxr 已提交
7
import org.springframework.cloud.openfeign.FeignClient;
H
haoxr 已提交
8
import org.springframework.web.bind.annotation.*;
H
haoxr 已提交
9

G
Gadfly 已提交
10
@FeignClient(name = "mall-ums", contextId = "member")
H
haoxr 已提交
11
public interface MemberFeignClient {
H
haoxr 已提交
12

H
haoxr 已提交
13
    @PostMapping("/app-api/v1/members")
G
Gadfly 已提交
14
    Result<Long> add(@RequestBody UmsMember member);
H
haoxr 已提交
15

16
    @PutMapping("/app-api/v1/members/{id}")
G
Gadfly 已提交
17
    <T> Result<T> update(@PathVariable Long id, @RequestBody UmsMember member);
H
haoxr 已提交
18 19

    /**
H
haoxr 已提交
20
     * 获取会员信息
H
haoxr 已提交
21
     */
H
haoxr 已提交
22
    @GetMapping("/app-api/v1/members/{id}")
H
haoxr 已提交
23
    Result<MemberDTO> getUserById(@PathVariable Long id);
H
haoxr 已提交
24

G
Gadfly 已提交
25 26 27 28 29
    /**
     * 获取会员信息
     */
    @GetMapping("/app-api/v1/members/detail/{id}")
    Result<UmsMember> getUserEntityById(@PathVariable Long id);
H
haoxr 已提交
30 31

    /**
H
haoxr 已提交
32
     * 获取认证会员信息
H
haoxr 已提交
33
     */
H
haoxr 已提交
34
    @GetMapping("/app-api/v1/members/openid/{openid}")
H
haoxr 已提交
35
    Result<UmsMember> getByOpenid(@PathVariable String openid);
H
haoxr 已提交
36 37 38 39

    /**
     * 修改会员积分
     */
H
haoxr 已提交
40
    @PutMapping("/app-api/v1/members/{id}/points")
G
Gadfly 已提交
41
    <T> Result<T> updatePoint(@PathVariable Long id, @RequestParam Integer num);
H
haoxr 已提交
42

huawei_code1994's avatar
huawei_code1994 已提交
43
    /**
H
haoxr 已提交
44
     * 扣减会员余额
huawei_code1994's avatar
huawei_code1994 已提交
45
     */
H
haoxr 已提交
46
    @PutMapping("/app-api/v1/members/{id}/deduct-balance")
G
Gadfly 已提交
47
    <T> Result<T> deductBalance(@PathVariable Long id, @RequestParam Long balance);
H
haoxr 已提交
48 49 50 51

    /**
     * 获取会员余额
     */
H
haoxr 已提交
52
    @GetMapping("/app-api/v1/members/{id}/balance")
H
haoxr 已提交
53
    Result<Long> getBalance(@PathVariable Long id);
G
Gadfly 已提交
54 55 56 57 58 59

    /**
     * 添加浏览记录
     */
    @PostMapping("/app-api/v1/members/view/history")
    <T> Result<T> addProductViewHistory(@RequestBody ProductHistoryVO product);
H
haoxr 已提交
60 61 62
}