mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-20 01:34:24 +08:00
code refactor
This commit is contained in:
@@ -1,3 +1,27 @@
|
||||
export class TransactionPicture implements TransactionPictureInfoBasicResponse {
|
||||
public pictureId: string;
|
||||
public originalUrl: string;
|
||||
|
||||
private constructor(pictureId: string, originalUrl: string) {
|
||||
this.pictureId = pictureId;
|
||||
this.originalUrl = originalUrl;
|
||||
}
|
||||
|
||||
public static of(picture: TransactionPictureInfoBasicResponse): TransactionPicture {
|
||||
return new TransactionPicture(picture.pictureId, picture.originalUrl);
|
||||
}
|
||||
|
||||
public static ofMulti(pictureResponses: TransactionPictureInfoBasicResponse[]): TransactionPicture[] {
|
||||
const pictures: TransactionPicture[] = [];
|
||||
|
||||
for (const pictureResponse of pictureResponses) {
|
||||
pictures.push(TransactionPicture.of(pictureResponse));
|
||||
}
|
||||
|
||||
return pictures;
|
||||
}
|
||||
}
|
||||
|
||||
export interface TransactionPictureUnusedDeleteRequest {
|
||||
readonly id: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user