diff --git a/src/api/carousal.ts b/src/api/carousal.ts index bdc591a..c2e71ca 100644 --- a/src/api/carousal.ts +++ b/src/api/carousal.ts @@ -1,13 +1,18 @@ -import type { CreateCarousalsRequest, TypeList } from '@/model/carousals' +import type { PageResult } from '@/model/base' +import type { Article, ArticleParams, Category, CreateCarousalsRequest } from '@/model/pet-manual' import httpClient from '@/api/httpClient' function getCarousalList() { return httpClient.get('/carousals/active-list') } function getTypeList() { - return httpClient.get('/categories/list') + return httpClient.get('/categories/list') +} +function getArticleList(data: ArticleParams) { + return httpClient.get>('/articles', data) } export default { getCarousalList, getTypeList, + getArticleList, } diff --git a/src/model/base.ts b/src/model/base.ts new file mode 100644 index 0000000..6c5d918 --- /dev/null +++ b/src/model/base.ts @@ -0,0 +1,32 @@ +import type { User } from './user' + +export interface ErrorResponse { + code: number + message: string +} +export interface BaseModel { + id: string + createdTime: string + updateTime: string +} + +export interface AuditBaseModel extends BaseModel { + createBy: User + updateBy: User +} + +export interface Paging { + page: number + size: number + total?: number +} + +export interface BaseFilterRequest extends Partial { +} + +export interface PageResult { + pagination: Paging + data: T[] +} + +export interface ErrorResponseList extends Array {} diff --git a/src/model/carousals.ts b/src/model/carousals.ts deleted file mode 100644 index 0fd964f..0000000 --- a/src/model/carousals.ts +++ /dev/null @@ -1,13 +0,0 @@ -export interface CreateCarousalsRequest { - imageUrl: string - targetType: string - targetUrl: string - targetId?: string -} - -export interface TypeList { - id: string - code: string - name: string - isClick?: boolean -} diff --git a/src/model/pet-manual.ts b/src/model/pet-manual.ts new file mode 100644 index 0000000..27c9528 --- /dev/null +++ b/src/model/pet-manual.ts @@ -0,0 +1,29 @@ +import type { Paging } from '@/model/base' + +export interface CreateCarousalsRequest { + imageUrl: string + targetType: string + targetUrl: string + targetId?: string +} + +export interface Category { + id: string + code: string + name: string + isClick?: boolean +} + +export interface ArticleParams extends Paging { + title: string + categoryId: string +} + +export interface Article { + id: string + content: string + status: string + title: string + updatedTime?: string + imageUrl?: string +} diff --git a/src/model/user.ts b/src/model/user.ts new file mode 100644 index 0000000..c9cd9c0 --- /dev/null +++ b/src/model/user.ts @@ -0,0 +1,11 @@ +import type { AuditBaseModel, BaseFilterRequest } from '@/model/base' + +export interface User extends AuditBaseModel { + username: string + locked: boolean + enabled: boolean +} + +export interface UserSearchFilter extends BaseFilterRequest { + username?: string +} diff --git a/src/pages/pet-manual/components/CardList.vue b/src/pages/pet-manual/components/CardList.vue index bc7973a..b848608 100644 --- a/src/pages/pet-manual/components/CardList.vue +++ b/src/pages/pet-manual/components/CardList.vue @@ -1,13 +1,34 @@