-
Notifications
You must be signed in to change notification settings - Fork 276
Expand file tree
/
Copy pathKeyUsecase.java
More file actions
68 lines (61 loc) · 1.61 KB
/
KeyUsecase.java
File metadata and controls
68 lines (61 loc) · 1.61 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* Copyright DDDplus Authors.
*
* Licensed under the Apache License version 2.0, available at http://www.apache.org/licenses/LICENSE-2.0
*/
package io.github.dddplus.dsl;
import java.lang.annotation.*;
/**
* 关键业务用例:(用户, 系统)交互入口.
*
* <p>业务的核心入口,常用于:Controller/ApplicationService/MQ Consumer/Job/Worker.</p>
* <p>Example:</p>
* <pre>
* {@code
*
* class OrderController {
* ℗KeyUsecase(in = {"orderNo", "containerNo"})
* ℗PostMapping("a/b")
* public Response doSth(Request request) {}
* }
*
* class OrderSubmittedConsumer {
* ℗KeyUsecase(consumesKeyEvent = OrderSubmittedEvent.class)
* void onMessage(String message) {}
* }
* }
* </pre>
*
* @deprecated Please use {@link KeyFlow#usecase()}
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.SOURCE)
@Deprecated
public @interface KeyUsecase {
/**
* 该属性名称在逆向建模时被修正为哪一个统一语言名称.
*/
String name() default "";
/**
* 补充说明.
*/
String remark() default "";
/**
* 消费哪一个业务事件.
*
* @see KeyEvent
*/
Class[] consumesKeyEvent() default {};
/**
* 关键的入参.
*
* <p>虽然可以自动分析方法的入参,但这里提供了修正的机会:报文里关键信息需要人工标注.</p>
*/
String[] in() default {};
/**
* 关键的出参.
*
* <p>虽然可以自动分析方法的出参,但这里提供了修正的机会:报文里关键信息需要人工标注.</p>
*/
String[] out() default {};
}