Created
January 1, 2019 15:53
-
-
Save ChangJoo-Park/038fa4bdefe75a7326819a40978b817f to your computer and use it in GitHub Desktop.
Aqueduct Live and File Template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set( $CAMEL_NAME = ${StringUtils.removeAndHump(${NAME})}) | |
import 'package:aqueduct/aqueduct.dart'; | |
import 'package:${PROJECT_NAME}/${PROJECT_NAME}.dart'; | |
class ${CAMEL_NAME} extends ManagedObject<_${CAMEL_NAME}> implements _${CAMEL_NAME} { | |
@override | |
void willUpdate() { | |
} | |
@override | |
void willInsert() { | |
} | |
} | |
class _${CAMEL_NAME} { | |
@primaryKey | |
int id; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#set( $CAMEL_NAME = ${StringUtils.removeAndHump(${NAME})}) | |
import 'package:aqueduct/aqueduct.dart'; | |
import 'package:${PROJECT_NAME}/${PROJECT_NAME}.dart'; | |
class ${CAMEL_NAME} extends ResourceController { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'harness/app.dart'; | |
Future main() async { | |
final harness = Harness()..install(); | |
test("Example", () async { | |
final response = await harness.agent.get("/path"); | |
expectResponse(response, 200); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Bind Body | |
@Bind.body() $TYPE$ $CAMEL_TYPE$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Bind Header | |
@Bind.header("$HEADER_NAME$") String $CAMEL_HEADER_NAME$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Bind Path Variable | |
@Bind.path("$PATH_KEY$") String $CAMEL_PATH_KEY$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Bind Query Parameter | |
@Bind.query("$QUERY_KEY$") String $CAMEL_QUERY_KEY$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Managed Object Column | |
@Column($ATTRIBUTES$) | |
$TYPE$ $NAME$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Operation Method | |
@Operation.$HTTP_METHOD$() | |
Future<Response> $LOWERCASE_HTTP_METHOD$() async { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Property Selector | |
(o) => o.$END$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Managed Object Relationship | |
@Relate(#$INVERSE$) | |
$TYPE$ $RELATIONSHIP_NAME$; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Test Case | |
test("$NAME$", () { | |
$END$ | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment