1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| import com.ilubov.vo.TestVo; import com.ilubov.util.ReturnData; import com.ilubov.annotations.DesensitizeSupport; import com.google.common.collect.ImmutableList; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController @RequestMapping("/test") //@DesensitizeSupport //也可以直接用在类上 public class TestController {
@GetMapping("/t1") @DesensitizeSupport public ReturnData t1(Long id) { List<TestVo> list = ImmutableList.of( new TestVo(1L, "张三", "18812345678", "123456"), new TestVo(2L, "李四", "13377881200", "123456"), new TestVo(3L, "王二麻", "18644110099", "123456")); return ReturnData.ok("success", list); }
@GetMapping("/t2") @DesensitizeSupport public ReturnData t2(Long id) { return ReturnData.ok("success", new TestVo(1L, "张三", "18812345678", "123456")); } }
|