Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

发给xvcvx (Amplication build 9wjatxvr) #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions admin-ui/src/api/user/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export type User = {
lastName: string | null;
username: string;
roles: JsonValue;
age: string | null;
};
1 change: 1 addition & 0 deletions admin-ui/src/api/user/UserCreateInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export type UserCreateInput = {
username: string;
password: string;
roles: InputJsonValue;
age?: string | null;
};
1 change: 1 addition & 0 deletions admin-ui/src/api/user/UserOrderByInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export type UserOrderByInput = {
username?: SortOrder;
password?: SortOrder;
roles?: SortOrder;
age?: SortOrder;
};
1 change: 1 addition & 0 deletions admin-ui/src/api/user/UserUpdateInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export type UserUpdateInput = {
username?: string;
password?: string;
roles?: InputJsonValue;
age?: string | null;
};
1 change: 1 addition & 0 deletions admin-ui/src/api/user/UserWhereInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ export type UserWhereInput = {
firstName?: StringNullableFilter;
lastName?: StringNullableFilter;
username?: StringFilter;
age?: StringNullableFilter;
};
1 change: 1 addition & 0 deletions admin-ui/src/user/UserCreate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const UserCreate = (props: CreateProps): React.ReactElement => {
optionText="label"
optionValue="value"
/>
<TextInput label="age" source="age" />
</SimpleForm>
</Create>
);
Expand Down
1 change: 1 addition & 0 deletions admin-ui/src/user/UserEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const UserEdit = (props: EditProps): React.ReactElement => {
optionText="label"
optionValue="value"
/>
<TextInput label="age" source="age" />
</SimpleForm>
</Edit>
);
Expand Down
1 change: 1 addition & 0 deletions admin-ui/src/user/UserList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const UserList = (props: ListProps): React.ReactElement => {
<TextField label="Last Name" source="lastName" />
<TextField label="Username" source="username" />
<TextField label="Roles" source="roles" />
<TextField label="age" source="age" />
</Datagrid>
</List>
);
Expand Down
1 change: 1 addition & 0 deletions admin-ui/src/user/UserShow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const UserShow = (props: ShowProps): React.ReactElement => {
<TextField label="Last Name" source="lastName" />
<TextField label="Username" source="username" />
<TextField label="Roles" source="roles" />
<TextField label="age" source="age" />
</SimpleShowLayout>
</Show>
);
Expand Down
1 change: 1 addition & 0 deletions server/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ model User {
username String @unique
password String
roles Json
age String?
}
2 changes: 1 addition & 1 deletion server/src/swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const swaggerDocumentOptions = new DocumentBuilder()
.setDescription(
'\n\n## Congratulations! Your service resource is ready.\n \nPlease note that all endpoints are secured with JWT Bearer authentication.\nBy default, your service resource comes with one user with the username "admin" and password "admin".\nLearn more in [our docs](https://docs.amplication.com)'
)
.setVersion("1104a18s")
.setVersion("g914j4pz")
.addBearerAuth()
.build();

Expand Down
11 changes: 11 additions & 0 deletions server/src/user/base/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,17 @@ class User {
@IsJSON()
@Field(() => GraphQLJSON)
roles!: JsonValue;

@ApiProperty({
required: false,
type: String,
})
@IsString()
@IsOptional()
@Field(() => String, {
nullable: true,
})
age!: string | null;
}

export { User as User };
11 changes: 11 additions & 0 deletions server/src/user/base/UserCreateInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ class UserCreateInput {
@IsJSON()
@Field(() => GraphQLJSON)
roles!: InputJsonValue;

@ApiProperty({
required: false,
type: String,
})
@IsString()
@IsOptional()
@Field(() => String, {
nullable: true,
})
age?: string | null;
}

export { UserCreateInput as UserCreateInput };
9 changes: 9 additions & 0 deletions server/src/user/base/UserOrderByInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ class UserOrderByInput {
nullable: true,
})
roles?: SortOrder;

@ApiProperty({
required: false,
enum: ["asc", "desc"],
})
@Field(() => SortOrder, {
nullable: true,
})
age?: SortOrder;
}

export { UserOrderByInput as UserOrderByInput };
11 changes: 11 additions & 0 deletions server/src/user/base/UserUpdateInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@ class UserUpdateInput {
nullable: true,
})
roles?: InputJsonValue;

@ApiProperty({
required: false,
type: String,
})
@IsString()
@IsOptional()
@Field(() => String, {
nullable: true,
})
age?: string | null;
}

export { UserUpdateInput as UserUpdateInput };
11 changes: 11 additions & 0 deletions server/src/user/base/UserWhereInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,17 @@ class UserWhereInput {
nullable: true,
})
username?: StringFilter;

@ApiProperty({
required: false,
type: StringNullableFilter,
})
@Type(() => StringNullableFilter)
@IsOptional()
@Field(() => StringNullableFilter, {
nullable: true,
})
age?: StringNullableFilter;
}

export { UserWhereInput as UserWhereInput };
4 changes: 4 additions & 0 deletions server/src/user/base/user.controller.base.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const CREATE_INPUT = {
lastName: "exampleLastName",
username: "exampleUsername",
password: "examplePassword",
age: "exampleAge",
};
const CREATE_RESULT = {
id: "exampleId",
Expand All @@ -35,6 +36,7 @@ const CREATE_RESULT = {
lastName: "exampleLastName",
username: "exampleUsername",
password: "examplePassword",
age: "exampleAge",
};
const FIND_MANY_RESULT = [
{
Expand All @@ -45,6 +47,7 @@ const FIND_MANY_RESULT = [
lastName: "exampleLastName",
username: "exampleUsername",
password: "examplePassword",
age: "exampleAge",
},
];
const FIND_ONE_RESULT = {
Expand All @@ -55,6 +58,7 @@ const FIND_ONE_RESULT = {
lastName: "exampleLastName",
username: "exampleUsername",
password: "examplePassword",
age: "exampleAge",
};

const service = {
Expand Down
5 changes: 5 additions & 0 deletions server/src/user/base/user.controller.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ export class UserControllerBase {
lastName: true,
username: true,
roles: true,
age: true,
},
});
}
Expand Down Expand Up @@ -85,6 +86,7 @@ export class UserControllerBase {
lastName: true,
username: true,
roles: true,
age: true,
},
});
}
Expand Down Expand Up @@ -114,6 +116,7 @@ export class UserControllerBase {
lastName: true,
username: true,
roles: true,
age: true,
},
});
if (result === null) {
Expand Down Expand Up @@ -152,6 +155,7 @@ export class UserControllerBase {
lastName: true,
username: true,
roles: true,
age: true,
},
});
} catch (error) {
Expand Down Expand Up @@ -189,6 +193,7 @@ export class UserControllerBase {
lastName: true,
username: true,
roles: true,
age: true,
},
});
} catch (error) {
Expand Down